Merged PR 885: show only active appeal form details

To fix duplicate associated view records entered in error

Related work items: #7866
This commit is contained in:
Robert Bond
2022-08-02 11:12:39 +00:00
13 changed files with 142 additions and 128 deletions
@@ -219,11 +219,16 @@ const Pinswg_commonlandid = (props) => {
{router.locale == "cy" {router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
'$..[?(@.value=="' + '$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy' '")].value_cy'
) )
: detailsObj.pinswg_relevantauthorityname || : jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
@@ -201,11 +201,16 @@ const Pinswg_compulsorypurchaseordersid = (props) => {
{router.locale == "cy" {router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
'$..[?(@.value=="' + '$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy' '")].value_cy'
) )
: detailsObj.pinswg_relevantauthorityname || : jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
@@ -219,11 +219,16 @@ const Pinswg_environmentalpermittingid = (props) => {
{router.locale == "cy" {router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
'$..[?(@.value=="' + '$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy' '")].value_cy'
) )
: detailsObj.pinswg_relevantauthorityname || : jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
@@ -219,15 +219,16 @@ const Pinswg_hedgeshedgerowstreepreservatioid = (props) => {
{router.locale == "cy" {router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
'$..[?(@.value=="' + '$..[?(@.pinswg_lpa=="' +
detailsObj[ detailsObj.pinswg_relevantauthorityname +
"pinswg_relevantauthorityname@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy' '")].value_cy'
) )
: detailsObj[ : jsonpath.query(
"pinswg_relevantauthorityname@OData.Community.Display.V1.FormattedValue" transLookup,
] || '$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
@@ -219,15 +219,16 @@ const Pinswg_miscellaneouscasewordid = (props) => {
{router.locale == "cy" {router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
'$..[?(@.value=="' + '$..[?(@.pinswg_lpa=="' +
detailsObj[ detailsObj.pinswg_relevantauthorityname +
"pinswg_relevantauthorityname@OData.Community.Display.V1.FormattedValue"
] +
'")].value_cy' '")].value_cy'
) )
: detailsObj[ : jsonpath.query(
"pinswg_relevantauthorityname@OData.Community.Display.V1.FormattedValue" transLookup,
] || '$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
+7 -2
View File
@@ -219,11 +219,16 @@ const Pinswg_rowid = (props) => {
{router.locale == "cy" {router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
'$..[?(@.value=="' + '$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy' '")].value_cy'
) )
: detailsObj.pinswg_relevantauthorityname || : jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
@@ -219,11 +219,16 @@ const Pinswg_wayleaveid = (props) => {
{router.locale == "cy" {router.locale == "cy"
? jsonpath.query( ? jsonpath.query(
transLookup, transLookup,
'$..[?(@.value=="' + '$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname + detailsObj.pinswg_relevantauthorityname +
'")].value_cy' '")].value_cy'
) )
: detailsObj.pinswg_relevantauthorityname || : jsonpath.query(
transLookup,
'$..[?(@.pinswg_lpa=="' +
detailsObj.pinswg_relevantauthorityname +
'")].value'
) ||
t( t(
"case:summary-no-date-entered-label" "case:summary-no-date-entered-label"
)} )}
+8 -1
View File
@@ -56,7 +56,13 @@ const RenderTextfield = ({
{error} {error}
</span> </span>
)} )}
<input {...input} className={className} name={name} id={id} /> <input
{...input}
className={className}
name={name}
id={id}
autoComplete="username"
/>
</div> </div>
</> </>
); );
@@ -102,6 +108,7 @@ const RenderPasswordfield = ({
className={className} className={className}
name={name} name={name}
id={id} id={id}
autoComplete="current-password"
/> />
</div> </div>
</> </>
+79 -99
View File
@@ -264,149 +264,129 @@
], ],
"pinswg_lpa": [ "pinswg_lpa": [
{ {
"value": "Blaenau Gwent County Borough Council", "value": "Isle of Anglesey County Council",
"value_cy": "Cyngor Bwrdeistref Sirol Blaenau Gwent", "value_cy": "Cyngor Sir Ynys Môn",
"pinswg_lpa": 0 "pinswg_lpa": 846040000
}, },
{ {
"value": "Bridgend CBC", "value": "Blaenau Gwent County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr", "value_cy": "Cyngor Bwrdeistref Sirol Blaenau Gwent",
"pinswg_lpa": 0 "pinswg_lpa": 846040001
}, },
{ {
"value": "Bridgend County Borough Council", "value": "Bridgend County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr", "value_cy": "Cyngor Bwrdeistref Sirol Pen-y-bont ar Ogwr",
"pinswg_lpa": 0 "pinswg_lpa": 846040002
}, },
{ {
"value": "Caerphilly County Borough Council", "value": "Caerphilly County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Caerffili", "value_cy": "Cyngor Bwrdeistref Sirol Caerffili",
"pinswg_lpa": 0 "pinswg_lpa": 846040003
}, },
{ {
"value": "Cardiff County Council", "value": "Cardiff County Council",
"value_cy": "Cyngor Caerdydd", "value_cy": "Cyngor Caerdydd",
"pinswg_lpa": 0 "pinswg_lpa": 846040004
},
{
"value": "Cardiff City Council",
"value_cy": "Cyngor Caerdydd",
"pinswg_lpa": 0
}, },
{ {
"value": "Carmarthenshire County Council", "value": "Carmarthenshire County Council",
"value_cy": "Cyngor Sir Gaerfyrddin", "value_cy": "Cyngor Sir Gaerfyrddin",
"pinswg_lpa": 0 "pinswg_lpa": 846040005
}, },
{ {
"value": "Ceredigion County Council", "value": "Ceredigion County Council",
"value_cy": "Cyngor Sir Ceredigion", "value_cy": "Cyngor Sir Ceredigion",
"pinswg_lpa": 0 "pinswg_lpa": 846040006
},
{
"value": "Conwy County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Conwy",
"pinswg_lpa": 0
},
{
"value": "Denbighshire County Council",
"value_cy": "Cyngor Sir Ddinbych",
"pinswg_lpa": 0
},
{
"value": "Flintshire County Council",
"value_cy": "Cyngor Sir y Fflint",
"pinswg_lpa": 0
},
{
"value": "Gwynedd Council",
"value_cy": "Cyngor Gwynedd",
"pinswg_lpa": 0
},
{
"value": "Isle of Anglesey County Council",
"value_cy": "Cyngor Sir Ynys Môn",
"pinswg_lpa": 0
},
{
"value": "Merthyr Tydfil County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Merthyr Tudful",
"pinswg_lpa": 0
},
{
"value": "Monmouthshire County Council",
"value_cy": "Cyngor Sir Fynwy",
"pinswg_lpa": 0
},
{
"value": "Neath Port Talbot County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Castell-nedd Port Talbot",
"pinswg_lpa": 0
},
{
"value": "Newport City Council",
"value_cy": "Cyngor Dinas Casnewydd",
"pinswg_lpa": 0
},
{
"value": "Pembrokeshire County Council",
"value_cy": "Cyngor Sir Penfro",
"pinswg_lpa": 0
},
{
"value": "Powys County Council",
"value_cy": "Cyngor Sir Powys",
"pinswg_lpa": 0
},
{
"value": "Rhondda Cynon Taff County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
"pinswg_lpa": 0
},
{
"value": "Swansea Council",
"value_cy": "Cyngor a Dinas Abertawe",
"pinswg_lpa": 0
}, },
{ {
"value": "City and County of Swansea Council", "value": "City and County of Swansea Council",
"value_cy": "Dinas a Sir Abertawe", "value_cy": "Dinas a Sir Abertawe",
"pinswg_lpa": 0 "pinswg_lpa": 846040007
}, },
{ {
"value": "Torfaen County Borough Council", "value": "Conwy County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Torfaen", "value_cy": "Cyngor Bwrdeistref Sirol Conwy",
"pinswg_lpa": 0 "pinswg_lpa": 846040008
}, },
{ {
"value": "Vale of Glamorgan Council", "value": "Denbighshire County Council",
"value_cy": "Cyngor Bro Morgannwg", "value_cy": "Cyngor Sir Ddinbych",
"pinswg_lpa": 0 "pinswg_lpa": 846040009
}, },
{ {
"value": "Vale of Glamorgan Borough Council", "value": "Flintshire County Council",
"value_cy": "Cyngor Bro Morgannwg", "value_cy": "Cyngor Sir y Fflint",
"pinswg_lpa": 0 "pinswg_lpa": 846040010
}, },
{ {
"value": "Wrexham County Borough Council", "value": "Gwynedd Council",
"value_cy": "Cyngor Bwrdeistref Sirol Wrecsam", "value_cy": "Cyngor Gwynedd",
"pinswg_lpa": 0 "pinswg_lpa": 846040011
}, },
{ {
"value": "Brecon Beacons National Park Authority", "value": "Merthyr Tydfil County Borough Council",
"value_cy": "Parc Cenedlaethol Bannau Brycheiniog", "value_cy": "Cyngor Bwrdeistref Sirol Merthyr Tudful",
"pinswg_lpa": 0 "pinswg_lpa": 846040012
},
{
"value": "Monmouthshire County Council",
"value_cy": "Cyngor Sir Fynwy",
"pinswg_lpa": 846040013
},
{
"value": "Neath Port Talbot County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Castell-nedd Port Talbot",
"pinswg_lpa": 846040014
},
{
"value": "Newport City Council",
"value_cy": "Cyngor Dinas Casnewydd",
"pinswg_lpa": 846040015
}, },
{ {
"value": "Pembrokeshire Coast National Park Authority", "value": "Pembrokeshire Coast National Park Authority",
"value_cy": "Parc Cenedlaethol Arfordir Penfro", "value_cy": "Parc Cenedlaethol Arfordir Penfro",
"pinswg_lpa": 0 "pinswg_lpa": 846040016
},
{
"value": "Pembrokeshire County Council",
"value_cy": "Cyngor Sir Penfro",
"pinswg_lpa": 846040017
},
{
"value": "Powys County Council",
"value_cy": "Cyngor Sir Powys",
"pinswg_lpa": 846040018
},
{
"value": "Rhondda Cynon Taff County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Rhondda Cynon Taf",
"pinswg_lpa": 846040019
}, },
{ {
"value": "Snowdonia National Park Authority", "value": "Snowdonia National Park Authority",
"value_cy": "Parc Cenedlaethol Eryri", "value_cy": "Parc Cenedlaethol Eryri",
"pinswg_lpa": 0 "pinswg_lpa": 846040020
},
{
"value": "Torfaen County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Torfaen",
"pinswg_lpa": 846040021
},
{
"value": "Vale of Glamorgan Council",
"value_cy": "Cyngor Bro Morgannwg",
"pinswg_lpa": 846040022
},
{
"value": "Wrexham County Borough Council",
"value_cy": "Cyngor Bwrdeistref Sirol Wrecsam",
"pinswg_lpa": 846040023
},
{
"value": "Brecon Beacons National Park Authority",
"value_cy": "Parc Cenedlaethol Bannau Brycheiniog",
"pinswg_lpa": 846040024
} }
], ],
"pinswg_procedure": [ "pinswg_procedure": [
@@ -29,7 +29,7 @@ export default async function ApiProxy(req, res) {
var queryUrl = var queryUrl =
"pinswg_dnses?$filter=pinswg_name eq '" + "pinswg_dnses?$filter=pinswg_name eq '" +
caseReference + caseReference +
"'&$count=true"; " and statuscode eq 1&$count=true";
queryUrl = queryUrl + getSelectQuery("pinswg_dnses"); queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
@@ -29,7 +29,7 @@ export default async function ApiProxy(req, res) {
var queryUrl = var queryUrl =
"pinswg_dnses?$filter=pinswg_name eq '" + "pinswg_dnses?$filter=pinswg_name eq '" +
caseReference + caseReference +
"'&$count=true"; " and statuscode eq 1&$count=true";
queryUrl = queryUrl + getSelectQuery("pinswg_dnses"); queryUrl = queryUrl + getSelectQuery("pinswg_dnses");
@@ -30,7 +30,7 @@ export default async function ApiProxy(req, res) {
primaryIdAttribute + primaryIdAttribute +
"s_value eq " + "s_value eq " +
incidentID + incidentID +
"&$count=true"; " and statuscode eq 1&$count=true";
queryUrl = queryUrl + getSelectQuery(appealTypeName); queryUrl = queryUrl + getSelectQuery(appealTypeName);
@@ -34,7 +34,7 @@ export default async function ApiProxy(req, res) {
primaryIdAttribute + primaryIdAttribute +
"s_value eq " + "s_value eq " +
incidentID + incidentID +
"&$count=true"; " and statuscode eq 1&$count=true";
queryUrl = queryUrl + getSelectQuery(appealTypeName); queryUrl = queryUrl + getSelectQuery(appealTypeName);