Merged PR 1033: Merge dev work for Phase 2
Make development branch back in sync with reps work and other dev done since phase 1a deployment to give a phase 2 Related work items: #6495, #8449, #8450, #8456, #8457, #8458
This commit is contained in:
+119
@@ -0,0 +1,119 @@
|
|||||||
|
ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/
|
||||||
|
//ESNR Tenant
|
||||||
|
//TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502
|
||||||
|
//WGO Tenant
|
||||||
|
TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5
|
||||||
|
GRANT_TYPE = "client_credentials"
|
||||||
|
|
||||||
|
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
||||||
|
NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
||||||
|
|
||||||
|
|
||||||
|
//Dev oauth ESNR
|
||||||
|
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
|
||||||
|
//CLIENT_SECRET = 4Vt8Q~olL1hx7n01B0~tXf-N2YL5DyC_Fk6waagX
|
||||||
|
CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE
|
||||||
|
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
|
||||||
|
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
|
||||||
|
RELAYPATH = "dev-pedw-hc"
|
||||||
|
|
||||||
|
|
||||||
|
//Test Oauth ESNR
|
||||||
|
//CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||||
|
//CLIENT_SECRET = IXI8Q~D5oqsC-nrtayHHc~tUAfjQFzNiKVQ~fc2S
|
||||||
|
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
|
||||||
|
//RELAYURI = "test-pedw-ns.servicebus.windows.net"
|
||||||
|
//RELAYPATH = "test-pedw-hc"
|
||||||
|
|
||||||
|
|
||||||
|
//Preprod Oauth WGO
|
||||||
|
//CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||||
|
//CLIENT_SECRET = Ioo7Q~RJfhWsE45wPsuHm1CzRk1SppnNN3lZF
|
||||||
|
//RELAY_ROOT = https://pp-pedw-ns.servicebus.windows.net/pp-pedw-hc/
|
||||||
|
//RELAYURI = "pp-pedw-ns.servicebus.windows.net"
|
||||||
|
//RELAYPATH = "pp-pedw-hc"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Prod Oauth WGO
|
||||||
|
//CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
|
||||||
|
//CLIENT_SECRET = mJN7Q~lFu.xFGa5KCc.zwIm_fJAWxajyQaFo~
|
||||||
|
//RELAY_ROOT = https://prod-pedw-ns.servicebus.windows.net/prod-pedw-hc/
|
||||||
|
//RELAYURI = "prod-pedw-ns.servicebus.windows.net"
|
||||||
|
//RELAYPATH = "prod-pedw-hc"
|
||||||
|
|
||||||
|
|
||||||
|
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||||
|
SHOWLOGIN = "true"
|
||||||
|
SHOWREPRESENTATIONS = true
|
||||||
|
SHOWFILEUPLOAD = "false"
|
||||||
|
SHOWMAPS = "false"
|
||||||
|
//BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
|
||||||
|
|
||||||
|
|
||||||
|
PORT= "3000"
|
||||||
|
DEFAULT_DOMAIN = "localhost"
|
||||||
|
I18N_DOMAIN = "cymru.local"
|
||||||
|
//I18N_DOMAIN ="dev-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
|
//I18N_DOMAIN ="stage-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
|
//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"s
|
||||||
|
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
|
||||||
|
|
||||||
|
|
||||||
|
//gov gateway
|
||||||
|
GG_PROVIDER_CONFIG_ENDPOINT = "https://api.ete.access.service.gov.uk/.well-known/openid-configuration"
|
||||||
|
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||||
|
GG_CLIENT_SECRET = z1PGLAKPxIhjMBegTdzX22AayIORc1GsCbMQZ6mieBn7zChjzzxup5lkIByEmsYS
|
||||||
|
//GG_REDIRECT_URI = "http://localhost:3000"
|
||||||
|
GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
|
||||||
|
|
||||||
|
NEXT_PUBLIC_GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
||||||
|
NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
|
||||||
|
|
||||||
|
API_ROOT = "http://localhost:3000"
|
||||||
|
|
||||||
|
|
||||||
|
GOOGLE_MAP_API_KEY = AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Next Auth vars
|
||||||
|
//EMAIL_SERVER_HOST=smtp.sendgrid.net
|
||||||
|
//EMAIL_SERVER_PORT=465
|
||||||
|
//EMAIL_SERVER_USER=apikey
|
||||||
|
//EMAIL_SERVER_PASSWORD=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
|
||||||
|
//EMAIL_FROM=rob@rdbsolutions.co.uk
|
||||||
|
|
||||||
|
|
||||||
|
EMAIL_SERVER_HOST=rdbdigital.com
|
||||||
|
EMAIL_SERVER_PORT=465
|
||||||
|
EMAIL_SERVER_USER=rob@rdbdigital.com
|
||||||
|
EMAIL_SERVER_PASSWORD=!Sky9fish2020
|
||||||
|
EMAIL_FROM=no-reply@rdbdigital.com
|
||||||
|
|
||||||
|
NEXTAUTH_URL=http://localhost:3000
|
||||||
|
NEXTAUTH_URL_INTERNAL=http://localhost:3000
|
||||||
|
//DATABASE_URL=mysql://nextAuthAdmin:!Sky9fish1972@77.68.17.157:3306/nextauthDB?synchronise=true
|
||||||
|
DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
|
SECRET = SuperSecret
|
||||||
|
|
||||||
|
|
||||||
|
//Azure Storage Account
|
||||||
|
|
||||||
|
AZURE_CLIENT_ID = $CLIENT_ID
|
||||||
|
AZURE_TENANT_ID = $TENANT
|
||||||
|
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
||||||
|
AZURE_STORAGE_ACCOUNT_NAME= "pedwdev"
|
||||||
|
AZURE_STORAGE_ACCOUNT_KEY = JS3ZIXianhYhB1lZrHB+bXbdzaLlON0alCyKrFAb+jVEwr9iqo2dty92EBxwnufNFM+CSN/fKX2R+AStDn0byg==
|
||||||
|
|
||||||
|
|
||||||
|
AZURE_PEDW_STORAGE_ENDPOINT = https://pedwdev.blob.core.windows.net
|
||||||
|
AZURE_PEDW_CONTAINER = "pedwapplications"
|
||||||
|
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//gov.notify
|
||||||
|
|
||||||
|
NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
|
||||||
+10
-55
@@ -1,17 +1,11 @@
|
|||||||
ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/
|
ACCESS_TOKEN_ENDPOINT = https://login.microsoftonline.com/
|
||||||
//ESNR Tenant
|
|
||||||
//TENANT = a8d860de-d5e1-45af-8376-d93f02e6b502
|
|
||||||
//WGO Tenant
|
|
||||||
TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5
|
TENANT = 9ac1a5ab-cd58-409e-a1b6-6b10422a68f5
|
||||||
GRANT_TYPE = "client_credentials"
|
GRANT_TYPE = "client_credentials"
|
||||||
|
|
||||||
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
||||||
NEXT_PUBLIC_HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136d84f68818d3a96399467b52143e273d4f3bf4ae190848891535421cd6c
|
|
||||||
|
|
||||||
|
|
||||||
//Dev oauth ESNR
|
//Dev oauth ESNR
|
||||||
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
|
CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
|
||||||
//CLIENT_SECRET = 4Vt8Q~olL1hx7n01B0~tXf-N2YL5DyC_Fk6waagX
|
|
||||||
CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE
|
CLIENT_SECRET = AU88Q~NBOVOXqwb4mBx9y.NMIZ9s1o7boqZoKcSE
|
||||||
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
|
RELAY_ROOT = https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/
|
||||||
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
|
RELAYURI = "dev-pedw-ns.servicebus.windows.net"
|
||||||
@@ -44,59 +38,23 @@ RELAYPATH = "dev-pedw-hc"
|
|||||||
|
|
||||||
|
|
||||||
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||||
SHOWLOGIN = "true"
|
SHOWLOGIN = true
|
||||||
SHOWREPRESENTATIONS = false
|
SHOWREPRESENTATIONS = true
|
||||||
SHOWFILEUPLOAD = "false"
|
SHOWFILEUPLOAD = "false"
|
||||||
SHOWMAPS = "true"
|
SHOWMAPS = "false"
|
||||||
//BASIC_AUTH_CREDENTIALS = pinswg:password|pinswg2:password2
|
|
||||||
|
|
||||||
|
|
||||||
PORT= "3000"
|
|
||||||
DEFAULT_DOMAIN = "localhost"
|
|
||||||
I18N_DOMAIN = "cymru.local"
|
|
||||||
//I18N_DOMAIN ="dev-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
|
||||||
//I18N_DOMAIN ="stage-gwaithcynllunio.gwasanaeth.llyw.cymru"
|
|
||||||
//I18N_DOMAIN ="pp-gwaithcynllunio.gwasanaeth.llyw.cymru"s
|
|
||||||
//I18N_DOMAIN ="gwaithcynllunio.gwasanaeth.llyw.cymru"
|
|
||||||
|
|
||||||
|
|
||||||
//gov gateway
|
|
||||||
GG_PROVIDER_CONFIG_ENDPOINT = "https://api.ete.access.service.gov.uk/.well-known/openid-configuration"
|
|
||||||
GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
|
||||||
GG_CLIENT_SECRET = z1PGLAKPxIhjMBegTdzX22AayIORc1GsCbMQZ6mieBn7zChjzzxup5lkIByEmsYS
|
|
||||||
//GG_REDIRECT_URI = "http://localhost:3000"
|
|
||||||
GG_REDIRECT_URI = "https://dev-planningcasework.service.gov.wales"
|
|
||||||
|
|
||||||
NEXT_PUBLIC_GG_CLIENT_ID = 5vTukeSpN7d6uBV7YLb7A5wOctzzkZ
|
|
||||||
NEXT_PUBLIC_GG_REDIRECT_URI = "http://localhost:3000"
|
|
||||||
|
|
||||||
API_ROOT = "http://localhost:3000"
|
API_ROOT = "http://localhost:3000"
|
||||||
|
CY_API_ROOT ="http://cymru.local:3000"
|
||||||
|
I18N_DOMAIN = "cymru.local"
|
||||||
GOOGLE_MAP_API_KEY = AIzaSyCzeVrHt544bp_72YCFkw21eDsmI2JEsQo
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Next Auth vars
|
//Next Auth vars
|
||||||
//EMAIL_SERVER_HOST=smtp.sendgrid.net
|
NEXTAUTH_URL=$API_ROOT
|
||||||
//EMAIL_SERVER_PORT=465
|
NEXTAUTH_URL_INTERNAL=$API_ROOT
|
||||||
//EMAIL_SERVER_USER=apikey
|
NEXTAUTH_SECRET = SuperSecret
|
||||||
//EMAIL_SERVER_PASSWORD=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
|
|
||||||
//EMAIL_FROM=rob@rdbsolutions.co.uk
|
|
||||||
|
|
||||||
|
|
||||||
EMAIL_SERVER_HOST=rdbdigital.com
|
|
||||||
EMAIL_SERVER_PORT=465
|
|
||||||
EMAIL_SERVER_USER=rob@rdbdigital.com
|
|
||||||
EMAIL_SERVER_PASSWORD=!Sky9fish2020
|
|
||||||
EMAIL_FROM=no-reply@rdbdigital.com
|
|
||||||
|
|
||||||
NEXTAUTH_URL=http://localhost:3000
|
|
||||||
NEXTAUTH_URL_INTERNAL=http://localhost:3000
|
|
||||||
//DATABASE_URL=mysql://nextAuthAdmin:!Sky9fish1972@77.68.17.157:3306/nextauthDB?synchronise=true
|
|
||||||
DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
SECRET = SuperSecret
|
||||||
|
|
||||||
SECRET=SuperSecret
|
|
||||||
|
|
||||||
|
|
||||||
//Azure Storage Account
|
//Azure Storage Account
|
||||||
@@ -104,15 +62,12 @@ SECRET=SuperSecret
|
|||||||
AZURE_CLIENT_ID = $CLIENT_ID
|
AZURE_CLIENT_ID = $CLIENT_ID
|
||||||
AZURE_TENANT_ID = $TENANT
|
AZURE_TENANT_ID = $TENANT
|
||||||
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
AZURE_CLIENT_SECRET = $CLIENT_SECRET
|
||||||
|
AZURE_STORAGE_ACCOUNT_NAME= "pedwdev"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = JS3ZIXianhYhB1lZrHB+bXbdzaLlON0alCyKrFAb+jVEwr9iqo2dty92EBxwnufNFM+CSN/fKX2R+AStDn0byg==
|
AZURE_STORAGE_ACCOUNT_KEY = JS3ZIXianhYhB1lZrHB+bXbdzaLlON0alCyKrFAb+jVEwr9iqo2dty92EBxwnufNFM+CSN/fKX2R+AStDn0byg==
|
||||||
|
|
||||||
|
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://pedwdev.blob.core.windows.net
|
AZURE_PEDW_STORAGE_ENDPOINT = https://pedwdev.blob.core.windows.net
|
||||||
AZURE_PEDW_CONTAINER = "pedwapplications"
|
AZURE_PEDW_CONTAINER = "pedwapplications"
|
||||||
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
AZURE_PEDW_QUEUE_ENDPOINT = https://$AZURE_STORAGE_ACCOUNT_NAME.queue.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//gov.notify
|
//gov.notify
|
||||||
|
|
||||||
NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
|
NOTIFY_API_KEY = pedwnextauthkey-90f93710-9dae-423e-aea1-11eccd0dc132-0c9469d9-d671-444d-9e9d-3e5a62001043
|
||||||
@@ -3,7 +3,32 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"@next/next/no-img-element": "off",
|
"@next/next/no-img-element": "off",
|
||||||
"react/no-unknown-property": "error"
|
"react/no-unknown-property": "error"
|
||||||
}
|
|
||||||
|
}//,
|
||||||
|
//...your configuration
|
||||||
|
// "overrides": [
|
||||||
|
// //...your overrides
|
||||||
|
// {
|
||||||
|
// // Force the setting of a swagger description on each api endpoint
|
||||||
|
// "files": ["pages/api/**/*.js"],
|
||||||
|
// "plugins": ["jsdoc"],
|
||||||
|
// "rules": {
|
||||||
|
// "jsdoc/no-missing-syntax": [
|
||||||
|
// "error",
|
||||||
|
// {
|
||||||
|
// "contexts": [
|
||||||
|
// {
|
||||||
|
// "comment": "JsdocBlock:has(JsdocTag[tag=swagger])",
|
||||||
|
// "context": "any",
|
||||||
|
// "message": "@swagger documentation is required on each API. Check this out for syntax info: https://github.com/jellydn/next-swagger-doc"
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,3 +17,5 @@ yarn-error.log*
|
|||||||
#lock files
|
#lock files
|
||||||
yarn.lock
|
yarn.lock
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
|
tmp/
|
||||||
Vendored
+7
-1
@@ -5,11 +5,17 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
|
"name": "Next.js: debug server-side",
|
||||||
|
"type": "node-terminal",
|
||||||
|
"request": "launch",
|
||||||
|
"command": "yarn run dev"
|
||||||
|
},
|
||||||
|
{"name": "Launch Chrome against localhost",
|
||||||
"type": "pwa-chrome",
|
"type": "pwa-chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch Chrome against localhost",
|
|
||||||
"url": "http://localhost:3000",
|
"url": "http://localhost:3000",
|
||||||
"webRoot": "${workspaceFolder}"
|
"webRoot": "${workspaceFolder}"
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+464
-33
@@ -1,4 +1,6 @@
|
|||||||
import { v4 as uuidv4 } from "uuid";
|
import { DefaultAzureCredential } from "@azure/identity";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { hashAPIPath } from ".";
|
||||||
const {
|
const {
|
||||||
ContainerClient,
|
ContainerClient,
|
||||||
BlockBlobClient,
|
BlockBlobClient,
|
||||||
@@ -6,13 +8,25 @@ const {
|
|||||||
BlobSASPermissions,
|
BlobSASPermissions,
|
||||||
ContainerSASPermissions,
|
ContainerSASPermissions,
|
||||||
generateBlobSASQueryParameters,
|
generateBlobSASQueryParameters,
|
||||||
|
|
||||||
SASProtocol,
|
SASProtocol,
|
||||||
} = require("@azure/storage-blob");
|
} = require("@azure/storage-blob");
|
||||||
import { DefaultAzureCredential } from "@azure/identity";
|
const {
|
||||||
import { consoleLogger, conLog, hashAPIPath } from ".";
|
QueueServiceClient,
|
||||||
import _ from "lodash";
|
AccountSASResourceTypes,
|
||||||
|
AccountSASServices,
|
||||||
|
AccountSASPermissions,
|
||||||
|
QueueSASPermissions,
|
||||||
|
QueueSASSignatureValues,
|
||||||
|
generateAccountSASQueryParameters,
|
||||||
|
generateQueueSASQueryParameters,
|
||||||
|
StorageSharedKeyCredential,
|
||||||
|
QueueClient,
|
||||||
|
} = require("@azure/storage-queue");
|
||||||
const STORAGE_PATH = process.env.AZURE_PEDW_STORAGE_ENDPOINT;
|
const STORAGE_PATH = process.env.AZURE_PEDW_STORAGE_ENDPOINT;
|
||||||
const STORAGE_CONTAINER = process.env.AZURE_PEDW_CONTAINER;
|
const STORAGE_CONTAINER = process.env.AZURE_PEDW_CONTAINER;
|
||||||
|
const QUEUE_PATH = process.env.AZURE_PEDW_QUEUE_ENDPOINT;
|
||||||
|
|
||||||
const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
|
const accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME;
|
||||||
|
|
||||||
export const createContainerSas = async (containerName) => {
|
export const createContainerSas = async (containerName) => {
|
||||||
@@ -41,7 +55,7 @@ export const createContainerSas = async (containerName) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Need only list permission to list blobs
|
// Need only list permission to list blobs
|
||||||
const containerPermissions = "rcwltd";
|
const containerPermissions = "rcwdltf";
|
||||||
|
|
||||||
// Best practice: SAS options are time-limited
|
// Best practice: SAS options are time-limited
|
||||||
const sasOptions = {
|
const sasOptions = {
|
||||||
@@ -246,6 +260,40 @@ export const createBlob = async (formContent, containerName, caseref) => {
|
|||||||
const tags = {
|
const tags = {
|
||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
caseID: caseID,
|
caseID: caseID,
|
||||||
|
blobType: "Appeal",
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("the tags:", tags);
|
||||||
|
const withTags = await blockBlobClient.setTags(tags);
|
||||||
|
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||||
|
|
||||||
|
return formContent.pinswg_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createRepBlob = async (formContent, containerName, caseref) => {
|
||||||
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
|
|
||||||
|
formContent = JSON.parse(formContent);
|
||||||
|
|
||||||
|
const content = JSON.stringify(formContent);
|
||||||
|
|
||||||
|
//console.log(content);
|
||||||
|
const blobName = caseref + "/" + formContent.repfile_name + "_rep.json";
|
||||||
|
|
||||||
|
console.log("blobName:", blobName);
|
||||||
|
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||||
|
|
||||||
|
const uploadBlobResponse = await blockBlobClient.upload(
|
||||||
|
content,
|
||||||
|
Buffer.byteLength(content)
|
||||||
|
);
|
||||||
|
|
||||||
|
const tags = {
|
||||||
|
containerid: containerName,
|
||||||
|
caseID: formContent.caseRef,
|
||||||
|
blobType: "Representation",
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("the tags:", tags);
|
console.log("the tags:", tags);
|
||||||
@@ -325,13 +373,18 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
|||||||
files[prop][0].path,
|
files[prop][0].path,
|
||||||
files[prop].size
|
files[prop].size
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"////////////////////////\nfile name:",
|
||||||
|
files[prop][0].fieldName,
|
||||||
|
"\n////////////////////////////"
|
||||||
|
);
|
||||||
|
|
||||||
const tags = {
|
const tags = {
|
||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
caseID: foldername,
|
caseID: foldername.split("/")[0],
|
||||||
documentType: files[prop][0].fieldName.slice(
|
documentType: files[prop][0].fieldName.split(".")[1],
|
||||||
0,
|
blobType: "RepresentationFile",
|
||||||
files[prop][0].fieldName.indexOf("_")
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
const withTags = await blockBlobClient.setTags(tags);
|
const withTags = await blockBlobClient.setTags(tags);
|
||||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||||
@@ -343,8 +396,125 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const uploadRepFiles = async (
|
||||||
|
formContent,
|
||||||
|
containerName,
|
||||||
|
foldername
|
||||||
|
) => {
|
||||||
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
|
|
||||||
|
const files = formContent;
|
||||||
|
|
||||||
|
console.log(...formContent);
|
||||||
|
console.log("rep files...", files, Object.keys(files).length, foldername);
|
||||||
|
|
||||||
|
const blobName = foldername + "/" + formContent.split("tmp/")[1];
|
||||||
|
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||||
|
const uploadBlobResponse = await blockBlobClient.uploadFile(formContent);
|
||||||
|
const tags = {
|
||||||
|
containerid: containerName,
|
||||||
|
caseID: formContent.split("tmp/")[0],
|
||||||
|
documentType: "Rep docs",
|
||||||
|
};
|
||||||
|
console.log(tags);
|
||||||
|
const withTags = await blockBlobClient.setTags(tags);
|
||||||
|
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`Uploaded block blob ${files} successfully`,
|
||||||
|
uploadBlobResponse.requestId
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const uploadPDFRepFiles = async (
|
||||||
|
formContent,
|
||||||
|
containerName,
|
||||||
|
foldername,
|
||||||
|
repType
|
||||||
|
) => {
|
||||||
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
|
|
||||||
|
const files = formContent;
|
||||||
|
|
||||||
|
console.log(formContent, containerName, foldername);
|
||||||
|
console.log(
|
||||||
|
"rep pdf files...",
|
||||||
|
files,
|
||||||
|
Object.keys(files).length,
|
||||||
|
foldername
|
||||||
|
);
|
||||||
|
|
||||||
|
// console.log(`files[${prop}] = ${files[prop][0].size}`);
|
||||||
|
console.log(foldername + "/files/" + formContent.split("tmp/")[1]);
|
||||||
|
|
||||||
|
const blobName = foldername + "/" + formContent.split("tmp/")[1];
|
||||||
|
console.log(blobName);
|
||||||
|
|
||||||
|
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||||
|
const uploadBlobResponse = await blockBlobClient.uploadFile(formContent);
|
||||||
|
|
||||||
|
const tags = {
|
||||||
|
containerid: containerName,
|
||||||
|
caseID: foldername.split("/")[0],
|
||||||
|
documentType: repType,
|
||||||
|
blobType: "RepresentationPDF",
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("the tags:", tags);
|
||||||
|
const withTags = await blockBlobClient.setTags(tags);
|
||||||
|
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`Uploaded block blob ${files} successfully`,
|
||||||
|
uploadBlobResponse.requestId
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const uploadPDFCaseFiles = async (
|
||||||
|
formContent,
|
||||||
|
containerName,
|
||||||
|
foldername
|
||||||
|
) => {
|
||||||
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
|
|
||||||
|
const files = formContent;
|
||||||
|
|
||||||
|
console.log(formContent, containerName, foldername);
|
||||||
|
console.log(
|
||||||
|
"case pdf files...",
|
||||||
|
files,
|
||||||
|
Object.keys(files).length,
|
||||||
|
foldername
|
||||||
|
);
|
||||||
|
|
||||||
|
const blobName = foldername + "/" + formContent.split("tmp/")[1];
|
||||||
|
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||||
|
const uploadBlobResponse = await blockBlobClient.uploadFile(formContent);
|
||||||
|
|
||||||
|
const tags = {
|
||||||
|
containerid: containerName,
|
||||||
|
caseID: foldername.split("/")[0],
|
||||||
|
blobType: "AppealPDF",
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("the tags:", tags);
|
||||||
|
const withTags = await blockBlobClient.setTags(tags);
|
||||||
|
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`Uploaded block blob ${files} successfully`,
|
||||||
|
uploadBlobResponse.requestId
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const downloadFile = async (containerName, blobName) => {
|
export const downloadFile = async (containerName, blobName) => {
|
||||||
//console.log.apply(containerName, blobName);
|
//console.log(containerName, blobName);
|
||||||
const containerToken = await createContainerSas(containerName);
|
const containerToken = await createContainerSas(containerName);
|
||||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
const containerClient = new ContainerClient(sasUrl);
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
@@ -360,7 +530,7 @@ export const downloadProgressFile = async (
|
|||||||
blobName,
|
blobName,
|
||||||
casefolderID
|
casefolderID
|
||||||
) => {
|
) => {
|
||||||
//console.log.apply(containerName, blobName);
|
console.log(containerName, blobName);
|
||||||
|
|
||||||
const containerToken = await createContainerSas(containerName);
|
const containerToken = await createContainerSas(containerName);
|
||||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
@@ -370,7 +540,7 @@ export const downloadProgressFile = async (
|
|||||||
|
|
||||||
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
|
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
|
||||||
|
|
||||||
console.log("Downloaded blob content:", downloaded.toString());
|
//console.log("Downloaded blob content:", downloaded.toString());
|
||||||
|
|
||||||
return JSON.parse(downloaded.toString());
|
return JSON.parse(downloaded.toString());
|
||||||
};
|
};
|
||||||
@@ -379,11 +549,11 @@ export const downloadAllProgressFiles = async (
|
|||||||
containerName,
|
containerName,
|
||||||
progressBlobObj
|
progressBlobObj
|
||||||
) => {
|
) => {
|
||||||
console.log(
|
// console.log(
|
||||||
"/////////////////////////\n downloading files: " +
|
// "/////////////////////////\n downloading files: " +
|
||||||
JSON.stringify(progressBlobObj) +
|
// JSON.stringify(progressBlobObj) +
|
||||||
"\n/////////////////////////\n"
|
// "\n/////////////////////////\n"
|
||||||
);
|
// );
|
||||||
|
|
||||||
const containerToken = await createContainerSas(containerName);
|
const containerToken = await createContainerSas(containerName);
|
||||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
@@ -397,7 +567,7 @@ export const downloadAllProgressFiles = async (
|
|||||||
let blobCount = 0;
|
let blobCount = 0;
|
||||||
|
|
||||||
for (const prop in progressBlobObj) {
|
for (const prop in progressBlobObj) {
|
||||||
console.log(`Progress - ${prop}: ${progressBlobObj[prop].path}`);
|
//console.log(`Progress - ${prop}: ${progressBlobObj[prop].path}`);
|
||||||
blobClient = containerClient.getBlobClient(progressBlobObj[prop].path);
|
blobClient = containerClient.getBlobClient(progressBlobObj[prop].path);
|
||||||
downloadedBlob = await blobClient.download(0);
|
downloadedBlob = await blobClient.download(0);
|
||||||
downloaded =
|
downloaded =
|
||||||
@@ -410,7 +580,7 @@ export const downloadAllProgressFiles = async (
|
|||||||
downloaded = downloaded.substring(0, downloaded.length - 1);
|
downloaded = downloaded.substring(0, downloaded.length - 1);
|
||||||
|
|
||||||
for (const prop in progressBlobObj) {
|
for (const prop in progressBlobObj) {
|
||||||
console.log(`Cases - ${prop}: ${progressBlobObj[prop].caseObj}`);
|
//console.log(`Cases - ${prop}: ${progressBlobObj[prop].caseObj}`);
|
||||||
blobClient = containerClient.getBlobClient(
|
blobClient = containerClient.getBlobClient(
|
||||||
progressBlobObj[prop].caseObj
|
progressBlobObj[prop].caseObj
|
||||||
);
|
);
|
||||||
@@ -434,6 +604,86 @@ export const downloadAllProgressFiles = async (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const downloadRepFile = async (
|
||||||
|
containerName,
|
||||||
|
blobName,
|
||||||
|
casefolderID
|
||||||
|
) => {
|
||||||
|
console.log(containerName, blobName);
|
||||||
|
|
||||||
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
|
const blobClient = containerClient.getBlobClient(blobName);
|
||||||
|
const downloadedBlob = await blobClient.download();
|
||||||
|
|
||||||
|
const downloaded = await streamToBuffer(downloadedBlob.readableStreamBody);
|
||||||
|
|
||||||
|
console.log("Downloaded blob content:", downloaded.toString());
|
||||||
|
|
||||||
|
return JSON.parse(downloaded.toString());
|
||||||
|
};
|
||||||
|
|
||||||
|
export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
|
||||||
|
console.log(
|
||||||
|
"/////////////////////////\n downloading files: " +
|
||||||
|
JSON.stringify(repsBlobObj) +
|
||||||
|
"\n/////////////////////////\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
|
|
||||||
|
let blobClient = {};
|
||||||
|
let downloadedBlob = {};
|
||||||
|
let repArr = [];
|
||||||
|
let downloaded = [];
|
||||||
|
let caseBlob = {};
|
||||||
|
let caseDownloaded = "";
|
||||||
|
let blobCount = 0;
|
||||||
|
|
||||||
|
Array.isArray(repsBlobObj) &&
|
||||||
|
!repsBlobObj.length &&
|
||||||
|
console.log("is empt and an array");
|
||||||
|
|
||||||
|
for (const prop in repsBlobObj) {
|
||||||
|
//console.log(`Progress - ${prop}: ${repsBlobObj[prop].path}`);
|
||||||
|
blobClient = containerClient.getBlobClient(repsBlobObj[prop].path);
|
||||||
|
downloadedBlob = await blobClient.download(0);
|
||||||
|
let repBlobObj = await streamToBuffer(
|
||||||
|
downloadedBlob.readableStreamBody
|
||||||
|
);
|
||||||
|
|
||||||
|
repBlobObj = JSON.parse(repBlobObj);
|
||||||
|
|
||||||
|
repBlobObj["casereference"] = repsBlobObj[prop].name.split("/")[1];
|
||||||
|
|
||||||
|
// repBlobObj = JSON.stringify(repBlobObj);
|
||||||
|
|
||||||
|
downloaded.push(repBlobObj);
|
||||||
|
blobCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//downloaded = downloaded.substring(0, downloaded.length - 1);
|
||||||
|
// console.log(
|
||||||
|
// "/////////////////////////\n downloaded : " +
|
||||||
|
// JSON.stringify(
|
||||||
|
// '{ "@odata.count": ' +
|
||||||
|
// blobCount +
|
||||||
|
// ',"value": ' +
|
||||||
|
// downloaded +
|
||||||
|
// "}"
|
||||||
|
// ) +
|
||||||
|
// "\n/////////////////////////\n"
|
||||||
|
// );
|
||||||
|
|
||||||
|
return {
|
||||||
|
"@odata.count": blobCount,
|
||||||
|
"value": downloaded,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const streamToBuffer = async (readableStream) => {
|
const streamToBuffer = async (readableStream) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const chunks = [];
|
const chunks = [];
|
||||||
@@ -465,6 +715,17 @@ export const getCaseBlob = async (
|
|||||||
content,
|
content,
|
||||||
Buffer.byteLength(content)
|
Buffer.byteLength(content)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const tags = {
|
||||||
|
containerid: containerName,
|
||||||
|
caseID: caseReference,
|
||||||
|
blobType: "Case",
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("the tags:", tags);
|
||||||
|
const withTags = await blockBlobClient.setTags(tags);
|
||||||
|
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||||
|
|
||||||
return blobName;
|
return blobName;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -482,18 +743,22 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
|||||||
blobCount++;
|
blobCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("this is the caasefolder:", caseReference, blobCount);
|
console.log(
|
||||||
|
"this is the casefolder and blobcount:",
|
||||||
|
caseReference,
|
||||||
|
blobCount
|
||||||
|
);
|
||||||
|
|
||||||
let blobObj = [];
|
let blobObj = [];
|
||||||
for await (const blob of containerClient.listBlobsFlat({
|
for await (const blob of containerClient.listBlobsFlat({
|
||||||
prefix: caseReference + "/" + caseReference + "_appeal.json",
|
prefix: caseReference + "/" + caseReference + "_appeal.json",
|
||||||
})) {
|
})) {
|
||||||
console.log("in here");
|
console.log("getProgressBlobs in here", blob.name.split("/"));
|
||||||
blobObj.push({
|
blobObj.push({
|
||||||
"name": blob.name.split("/")[1],
|
"name": blob.name.split("/")[1],
|
||||||
"path": blob.name,
|
"path": blob.name,
|
||||||
"versionId": blob.versionId,
|
"versionId": blob.versionId,
|
||||||
"caseObj": caseReference + "/" + caseReference + "_case.json",
|
"caseObj": caseReference + "/case/" + caseReference + "_case.json",
|
||||||
"isCurrentVersion": blob.isCurrentVersion,
|
"isCurrentVersion": blob.isCurrentVersion,
|
||||||
"contentLength": blob.properties.contentLength,
|
"contentLength": blob.properties.contentLength,
|
||||||
"contentType": blob.contentType,
|
"contentType": blob.contentType,
|
||||||
@@ -529,8 +794,6 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
|||||||
},
|
},
|
||||||
]).reverse()[0];
|
]).reverse()[0];
|
||||||
|
|
||||||
//console.log("blobObjwwwww:", blobObj);
|
|
||||||
|
|
||||||
return blobObj;
|
return blobObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -544,26 +807,194 @@ export const getAllProgressBlobs = async (containerName) => {
|
|||||||
let blobCount = 0;
|
let blobCount = 0;
|
||||||
|
|
||||||
let blobObj = [];
|
let blobObj = [];
|
||||||
for await (const blob of containerClient.listBlobsFlat()) {
|
for await (const blob of containerClient.findBlobsByTags(
|
||||||
blob.name.split("/")[1].indexOf(".json") > 0 &&
|
"blobType='Appeal'"
|
||||||
|
)) {
|
||||||
|
blob.name.split("/")[1].indexOf("_appeal.json") > 0 &&
|
||||||
blob.name.split("/")[1].indexOf("undefined") < 0 &&
|
blob.name.split("/")[1].indexOf("undefined") < 0 &&
|
||||||
blobObj.push({
|
blobObj.push({
|
||||||
"name": blob.name.split("/")[1],
|
"name": blob.name.split("/")[1],
|
||||||
"path": blob.name,
|
"path": blob.name,
|
||||||
"versionId": blob.versionId,
|
//"versionId": blob.versionId,
|
||||||
"caseObj":
|
"caseObj":
|
||||||
blob.name.split("/")[0] +
|
blob.name.split("/")[0] +
|
||||||
"/case/" +
|
"/case/" +
|
||||||
blob.name.split("/")[0] +
|
blob.name.split("/")[0] +
|
||||||
"_case.json",
|
"_case.json",
|
||||||
"isCurrentVersion": blob.isCurrentVersion,
|
// "isCurrentVersion": blob.isCurrentVersion,
|
||||||
"contentLength": blob.properties.contentLength,
|
// "contentLength": blob.properties.contentLength,
|
||||||
"contentType": blob.contentType,
|
// "contentType": blob.contentType,
|
||||||
"lastModified": blob.properties.lastModified,
|
// "lastModified": blob.properties.lastModified,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log("blobObj:", blobObj);
|
console.log("blobObj:", blobObj);
|
||||||
|
|
||||||
return blobObj;
|
return blobObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getRepsBlobs = async (containerName) => {
|
||||||
|
const containerToken = await createContainerSas(containerName);
|
||||||
|
|
||||||
|
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||||
|
|
||||||
|
const containerClient = new ContainerClient(sasUrl);
|
||||||
|
|
||||||
|
let blobCount = 0;
|
||||||
|
for await (const blob of containerClient.findBlobsByTags(
|
||||||
|
"blobType='Representation'"
|
||||||
|
)) {
|
||||||
|
console.log(`-----Blob ${blobCount++}: ${blob.name}`);
|
||||||
|
blobCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"this is the casefolder and blobcount:",
|
||||||
|
//caseReference,
|
||||||
|
blobCount
|
||||||
|
);
|
||||||
|
|
||||||
|
const listOptions = {
|
||||||
|
includeMetadata: true,
|
||||||
|
includeSnapshots: false,
|
||||||
|
includeTags: true,
|
||||||
|
includeVersions: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
let blobObj = [];
|
||||||
|
for await (const blob of containerClient.findBlobsByTags(
|
||||||
|
"blobType='Representation'",
|
||||||
|
listOptions
|
||||||
|
)) {
|
||||||
|
const blobClient = await containerClient.getBlobClient(blob.name);
|
||||||
|
console.log("getreps blob blob", blob);
|
||||||
|
blob.name.split("/")[2].indexOf("_rep.json") > 0 &&
|
||||||
|
blob.name.split("/")[2].indexOf("undefined") < 0 &&
|
||||||
|
blobObj.push({
|
||||||
|
"name": blob.name.split("/")[2],
|
||||||
|
"path": blob.name,
|
||||||
|
"size": blobClient.getProperties().contentLength,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log("blobObjwwwww:", blobObj);
|
||||||
|
|
||||||
|
return blobObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createQueueSas = async (queueName) => {
|
||||||
|
// Get environment variables
|
||||||
|
const account = process.env.AZURE_STORAGE_ACCOUNT_NAME;
|
||||||
|
const accountKey = process.env.AZURE_STORAGE_ACCOUNT_KEY;
|
||||||
|
|
||||||
|
const sharedKeyCredential = new StorageSharedKeyCredential(
|
||||||
|
account,
|
||||||
|
accountKey
|
||||||
|
);
|
||||||
|
|
||||||
|
// Best practice: create time limits
|
||||||
|
const TEN_MINUTES = 10 * 60 * 1000;
|
||||||
|
const NOW = new Date();
|
||||||
|
|
||||||
|
// Best practice: set start time a little before current time to
|
||||||
|
// make sure any clock issues are avoided
|
||||||
|
const TEN_MINUTES_AFTER_NOW = new Date(NOW.valueOf() + TEN_MINUTES);
|
||||||
|
|
||||||
|
var resource_types = new AccountSASResourceTypes();
|
||||||
|
resource_types.container = true;
|
||||||
|
resource_types.object = true;
|
||||||
|
resource_types.service = true;
|
||||||
|
|
||||||
|
var permission = new QueueSASPermissions();
|
||||||
|
permission.read = true;
|
||||||
|
permission.write = true;
|
||||||
|
permission.delete = true;
|
||||||
|
permission.list = true;
|
||||||
|
permission.add = true;
|
||||||
|
permission.update = true;
|
||||||
|
permission.process = true;
|
||||||
|
|
||||||
|
var sas_signature_val = {
|
||||||
|
expiresOn: TEN_MINUTES_AFTER_NOW,
|
||||||
|
permissions: permission,
|
||||||
|
queueName: queueName,
|
||||||
|
};
|
||||||
|
|
||||||
|
const sasToken = generateQueueSASQueryParameters(
|
||||||
|
sas_signature_val,
|
||||||
|
sharedKeyCredential
|
||||||
|
);
|
||||||
|
//console.log("sass token:", sasToken);
|
||||||
|
|
||||||
|
return sasToken.toString();
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createCaseCompleteMessage = async (
|
||||||
|
containerName,
|
||||||
|
caseReference
|
||||||
|
) => {
|
||||||
|
const whichQueue = "pedw-submitted-applications";
|
||||||
|
const queueToken = await createQueueSas(whichQueue);
|
||||||
|
|
||||||
|
const sasUrl = `${QUEUE_PATH}?${queueToken}`;
|
||||||
|
const queueServiceClient = new QueueServiceClient(sasUrl);
|
||||||
|
|
||||||
|
const message = {
|
||||||
|
containerName: containerName,
|
||||||
|
casepath:
|
||||||
|
containerName +
|
||||||
|
"/" +
|
||||||
|
caseReference +
|
||||||
|
"/" +
|
||||||
|
caseReference +
|
||||||
|
"_appeal.json",
|
||||||
|
casecontentpath: containerName + "/" + caseReference + "/case",
|
||||||
|
filespath: containerName + "/" + caseReference + "/files",
|
||||||
|
|
||||||
|
// uploadUrl: fileRecord.uploadUrl,
|
||||||
|
// filename: fileRecord.file.name,
|
||||||
|
// fileSize: fileRecord.file.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
const sendMessageResponse = await queueServiceClient
|
||||||
|
.getQueueClient(whichQueue)
|
||||||
|
.sendMessage(
|
||||||
|
JSON.stringify(
|
||||||
|
`<QueueMessage><MessageText>${JSON.stringify(
|
||||||
|
message
|
||||||
|
)}</MessageText></QueueMessage>`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return sendMessageResponse;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const createRepCompleteMessage = async (
|
||||||
|
containerName,
|
||||||
|
caseReference
|
||||||
|
) => {
|
||||||
|
const whichQueue = "pedw-submitted-representations";
|
||||||
|
const queueToken = await createQueueSas(whichQueue);
|
||||||
|
|
||||||
|
const sasUrl = `${QUEUE_PATH}?${queueToken}`;
|
||||||
|
const queueServiceClient = new QueueServiceClient(sasUrl);
|
||||||
|
|
||||||
|
const message = {
|
||||||
|
containerName: containerName,
|
||||||
|
caseref: caseReference,
|
||||||
|
reppath: containerName + "/" + caseReference + "/",
|
||||||
|
filespath: containerName + "/" + caseReference + "/files",
|
||||||
|
};
|
||||||
|
|
||||||
|
const sendMessageResponse = await queueServiceClient
|
||||||
|
.getQueueClient(whichQueue)
|
||||||
|
.sendMessage(
|
||||||
|
JSON.stringify(
|
||||||
|
`<QueueMessage><MessageText>${JSON.stringify(
|
||||||
|
message
|
||||||
|
)}</MessageText></QueueMessage>`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return sendMessageResponse;
|
||||||
|
};
|
||||||
|
|||||||
+269
-14
@@ -1,9 +1,5 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import https from "https";
|
|
||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import HmacSHA256 from "crypto-js/hmac-sha256";
|
|
||||||
import { getFormCollection } from "../components/utils";
|
|
||||||
import { downloadFile, getCaseBlob } from "./azurestorage";
|
|
||||||
|
|
||||||
let BASE_URL;
|
let BASE_URL;
|
||||||
const port = parseInt(process.env.PORT, 10) || 3000;
|
const port = parseInt(process.env.PORT, 10) || 3000;
|
||||||
@@ -13,6 +9,8 @@ if (process.browser) {
|
|||||||
} else {
|
} else {
|
||||||
BASE_URL = process.env.API_ROOT || `http://localhost:${port}`;
|
BASE_URL = process.env.API_ROOT || `http://localhost:${port}`;
|
||||||
}
|
}
|
||||||
|
BASE_URL = process.env.API_ROOT;
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
const cache = {};
|
const cache = {};
|
||||||
@@ -29,13 +27,15 @@ export const consoleLogger = (err) => {
|
|||||||
var errStr =
|
var errStr =
|
||||||
"\n\n/////////////////////////////////////////////////\nServer Error " +
|
"\n\n/////////////////////////////////////////////////\nServer Error " +
|
||||||
"\n" +
|
"\n" +
|
||||||
err.response.status +
|
(err.hasOwnProperty("response")
|
||||||
" : " +
|
? err.response.status +
|
||||||
err.response.statusText +
|
" : " +
|
||||||
"\nRequest URL: " +
|
err.response.statusText +
|
||||||
err.response.config.url +
|
"\nRequest URL: " +
|
||||||
"\nRequest Time: " +
|
err.response.config.url +
|
||||||
err.response.headers.date +
|
"\nRequest Time: " +
|
||||||
|
err.response.headers.date
|
||||||
|
: err) +
|
||||||
"\n/////////////////////////////////////////////////\n\n";
|
"\n/////////////////////////////////////////////////\n\n";
|
||||||
return errStr;
|
return errStr;
|
||||||
};
|
};
|
||||||
@@ -582,7 +582,7 @@ export const getPickLists = (whichForm) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getPersonalAccount = (contactid) => {
|
export const getPersonalAccount = (contactid) => {
|
||||||
//console.log(contactid);
|
console.log(contactid);
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
@@ -667,6 +667,17 @@ export const getMyCases = (loggedInUserId) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getMyLPACases = (lpaid) => {
|
||||||
|
return axios
|
||||||
|
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
//console.log("API call error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getMyRepresentations = (loggedInUserId) => {
|
export const getMyRepresentations = (loggedInUserId) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
@@ -793,12 +804,47 @@ export const getAwaitingSubmissionFromBlob = (containerName) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getRepsFromBlob = (containerName) => {
|
||||||
|
console.log(
|
||||||
|
"///////////////////////\ngetRepsFromBlob function: " +
|
||||||
|
containerName +
|
||||||
|
"\n///////////////////////\n",
|
||||||
|
BASE_URL +
|
||||||
|
"/api/file/getrepsblob?container=" +
|
||||||
|
containerName +
|
||||||
|
hashAPIPath("/api/file/getrepsblob?container=" + containerName)
|
||||||
|
);
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(
|
||||||
|
BASE_URL +
|
||||||
|
"/api/file/getrepsblob?container=" +
|
||||||
|
containerName +
|
||||||
|
hashAPIPath("/api/file/getrepsblob?container=" + containerName)
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(
|
||||||
|
"///////////////////////\ngetRepsFromBlob error response: " +
|
||||||
|
error +
|
||||||
|
"\n///////////////////////\n"
|
||||||
|
);
|
||||||
|
console.log("API call error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
|
export const getAwaitingSubmissionFromBlobProxy = (containerName) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/file/getawaitingsubmissionfromblob?container=" +
|
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||||
containerName
|
containerName +
|
||||||
|
hashAPIPath(
|
||||||
|
"/api/file/getawaitingsubmissionfromblob?container=" +
|
||||||
|
containerName
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -974,6 +1020,17 @@ export const createNewCaseBlob = (
|
|||||||
contactid +
|
contactid +
|
||||||
"&containername=" +
|
"&containername=" +
|
||||||
containerName;
|
containerName;
|
||||||
|
//+
|
||||||
|
// hashAPIPath(
|
||||||
|
// "/api/file/createcase_api?appealTypeId=" +
|
||||||
|
// appealTypeId +
|
||||||
|
// "&lpaID=" +
|
||||||
|
// lpaID +
|
||||||
|
// "&contactid=" +
|
||||||
|
// contactid +
|
||||||
|
// "&containername=" +
|
||||||
|
// containerName
|
||||||
|
// );
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "post",
|
method: "post",
|
||||||
@@ -1228,7 +1285,7 @@ export const uploadFiles = async (
|
|||||||
|
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
for (let j = 0; j < files[i].length; j++) {
|
for (let j = 0; j < files[i].length; j++) {
|
||||||
console.log(files[i][j].name);
|
console.log("upload files:", files[i][j].name);
|
||||||
formData.append(files[i][j].name, files[i][j]);
|
formData.append(files[i][j].name, files[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1253,7 +1310,96 @@ export const uploadFiles = async (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const uploadRepFiles = async (
|
||||||
|
formValues,
|
||||||
|
filesObj,
|
||||||
|
containerID,
|
||||||
|
casefolderID
|
||||||
|
) => {
|
||||||
|
let files = filesObj;
|
||||||
|
|
||||||
|
//console.log(formValues);
|
||||||
|
var formData = new FormData();
|
||||||
|
formData.append("appealData", JSON.stringify(formValues));
|
||||||
|
formData.append("containerID", containerID);
|
||||||
|
formData.append("casefolderID", casefolderID);
|
||||||
|
formData.append("repOrAppeal", true);
|
||||||
|
|
||||||
|
// files.forEach((file) => formData.append("files", file));
|
||||||
|
|
||||||
|
for (let i = 0; i < files.length; i++) {
|
||||||
|
for (let j = 0; j < files[i].length; j++) {
|
||||||
|
console.log("upload rep files:", files[i][j].name);
|
||||||
|
formData.append(files[i][j].name, files[i][j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log(formData);
|
||||||
|
|
||||||
|
var queryUrl = "/api/file/upload";
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
method: "post",
|
||||||
|
url: queryUrl,
|
||||||
|
data: formData,
|
||||||
|
headers: { "content-type": "multipart/form-data" },
|
||||||
|
};
|
||||||
|
|
||||||
|
//console.log(config);
|
||||||
|
try {
|
||||||
|
const res = await axios(config);
|
||||||
|
return res.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.log("this serror", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const generateRepPDF = async (formValues, containerID, casefolderID) => {
|
||||||
|
//let files = filesObj;
|
||||||
|
|
||||||
|
console.log("generateRepPDF function: " + formValues);
|
||||||
|
// var formData = new FormData();
|
||||||
|
// formValues.append("appealData", JSON.stringify(formValues));
|
||||||
|
// formValues.append("containerID", containerID);
|
||||||
|
// formValues.append("casefolderID", casefolderID);
|
||||||
|
|
||||||
|
// Object.assign(formValues, {
|
||||||
|
// "containerID": containerID,
|
||||||
|
// "casefolderID": casefolderID,
|
||||||
|
// });
|
||||||
|
|
||||||
|
var queryUrl = "/api/file/generatepdf";
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
method: "post",
|
||||||
|
url: queryUrl,
|
||||||
|
data: formValues,
|
||||||
|
headers: { "content-type": "multipart/form-data" },
|
||||||
|
};
|
||||||
|
|
||||||
|
//console.log(config);
|
||||||
|
try {
|
||||||
|
const res = await axios(config);
|
||||||
|
return res.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.log("this serror", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
export const getFilesFromBlob = (containerName, casefolderID) => {
|
export const getFilesFromBlob = (containerName, casefolderID) => {
|
||||||
|
console.log(
|
||||||
|
" get files from blob",
|
||||||
|
BASE_URL +
|
||||||
|
"/api/file/getbloblist?container=" +
|
||||||
|
containerName +
|
||||||
|
"&casefolderID=" +
|
||||||
|
casefolderID +
|
||||||
|
hashAPIPath(
|
||||||
|
"/api/file/getbloblist?container=" +
|
||||||
|
containerName +
|
||||||
|
"&casefolderID=" +
|
||||||
|
casefolderID
|
||||||
|
)
|
||||||
|
);
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
@@ -1350,6 +1496,20 @@ export const downloadBlob = (containerName, blobName) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getProgressFromBlob = async (containerName, casereference) => {
|
export const getProgressFromBlob = async (containerName, casereference) => {
|
||||||
|
console.log(
|
||||||
|
/////////////////\ngetProgressFromBlob",
|
||||||
|
BASE_URL +
|
||||||
|
"/api/file/getprogressobjblob?container=" +
|
||||||
|
containerName +
|
||||||
|
"&casefolderID=" +
|
||||||
|
casereference +
|
||||||
|
hashAPIPath(
|
||||||
|
"/api/file/getprogressobjblob?container=" +
|
||||||
|
containerName +
|
||||||
|
"&casefolderID=" +
|
||||||
|
casereference
|
||||||
|
)
|
||||||
|
);
|
||||||
try {
|
try {
|
||||||
const res = await axios.get(
|
const res = await axios.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
@@ -1383,6 +1543,13 @@ export const sendEmail = async (
|
|||||||
"personalisation": personalisation,
|
"personalisation": personalisation,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"hwewwew: ",
|
||||||
|
templateId,
|
||||||
|
emailAddress,
|
||||||
|
personalisation,
|
||||||
|
reference
|
||||||
|
);
|
||||||
var queryUrl = "/api/email/notify";
|
var queryUrl = "/api/email/notify";
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
@@ -1426,3 +1593,91 @@ export const getPortalLogin = (emailAddress) => {
|
|||||||
return JSON.stringify(error);
|
return JSON.stringify(error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const createContainerProxy = (containerName) => {
|
||||||
|
var queryUrl =
|
||||||
|
"/api/file/setupcontainer?ident=" +
|
||||||
|
containerName +
|
||||||
|
hashAPIPath("/api/file/setupcontainer?ident=" + containerName);
|
||||||
|
|
||||||
|
return axios
|
||||||
|
.get(BASE_URL + queryUrl)
|
||||||
|
.then((res) => res.data)
|
||||||
|
.catch((error) => {
|
||||||
|
//console.log(consoleLogger(error));
|
||||||
|
console.log("thiserror", error);
|
||||||
|
return JSON.stringify(error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const sendCaseCompleteMessage = async (containerID, caseReference) => {
|
||||||
|
var queryUrl =
|
||||||
|
"/api/file/createappealcompletemessage_api?container=" +
|
||||||
|
containerID +
|
||||||
|
"&tempcaseref=" +
|
||||||
|
caseReference;
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "get",
|
||||||
|
url: queryUrl,
|
||||||
|
};
|
||||||
|
|
||||||
|
//console.log(data);
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
//console.log("API call error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const sendCaseCompleteMessageProxy = async (
|
||||||
|
containerID,
|
||||||
|
caseReference
|
||||||
|
) => {
|
||||||
|
var queryUrl =
|
||||||
|
"/api/file/createappealcompletemessageproxy_api?container=" +
|
||||||
|
containerID +
|
||||||
|
"&tempcaseref=" +
|
||||||
|
caseReference;
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "get",
|
||||||
|
url: queryUrl,
|
||||||
|
};
|
||||||
|
|
||||||
|
//console.log(data);
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
//console.log("API call error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const sendRepCompleteMessage = async (containerID, caseReference) => {
|
||||||
|
var queryUrl =
|
||||||
|
"/api/file/createrepcompletemessage_api?container=" +
|
||||||
|
containerID +
|
||||||
|
"&tempcaseref=" +
|
||||||
|
caseReference;
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
method: "get",
|
||||||
|
url: queryUrl,
|
||||||
|
};
|
||||||
|
|
||||||
|
//console.log(data);
|
||||||
|
|
||||||
|
return axios(config)
|
||||||
|
.then((res) => {
|
||||||
|
return res.data;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
//console.log("API call error", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -48,7 +48,13 @@ export const getSelectQuery = (appealTypeName) => {
|
|||||||
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent";
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_sitepostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_starttimeofevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_planningappeals78s":
|
case "pinswg_planningappeals78s":
|
||||||
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_typeofevent";
|
// console.log(
|
||||||
|
// "///////////////\n path:",
|
||||||
|
// process.env.RELAYPATH == "test-pedw-hc"
|
||||||
|
// );
|
||||||
|
return process.env.RELAYPATH == "dev-pedw-hc"
|
||||||
|
? "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_representation_period_end_date,pinswg_extend_representation_date,pinswg_typeofevent"
|
||||||
|
: "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_localplanningauthority_value,pinswg_casedecisiondate,pinswg_dicision,pinswg_dateeventrequested,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdatetimeiftheevent,pinswg_typeofevent";
|
||||||
break;
|
break;
|
||||||
case "pinswg_planningconditionss73s79s":
|
case "pinswg_planningconditionss73s79s":
|
||||||
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
return "&$select=_pinswg_appellant_value,pinswg_name,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_questionnaireduedate,pinswg_startdate,pinswg_statementduedate,statuscode,pinswg_startdateofevent,pinswg_typeofevent";
|
||||||
|
|||||||
@@ -95,65 +95,63 @@ const ChangePassword = (props) => {
|
|||||||
|
|
||||||
const [hasErrors, setHasErrors] = useState("");
|
const [hasErrors, setHasErrors] = useState("");
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
{passwordUpdated != true ? (
|
||||||
{passwordUpdated != true ? (
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<fieldset className="govuk-fieldset">
|
||||||
<fieldset className="govuk-fieldset">
|
<Field
|
||||||
<Field
|
name="newpassword"
|
||||||
name="newpassword"
|
id="newpassword"
|
||||||
id="newpassword"
|
component={RenderTextfield}
|
||||||
component={RenderTextfield}
|
type="password"
|
||||||
type="password"
|
className="govuk-input govuk-input--width-20"
|
||||||
className="govuk-input govuk-input--width-20"
|
validate={[required, minLength(6)]}
|
||||||
validate={[required, minLength(6)]}
|
label="New password"
|
||||||
label="New password"
|
/>
|
||||||
/>
|
<Field
|
||||||
<Field
|
name="confirmpassword"
|
||||||
name="confirmpassword"
|
id="confirmpassword"
|
||||||
id="confirmpassword"
|
component={RenderTextfield}
|
||||||
component={RenderTextfield}
|
type="password"
|
||||||
type="password"
|
className="govuk-input govuk-input--width-20"
|
||||||
className="govuk-input govuk-input--width-20"
|
validate={[required, passwordsMustMatch]}
|
||||||
validate={[required, passwordsMustMatch]}
|
label="Confirm new password"
|
||||||
label="Confirm new password"
|
/>
|
||||||
/>
|
</fieldset>
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
>
|
>
|
||||||
Continue
|
Continue
|
||||||
</button>
|
</button>
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
"/myportal?q=" +
|
"/myportal?q=" +
|
||||||
props.accountDetails.loggedinUserId
|
props.accountDetails.loggedinUserId
|
||||||
}
|
}
|
||||||
>
|
className="govuk-link">
|
||||||
<a className="govuk-link">Cancel</a>
|
Cancel
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
"/myportal?q=" +
|
"/myportal?q=" +
|
||||||
props.accountDetails.loggedinUserId
|
props.accountDetails.loggedinUserId
|
||||||
}
|
}
|
||||||
>
|
className="govuk-link">
|
||||||
<a className="govuk-link">Go to My Portal</a>
|
Go to My Portal
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>;
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
@@ -63,6 +63,142 @@ const RenderTextfield = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const RenderRadioList = ({
|
||||||
|
datafieldname,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
id,
|
||||||
|
errorMsg,
|
||||||
|
options,
|
||||||
|
input: { onChange, value },
|
||||||
|
meta: { touched, error },
|
||||||
|
...custom
|
||||||
|
}) => {
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group "
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby={name + "-hint"}
|
||||||
|
>
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
|
||||||
|
<label
|
||||||
|
className="govuk-fieldset__heading govuk-body-m"
|
||||||
|
id={id + "_label"}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
</legend>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id={id + "-error"}
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<div className="govuk-radios govuk-radios--small govuk-radios--inline">
|
||||||
|
{Object.keys(options).map((key, index) => (
|
||||||
|
<div
|
||||||
|
className="govuk-radios__item"
|
||||||
|
data-children-count={key}
|
||||||
|
key={key}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
id={id + "_" + index}
|
||||||
|
name={id}
|
||||||
|
component="input"
|
||||||
|
type="radio"
|
||||||
|
className="govuk-radios__input"
|
||||||
|
value={options[key]}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor={id + "_" + index}
|
||||||
|
>
|
||||||
|
{options[key]}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const RenderPickList = ({
|
||||||
|
datafieldname,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
input,
|
||||||
|
optionsArr,
|
||||||
|
meta: { touched, error },
|
||||||
|
errorMsg,
|
||||||
|
}) => {
|
||||||
|
let { t, lang } = useTranslation();
|
||||||
|
optionsArr = [
|
||||||
|
t("account:account-preferred-language-english") + ":846040001",
|
||||||
|
t("account:account-preferred-language-welsh") + ":846040000",
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group "
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<label className="govuk-label" htmlFor="sort">
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id="passport-issued-error"
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">Error:</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<select
|
||||||
|
{...input}
|
||||||
|
className="govuk-select "
|
||||||
|
id={name}
|
||||||
|
name={name}
|
||||||
|
>
|
||||||
|
<option>Select...</option>
|
||||||
|
{Object.keys(optionsArr).map((key, index) => {
|
||||||
|
return (
|
||||||
|
<option
|
||||||
|
key={key}
|
||||||
|
value={optionsArr[key].split(":")[1]}
|
||||||
|
>
|
||||||
|
{optionsArr[key].split(":")[0]}
|
||||||
|
</option>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
let PersonalDetails = (props) => {
|
let PersonalDetails = (props) => {
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -101,171 +237,189 @@ let PersonalDetails = (props) => {
|
|||||||
setPersonalDetailsComplete(true);
|
setPersonalDetailsComplete(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
{props.accountUpdatedComplete == false ? (
|
||||||
{props.accountUpdatedComplete == false ? (
|
props.personalDetailsComplete == false ? (
|
||||||
props.personalDetailsComplete == false ? (
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<fieldset className="govuk-fieldset">
|
||||||
<fieldset className="govuk-fieldset">
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
<h2 className="govuk-fieldset__heading">
|
||||||
<h2 className="govuk-fieldset__heading">
|
{t("account:account-about-you-label")}
|
||||||
About you
|
</h2>
|
||||||
</h2>
|
</legend>
|
||||||
</legend>
|
<div className="govuk-form-group ">
|
||||||
<div className="govuk-form-group ">
|
<span className="govuk-label ">
|
||||||
<span className="govuk-label ">
|
{t("account:account-role-label")}:{" "}
|
||||||
Role:{" "}
|
{
|
||||||
{
|
props.props.accountDetails
|
||||||
props.props.accountDetails
|
.accountDetails[
|
||||||
.accountDetails[
|
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
]
|
||||||
]
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<Field
|
|
||||||
name="firstname"
|
|
||||||
id="firstname"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required]}
|
|
||||||
label="First name"
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="lastname"
|
|
||||||
id="lastname"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required]}
|
|
||||||
label="Last name"
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="emailaddress1"
|
|
||||||
id="emailaddress1"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="email"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required, email]}
|
|
||||||
label="Email address"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="telephone1"
|
|
||||||
id="telephone1"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="number"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
validate={[required, phoneNumber]}
|
|
||||||
label="Telephone"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="company"
|
|
||||||
id="company"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
label="Company/Group"
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset className="govuk-fieldset">
|
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
|
||||||
<h2 className="govuk-fieldset__heading">
|
|
||||||
What is your address?
|
|
||||||
</h2>
|
|
||||||
</legend>
|
|
||||||
|
|
||||||
<Field
|
|
||||||
name="address1_line1"
|
|
||||||
id="address1_line1"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
label="Address line 1"
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_line2"
|
|
||||||
id="address1_line2"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
label="Address line 2"
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_city"
|
|
||||||
id="address1_city"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-10"
|
|
||||||
label="Town/City"
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_county"
|
|
||||||
id="address1_county"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-10"
|
|
||||||
label="County"
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
<Field
|
|
||||||
name="address1_postalcode"
|
|
||||||
id="address1_postalcode"
|
|
||||||
component={RenderTextfield}
|
|
||||||
type="text"
|
|
||||||
className="govuk-input govuk-input--width-5"
|
|
||||||
label="Postcode"
|
|
||||||
validate={[required]}
|
|
||||||
errorMsg="Is required"
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
<div className="govuk-button-group">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="govuk-button"
|
|
||||||
data-module="govuk-button"
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</button>
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
"/myportal?q=" +
|
|
||||||
props.props.accountDetails.loggedinUserId
|
|
||||||
}
|
}
|
||||||
>
|
</span>
|
||||||
<a className="govuk-link">Cancel</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
) : (
|
<Field
|
||||||
<>
|
name="pinswg_preferredlanguage"
|
||||||
<BuildCheckPersonalDetails
|
component={RenderPickList}
|
||||||
props={props}
|
datafieldname="pinswg_preferredlanguage"
|
||||||
setPersonalDetailsComplete={
|
optionsArr={["English", "Welsh"]}
|
||||||
setPersonalDetailsComplete
|
className="govuk-input govuk-input--width-20 govuk-radios--inline"
|
||||||
}
|
validate={[required]}
|
||||||
setAccountUpdatedComplete={
|
label={t(
|
||||||
setAccountUpdatedComplete
|
"account:account-preferred-language-label"
|
||||||
}
|
)}
|
||||||
|
errorMsg="Is required"
|
||||||
/>
|
/>
|
||||||
</>
|
|
||||||
)
|
<Field
|
||||||
|
name="firstname"
|
||||||
|
id="firstname"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required]}
|
||||||
|
label={t("account:account-first-name-label")}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="lastname"
|
||||||
|
id="lastname"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required]}
|
||||||
|
label={t("account:account-last-name-label")}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="emailaddress1"
|
||||||
|
id="emailaddress1"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="email"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required, email]}
|
||||||
|
label={t("account:account-email-address-label")}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="telephone1"
|
||||||
|
id="telephone1"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="number"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
validate={[required, phoneNumber]}
|
||||||
|
label={t("account:account-telephone-label")}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
name="company"
|
||||||
|
id="company"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
label={t("account:account-company-group-label")}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset className="govuk-fieldset">
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
|
<h2 className="govuk-fieldset__heading">
|
||||||
|
{t("account:account-your-address-label")}
|
||||||
|
</h2>
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
name="address1_line1"
|
||||||
|
id="address1_line1"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
label={t(
|
||||||
|
"account:account-address-line-1-label"
|
||||||
|
)}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_line2"
|
||||||
|
id="address1_line2"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
label={t(
|
||||||
|
"account:account-address-line-2-label"
|
||||||
|
)}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_city"
|
||||||
|
id="address1_city"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-10"
|
||||||
|
label={t("account:account-town-city-label")}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_county"
|
||||||
|
id="address1_county"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-10"
|
||||||
|
label={t("account:account-county-label")}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
name="address1_postalcode"
|
||||||
|
id="address1_postalcode"
|
||||||
|
component={RenderTextfield}
|
||||||
|
type="text"
|
||||||
|
className="govuk-input govuk-input--width-5"
|
||||||
|
label={t("account:account-postcode-label")}
|
||||||
|
validate={[required]}
|
||||||
|
errorMsg="Is required"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
"/myportal?q=" +
|
||||||
|
props.props.accountDetails.loggedinUserId
|
||||||
|
}
|
||||||
|
className="govuk-link">
|
||||||
|
|
||||||
|
{t("common:cancel-link")}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
) : (
|
) : (
|
||||||
<PersonalDetailsComplete props={props} />
|
<>
|
||||||
)}
|
<BuildCheckPersonalDetails
|
||||||
</>
|
props={props}
|
||||||
);
|
setPersonalDetailsComplete={
|
||||||
|
setPersonalDetailsComplete
|
||||||
|
}
|
||||||
|
setAccountUpdatedComplete={
|
||||||
|
setAccountUpdatedComplete
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<PersonalDetailsComplete props={props} />
|
||||||
|
)}
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
@@ -25,272 +25,331 @@ const BuildCheckPersonalDetails = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
return (
|
const getPreferredLanguageLabel = (id) => {
|
||||||
<>
|
return id == 846040001
|
||||||
<h2 className="govuk-heading-m">About you</h2>
|
? t("account:account-preferred-language-english")
|
||||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
: t("account:account-preferred-language-welsh");
|
||||||
<div className="govuk-summary-list__row">
|
};
|
||||||
<dt className="govuk-summary-list__key">First name</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.firstname
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#firstname"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
first name
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">Last name</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.lastname
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#lastname"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
{" "}
|
|
||||||
last name
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">Email address</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.emailaddress1
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#emailaddress1"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
{" "}
|
|
||||||
email address
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">Telephone</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.telephone1
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#telephone1"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
telephone
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">Company/Group</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.company
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#company"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
{" "}
|
|
||||||
company/group
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
|
||||||
<h2 className="govuk-heading-m">Your address</h2>
|
|
||||||
|
|
||||||
<div className="govuk-summary-list__row">
|
return <>
|
||||||
<dt className="govuk-summary-list__key">Address Line 1</dt>
|
<h2 className="govuk-heading-m">
|
||||||
<dd className="govuk-summary-list__value">
|
{t("account:account-about-you-label")}
|
||||||
{
|
</h2>
|
||||||
props.props.props.form.personalDetailsForm.values
|
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||||
.address1_line1
|
<div className="govuk-summary-list__row">
|
||||||
}
|
<dt className="govuk-summary-list__key">
|
||||||
</dd>
|
{t("account:account-first-name-label")}
|
||||||
<dd className="govuk-summary-list__actions">
|
</dt>
|
||||||
<a
|
<dd className="govuk-summary-list__value">
|
||||||
className="govuk-link"
|
{
|
||||||
href="#address1_line1"
|
props.props.props.form.personalDetailsForm.values
|
||||||
onClick={() => {
|
.firstname
|
||||||
setPersonalDetailsComplete(false);
|
}
|
||||||
}}
|
</dd>
|
||||||
>
|
<dd className="govuk-summary-list__actions">
|
||||||
Change
|
<a
|
||||||
<span className="govuk-visually-hidden">
|
className="govuk-link"
|
||||||
{" "}
|
href="#firstname"
|
||||||
address line 1
|
onClick={() => {
|
||||||
</span>
|
setPersonalDetailsComplete(false);
|
||||||
</a>
|
}}
|
||||||
</dd>
|
>
|
||||||
</div>
|
{t("common:change-link-label")}
|
||||||
<div className="govuk-summary-list__row">
|
<span className="govuk-visually-hidden">
|
||||||
<dt className="govuk-summary-list__key">Address line 2</dt>
|
{t("account:account-first-name-label")}{" "}
|
||||||
<dd className="govuk-summary-list__value">
|
</span>
|
||||||
{
|
</a>
|
||||||
props.props.props.form.personalDetailsForm.values
|
</dd>
|
||||||
.address1_line2
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#address1_line2"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
{" "}
|
|
||||||
address line 2
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">Town/City</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.address1_city
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#address1_city"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
{" "}
|
|
||||||
town/city
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">County</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.address1_county
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#address1_county"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
{" "}
|
|
||||||
county
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dt className="govuk-summary-list__key">Postcode</dt>
|
|
||||||
<dd className="govuk-summary-list__value">
|
|
||||||
{
|
|
||||||
props.props.props.form.personalDetailsForm.values
|
|
||||||
.address1_postalcode
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__actions">
|
|
||||||
<a
|
|
||||||
className="govuk-link"
|
|
||||||
href="#address1_postalcode"
|
|
||||||
onClick={() => {
|
|
||||||
setPersonalDetailsComplete(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Change
|
|
||||||
<span className="govuk-visually-hidden">
|
|
||||||
{" "}
|
|
||||||
postcode
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
<div className="govuk-button-group">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="govuk-button"
|
|
||||||
data-module="govuk-button"
|
|
||||||
onClick={() => {
|
|
||||||
setAccountUpdatedComplete(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</button>
|
|
||||||
<Link
|
|
||||||
href={"/myportal?q=" + props.accountDetails.loggedinUserId}
|
|
||||||
>
|
|
||||||
<a className="govuk-link">Cancel</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
<div className="govuk-summary-list__row">
|
||||||
);
|
<dt className="govuk-summary-list__key">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-last-name-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.lastname
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#lastname"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-last-name-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-email-address-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.emailaddress1
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#emailaddress1"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-email-address-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("account:account-telephone-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.telephone1
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#telephone1"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{t("account:account-telephone-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-company-group-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.company
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#company"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-company-group-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("account:account-preferred-language-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{getPreferredLanguageLabel(
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.pinswg_preferredlanguage
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#company"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-preferred-language-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
<h2 className="govuk-heading-m">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-your-address-label")}
|
||||||
|
</h2>
|
||||||
|
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("account:account-address-line-1-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.address1_line1
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#address1_line1"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-address-line-1-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("account:account-address-line-2-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.address1_line2
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#address1_line2"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-address-line-2-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("account:account-town-city-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.address1_city
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#address1_city"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-town-city-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-county-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.address1_county
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#address1_county"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-county-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-postcode-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
props.props.props.form.personalDetailsForm.values
|
||||||
|
.address1_postalcode
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#address1_postalcode"
|
||||||
|
onClick={() => {
|
||||||
|
setPersonalDetailsComplete(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{t("account:account-postcode-label")}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
onClick={() => {
|
||||||
|
setAccountUpdatedComplete(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
<Link
|
||||||
|
href={"/myportal?q=" + props.accountDetails.loggedinUserId}
|
||||||
|
className="govuk-link">
|
||||||
|
{t("common:back-link")}
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
@@ -40,25 +40,22 @@ const PersonalDetailsComplete = (props) => {
|
|||||||
props.props.props.form.personalDetailsForm.values,
|
props.props.props.form.personalDetailsForm.values,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
<p className="govuk-body">{t("account:account-complete-para-1")}</p>
|
||||||
<p className="govuk-body">Your details have been updated</p>
|
|
||||||
|
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">{t("account:account-complete-para-2")}</p>
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a
|
|
||||||
metus non quam mollis egestas. Integer ac leo cursus, laoreet
|
|
||||||
nulla sed, tempus tellus. Mauris condimentum erat arcu.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
<Link
|
<Link
|
||||||
href={"/myportal?q=" + props.accountDetails.loggedinUserId}
|
href={"/myportal?q=" + props.accountDetails.loggedinUserId}
|
||||||
>
|
className="govuk-link">
|
||||||
<a className="govuk-link">Return to My Portal</a>
|
|
||||||
</Link>
|
{" "}
|
||||||
</p>
|
{t("account:account-complete-return-to-portal-link")}
|
||||||
</>
|
|
||||||
);
|
</Link>
|
||||||
|
</p>
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ const RegisterComplete = (props) => {
|
|||||||
var registerBody = "";
|
var registerBody = "";
|
||||||
switch (props.accountDetails.accCr) {
|
switch (props.accountDetails.accCr) {
|
||||||
case "created":
|
case "created":
|
||||||
return (registerBody = (
|
return registerBody = (
|
||||||
<>
|
<>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("account:register-new-account-confirmation-email")}
|
{t("account:register-new-account-confirmation-email")}
|
||||||
@@ -95,24 +95,33 @@ const RegisterComplete = (props) => {
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
<Link href="/">
|
<Link
|
||||||
<a
|
href="/"
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLogout(),
|
setLogout(),
|
||||||
window.localStorage.clear(),
|
window.localStorage.clear(),
|
||||||
destroyCookie({}, "pinsUser"),
|
destroyCookie(
|
||||||
signOut({ callbackUrl: "/logout" });
|
null,
|
||||||
}}
|
"next-auth.csrf-token"
|
||||||
>
|
),
|
||||||
{t(
|
destroyCookie(
|
||||||
"account:register-new-account-my-portal-link"
|
null,
|
||||||
)}
|
"next-auth.callback-url"
|
||||||
</a>
|
),
|
||||||
|
destroyCookie(null, "pedw_locale"),
|
||||||
|
destroyCookie(null, "pinsUser"),
|
||||||
|
signOut({ callbackUrl: "/logout" });
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{t(
|
||||||
|
"account:register-new-account-my-portal-link"
|
||||||
|
)}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
));
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+174
-162
@@ -4,7 +4,7 @@ import _ from "lodash";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import { getSession, useSession } from "next-auth/react";
|
import { getSession, useSession } from "next-auth/react";
|
||||||
|
|
||||||
const Breadcrumbs = (props) => {
|
const Breadcrumbs = (props) => {
|
||||||
@@ -61,17 +61,18 @@ const Breadcrumbs = (props) => {
|
|||||||
<div className="govuk-breadcrumbs ">
|
<div className="govuk-breadcrumbs ">
|
||||||
<ol className="govuk-breadcrumbs__list">
|
<ol className="govuk-breadcrumbs__list">
|
||||||
{/* <li className="govuk-breadcrumbs__list-item">
|
{/* <li className="govuk-breadcrumbs__list-item">
|
||||||
<Link href={t("common:gov-wales-link")}>
|
<Link href={t("common:gov-wales-link")}>
|
||||||
<a className="govuk-breadcrumbs__link">
|
<a className="govuk-breadcrumbs__link">
|
||||||
{t("common:gov-wales-label")}
|
{t("common:gov-wales-label")}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</li> */}
|
</li> */}
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link href={"/"}>
|
<Link
|
||||||
<a className="govuk-breadcrumbs__link">
|
href={"/"}
|
||||||
{t("common:service-name-breadcrumb")}
|
className="govuk-breadcrumbs__link"
|
||||||
</a>
|
>
|
||||||
|
{t("common:service-name-breadcrumb")}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
{router.pathname == "/myportal" ? (
|
{router.pathname == "/myportal" ? (
|
||||||
@@ -84,17 +85,18 @@ const Breadcrumbs = (props) => {
|
|||||||
{router.pathname == "/myportal/searchresults" ? (
|
{router.pathname == "/myportal/searchresults" ? (
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link
|
<a
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
</a>
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
{t("common:breadcrumb-search-results")}
|
{t("common:breadcrumb-search-results")}
|
||||||
@@ -127,13 +129,14 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -154,12 +157,9 @@ const Breadcrumbs = (props) => {
|
|||||||
"/advancedsearch"
|
"/advancedsearch"
|
||||||
: "/advancedsearch"
|
: "/advancedsearch"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-advanced-search")}
|
||||||
{t(
|
|
||||||
"common:breadcrumb-advanced-search"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -178,13 +178,14 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -195,12 +196,9 @@ const Breadcrumbs = (props) => {
|
|||||||
"/myportal/advancedsearch"
|
"/myportal/advancedsearch"
|
||||||
: "/myportal/advancedsearch"
|
: "/myportal/advancedsearch"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-advanced-search")}
|
||||||
{t(
|
|
||||||
"common:breadcrumb-advanced-search"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -218,13 +216,14 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("newappeal:parent-page-title")}
|
||||||
{t("newappeal:parent-page-title")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -240,13 +239,14 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("newappeal:parent-page-title")}
|
||||||
{t("newappeal:parent-page-title")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -262,13 +262,14 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("newappeal:parent-page-title")}
|
||||||
{t("newappeal:parent-page-title")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -287,26 +288,28 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("newappeal:parent-page-title")}
|
||||||
{t("newappeal:parent-page-title")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("newappeal:page-title")}
|
||||||
{t("newappeal:page-title")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -322,17 +325,18 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
Your cases
|
{t("common:breadcrumb-your-cases")}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
@@ -346,13 +350,12 @@ const Breadcrumbs = (props) => {
|
|||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/myportal"
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -381,26 +384,28 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/viewall"
|
? "/" +
|
||||||
: "/viewall"
|
router.locale +
|
||||||
|
"/fymhorth/gweldpopeth"
|
||||||
|
: "/myportal/viewall"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-your-cases")}
|
||||||
Your cases{" "}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -422,13 +427,14 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -444,20 +450,22 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link href={"/myportal/dnsapplications"}>
|
<Link
|
||||||
<a className="govuk-breadcrumbs__link">
|
href={"/myportal/dnsapplications"}
|
||||||
{t("dnsCommon:service-name")}
|
className="govuk-breadcrumbs__link"
|
||||||
</a>
|
>
|
||||||
|
{t("dnsCommon:service-name")}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -486,18 +494,13 @@ const Breadcrumbs = (props) => {
|
|||||||
props.props.search
|
props.props.search
|
||||||
.searchString
|
.searchString
|
||||||
}
|
}
|
||||||
|
onClick={() => {
|
||||||
|
// spinnerState();
|
||||||
|
router.back();
|
||||||
|
}}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a
|
{t("common:breadcrumb-search-results")}
|
||||||
onClick={() => {
|
|
||||||
// spinnerState();
|
|
||||||
router.back();
|
|
||||||
}}
|
|
||||||
className="govuk-breadcrumbs__link"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:breadcrumb-search-results"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -518,21 +521,36 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale +
|
? "/" +
|
||||||
|
router.locale +
|
||||||
"/myportal"
|
"/myportal"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t(
|
|
||||||
"common:breadcrumb-my-portal"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
Make representation for:{" "}
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale != "en"
|
||||||
|
? router.locale + "/case"
|
||||||
|
: "/case"
|
||||||
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
props.props.currentView
|
||||||
|
.caseReference.currentReference
|
||||||
|
}
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:make-a-representation-for-label"
|
||||||
|
)}{" "}
|
||||||
{
|
{
|
||||||
props.props.currentView.caseReference
|
props.props.currentView.caseReference
|
||||||
.currentReference
|
.currentReference
|
||||||
@@ -548,17 +566,18 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
Your account
|
{t("account:account-title")}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
@@ -579,13 +598,14 @@ const Breadcrumbs = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? router.locale + "/myportal"
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("common:breadcrumb-my-portal")}
|
||||||
{t("common:breadcrumb-my-portal")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -613,10 +633,9 @@ const Breadcrumbs = (props) => {
|
|||||||
? router.locale + "/../../dns"
|
? router.locale + "/../../dns"
|
||||||
: "/../../dns"
|
: "/../../dns"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("dnsCommon:service-name")}
|
||||||
{t("dnsCommon:service-name")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -649,10 +668,9 @@ const Breadcrumbs = (props) => {
|
|||||||
"/dnsapplications"
|
"/dnsapplications"
|
||||||
: "/dnsapplications"
|
: "/dnsapplications"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t("dnsCommon:service-name")}
|
||||||
{t("dnsCommon:service-name")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -712,12 +730,11 @@ const Breadcrumbs = (props) => {
|
|||||||
"/dns/applications"
|
"/dns/applications"
|
||||||
: "/dns/applications"
|
: "/dns/applications"
|
||||||
}
|
}
|
||||||
|
className="govuk-breadcrumbs__link"
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
{t(
|
||||||
{t(
|
"dnsApplicationView:page-parent-title"
|
||||||
"dnsApplicationView:page-parent-title"
|
)}
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
@@ -793,50 +810,45 @@ const Breadcrumbs = (props) => {
|
|||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{/* {!_.isEmpty(slug) ? (
|
{/* {!_.isEmpty(slug) ? (
|
||||||
<>
|
<>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" + router.locale +"/fymhorth"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
<a className="govuk-breadcrumbs__link">
|
||||||
{t("common:breadcrumb-my-portal")}
|
{t("common:breadcrumb-my-portal")}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? router.locale + "/apêlnewydd"
|
? router.locale + "/apêlnewydd"
|
||||||
: "/newappeal"
|
: "/newappeal"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<a className="govuk-breadcrumbs__link">
|
<a className="govuk-breadcrumbs__link">
|
||||||
{t("common:breadcrumb-new-appeal")}
|
{t("common:breadcrumb-new-appeal")}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className="govuk-breadcrumbs__list-item">
|
<li className="govuk-breadcrumbs__list-item">
|
||||||
{props.formTitle}
|
{props.formTitle}
|
||||||
</li>
|
</li>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)} */}
|
)} */}
|
||||||
|
|
||||||
<Breadcrumb />
|
<Breadcrumb />
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ const Case = (props) => {
|
|||||||
searchDetailsObj={props.searchDetailsObj}
|
searchDetailsObj={props.searchDetailsObj}
|
||||||
documentDetailsObj={props.documentDetailsObj}
|
documentDetailsObj={props.documentDetailsObj}
|
||||||
/>
|
/>
|
||||||
{showRepresentations == "true" && (
|
{showRepresentations == true && (
|
||||||
<RepresentationList
|
<RepresentationList
|
||||||
incidentid={props.incidentid}
|
incidentid={props.incidentid}
|
||||||
caseReference={props.caseReference}
|
caseReference={props.caseReference}
|
||||||
|
|||||||
+76
-107
@@ -1,29 +1,21 @@
|
|||||||
|
import jsonpath from "jsonpath";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import jsonpath from "jsonpath";
|
import { connect } from "react-redux";
|
||||||
import { useState, useEffect, useRef, useCallback } from "react";
|
|
||||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
import { formatDates } from "../utils";
|
||||||
import PaginationControl from "./pagination";
|
import PaginationControl from "./pagination";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import CryptoJS from "crypto-js";
|
|
||||||
|
|
||||||
import { setCurrentPage } from "../../store/currentView/action";
|
|
||||||
import {
|
import {
|
||||||
getBasicSearch,
|
|
||||||
getBasicSearchDetails,
|
|
||||||
getSearchDocumentDetails,
|
getSearchDocumentDetails,
|
||||||
getSearchDocumentDetailsPaged,
|
getSearchDocumentDetailsPaged,
|
||||||
getSearchDocumentTypes,
|
getSearchDocumentTypes,
|
||||||
} from "../../actions";
|
} from "../../actions";
|
||||||
|
import { setCurrentPage } from "../../store/currentView/action";
|
||||||
|
|
||||||
import {
|
import { setDocumentDetails } from "../../store/searchOutput/action";
|
||||||
setSearchResults,
|
|
||||||
setSearchDetails,
|
|
||||||
setDocumentDetails,
|
|
||||||
getSearchResultsObj,
|
|
||||||
} from "../../store/searchOutput/action";
|
|
||||||
|
|
||||||
const DocumentDetails = (props) => {
|
const DocumentDetails = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -204,8 +196,8 @@ const DocumentDetails = (props) => {
|
|||||||
</button>
|
</button>
|
||||||
</dd>
|
</dd>
|
||||||
{/* <dd className="govuk-summary-list__key govuk-!-font-size-16">
|
{/* <dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
{t("case:documents-size-label")}
|
{t("case:documents-size-label")}
|
||||||
</dd> */}
|
</dd> */}
|
||||||
</div>
|
</div>
|
||||||
{showSpinnerState == true ? (
|
{showSpinnerState == true ? (
|
||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
@@ -240,41 +232,33 @@ const DocumentDetails = (props) => {
|
|||||||
{showDownloadingState === key && (
|
{showDownloadingState === key && (
|
||||||
<div className="coverLoadingLink downloading">
|
<div className="coverLoadingLink downloading">
|
||||||
{/* <img
|
{/* <img
|
||||||
className="data-loading-icon"
|
className="data-loading-icon"
|
||||||
src="/assets/images/loading.gif"
|
src="/assets/images/loading.gif"
|
||||||
alt={
|
alt={
|
||||||
router.locale ==
|
router.locale ==
|
||||||
"cy"
|
"cy"
|
||||||
? "Nôl data"
|
? "Nôl data"
|
||||||
: "Fetching data"
|
: "Fetching data"
|
||||||
}
|
}
|
||||||
/> */}
|
/> */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
scroll={false}
|
scroll={false}
|
||||||
href={detailsObj.pinswg_hashlink}
|
href={detailsObj.pinswg_hashlink}
|
||||||
|
key={key}
|
||||||
|
onClick={() => {
|
||||||
|
toggleDownLoadLink(key);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<a
|
<span className="results-visually-hidden">
|
||||||
key={key}
|
{t("case:documents-name-label")}
|
||||||
onClick={() => {
|
:
|
||||||
toggleDownLoadLink(key);
|
</span>
|
||||||
}}
|
{_.has(detailsObj, "pinswg_name")
|
||||||
>
|
? detailsObj.pinswg_name
|
||||||
<span className="results-visually-hidden">
|
: ""}
|
||||||
{t(
|
|
||||||
"case:documents-name-label"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_name"
|
|
||||||
)
|
|
||||||
? detailsObj.pinswg_name
|
|
||||||
: ""}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -317,11 +301,11 @@ const DocumentDetails = (props) => {
|
|||||||
: ""}
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
|
{/* <dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t("case:documents-size-label")}:
|
{t("case:documents-size-label")}:
|
||||||
</span>
|
</span>
|
||||||
92
|
92
|
||||||
</dd> */}
|
</dd> */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@@ -340,49 +324,6 @@ const DocumentDetails = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getDocumentTypes();
|
|
||||||
if (selectedOption) {
|
|
||||||
setShowSpinnerState(true);
|
|
||||||
getDocumentResults(1, orderByState, fieldSortState);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedDocumentType) {
|
|
||||||
setShowSpinnerState(true);
|
|
||||||
getDocumentResults(
|
|
||||||
1,
|
|
||||||
orderByState,
|
|
||||||
fieldSortState,
|
|
||||||
selectedDocumentType
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const docDetailsObj = async () => {
|
|
||||||
let docObj = await getSearchDocumentDetails(incidentid).then(
|
|
||||||
(data) => {
|
|
||||||
//console.log(data);
|
|
||||||
setDocumentDetails(data);
|
|
||||||
setDocumentSearchState(true);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return docObj;
|
|
||||||
};
|
|
||||||
|
|
||||||
const searchDocumentResultsObj = docDetailsObj();
|
|
||||||
}, [
|
|
||||||
incidentid,
|
|
||||||
setDocumentDetails,
|
|
||||||
selectedOption,
|
|
||||||
selectedDocumentType,
|
|
||||||
fieldSortState,
|
|
||||||
orderByState,
|
|
||||||
getDocumentTypes,
|
|
||||||
getDocumentResults,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const getDocumentTypes = useCallback(() => {
|
const getDocumentTypes = useCallback(() => {
|
||||||
getSearchDocumentTypes(props.incidentid).then((data) => {
|
getSearchDocumentTypes(props.incidentid).then((data) => {
|
||||||
setDocumentTypes(data);
|
setDocumentTypes(data);
|
||||||
@@ -429,15 +370,6 @@ const DocumentDetails = (props) => {
|
|||||||
return docObj;
|
return docObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
function formatDates(dateObj) {
|
|
||||||
var dateObj = new Date(dateObj);
|
|
||||||
var dd = String(dateObj.getDate()).padStart(2, "0");
|
|
||||||
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
|
||||||
var yyyy = dateObj.getFullYear();
|
|
||||||
|
|
||||||
return dd + "/" + mm + "/" + yyyy;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pagesCount = Math.ceil(documentDetailsObj["@odata.count"] / 10);
|
const pagesCount = Math.ceil(documentDetailsObj["@odata.count"] / 10);
|
||||||
|
|
||||||
let currentPage = 0;
|
let currentPage = 0;
|
||||||
@@ -504,6 +436,48 @@ const DocumentDetails = (props) => {
|
|||||||
setShowSpinnerState(true);
|
setShowSpinnerState(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getDocumentTypes();
|
||||||
|
if (selectedOption) {
|
||||||
|
setShowSpinnerState(true);
|
||||||
|
getDocumentResults(1, orderByState, fieldSortState);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDocumentType) {
|
||||||
|
setShowSpinnerState(true);
|
||||||
|
getDocumentResults(
|
||||||
|
1,
|
||||||
|
orderByState,
|
||||||
|
fieldSortState,
|
||||||
|
selectedDocumentType
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const docDetailsObj = async () => {
|
||||||
|
let docObj = await getSearchDocumentDetails(incidentid).then(
|
||||||
|
(data) => {
|
||||||
|
//console.log(data);
|
||||||
|
setDocumentDetails(data);
|
||||||
|
setDocumentSearchState(true);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return docObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
const searchDocumentResultsObj = docDetailsObj();
|
||||||
|
}, [
|
||||||
|
incidentid,
|
||||||
|
setDocumentDetails,
|
||||||
|
selectedOption,
|
||||||
|
selectedDocumentType,
|
||||||
|
fieldSortState,
|
||||||
|
orderByState,
|
||||||
|
getDocumentTypes,
|
||||||
|
getDocumentResults,
|
||||||
|
]);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
@@ -528,11 +502,6 @@ const DocumentDetails = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,212 +0,0 @@
|
|||||||
import Link from "next/link";
|
|
||||||
import { useState, useEffect } from "react";
|
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
|
||||||
import jsonpath from "jsonpath";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { Field, FieldArray, reduxForm, formValueSelector } from "redux-form";
|
|
||||||
import { connect } from "react-redux";
|
|
||||||
import { useDropzone } from "react-dropzone";
|
|
||||||
|
|
||||||
import { setRepresentationCapacity } from "../../../store/currentView/action";
|
|
||||||
import RepCapacitySelection from "./representationCapacitySelection";
|
|
||||||
import RepDetails from "./representationDetails";
|
|
||||||
import RepAppellant from "./representationAppellant";
|
|
||||||
import RepAgent from "./representationAgent";
|
|
||||||
import RepInterestedPartyPerson from "./representationInterestedPartyPerson";
|
|
||||||
import RepLandOwner from "./representationLandowner";
|
|
||||||
import {
|
|
||||||
RenderPickList,
|
|
||||||
RenderRadioList,
|
|
||||||
RenderTextfield,
|
|
||||||
} from "./representationElements";
|
|
||||||
|
|
||||||
let MakeRepresentation = (props) => {
|
|
||||||
let { t } = useTranslation();
|
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
|
||||||
|
|
||||||
const [clearRepForm, setClearRepForm] = useState(false);
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const { locale } = router;
|
|
||||||
const {
|
|
||||||
caseReference,
|
|
||||||
myCases,
|
|
||||||
myRepresentations,
|
|
||||||
watchedCases,
|
|
||||||
awaitingSubmission,
|
|
||||||
searchResultsObj,
|
|
||||||
currentType,
|
|
||||||
currentView,
|
|
||||||
setRepresentationCapacity,
|
|
||||||
} = props;
|
|
||||||
const formObj = props.props.form;
|
|
||||||
let setCaseQueryObj = props[currentType];
|
|
||||||
var casesObj = {};
|
|
||||||
|
|
||||||
currentType == "searchResultsObj"
|
|
||||||
? (casesObj = jsonpath.query(
|
|
||||||
setCaseQueryObj,
|
|
||||||
'$..[?(@.title=="' + caseReference + '")]'
|
|
||||||
))
|
|
||||||
: (casesObj = jsonpath.query(
|
|
||||||
setCaseQueryObj,
|
|
||||||
'$..[?(@.reference=="' + caseReference + '")]'
|
|
||||||
));
|
|
||||||
|
|
||||||
casesObj = Object.assign({}, ...casesObj);
|
|
||||||
|
|
||||||
const capacityOptionsArr = [
|
|
||||||
"Appellant",
|
|
||||||
"Agent",
|
|
||||||
"Interested Party/Person",
|
|
||||||
"Land Owner",
|
|
||||||
];
|
|
||||||
|
|
||||||
const appellantApplicantRepresentationArr = [
|
|
||||||
"Other",
|
|
||||||
"Statement",
|
|
||||||
"Statement of common ground",
|
|
||||||
"Written statement of evidence",
|
|
||||||
];
|
|
||||||
|
|
||||||
const interestedPersonRepresentationArr = [
|
|
||||||
"Interested Party/Person correspondence",
|
|
||||||
];
|
|
||||||
|
|
||||||
const landOwnerRepresentationArr = [
|
|
||||||
"Other",
|
|
||||||
"Statement",
|
|
||||||
"Written statement of evidence",
|
|
||||||
];
|
|
||||||
|
|
||||||
const repCapacityType = () => {
|
|
||||||
currentView.representationCapacity == false
|
|
||||||
? false
|
|
||||||
: _.isEmpty(formObj["representationForm"])
|
|
||||||
? false
|
|
||||||
: _.isEmpty(formObj["representationForm"].values)
|
|
||||||
? false
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"].values.representationCapacity
|
|
||||||
)
|
|
||||||
? setRepresentationCapacity(false)
|
|
||||||
: setRepresentationCapacity(
|
|
||||||
formObj["representationForm"].values.representationCapacity
|
|
||||||
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
|
|
||||||
.toLowerCase()
|
|
||||||
);
|
|
||||||
|
|
||||||
return currentView.representationCapacity;
|
|
||||||
};
|
|
||||||
|
|
||||||
const whichControl = () => {
|
|
||||||
repCapacityType();
|
|
||||||
switch (currentView.representationCapacity) {
|
|
||||||
case false:
|
|
||||||
return (
|
|
||||||
<RepCapacitySelection
|
|
||||||
formObj={formObj}
|
|
||||||
capacityOptionsArr={capacityOptionsArr}
|
|
||||||
currentType={currentType}
|
|
||||||
casesObj={casesObj}
|
|
||||||
setRepresentationCapacity={setRepresentationCapacity}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case "appellant":
|
|
||||||
setRepresentationCapacity("appellant");
|
|
||||||
return (
|
|
||||||
<RepAppellant
|
|
||||||
formObj={formObj}
|
|
||||||
appellantApplicantRepresentationArr={
|
|
||||||
appellantApplicantRepresentationArr
|
|
||||||
}
|
|
||||||
setRepresentationCapacity={setRepresentationCapacity}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case "agent":
|
|
||||||
setRepresentationCapacity("agent");
|
|
||||||
return (
|
|
||||||
<RepAgent
|
|
||||||
formObj={formObj}
|
|
||||||
appellantApplicantRepresentationArr={
|
|
||||||
appellantApplicantRepresentationArr
|
|
||||||
}
|
|
||||||
setRepresentationCapacity={setRepresentationCapacity}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case "interestedpartyperson":
|
|
||||||
setRepresentationCapacity("interestedpartyperson");
|
|
||||||
return (
|
|
||||||
<RepInterestedPartyPerson
|
|
||||||
formObj={formObj}
|
|
||||||
interestedPersonRepresentationArr={
|
|
||||||
interestedPersonRepresentationArr
|
|
||||||
}
|
|
||||||
setRepresentationCapacity={setRepresentationCapacity}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case "landowner":
|
|
||||||
setRepresentationCapacity("landowner");
|
|
||||||
return (
|
|
||||||
<RepLandOwner
|
|
||||||
formObj={formObj}
|
|
||||||
landOwnerRepresentationArr={landOwnerRepresentationArr}
|
|
||||||
setRepresentationCapacity={setRepresentationCapacity}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return (
|
|
||||||
<RepCapacitySelection
|
|
||||||
formObj={formObj}
|
|
||||||
capacityOptionsArr={capacityOptionsArr}
|
|
||||||
currentType={currentType}
|
|
||||||
casesObj={casesObj}
|
|
||||||
setRepresentationCapacity={setRepresentationCapacity}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
{whichControl()} - {props.firstValue}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
|
||||||
return {
|
|
||||||
search: state.search,
|
|
||||||
searchResultsObj: state.searchResultsObj,
|
|
||||||
formData: state.formData,
|
|
||||||
appealType: state.appealType,
|
|
||||||
currentView: state.currentView,
|
|
||||||
//form: state.form,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => {
|
|
||||||
return {
|
|
||||||
setRepresentationCapacity: (representationCapacity) => {
|
|
||||||
dispatch(setRepresentationCapacity(representationCapacity));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const selector = formValueSelector("representationForm");
|
|
||||||
|
|
||||||
export default connect(
|
|
||||||
mapStateToProps,
|
|
||||||
mapDispatchToProps
|
|
||||||
)(
|
|
||||||
reduxForm({
|
|
||||||
form: "representationForm",
|
|
||||||
destroyOnUnmount: false,
|
|
||||||
})(MakeRepresentation)
|
|
||||||
);
|
|
||||||
+1042
-139
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { connect } from "react-redux";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
@@ -7,11 +8,16 @@ import {
|
|||||||
RenderTextfield,
|
RenderTextfield,
|
||||||
RenderRadioList,
|
RenderRadioList,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
|
RenderRichMultiline,
|
||||||
|
RenderCondtionalRadioList,
|
||||||
|
FileUploadField,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
import {
|
import {
|
||||||
setRepresentationCapacity,
|
getFormCollectionByID,
|
||||||
setRepresentationSubmit,
|
getThumbnailIconByExtension,
|
||||||
} from "../../../store/currentView/action";
|
bytesToSize,
|
||||||
|
} from "../../utils";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
|
|
||||||
const RepAgent = (props) => {
|
const RepAgent = (props) => {
|
||||||
@@ -32,29 +38,33 @@ const RepAgent = (props) => {
|
|||||||
{file.path} - {file.size} bytes
|
{file.path} - {file.size} bytes
|
||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="rep-appellant">
|
<>
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-row">
|
<h2 className="govuk-heading-m ">
|
||||||
<h2 className="govuk-heading-m ">Representation - agent</h2>
|
{t(
|
||||||
|
"myrepresentations:representation-from-an-agent-heading"
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<label
|
<label
|
||||||
className="govuk-label govuk-body-m"
|
className="govuk-label govuk-body-m"
|
||||||
htmlFor="representationType"
|
htmlFor="representationType"
|
||||||
>
|
>
|
||||||
What kind of representation are you making?
|
{t("myrepresentations:kind-of-rep-label")}
|
||||||
</label>
|
</label>
|
||||||
<Field
|
<Field
|
||||||
name="representationType"
|
name="representationType"
|
||||||
component={RenderPickList}
|
component={RenderPickList}
|
||||||
datafieldname="representationType"
|
datafieldname="representationType"
|
||||||
optionsArr={appellantApplicantRepresentationArr}
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
</div>
|
||||||
|
{/* <div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<Field
|
<Field
|
||||||
className="govuk-input govuk-!-width-three-quarters"
|
className="govuk-input govuk-!-width-three-quarters"
|
||||||
@@ -67,168 +77,130 @@ const RepAgent = (props) => {
|
|||||||
label="Description of representation"
|
label="Description of representation"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<p className="govuk-body">
|
<Field
|
||||||
You can enter your comments in the space provided or
|
name="representationOnBehalfOf"
|
||||||
attach a separate document.
|
datafieldname="representationOnBehalfOf"
|
||||||
</p>
|
// label={t("myrepresentations:capacity-select-what-capacity-label")}
|
||||||
<fieldset
|
options={["Yes", "No"]}
|
||||||
className="govuk-fieldset"
|
id="representationOnBehalfOf"
|
||||||
aria-describedby="commentBox-hint"
|
className="govuk-radios__input"
|
||||||
>
|
errorMsg={t("newappeal:select-an-option-label")}
|
||||||
<div id="commentBox-hint" className="govuk-hint">
|
component={RenderCondtionalRadioList}
|
||||||
My comments are set out in:*
|
validate={[required]}
|
||||||
</div>
|
legend={
|
||||||
<div
|
"Are you acting on behalf of a company, group or organisation?"
|
||||||
className="govuk-checkboxes"
|
}
|
||||||
data-module="govuk-checkboxes"
|
/>
|
||||||
>
|
|
||||||
<div className="govuk-checkboxes__item">
|
|
||||||
<Field
|
|
||||||
className="govuk-checkboxes__input"
|
|
||||||
id="commentBox"
|
|
||||||
name="commentBox"
|
|
||||||
value="email"
|
|
||||||
data-aria-controls="commentBox"
|
|
||||||
type="checkbox"
|
|
||||||
component={RenderTextfield}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-checkboxes__label"
|
|
||||||
htmlFor="commentBox"
|
|
||||||
>
|
|
||||||
the box below{" "}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
_.isEmpty(formObj["representationForm"])
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden q11 "
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values.commentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.commentBox == false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden wwwaqqqq"
|
|
||||||
}
|
|
||||||
id="conditional-commentBox"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<Field
|
|
||||||
name="representationComments"
|
|
||||||
id="representationComments"
|
|
||||||
component={RenderMultiline}
|
|
||||||
type="text"
|
|
||||||
rows="5"
|
|
||||||
className="govuk-textarea govuk-input--width-30"
|
|
||||||
aria-describedby={
|
|
||||||
props.name + "-hint"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-checkboxes__item">
|
|
||||||
<Field
|
|
||||||
className="govuk-checkboxes__input"
|
|
||||||
id="documentBox"
|
|
||||||
name="documentBox"
|
|
||||||
value="email"
|
|
||||||
data-aria-controls="documentBox"
|
|
||||||
type="checkbox"
|
|
||||||
component={RenderTextfield}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-checkboxes__label"
|
|
||||||
htmlFor="documentBox"
|
|
||||||
>
|
|
||||||
separate documents
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
_.isEmpty(formObj["representationForm"])
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values.documentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.documentBox == false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden"
|
|
||||||
}
|
|
||||||
id="conditional-documentBox"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<section className="container">
|
|
||||||
<div
|
|
||||||
{...getRootProps({
|
|
||||||
className: "dropzone",
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<input {...getInputProps()} />
|
|
||||||
<p>
|
|
||||||
Drag and drop files here or
|
|
||||||
click to select files
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<aside>
|
|
||||||
<h4>Files</h4>
|
|
||||||
<ul>{files}</ul>
|
|
||||||
</aside>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>{" "}
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-button-group">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="govuk-button"
|
|
||||||
data-module="govuk-button"
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</button>
|
|
||||||
{/* <a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationSubmit(false);
|
|
||||||
}}
|
|
||||||
className="govuk-button"
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</a> */}
|
|
||||||
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationCapacity();
|
|
||||||
}}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
Back
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("myrepresentations:enter-comment-label")}
|
||||||
|
</p>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
<div id="commentBox-hint" className="govuk-hint">
|
||||||
|
{t("myrepresentations:comments-set-out-label")}:
|
||||||
|
</div>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<Field
|
||||||
|
name="representationComments"
|
||||||
|
id="representationComments"
|
||||||
|
component={RenderRichMultiline}
|
||||||
|
type="text"
|
||||||
|
rows="5"
|
||||||
|
className="govuk-textarea govuk-input--width-30"
|
||||||
|
aria-describedby={props.name + "-hint"}
|
||||||
|
/>
|
||||||
|
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||||
|
{t("myrepresentations:publish-policy-label")}
|
||||||
|
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
|
||||||
|
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||||
|
<FileUploadField
|
||||||
|
name={"representationDocuments"}
|
||||||
|
label={t("myrepresentations:add-files-label")}
|
||||||
|
ticketnumber={props.props.caseReference}
|
||||||
|
hint={"sdsd"}
|
||||||
|
fileList={[]}
|
||||||
|
setFilesForRepresentation={[]}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails.containerID
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{props.currentView.caseReference.hasOwnProperty(
|
||||||
|
"repDetails"
|
||||||
|
) &&
|
||||||
|
props.currentView.caseReference.repDetails.filesList
|
||||||
|
.length > 0 ? (
|
||||||
|
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||||
|
{props.currentView.caseReference.repDetails.filesList.map(
|
||||||
|
(blob, i) => (
|
||||||
|
<div
|
||||||
|
key={blob.name + "_" + i}
|
||||||
|
className="govuk-!-margin-bottom-5 fileThumb "
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={getThumbnailIconByExtension(
|
||||||
|
blob.name
|
||||||
|
)}
|
||||||
|
alt={blob.name}
|
||||||
|
width="50"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||||
|
{blob.name} (
|
||||||
|
{bytesToSize(blob.size)})
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</fieldset>
|
||||||
|
</div>{" "}
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}{" "}
|
||||||
|
</button>
|
||||||
|
{/* <a
|
||||||
|
onClick={() => {
|
||||||
|
setRepresentationSubmit(true);
|
||||||
|
}}
|
||||||
|
className="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")} ww
|
||||||
|
</a> */}
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setRepresentationCapacity();
|
||||||
|
}}
|
||||||
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
{t("common:back-link")}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,17 @@ import {
|
|||||||
RenderTextfield,
|
RenderTextfield,
|
||||||
RenderRadioList,
|
RenderRadioList,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
|
RenderRichMultiline,
|
||||||
RenderFileUpload,
|
RenderFileUpload,
|
||||||
|
FileUploadField,
|
||||||
|
RepresentationGuidanceText,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getThumbnailIconByExtension,
|
||||||
|
bytesToSize,
|
||||||
|
} from "../../utils";
|
||||||
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
// import {
|
// import {
|
||||||
// setRepresentationCapacity,
|
// setRepresentationCapacity,
|
||||||
@@ -35,25 +44,38 @@ const RepAppellant = (props) => {
|
|||||||
// console.log(props);
|
// console.log(props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="rep-appellant">
|
<>
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-form-group">
|
||||||
<div className="govuk-form-group">
|
<h2 className="govuk-heading-m ">
|
||||||
<label
|
{t(
|
||||||
className="govuk-label govuk-body-m"
|
"myrepresentations:representation-from-an-appellant-heading"
|
||||||
htmlFor="representationType"
|
)}
|
||||||
>
|
</h2>
|
||||||
What kind of representation are you making?
|
<label
|
||||||
</label>
|
className="govuk-label govuk-body-m"
|
||||||
|
htmlFor="representationType"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:representation-from-an-agent-heading"
|
||||||
|
)}
|
||||||
|
?
|
||||||
|
</label>
|
||||||
|
|
||||||
|
{typeof props.representationType == "undefined" ? (
|
||||||
<Field
|
<Field
|
||||||
name="representationType"
|
name="representationType"
|
||||||
component={RenderPickList}
|
component={RenderPickList}
|
||||||
datafieldname="representationType"
|
datafieldname="representationType"
|
||||||
optionsArr={appellantApplicantRepresentationArr}
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
/>
|
/>
|
||||||
</div>
|
) : (
|
||||||
|
<p>{props.representationType}</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
</div>
|
||||||
|
|
||||||
|
{/* <div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<Field
|
<Field
|
||||||
className="govuk-input govuk-!-width-three-quarters"
|
className="govuk-input govuk-!-width-three-quarters"
|
||||||
@@ -66,169 +88,109 @@ const RepAppellant = (props) => {
|
|||||||
label="Description of representation"
|
label="Description of representation"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-grid-row">
|
||||||
<p className="govuk-body">
|
<div className="govuk-form-group">
|
||||||
You can enter your comments in the space provided or
|
<p className="govuk-body">
|
||||||
attach a separate document.
|
{t("myrepresentations:enter-comment-label")}
|
||||||
</p>
|
</p>
|
||||||
<fieldset
|
<fieldset
|
||||||
className="govuk-fieldset"
|
className="govuk-fieldset"
|
||||||
aria-describedby="commentBox-hint"
|
aria-describedby="commentBox-hint"
|
||||||
>
|
>
|
||||||
<div id="commentBox-hint" className="govuk-hint">
|
<div id="commentBox-hint" className="govuk-hint">
|
||||||
My comments are set out in:*
|
{t("myrepresentations:comments-set-out-label")}:
|
||||||
|
</div>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<Field
|
||||||
|
name="representationComments"
|
||||||
|
id="representationComments"
|
||||||
|
component={RenderRichMultiline}
|
||||||
|
type="text"
|
||||||
|
rows="5"
|
||||||
|
className="govuk-textarea govuk-input--width-30"
|
||||||
|
aria-describedby={props.name + "-hint"}
|
||||||
|
/>
|
||||||
|
{RepresentationGuidanceText(
|
||||||
|
formObj.representationForm.values.appealType
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||||
|
<FileUploadField
|
||||||
|
name={"representationDocuments"}
|
||||||
|
label={t("myrepresentations:add-files-label")}
|
||||||
|
ticketnumber={props.props.caseReference}
|
||||||
|
hint={"sdsd"}
|
||||||
|
fileList={[]}
|
||||||
|
setFilesForRepresentation={[]}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails.containerID
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{props.currentView.caseReference.hasOwnProperty(
|
||||||
|
"repDetails"
|
||||||
|
) &&
|
||||||
|
props.currentView.caseReference.repDetails.filesList
|
||||||
|
.length > 0 ? (
|
||||||
|
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||||
|
{props.currentView.caseReference.repDetails.filesList.map(
|
||||||
|
(blob, i) => (
|
||||||
|
<div
|
||||||
|
key={blob.name + "_" + i}
|
||||||
|
className="govuk-!-margin-bottom-5 fileThumb "
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={getThumbnailIconByExtension(
|
||||||
|
blob.name
|
||||||
|
)}
|
||||||
|
alt={blob.name}
|
||||||
|
width="50"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||||
|
{blob.name} (
|
||||||
|
{bytesToSize(blob.size)})
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div
|
) : (
|
||||||
className="govuk-checkboxes"
|
""
|
||||||
data-module="govuk-checkboxes"
|
)}
|
||||||
>
|
</fieldset>
|
||||||
<div className="govuk-checkboxes__item">
|
</div>{" "}
|
||||||
<Field
|
</div>
|
||||||
className="govuk-checkboxes__input"
|
<div className="govuk-grid-row">
|
||||||
id="commentBox"
|
<div className="govuk-button-group">
|
||||||
name="commentBox"
|
<button
|
||||||
value="email"
|
type="submit"
|
||||||
data-aria-controls="commentBox"
|
className="govuk-button"
|
||||||
type="checkbox"
|
data-module="govuk-button"
|
||||||
component={RenderTextfield}
|
>
|
||||||
/>
|
{t("common:continue-button")}
|
||||||
<label
|
</button>
|
||||||
className="govuk-label govuk-checkboxes__label"
|
{/* <a
|
||||||
htmlFor="commentBox"
|
|
||||||
>
|
|
||||||
the box below{" "}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
_.isEmpty(formObj["representationForm"])
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden q11 "
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values.commentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.commentBox == false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden wwwaqqqq"
|
|
||||||
}
|
|
||||||
id="conditional-commentBox"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<Field
|
|
||||||
name="representationComments"
|
|
||||||
id="representationComments"
|
|
||||||
component={RenderMultiline}
|
|
||||||
type="text"
|
|
||||||
rows="5"
|
|
||||||
className="govuk-textarea govuk-input--width-30"
|
|
||||||
aria-describedby={
|
|
||||||
props.name + "-hint"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-checkboxes__item">
|
|
||||||
<Field
|
|
||||||
className="govuk-checkboxes__input"
|
|
||||||
id="documentBox"
|
|
||||||
name="documentBox"
|
|
||||||
data-aria-controls="documentBox"
|
|
||||||
type="checkbox"
|
|
||||||
component={RenderTextfield}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-checkboxes__label"
|
|
||||||
htmlFor="documentBox"
|
|
||||||
>
|
|
||||||
separate documents
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
_.isEmpty(formObj["representationForm"])
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values.documentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.documentBox == false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden"
|
|
||||||
}
|
|
||||||
id="conditional-documentBox"
|
|
||||||
>
|
|
||||||
<h2 className="govuk-heading-s">
|
|
||||||
{props.label}{" "}
|
|
||||||
</h2>
|
|
||||||
<Field
|
|
||||||
name="repsFiles"
|
|
||||||
id="repsFiles"
|
|
||||||
component={RenderFileUpload}
|
|
||||||
className="govuk-input govuk-input--width-20"
|
|
||||||
//validate={[required]}
|
|
||||||
label={props.label}
|
|
||||||
errorMsg="Is required"
|
|
||||||
ticketnumber={props.caseReference}
|
|
||||||
documentTypeCode={
|
|
||||||
props.documentTypeCode
|
|
||||||
}
|
|
||||||
hint={props.hint}
|
|
||||||
fileList={props.fileList}
|
|
||||||
setFilesForAppeal={
|
|
||||||
props.setFilesForAppeal
|
|
||||||
}
|
|
||||||
containerID={props.containerID}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>{" "}
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-button-group">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="govuk-button"
|
|
||||||
data-module="govuk-button"
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</button>
|
|
||||||
{/* <a
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setRepresentationSubmit(true);
|
setRepresentationSubmit(true);
|
||||||
}}
|
}}
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
>
|
>
|
||||||
Continue ww
|
{t("common:continue-button")} ww
|
||||||
</a> */}
|
</a> */}
|
||||||
<a
|
<a
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setRepresentationCapacity();
|
setRepresentationCapacity();
|
||||||
}}
|
}}
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
>
|
>
|
||||||
Back
|
{t("common:back-link")}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderTextfield,
|
RenderTextfield,
|
||||||
RenderRadioList,
|
RenderRadioList,
|
||||||
|
RenderRadioListWithText,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
@@ -47,22 +48,31 @@ let RepCapacitySelection = (props) => {
|
|||||||
formObj={formObj}
|
formObj={formObj}
|
||||||
currentType={currentType}
|
currentType={currentType}
|
||||||
casesObj={casesObj}
|
casesObj={casesObj}
|
||||||
|
caseReference={props.props.caseReference}
|
||||||
|
searchResultsObj={props.props.searchResultsObj}
|
||||||
|
myRepresentations={props.props.myRepresentations}
|
||||||
|
props={props}
|
||||||
/>{" "}
|
/>{" "}
|
||||||
<div id="rep-details" className="vo_hiddens">
|
<div id="rep-details" className="">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<h2 className="govuk-heading-m ">
|
<h2 className="govuk-heading-m ">
|
||||||
Your details - {props.firstValue}
|
{t(
|
||||||
|
"myrepresentations:capacity-select-your-details"
|
||||||
|
)}{" "}
|
||||||
|
- {props.firstValue}
|
||||||
</h2>
|
</h2>
|
||||||
<Field
|
<Field
|
||||||
name="representationCapacity"
|
name="representationCapacity"
|
||||||
datafieldname="representationCapacity"
|
datafieldname="representationCapacity"
|
||||||
label="In what capacity do you wish to make representations on this case?"
|
label={t(
|
||||||
|
"myrepresentations:capacity-select-what-capacity-label"
|
||||||
|
)}
|
||||||
options={capacityOptionsArr}
|
options={capacityOptionsArr}
|
||||||
id="representationCapacity"
|
id="representationCapacity"
|
||||||
className="govuk-radios__input"
|
className="govuk-radios__input"
|
||||||
errorMsg={t("newappeal:select-an-option-label")}
|
errorMsg={t("newappeal:select-an-option-label")}
|
||||||
component={RenderRadioList}
|
component={RenderRadioListWithText}
|
||||||
validate={[required]}
|
validate={[required]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -75,7 +85,7 @@ let RepCapacitySelection = (props) => {
|
|||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
>
|
>
|
||||||
Continue
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import { useEffect } from "react";
|
||||||
import { Field, reduxForm } from "redux-form";
|
|
||||||
import {
|
|
||||||
RenderPickList,
|
|
||||||
RenderTextfield,
|
|
||||||
RenderRadioList,
|
|
||||||
RenderMultiline,
|
|
||||||
} from "./representationElements";
|
|
||||||
import {
|
|
||||||
setRepresentationCapacity,
|
|
||||||
setRepresentationSubmit,
|
|
||||||
setSubmitBack,
|
|
||||||
} from "../../../store/currentView/action";
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import { sendEmail, sendRepCompleteMessage } from "../../../actions";
|
||||||
|
import { setRepresentationReset } from "../../../store/currentView/action";
|
||||||
|
|
||||||
const RepComplete = (props) => {
|
const RepComplete = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -28,6 +20,7 @@ const RepComplete = (props) => {
|
|||||||
currentView,
|
currentView,
|
||||||
setSubmitBack,
|
setSubmitBack,
|
||||||
setRepresentationSubmitConfirmation,
|
setRepresentationSubmitConfirmation,
|
||||||
|
setRepresentationMessageSent,
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
const files = acceptedFiles.map((file) => (
|
const files = acceptedFiles.map((file) => (
|
||||||
@@ -36,35 +29,50 @@ const RepComplete = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const reference = "PEDW-REPRESENTATION-COMPLETE";
|
||||||
|
const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
|
||||||
|
const emailAddress =
|
||||||
|
props.props.props.props.accountDetails.accountDetails.emailaddress1;
|
||||||
|
const personalisation = {
|
||||||
|
"caseReference":
|
||||||
|
props.props.currentView.caseReference.currentReference,
|
||||||
|
"emailAddress":
|
||||||
|
props.props.props.props.accountDetails.accountDetails
|
||||||
|
.emailaddress1,
|
||||||
|
"linkExpiry": 10 * 60,
|
||||||
|
};
|
||||||
|
|
||||||
|
props.props.currentView.representationMessageSent != true &&
|
||||||
|
(sendRepCompleteMessage(
|
||||||
|
props.props.props.props.accountDetails.containerID,
|
||||||
|
props.props.currentView.caseReference.currentReference
|
||||||
|
),
|
||||||
|
sendEmail(templateId, emailAddress, personalisation, reference),
|
||||||
|
setRepresentationMessageSent(true));
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<div id="rep-appellant">
|
<div id="rep-appellant">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-grid-row govuk-body">
|
<div className="govuk-grid-row govuk-body">
|
||||||
<h1 className="govuk-heading-m ">
|
<h1 className="govuk-heading-m ">
|
||||||
Submission of Representation
|
{t("myrepresentations:rep-complete-heading")}
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>{t("myrepresentations:rep-complete-para-one")}</p>
|
||||||
Thank you for submitting your representation(s) using
|
|
||||||
the Appeals Casework Portal.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>{t("myrepresentations:rep-complete-para-two")}</p>
|
||||||
Please remember that any supporting documentation needs
|
|
||||||
to be received by us within the appropriate deadline for
|
|
||||||
the case. Anything you send to us must be clearly marked
|
|
||||||
with the case reference number and the site address
|
|
||||||
(including the postcode, where known).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p> {t("myrepresentations:rep-complete-para-three")}</p>
|
||||||
You will shortly receive confirmation to the email
|
|
||||||
address you have provided.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<Link href="/myportal">
|
<Link
|
||||||
<a className="govuk-button">Continue</a>
|
href="/myportal"
|
||||||
|
onClick={() => setRepresentationReset()}
|
||||||
|
className="govuk-button">
|
||||||
|
|
||||||
|
{t("common:continue-button")}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
import Link from "next/link";
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/router";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { useRouter } from "next/router";
|
||||||
import {
|
|
||||||
RenderPickList,
|
|
||||||
RenderTextfield,
|
|
||||||
RenderRadioList,
|
|
||||||
RenderMultiline,
|
|
||||||
} from "./representationElements";
|
|
||||||
import {
|
|
||||||
setRepresentationCapacity,
|
|
||||||
setRepresentationSubmit,
|
|
||||||
setSubmitBack,
|
|
||||||
setRepresentationSubmitConfirmation,
|
|
||||||
} from "../../../store/currentView/action";
|
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import RepComplete from "./representationComplete";
|
import RepComplete from "./representationComplete";
|
||||||
|
import RepLPAQuestionnaireCheck_s78 from "./representationQuestionnairesCheck/representationLPAQuestionnaireCheck_s78";
|
||||||
|
import RepLPAQuestionnaireCheck_enforcement from "./representationQuestionnairesCheck/representationLPAQuestionnaireCheck_enforcement";
|
||||||
|
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getThumbnailIconByExtension,
|
||||||
|
bytesToSize,
|
||||||
|
} from "../../utils";
|
||||||
|
|
||||||
const RepCompleteSubmit = (props) => {
|
const RepCompleteSubmit = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -30,6 +25,8 @@ const RepCompleteSubmit = (props) => {
|
|||||||
currentView,
|
currentView,
|
||||||
setSubmitBack,
|
setSubmitBack,
|
||||||
setRepresentationSubmitConfirmation,
|
setRepresentationSubmitConfirmation,
|
||||||
|
setRepresentationMessageSent,
|
||||||
|
setRepresentationReset,
|
||||||
} = props;
|
} = props;
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
const files = acceptedFiles.map((file) => (
|
const files = acceptedFiles.map((file) => (
|
||||||
@@ -38,34 +35,279 @@ const RepCompleteSubmit = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
|
|
||||||
|
const repFormData = formObj.representationForm.values;
|
||||||
|
|
||||||
|
console.log("///////// formObj:", formObj);
|
||||||
|
|
||||||
|
const whichQuestionnaireCheck = () => {
|
||||||
|
{
|
||||||
|
console.log("curr");
|
||||||
|
switch (currentView.caseReference.appealType) {
|
||||||
|
case 846040000:
|
||||||
|
return (
|
||||||
|
<RepLPAQuestionnaireCheck_s78
|
||||||
|
props={props}
|
||||||
|
formObj={formObj}
|
||||||
|
setSubmitBack={setSubmitBack}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 846040005:
|
||||||
|
return (
|
||||||
|
<RepLPAQuestionnaireCheck_enforcement
|
||||||
|
props={props}
|
||||||
|
formObj={formObj}
|
||||||
|
setSubmitBack={setSubmitBack}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return <>hello</>;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{currentView.representationSubmitConfirmation == true ? (
|
{currentView.representationSubmitConfirmation == true ? (
|
||||||
<RepComplete />
|
<RepComplete
|
||||||
|
props={props}
|
||||||
|
setRepresentationMessageSent={setRepresentationMessageSent}
|
||||||
|
setRepresentationReset={setRepresentationReset}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div id="rep-appellant">
|
<div id="rep-appellant">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-grid-row govuk-body">
|
<div className="govuk-grid-row govuk-body">
|
||||||
<h1 className="govuk-heading-m ">Submit</h1>
|
<h1 className="govuk-heading-m ">
|
||||||
|
{" "}
|
||||||
|
{t(
|
||||||
|
"myrepresentations:rep-check-submit-heading"
|
||||||
|
)}
|
||||||
|
</h1>
|
||||||
|
<dl className="govuk-summary-list ">
|
||||||
|
<h2 className="govuk-heading-m govuk-!-margin-top-9">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:rep-check-your-rep-heading"
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:representation-representation-type"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{repFormData.representationType}
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setSubmitBack();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("newappeal:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{/* {FieldsTranslations(
|
||||||
|
rows[0].value
|
||||||
|
)} */}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
{_.has(
|
||||||
|
repFormData,
|
||||||
|
"representationOnBehalfOf"
|
||||||
|
) && (
|
||||||
|
<>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:representation-onbehalfof"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
repFormData.representationOnBehalfOf
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setSubmitBack();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"newappeal:change-link-label"
|
||||||
|
)}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{/* {FieldsTranslations(
|
||||||
|
rows[0].value
|
||||||
|
)} */}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
{repFormData.representationOnBehalfOf ==
|
||||||
|
"Yes" && (
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t(
|
||||||
|
"case:representation-onbehalfof-details"
|
||||||
|
)}
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{
|
||||||
|
repFormData.representationOnBehalfOf_details
|
||||||
|
}
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setSubmitBack();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"newappeal:change-link-label"
|
||||||
|
)}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{/* {FieldsTranslations(
|
||||||
|
rows[0].value
|
||||||
|
)} */}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:representation-comments")}
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
<span
|
||||||
|
className="multiline-elipsis"
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: repFormData.representationComments,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setSubmitBack();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("newappeal:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{/* {FieldsTranslations(
|
||||||
|
rows[0].value
|
||||||
|
)} */}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:representation-files")}
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{formObj.representationForm.values.hasOwnProperty(
|
||||||
|
"representationDocuments"
|
||||||
|
) &&
|
||||||
|
formObj.representationForm.values
|
||||||
|
.representationDocuments.length > 0
|
||||||
|
? formObj.representationForm.values.representationDocuments.map(
|
||||||
|
(blob, i) => (
|
||||||
|
<div
|
||||||
|
key={
|
||||||
|
blob.name +
|
||||||
|
"_" +
|
||||||
|
i
|
||||||
|
}
|
||||||
|
className="govuk-!-margin-bottom-5 fileThumb "
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={getThumbnailIconByExtension(
|
||||||
|
blob.name
|
||||||
|
)}
|
||||||
|
alt={blob.name}
|
||||||
|
width="50"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||||
|
{blob.name} (
|
||||||
|
{bytesToSize(
|
||||||
|
blob.size
|
||||||
|
)}
|
||||||
|
)
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
: ""}{" "}
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd className="govuk-summary-list__actions">
|
||||||
|
<a
|
||||||
|
className="govuk-link"
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setSubmitBack();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("newappeal:change-link-label")}
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
{" "}
|
||||||
|
{/* {FieldsTranslations(
|
||||||
|
rows[0].value
|
||||||
|
)} */}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
{whichQuestionnaireCheck()}
|
||||||
|
</dl>
|
||||||
<p>
|
<p>
|
||||||
The gathering and subsequent processing of the
|
{t(
|
||||||
personal data supplied by you in this form, is
|
"myrepresentations:rep-check-tandc-para-one"
|
||||||
in accordance with the terms of our registration
|
)}
|
||||||
under the Data Protection Act 2018.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The Planning Inspectorate takes its data
|
{t(
|
||||||
protection responsibilities for the information
|
"myrepresentations:rep-check-tandc-para-two"
|
||||||
you provide us with very seriously. To find out
|
)}
|
||||||
more about how we use and manage your personal
|
|
||||||
data, please go to our privacy notice.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
I confirm that all sections of this form have
|
{t(
|
||||||
been fully completed and that the details are
|
"myrepresentations:rep-check-tandc-para-three"
|
||||||
correct to the best of my knowledge.
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
@@ -73,7 +315,10 @@ const RepCompleteSubmit = (props) => {
|
|||||||
className="govuk-label govuk-body-m"
|
className="govuk-label govuk-body-m"
|
||||||
htmlFor="representationType"
|
htmlFor="representationType"
|
||||||
>
|
>
|
||||||
I confirm I have read the above.
|
{" "}
|
||||||
|
{t(
|
||||||
|
"myrepresentations:rep-check-tandc-para-four"
|
||||||
|
)}
|
||||||
</label>
|
</label>
|
||||||
{/* <Field
|
{/* <Field
|
||||||
name="representationType"
|
name="representationType"
|
||||||
@@ -89,11 +334,12 @@ const RepCompleteSubmit = (props) => {
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
onClick={() =>
|
// onClick={() => {
|
||||||
setRepresentationSubmitConfirmation()
|
// setRepresentationSubmitConfirmation();
|
||||||
}
|
// setRepresentationSubmit(true);
|
||||||
|
// }}
|
||||||
>
|
>
|
||||||
Continue
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
{/* <a
|
{/* <a
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -101,14 +347,14 @@ const RepCompleteSubmit = (props) => {
|
|||||||
}}
|
}}
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
>
|
>
|
||||||
Continue
|
{t("common:continue-button")}
|
||||||
</a> */}
|
</a> */}
|
||||||
|
|
||||||
<a
|
<a
|
||||||
onClick={() => setSubmitBack()}
|
onClick={() => setSubmitBack()}
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
>
|
>
|
||||||
Back
|
{t("case:summary-back-button-label")}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
import { RenderPickList, RenderTextfield } from "./representationElements";
|
import { RenderPickList, RenderTextfield } from "./representationElements";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
|
||||||
const RepDetails = (props) => {
|
const RepDetails = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -12,6 +13,31 @@ const RepDetails = (props) => {
|
|||||||
|
|
||||||
const { currentType, casesObj } = props;
|
const { currentType, casesObj } = props;
|
||||||
|
|
||||||
|
let { caseReference } = props;
|
||||||
|
|
||||||
|
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||||
|
? router.query.state == "edit"
|
||||||
|
? props.myRepresentations.myRepresentations
|
||||||
|
: props.searchResultsObj.searchDetailsObj
|
||||||
|
: props.searchResultsObj.searchDetailsObj;
|
||||||
|
|
||||||
|
var detailsObj = {};
|
||||||
|
|
||||||
|
caseReference = router.query.hasOwnProperty("state")
|
||||||
|
? router.query.state == "edit"
|
||||||
|
? router.query.case
|
||||||
|
: caseReference
|
||||||
|
: caseReference;
|
||||||
|
|
||||||
|
detailsObj = jsonpath.query(
|
||||||
|
setCaseDetailsObj,
|
||||||
|
'$..[?(@.pinswg_name=="' + caseReference + '")]'
|
||||||
|
);
|
||||||
|
|
||||||
|
detailsObj = detailsObj[0];
|
||||||
|
|
||||||
|
console.log("-----detailsObj:", detailsObj);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
@@ -24,6 +50,14 @@ const RepDetails = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{casesObj.appellantApplicant || ""}
|
{casesObj.appellantApplicant || ""}
|
||||||
|
{
|
||||||
|
detailsObj[
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
{/* {detailsObj.firstName +
|
||||||
|
" " +
|
||||||
|
detailsObj.lastName || "not entered"} */}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="govuk-summary-list__row">
|
{/* <div className="govuk-summary-list__row">
|
||||||
@@ -39,26 +73,46 @@ const RepDetails = (props) => {
|
|||||||
{t("case:summary-site-address-label")}
|
{t("case:summary-site-address-label")}
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{casesObj.address1 || ""}
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
<br />
|
? detailsObj.pinswg_siteaddressline1
|
||||||
{casesObj.town || ""}
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
||||||
<br />
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
{casesObj.postcode || ""}
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline2")
|
||||||
|
? detailsObj.pinswg_siteaddressline2
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
||||||
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
|
? detailsObj.pinswg_siteaddresstown
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||||
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
|
: ""}
|
||||||
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresscounty"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
||||||
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
|
: ""}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
This form enables you to submit comments on a case to
|
{t("myrepresentations:capacity-para-one")}
|
||||||
Planning and Environment Decisions Wales.{" "}
|
|
||||||
</p>
|
</p>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
Please note that comments from interested parties need
|
{t("myrepresentations:capacity-para-two")}
|
||||||
to be made within the timetable. This can be found on
|
|
||||||
the previous ‘Case Summary‘ page. Comments
|
|
||||||
submitted after this date may be considered invalid.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,26 @@ import Link from "next/link";
|
|||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
|
const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
|
||||||
import "react-quill/dist/quill.snow.css";
|
import "react-quill/dist/quill.snow.css";
|
||||||
|
import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
|
||||||
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
|
|
||||||
|
import {
|
||||||
|
addYears,
|
||||||
|
addMonths,
|
||||||
|
addDays,
|
||||||
|
subYears,
|
||||||
|
subMonths,
|
||||||
|
subDays,
|
||||||
|
parseISO,
|
||||||
|
} from "date-fns";
|
||||||
|
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getThumbnailIconByExtension,
|
||||||
|
bytesToSize,
|
||||||
|
} from "../../utils";
|
||||||
|
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
export const RenderRadioList = ({
|
export const RenderRadioList = ({
|
||||||
datafieldname,
|
datafieldname,
|
||||||
@@ -54,7 +74,13 @@ export const RenderRadioList = ({
|
|||||||
{errorMsg}
|
{errorMsg}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<div className="govuk-radios govuk-radios--small">
|
<div
|
||||||
|
className={
|
||||||
|
custom.inline == true
|
||||||
|
? "govuk-radios govuk-radios--inline govuk-radios--small"
|
||||||
|
: "govuk-radios govuk-radios--small"
|
||||||
|
}
|
||||||
|
>
|
||||||
{Object.keys(options).map((key, index) => (
|
{Object.keys(options).map((key, index) => (
|
||||||
<div
|
<div
|
||||||
className="govuk-radios__item"
|
className="govuk-radios__item"
|
||||||
@@ -84,29 +110,419 @@ export const RenderRadioList = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const RenderRadioListWithText = ({
|
||||||
|
datafieldname,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
id,
|
||||||
|
errorMsg,
|
||||||
|
options,
|
||||||
|
input: { onChange, value },
|
||||||
|
meta: { touched, error },
|
||||||
|
...custom
|
||||||
|
}) => {
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group "
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby={name + "-hint"}
|
||||||
|
>
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
|
||||||
|
<label
|
||||||
|
className="govuk-fieldset__heading govuk-body-m"
|
||||||
|
id={id + "_label"}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
</legend>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id={id + "-error"}
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
custom.inline == true
|
||||||
|
? "govuk-radios govuk-radios--inline govuk-radios--small "
|
||||||
|
: "govuk-radios govuk-radios--small govuk-grid-column-full"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{Object.keys(options).map((key, index) => (
|
||||||
|
<div
|
||||||
|
className="govuk-radios__item govuk-grid-column-full"
|
||||||
|
data-children-count={key}
|
||||||
|
key={key}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
id={id + "_" + index}
|
||||||
|
name={id}
|
||||||
|
component="input"
|
||||||
|
type="radio"
|
||||||
|
className="govuk-radios__input"
|
||||||
|
value={options[key]}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor={id + "_" + index}
|
||||||
|
>
|
||||||
|
{options[key]}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
{value === options[key] && (
|
||||||
|
<div
|
||||||
|
className="govuk-radios__conditional "
|
||||||
|
id={"conditional_" + id + "_" + index}
|
||||||
|
>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<label
|
||||||
|
className="govuk-label"
|
||||||
|
htmlFor={
|
||||||
|
"conditional_" +
|
||||||
|
id +
|
||||||
|
"_Comments"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Please give further details for
|
||||||
|
your this selection
|
||||||
|
</label>
|
||||||
|
<Field
|
||||||
|
name={
|
||||||
|
"conditional_" +
|
||||||
|
id +
|
||||||
|
"_Comments"
|
||||||
|
}
|
||||||
|
id={
|
||||||
|
"conditional_" +
|
||||||
|
id +
|
||||||
|
"_Comments"
|
||||||
|
}
|
||||||
|
component={RenderRichMultiline}
|
||||||
|
type="text"
|
||||||
|
rows="5"
|
||||||
|
className="govuk-textarea govuk-input--width-30"
|
||||||
|
aria-describedby={
|
||||||
|
id + "_" + index + "-hint"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const RenderCondtionalRadioList = ({
|
||||||
|
datafieldname,
|
||||||
|
legend,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
id,
|
||||||
|
errorMsg,
|
||||||
|
options,
|
||||||
|
input: { onChange, value },
|
||||||
|
meta: { touched, error },
|
||||||
|
...custom
|
||||||
|
}) => {
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
let { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group "
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby={id + "-hint"}
|
||||||
|
>
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
|
||||||
|
<label
|
||||||
|
className="govuk-fieldset__heading govuk-body-m"
|
||||||
|
id={id + "_label"}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
</legend>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id={id + "-error"}
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
|
<label
|
||||||
|
className="govuk-fieldset__heading govuk-body-m"
|
||||||
|
id="representationCapacity_label"
|
||||||
|
>
|
||||||
|
{legend}
|
||||||
|
</label>
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
<div id={id + "-hint"} className="govuk-hint">
|
||||||
|
e.g. ‘Owners of Numbers 1-5 High Street‘, or
|
||||||
|
‘Mr and Mrs Smith‘ or ‘The executors
|
||||||
|
of Mr Evans‘ estate‘
|
||||||
|
</div>
|
||||||
|
<div className="govuk-radios">
|
||||||
|
{Object.keys(options).map((key, index) => (
|
||||||
|
<div key={key} className="govuk-!-margin-bottom-3">
|
||||||
|
<div
|
||||||
|
className="govuk-radios__item"
|
||||||
|
data-children-count={key}
|
||||||
|
key={key}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
id={id + "_" + index}
|
||||||
|
name={id}
|
||||||
|
component="input"
|
||||||
|
type="radio"
|
||||||
|
className="govuk-radios__input"
|
||||||
|
value={options[key]}
|
||||||
|
validate={[required]}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor={id + "_" + index}
|
||||||
|
>
|
||||||
|
{options[key]}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{value ==
|
||||||
|
t("myrepresentations:questionnaire-yes") &&
|
||||||
|
options[key] ==
|
||||||
|
t(
|
||||||
|
"myrepresentations:questionnaire-yes"
|
||||||
|
) && (
|
||||||
|
<div
|
||||||
|
className="govuk-radios__conditional "
|
||||||
|
id={"conditional-" + id}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="govuk-form-group"
|
||||||
|
key={"yes_group_" + key}
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
className="govuk-label"
|
||||||
|
htmlFor={id + "_details"}
|
||||||
|
>
|
||||||
|
Enter the name of the
|
||||||
|
company/group/organisation *
|
||||||
|
</label>
|
||||||
|
<Field
|
||||||
|
className="govuk-input govuk-!-width-one-half"
|
||||||
|
id={id + "_details"}
|
||||||
|
name={id + "_details"}
|
||||||
|
component="input"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const RenderLPACondtionalRadioList = ({
|
||||||
|
datafieldname,
|
||||||
|
legend,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
id,
|
||||||
|
errorMsg,
|
||||||
|
options,
|
||||||
|
input: { onChange, value },
|
||||||
|
meta: { touched, error },
|
||||||
|
...custom
|
||||||
|
}) => {
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
console.log(error);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group "
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby={id + "-hint"}
|
||||||
|
>
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
|
||||||
|
<label
|
||||||
|
className="govuk-fieldset__heading govuk-body-m"
|
||||||
|
id={id + "_label"}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
</legend>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id={id + "-error"}
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--m">
|
||||||
|
<label
|
||||||
|
className=" govuk-body-m"
|
||||||
|
id="representationCapacity_label"
|
||||||
|
>
|
||||||
|
{legend}
|
||||||
|
</label>
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
<div id={id + "-hint"} className="govuk-hint"></div>
|
||||||
|
<div className="govuk-radios govuk-radios--small">
|
||||||
|
{Object.keys(options).map((key, index) => (
|
||||||
|
<div key={key} className="govuk-!-margin-bottom-3">
|
||||||
|
<div
|
||||||
|
className="govuk-radios__item"
|
||||||
|
data-children-count={key}
|
||||||
|
key={key}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
id={id + "_" + index}
|
||||||
|
name={id}
|
||||||
|
component="input"
|
||||||
|
type="radio"
|
||||||
|
className="govuk-radios__input"
|
||||||
|
value={options[key]}
|
||||||
|
validate={[eval(required)]}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-radios__label"
|
||||||
|
htmlFor={id + "_" + index}
|
||||||
|
>
|
||||||
|
{options[key]}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{value == custom.optionSelect &&
|
||||||
|
options[key] == custom.optionSelect && (
|
||||||
|
<div
|
||||||
|
className="govuk-radios__conditional "
|
||||||
|
id={id}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="govuk-form-group"
|
||||||
|
key={"yes_group_" + key}
|
||||||
|
>
|
||||||
|
<label
|
||||||
|
className="govuk-label"
|
||||||
|
htmlFor={id + "_details"}
|
||||||
|
>
|
||||||
|
{custom.conditionalLabel}
|
||||||
|
</label>
|
||||||
|
<Field
|
||||||
|
className="govuk-input govuk-!-width-one-half"
|
||||||
|
id={id + "Evidence"}
|
||||||
|
name={id + "Evidence"}
|
||||||
|
component={RenderMultiline}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const RenderPickList = ({
|
export const RenderPickList = ({
|
||||||
datafieldname,
|
datafieldname,
|
||||||
name,
|
name,
|
||||||
label,
|
label,
|
||||||
input,
|
input,
|
||||||
optionsArr,
|
optionsArr,
|
||||||
meta: { touched, errorStr },
|
meta: { touched, error },
|
||||||
|
errorMsg,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
<select {...input} className="govuk-select " id={name} name={name}>
|
<div
|
||||||
<option>Select...</option>
|
className={
|
||||||
{Object.keys(optionsArr).map((key, index) => {
|
touched && error
|
||||||
return (
|
? "govuk-form-group govuk-form-group--error"
|
||||||
<option key={key} value={optionsArr[key]}>
|
: "govuk-form-group "
|
||||||
{optionsArr[key]}
|
}
|
||||||
</option>
|
>
|
||||||
);
|
<label className="govuk-label" htmlFor="sort">
|
||||||
})}
|
{label}
|
||||||
</select>
|
</label>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id="passport-issued-error"
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">Error:</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
{touched && errorStr && <span>{errorStr}</span>}
|
<div>
|
||||||
</div>
|
<select
|
||||||
|
{...input}
|
||||||
|
className="govuk-select "
|
||||||
|
id={name}
|
||||||
|
name={name}
|
||||||
|
>
|
||||||
|
<option>Select...</option>
|
||||||
|
{Object.keys(optionsArr).map((key, index) => {
|
||||||
|
return (
|
||||||
|
<option key={key} value={optionsArr[key]}>
|
||||||
|
{optionsArr[key]}
|
||||||
|
</option>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -123,6 +539,8 @@ export const RenderTextfield = ({
|
|||||||
meta: { touched, error },
|
meta: { touched, error },
|
||||||
...custom
|
...custom
|
||||||
}) => {
|
}) => {
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
<label className="govuk-label " htmlFor={id} id={id + "_label"}>
|
||||||
@@ -145,6 +563,118 @@ export const RenderTextfield = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const RenderDatePicker = ({
|
||||||
|
datafieldname,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
id,
|
||||||
|
errorMsg,
|
||||||
|
input: { onChange, value },
|
||||||
|
meta: { touched, error },
|
||||||
|
...custom
|
||||||
|
}) => {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
var startDateArr =
|
||||||
|
custom.dateStart != "0" ? custom.dateStart.split("") : custom.dateStart;
|
||||||
|
var endDateArr =
|
||||||
|
custom.dateEnd != "0" ? custom.dateEnd.split("") : custom.dateEnd;
|
||||||
|
|
||||||
|
var minDate =
|
||||||
|
startDateArr == 0
|
||||||
|
? new Date()
|
||||||
|
: startDateArr[0] == "-"
|
||||||
|
? startDateArr[2] == "y"
|
||||||
|
? subYears(new Date(), startDateArr[1])
|
||||||
|
: startDateArr[2] == "m"
|
||||||
|
? subMonths(new Date(), startDateArr[1])
|
||||||
|
: subDays(new Date(), startDateArr[1])
|
||||||
|
: startDateArr[2] == "y"
|
||||||
|
? addYears(new Date(), startDateArr[1])
|
||||||
|
: startDateArr[2] == "m"
|
||||||
|
? addMonths(new Date(), startDateArr[1])
|
||||||
|
: addDays(new Date(), startDateArr[1]);
|
||||||
|
|
||||||
|
var maxDate =
|
||||||
|
endDateArr == 0
|
||||||
|
? new Date()
|
||||||
|
: startDateArr[0] == "-"
|
||||||
|
? startDateArr[2] == "y"
|
||||||
|
? subYears(new Date(), startDateArr[1])
|
||||||
|
: startDateArr[2] == "m"
|
||||||
|
? subMonths(new Date(), startDateArr[1])
|
||||||
|
: subDays(new Date(), startDateArr[1])
|
||||||
|
: startDateArr[2] == "y"
|
||||||
|
? addYears(new Date(), startDateArr[1])
|
||||||
|
: startDateArr[2] == "m"
|
||||||
|
? addMonths(new Date(), startDateArr[1])
|
||||||
|
: addDays(new Date(), startDateArr[1]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group "
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
role="group"
|
||||||
|
aria-describedby={id + "_label"}
|
||||||
|
>
|
||||||
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--s govuk-!-font-weight-regular">
|
||||||
|
<label
|
||||||
|
className="govuk-fieldset__heading"
|
||||||
|
id={id + "_label"}
|
||||||
|
htmlFor={id}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
</legend>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id={id + "-error"}
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Error:
|
||||||
|
</span>{" "}
|
||||||
|
{errorMsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* {value}
|
||||||
|
<br />
|
||||||
|
{moment(value).format("DD/MM/YY")}
|
||||||
|
<br /> */}
|
||||||
|
|
||||||
|
<DatePicker
|
||||||
|
{...custom}
|
||||||
|
locale={custom.locale}
|
||||||
|
autoOk={true}
|
||||||
|
id={id}
|
||||||
|
dateFormat="dd/MM/yyyy"
|
||||||
|
onChange={onChange}
|
||||||
|
selected={
|
||||||
|
value
|
||||||
|
? typeof value != "object"
|
||||||
|
? parseISO(value)
|
||||||
|
: value
|
||||||
|
: null
|
||||||
|
} //{parseISO(value) || null}
|
||||||
|
className="govuk-input govuk-input--width-10"
|
||||||
|
minDate={minDate}
|
||||||
|
maxDate={maxDate}
|
||||||
|
//value={!value ? null : moment(value, "DD/MM/yyyy")}
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const RenderMultiline = ({
|
export const RenderMultiline = ({
|
||||||
id,
|
id,
|
||||||
className,
|
className,
|
||||||
@@ -165,6 +695,71 @@ export const RenderMultiline = ({
|
|||||||
input.onChange(valStr);
|
input.onChange(valStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var modules = {
|
||||||
|
toolbar: [
|
||||||
|
[{ "header": [1, 2, false] }],
|
||||||
|
["bold", "italic", "underline", "blockquote"],
|
||||||
|
[{ "list": "ordered" }, { "list": "bullet" }, "link"],
|
||||||
|
["clean"],
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="govuk-form-group ">
|
||||||
|
<label className="govuk-label" htmlFor={name}>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
|
{"hint" in custom}
|
||||||
|
|
||||||
|
{"hint" in custom && (
|
||||||
|
<div
|
||||||
|
id={name + "-hint"}
|
||||||
|
className="govuk-hint govuk-!-font-size-14"
|
||||||
|
>
|
||||||
|
{custom.hint}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<ReactQuill
|
||||||
|
modules={modules}
|
||||||
|
theme="snow"
|
||||||
|
value={editValue}
|
||||||
|
onChange={changeEdit}
|
||||||
|
/>
|
||||||
|
<textarea
|
||||||
|
{...input}
|
||||||
|
id={id}
|
||||||
|
name={name}
|
||||||
|
rows={rows}
|
||||||
|
className={className}
|
||||||
|
value={editValue}
|
||||||
|
style={{ display: "none" }}
|
||||||
|
></textarea>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const RenderRichMultiline = ({
|
||||||
|
id,
|
||||||
|
className,
|
||||||
|
rows,
|
||||||
|
datafieldname,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
input,
|
||||||
|
meta: { touched, error },
|
||||||
|
...custom
|
||||||
|
}) => {
|
||||||
|
const [editValue, setEditValue] = useState(
|
||||||
|
input.value != null ? input.value : ""
|
||||||
|
);
|
||||||
|
|
||||||
|
const changeEdit = (valStr) => {
|
||||||
|
setEditValue(valStr);
|
||||||
|
input.onChange(valStr);
|
||||||
|
};
|
||||||
|
|
||||||
var modules = {
|
var modules = {
|
||||||
toolbar: [
|
toolbar: [
|
||||||
[{ "header": [1, 2, false] }],
|
[{ "header": [1, 2, false] }],
|
||||||
@@ -176,6 +771,9 @@ export const RenderMultiline = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<label className="govuk-label" htmlFor={name}>
|
||||||
|
{label}
|
||||||
|
</label>
|
||||||
<ReactQuill
|
<ReactQuill
|
||||||
modules={modules}
|
modules={modules}
|
||||||
theme="snow"
|
theme="snow"
|
||||||
@@ -219,6 +817,7 @@ export function MultiLinefield(props) {
|
|||||||
component={RenderMultiline}
|
component={RenderMultiline}
|
||||||
type="text"
|
type="text"
|
||||||
rows="5"
|
rows="5"
|
||||||
|
validate={[required]}
|
||||||
className="govuk-textarea govuk-input--width-30"
|
className="govuk-textarea govuk-input--width-30"
|
||||||
aria-describedby={props.name + "-hint"}
|
aria-describedby={props.name + "-hint"}
|
||||||
/>
|
/>
|
||||||
@@ -277,13 +876,6 @@ export const RenderFileUpload = (field) => {
|
|||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
|
|
||||||
function bytesToSize(bytes) {
|
|
||||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
||||||
if (bytes == 0) return "0 Byte";
|
|
||||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
|
||||||
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
const getThumbnailIcon = (fileObj, fileType) => {
|
const getThumbnailIcon = (fileObj, fileType) => {
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
case "text/html":
|
case "text/html":
|
||||||
@@ -321,47 +913,6 @@ export const RenderFileUpload = (field) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getThumbnailIconByExtension = (blobName) => {
|
|
||||||
let fileType = blobName.slice(blobName.lastIndexOf(".") + 1);
|
|
||||||
|
|
||||||
switch (fileType) {
|
|
||||||
case "html":
|
|
||||||
return "/assets/images/documenttypes/html.png";
|
|
||||||
break;
|
|
||||||
case "txt":
|
|
||||||
return "/assets/images/documenttypes/txt.png";
|
|
||||||
break;
|
|
||||||
case "doc":
|
|
||||||
return "/assets/images/documenttypes/doc.png";
|
|
||||||
break;
|
|
||||||
case "pdf":
|
|
||||||
return "/assets/images/documenttypes/pdf.png";
|
|
||||||
break;
|
|
||||||
case "docx":
|
|
||||||
return "/assets/images/documenttypes/docx.png";
|
|
||||||
break;
|
|
||||||
case "csv":
|
|
||||||
return "/assets/images/documenttypes/csv.png";
|
|
||||||
break;
|
|
||||||
case "xlsx":
|
|
||||||
return "/assets/images/documenttypes/xlsx.png";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "zip":
|
|
||||||
return "/assets/images/documenttypes/zip.png";
|
|
||||||
break;
|
|
||||||
case "jpeg":
|
|
||||||
case "jpg":
|
|
||||||
return "/assets/images/documenttypes/jpg.png";
|
|
||||||
case "png":
|
|
||||||
return "/assets/images/documenttypes/png.png";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return "/assets/images/documenttypes/txt.png";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getDocumentType = (docCode) => {
|
const getDocumentType = (docCode) => {
|
||||||
switch (docCode) {
|
switch (docCode) {
|
||||||
case "000001":
|
case "000001":
|
||||||
@@ -448,15 +999,9 @@ export const RenderFileUpload = (field) => {
|
|||||||
onDrop={(filesToUpload, e) => {
|
onDrop={(filesToUpload, e) => {
|
||||||
const renamedAcceptedFiles = filesToUpload.map(
|
const renamedAcceptedFiles = filesToUpload.map(
|
||||||
(file) =>
|
(file) =>
|
||||||
new File(
|
new File([file], `${file.name}`, {
|
||||||
[file],
|
type: file.type,
|
||||||
`${getDocumentType(field.documentTypeCode)}_${
|
})
|
||||||
file.name
|
|
||||||
}`,
|
|
||||||
{
|
|
||||||
type: file.type,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
field.input.onChange(renamedAcceptedFiles);
|
field.input.onChange(renamedAcceptedFiles);
|
||||||
}}
|
}}
|
||||||
@@ -464,9 +1009,9 @@ export const RenderFileUpload = (field) => {
|
|||||||
{({ getRootProps, getInputProps }) => (
|
{({ getRootProps, getInputProps }) => (
|
||||||
<>
|
<>
|
||||||
{/* {field.hint != false && (
|
{/* {field.hint != false && (
|
||||||
<div className="govuk-hint">ss{t(field.hint)}</div>
|
<div className="govuk-hint">ss{t(field.hint)}</div>
|
||||||
)}
|
)}
|
||||||
<div className="govuk-form-group"></div> */}
|
<div className="govuk-form-group"></div> */}
|
||||||
<section className="container">
|
<section className="container">
|
||||||
<div {...getRootProps({ style })}>
|
<div {...getRootProps({ style })}>
|
||||||
{" "}
|
{" "}
|
||||||
@@ -551,13 +1096,64 @@ export const RenderFileUpload = (field) => {
|
|||||||
blob.name +
|
blob.name +
|
||||||
blob.hashedfilepath
|
blob.hashedfilepath
|
||||||
}
|
}
|
||||||
|
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link"
|
||||||
>
|
>
|
||||||
<a className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link">
|
{blob.name}({bytesToSize(blob.contentLength)})
|
||||||
{blob.name} ({bytesToSize(blob.contentLength)})
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
))}{" "}
|
))}{" "}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function FileUploadField(props) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h2 className="govuk-heading-s">{props.label} </h2>
|
||||||
|
<Field
|
||||||
|
name={props.name}
|
||||||
|
id={props.name}
|
||||||
|
component={RenderFileUpload}
|
||||||
|
className="govuk-input govuk-input--width-20"
|
||||||
|
//validate={[required]}
|
||||||
|
label={props.label}
|
||||||
|
errorMsg="Is required"
|
||||||
|
ticketnumber={props.ticketnumber}
|
||||||
|
hint={props.hint}
|
||||||
|
fileList={props.fileList}
|
||||||
|
setFilesForAppeal={props.setFilesForAppeal}
|
||||||
|
containerID={props.containerID}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RepresentationGuidanceText = (appealType) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
console.log(appealType);
|
||||||
|
switch (appealType) {
|
||||||
|
case "846040004": //has/cas
|
||||||
|
return (
|
||||||
|
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||||
|
{t("myrepresentations:questionnaire-publish-policy-label")}{" "}
|
||||||
|
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
|
||||||
|
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return (
|
||||||
|
<p className="govuk-hint govuk-!-font-size-14 govuk-!-margin-top-5">
|
||||||
|
{t("myrepresentations:publish-policy-label")}{" "}
|
||||||
|
<a href="https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html">
|
||||||
|
https://gov.wales/planning-and-environment-decisions-wales-publishing-policy-html
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return guidanceString;
|
||||||
|
};
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import { Field, reduxForm } from "redux-form";
|
|||||||
import {
|
import {
|
||||||
RenderPickList,
|
RenderPickList,
|
||||||
RenderTextfield,
|
RenderTextfield,
|
||||||
RenderRadioList,
|
RenderCondtionalRadioList,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
|
RenderRichMultiline,
|
||||||
|
FileUploadField,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
|
|
||||||
@@ -21,6 +23,8 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
setRepresentationCapacity,
|
setRepresentationCapacity,
|
||||||
setRepresentationSubmit,
|
setRepresentationSubmit,
|
||||||
} = props;
|
} = props;
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
const files = acceptedFiles.map((file) => (
|
const files = acceptedFiles.map((file) => (
|
||||||
<li key={file.path}>
|
<li key={file.path}>
|
||||||
@@ -28,302 +32,125 @@ const RepInterestedPartyPerson = (props) => {
|
|||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
return (
|
return (
|
||||||
<div id="rep-interested">
|
<>
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-row">
|
<h2 className="govuk-heading-m ">
|
||||||
<h2 className="govuk-heading-m ">
|
{t(
|
||||||
Representation - interested
|
"myrepresentations:representation-from-an-interested-party-heading"
|
||||||
</h2>
|
)}
|
||||||
|
</h2>
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<label
|
<label
|
||||||
className="govuk-label govuk-body-m"
|
className="govuk-label govuk-body-m"
|
||||||
htmlFor="representationType"
|
htmlFor="representationType"
|
||||||
>
|
>
|
||||||
What kind of representation are you making?
|
{t(
|
||||||
</label>
|
"myrepresentations:representation-from-an-agent-heading"
|
||||||
<Field
|
)}
|
||||||
name="representationType"
|
?
|
||||||
component={RenderPickList}
|
</label>
|
||||||
datafieldname="representationType"
|
<Field
|
||||||
optionsArr={interestedPersonRepresentationArr}
|
name="representationType"
|
||||||
/>
|
component={RenderPickList}
|
||||||
</div>
|
datafieldname="representationType"
|
||||||
</div>
|
validate={[required]}
|
||||||
<div className="govuk-grid-row">
|
optionsArr={interestedPersonRepresentationArr}
|
||||||
<div className="govuk-form-group">
|
errorMsg={t("newappeal:select-an-option-label")}
|
||||||
<Field
|
/>
|
||||||
className="govuk-input govuk-!-width-three-quarters"
|
|
||||||
id="representationDescription"
|
|
||||||
name="representationDescription"
|
|
||||||
value="email"
|
|
||||||
data-aria-controls="representationDescription"
|
|
||||||
type="text"
|
|
||||||
component={RenderTextfield}
|
|
||||||
label="Description of representation"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<fieldset
|
|
||||||
className="govuk-fieldset"
|
|
||||||
aria-describedby="contact-hint"
|
|
||||||
>
|
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
|
||||||
<label
|
|
||||||
className="govuk-fieldset__heading govuk-body-m"
|
|
||||||
id="representationCapacity_label"
|
|
||||||
>
|
|
||||||
Are you acting on behalf of a company,
|
|
||||||
group or organisation?
|
|
||||||
</label>
|
|
||||||
</legend>
|
|
||||||
<div id="contact-hint" className="govuk-hint">
|
|
||||||
e.g. ‘Owners of Numbers 1-5 High
|
|
||||||
Street‘, or ‘Mr and Mrs
|
|
||||||
Smith‘ or ‘The executors of Mr
|
|
||||||
Evans‘ estate‘
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="govuk-radios govuk-radios--conditional"
|
|
||||||
data-module="govuk-radios"
|
|
||||||
>
|
|
||||||
<div className="govuk-radios__item">
|
|
||||||
<input
|
|
||||||
className="govuk-radios__input"
|
|
||||||
id="contact"
|
|
||||||
name="contact"
|
|
||||||
type="radio"
|
|
||||||
value="email"
|
|
||||||
data-aria-controls="conditional-contact"
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-radios__label"
|
|
||||||
htmlFor="contact"
|
|
||||||
>
|
|
||||||
Yes
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="govuk-radios__conditional govuk-radios__conditional--hidden"
|
|
||||||
id="conditional-contact"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<label
|
|
||||||
className="govuk-label"
|
|
||||||
htmlFor="contact-by-email"
|
|
||||||
>
|
|
||||||
Enter the name of the
|
|
||||||
company/group/organisation *
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
className="govuk-input govuk-!-width-one-third"
|
|
||||||
id="contact-by-email"
|
|
||||||
name="contact-by-email"
|
|
||||||
type="email"
|
|
||||||
spellCheck="false"
|
|
||||||
autoComplete="email"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-radios__item">
|
|
||||||
<input
|
|
||||||
className="govuk-radios__input"
|
|
||||||
id="contact-2"
|
|
||||||
name="contact"
|
|
||||||
type="radio"
|
|
||||||
value="phone"
|
|
||||||
data-aria-controls="conditional-contact-2"
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-radios__label"
|
|
||||||
htmlFor="contact-2"
|
|
||||||
>
|
|
||||||
No
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<p className="govuk-body">
|
|
||||||
You can enter your comments in the space
|
|
||||||
provided or attach a separate document.
|
|
||||||
</p>
|
|
||||||
<fieldset
|
|
||||||
className="govuk-fieldset"
|
|
||||||
aria-describedby="commentBox-hint"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
id="commentBox-hint"
|
|
||||||
className="govuk-hint"
|
|
||||||
>
|
|
||||||
My comments are set out in:*
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="govuk-checkboxes"
|
|
||||||
data-module="govuk-checkboxes"
|
|
||||||
>
|
|
||||||
<div className="govuk-checkboxes__item">
|
|
||||||
<Field
|
|
||||||
className="govuk-checkboxes__input"
|
|
||||||
id="commentBox"
|
|
||||||
name="commentBox"
|
|
||||||
value="email"
|
|
||||||
data-aria-controls="commentBox"
|
|
||||||
type="checkbox"
|
|
||||||
component={RenderTextfield}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-checkboxes__label"
|
|
||||||
htmlFor="commentBox"
|
|
||||||
>
|
|
||||||
the box below{" "}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
_.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj[
|
|
||||||
"representationForm"
|
|
||||||
].values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden q11 "
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj[
|
|
||||||
"representationForm"
|
|
||||||
].values.commentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.commentBox ==
|
|
||||||
false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden wwwaqqqq"
|
|
||||||
}
|
|
||||||
id="conditional-commentBox"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<Field
|
|
||||||
name="representationComments"
|
|
||||||
id="representationComments"
|
|
||||||
component={RenderMultiline}
|
|
||||||
type="text"
|
|
||||||
rows="5"
|
|
||||||
className="govuk-textarea govuk-input--width-30"
|
|
||||||
aria-describedby={
|
|
||||||
props.name + "-hint"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-checkboxes__item">
|
|
||||||
<Field
|
|
||||||
className="govuk-checkboxes__input"
|
|
||||||
id="documentBox"
|
|
||||||
name="documentBox"
|
|
||||||
value="email"
|
|
||||||
data-aria-controls="documentBox"
|
|
||||||
type="checkbox"
|
|
||||||
component={RenderTextfield}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-checkboxes__label"
|
|
||||||
htmlFor="documentBox"
|
|
||||||
>
|
|
||||||
separate documents
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
_.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj[
|
|
||||||
"representationForm"
|
|
||||||
].values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj[
|
|
||||||
"representationForm"
|
|
||||||
].values.documentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.documentBox ==
|
|
||||||
false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden"
|
|
||||||
}
|
|
||||||
id="conditional-documentBox"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<section className="container">
|
|
||||||
<div
|
|
||||||
{...getRootProps({
|
|
||||||
className: "dropzone",
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
{...getInputProps()}
|
|
||||||
/>
|
|
||||||
<p>
|
|
||||||
Drag and drop files here
|
|
||||||
or click to select files
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<aside>
|
|
||||||
<h4>Files</h4>
|
|
||||||
<ul>{files}</ul>
|
|
||||||
</aside>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>{" "}
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row">
|
|
||||||
<div className="govuk-button-group">
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="govuk-button"
|
|
||||||
data-module="govuk-button"
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</button>
|
|
||||||
{/* <Link href="/representation">
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationSubmit(true);
|
|
||||||
}}
|
|
||||||
className="govuk-button"
|
|
||||||
>
|
|
||||||
Continue
|
|
||||||
</a>
|
|
||||||
</Link> */}
|
|
||||||
<a
|
|
||||||
onClick={() => {
|
|
||||||
setRepresentationCapacity();
|
|
||||||
}}
|
|
||||||
className="govuk-link"
|
|
||||||
>
|
|
||||||
Back
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<Field
|
||||||
|
name="representationOnBehalfOf"
|
||||||
|
datafieldname="representationOnBehalfOf"
|
||||||
|
// label="In what capacity do you wish to make representations on this case?"
|
||||||
|
options={["Yes", "No"]}
|
||||||
|
id="representationOnBehalfOf"
|
||||||
|
className="govuk-radios__input"
|
||||||
|
errorMsg={t("newappeal:select-an-option-label")}
|
||||||
|
component={RenderCondtionalRadioList}
|
||||||
|
validate={[required]}
|
||||||
|
legend={
|
||||||
|
"Are you acting on behalf of a company, group or organisation?"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("myrepresentations:enter-comment-label")}
|
||||||
|
</p>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
<div id="commentBox-hint" className="govuk-hint">
|
||||||
|
{t("myrepresentations:comments-set-out-label")}:
|
||||||
|
</div>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<Field
|
||||||
|
name="representationComments"
|
||||||
|
id="representationComments"
|
||||||
|
component={RenderRichMultiline}
|
||||||
|
type="text"
|
||||||
|
rows="5"
|
||||||
|
className="govuk-textarea govuk-input--width-30"
|
||||||
|
aria-describedby={props.name + "-hint"}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||||
|
<FileUploadField
|
||||||
|
name={"representationDocuments"}
|
||||||
|
label={t("myrepresentations:add-files-label")}
|
||||||
|
ticketnumber={props.props.caseReference}
|
||||||
|
hint={"sdsd"}
|
||||||
|
fileList={[]}
|
||||||
|
setFilesForRepresentation={[]}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails.containerID
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>{" "}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
{/* <Link href="/representation">
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setRepresentationSubmit(true);
|
||||||
|
}}
|
||||||
|
className="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</a>
|
||||||
|
</Link> */}
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setRepresentationCapacity();
|
||||||
|
//setRepresentationSubmit(true);
|
||||||
|
}}
|
||||||
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
{t("case:summary-back-button-label")}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,425 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, reduxForm, formValueSelector } from "redux-form";
|
||||||
|
import {
|
||||||
|
RenderPickList,
|
||||||
|
RenderTextfield,
|
||||||
|
RenderRadioList,
|
||||||
|
RenderMultiline,
|
||||||
|
RenderCondtionalRadioList,
|
||||||
|
RenderLPACondtionalRadioList,
|
||||||
|
FileUploadField,
|
||||||
|
RenderRichMultiline,
|
||||||
|
RenderDatePicker,
|
||||||
|
} from "./representationElements";
|
||||||
|
import { getFormCollectionByID, formatDates } from "../../utils";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
} from "../../../store/currentView/action";
|
||||||
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import { select } from "xpath";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
import { useState } from "react";
|
||||||
|
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
|
||||||
|
import S78_Qquestionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78";
|
||||||
|
import RepresentationProgress_s78 from "./representationProgress/representationProgress_s78";
|
||||||
|
import RepresentationProgress_enforcement from "./representationProgress/representationProgress_enforcement";
|
||||||
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
|
|
||||||
|
let RepLPA = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
const {
|
||||||
|
formObj,
|
||||||
|
appellantApplicantRepresentationArr,
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
currentView,
|
||||||
|
procedureTypeValue,
|
||||||
|
onBehalfOfLPA,
|
||||||
|
setShowQuestionnaireSection,
|
||||||
|
showQuestionnaireSection,
|
||||||
|
} = props;
|
||||||
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
const files = acceptedFiles.map((file) => (
|
||||||
|
<li key={file.path}>
|
||||||
|
{file.path} - {file.size} bytes
|
||||||
|
</li>
|
||||||
|
));
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
const whichQuestionnaire = () => {
|
||||||
|
{
|
||||||
|
console.log("curr");
|
||||||
|
switch (currentView.caseReference.appealType) {
|
||||||
|
case 846040000:
|
||||||
|
case 846040001:
|
||||||
|
case 846040006:
|
||||||
|
case 846040025:
|
||||||
|
case 846040004:
|
||||||
|
case 846040018:
|
||||||
|
case 846040003:
|
||||||
|
case 846040009:
|
||||||
|
case 846040008:
|
||||||
|
return (
|
||||||
|
<S78_Qquestionnaire
|
||||||
|
props={props}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails.containerID
|
||||||
|
}
|
||||||
|
currentView={currentView}
|
||||||
|
showQuestionnaireSection={showQuestionnaireSection}
|
||||||
|
setShowQuestionnaireSection={
|
||||||
|
setShowQuestionnaireSection
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 846040005:
|
||||||
|
case 846040006:
|
||||||
|
case 846040007:
|
||||||
|
return (
|
||||||
|
<Enforcement_Questionnaire
|
||||||
|
props={props}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails.containerID
|
||||||
|
}
|
||||||
|
currentView={currentView}
|
||||||
|
showQuestionnaireSection={showQuestionnaireSection}
|
||||||
|
setShowQuestionnaireSection={
|
||||||
|
setShowQuestionnaireSection
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return <>hello</>;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const whichProgress = () => {
|
||||||
|
{
|
||||||
|
console.log("curr");
|
||||||
|
switch (currentView.caseReference.appealType) {
|
||||||
|
case 846040000:
|
||||||
|
case 846040001:
|
||||||
|
case 846040006:
|
||||||
|
case 846040025:
|
||||||
|
case 846040004:
|
||||||
|
case 846040018:
|
||||||
|
case 846040003:
|
||||||
|
case 846040009:
|
||||||
|
case 846040008:
|
||||||
|
return (
|
||||||
|
<RepresentationProgress_s78
|
||||||
|
props={props}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails.containerID
|
||||||
|
}
|
||||||
|
currentView={currentView}
|
||||||
|
showQuestionnaireSection={showQuestionnaireSection}
|
||||||
|
setShowQuestionnaireSection={
|
||||||
|
setShowQuestionnaireSection
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 846040005:
|
||||||
|
case 846040006:
|
||||||
|
case 846040007:
|
||||||
|
return (
|
||||||
|
<RepresentationProgress_enforcement
|
||||||
|
props={props}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails.containerID
|
||||||
|
}
|
||||||
|
currentView={currentView}
|
||||||
|
showQuestionnaireSection={showQuestionnaireSection}
|
||||||
|
setShowQuestionnaireSection={
|
||||||
|
setShowQuestionnaireSection
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return <>hello</>;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||||
|
? router.query.state == "edit"
|
||||||
|
? props.props.myRepresentations.myRepresentations
|
||||||
|
: props.props.searchResultsObj.searchDetailsObj
|
||||||
|
: props.props.searchResultsObj.searchDetailsObj;
|
||||||
|
|
||||||
|
var detailsObj = {};
|
||||||
|
|
||||||
|
detailsObj = jsonpath.query(
|
||||||
|
setCaseDetailsObj,
|
||||||
|
'$..[?(@.pinswg_name=="' +
|
||||||
|
currentView.caseReference.currentReference +
|
||||||
|
'")]'
|
||||||
|
);
|
||||||
|
|
||||||
|
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||||
|
? router.query.state == "edit"
|
||||||
|
? props.props.myRepresentations.myRepresentations
|
||||||
|
: props.props.searchResultsObj.searchResultsObj
|
||||||
|
: props.props.searchResultsObj.searchResultsObj;
|
||||||
|
|
||||||
|
detailsObj = detailsObj[0];
|
||||||
|
|
||||||
|
var resultsObj = {};
|
||||||
|
|
||||||
|
resultsObj = jsonpath.query(
|
||||||
|
setCaseResultssObj,
|
||||||
|
'$..[?(@.pinswg_name=="' +
|
||||||
|
currentView.caseReference.currentReference +
|
||||||
|
'")]'
|
||||||
|
);
|
||||||
|
resultsObj = resultsObj[0];
|
||||||
|
|
||||||
|
//console.log(resultsObj, detailsObj);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<h2 className="govuk-heading-m ">
|
||||||
|
{typeof props.representationType != "undefined"
|
||||||
|
? props.representationType == "Questionnaire"
|
||||||
|
? locale == "cy"
|
||||||
|
? "Holiadur"
|
||||||
|
: props.representationType
|
||||||
|
: props.representationType
|
||||||
|
: locale == "cy"
|
||||||
|
? "Cynrychioliadau"
|
||||||
|
: "Representation"}{" "}
|
||||||
|
{locale == "cy" ? "o ACLI am a" : "from an LPA for a"}{" "}
|
||||||
|
{locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.attributevalue=="' +
|
||||||
|
currentView.caseReference.appealType +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: getFormCollectionByID(
|
||||||
|
currentView.caseReference.appealType
|
||||||
|
).value}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
{typeof props.representationType == "undefined" && (
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<label
|
||||||
|
className="govuk-label govuk-body-m"
|
||||||
|
htmlFor="representationType"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:representation-from-an-agent-heading"
|
||||||
|
)}
|
||||||
|
?
|
||||||
|
</label>
|
||||||
|
<Field
|
||||||
|
id="representationType"
|
||||||
|
name="representationType"
|
||||||
|
component={RenderPickList}
|
||||||
|
datafieldname="representationType"
|
||||||
|
optionsArr={appellantApplicantRepresentationArr}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
{typeof props.representationType != "undefined" &&
|
||||||
|
(props.representationType != "Questionnaire" ? (
|
||||||
|
<>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("myrepresentations:enter-comment-label")}
|
||||||
|
</p>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
id="commentBox-hint"
|
||||||
|
className="govuk-hint"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:comments-set-out-label"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</div>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<Field
|
||||||
|
name="representationComments"
|
||||||
|
id="representationComments"
|
||||||
|
component={RenderMultiline}
|
||||||
|
type="text"
|
||||||
|
rows="5"
|
||||||
|
className="govuk-textarea govuk-input--width-30"
|
||||||
|
aria-describedby={
|
||||||
|
props.name + "-hint"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset govuk-!-margin-top-9"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
{" "}
|
||||||
|
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||||
|
<FileUploadField
|
||||||
|
name={"representationDocuments"}
|
||||||
|
label={t(
|
||||||
|
"myrepresentations:add-files-label"
|
||||||
|
)}
|
||||||
|
ticketnumber={
|
||||||
|
props.props.caseReference
|
||||||
|
}
|
||||||
|
hint={"sdsd"}
|
||||||
|
fileList={[]}
|
||||||
|
setFilesForRepresentation={[]}
|
||||||
|
containerID={
|
||||||
|
props.props.props.accountDetails
|
||||||
|
.containerID
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
whichQuestionnaire()
|
||||||
|
))}
|
||||||
|
</div>{" "}
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
{typeof props.representationType != "undefined" &&
|
||||||
|
props.representationType == "Questionnaire" && (
|
||||||
|
<>
|
||||||
|
{showQuestionnaireSection < 7 && (
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(
|
||||||
|
showQuestionnaireSection + 1
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
className="govuk-button"
|
||||||
|
>
|
||||||
|
Next section
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
{showQuestionnaireSection == 9 && (
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}ww
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{showQuestionnaireSection > 1 && (
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(
|
||||||
|
showQuestionnaireSection - 1
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
Back
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}{" "}
|
||||||
|
{typeof props.representationType != "undefined" &&
|
||||||
|
props.representationType != "Questionnaire" && (
|
||||||
|
<>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
{/* <a
|
||||||
|
onClick={() => {
|
||||||
|
|
||||||
|
setRepresentationSubmit(false);
|
||||||
|
}}
|
||||||
|
className="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</a> */}
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
//setRepresentationCapacity();
|
||||||
|
}}
|
||||||
|
className="govuk-link"
|
||||||
|
>
|
||||||
|
{t("common:back-link")}
|
||||||
|
</a>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const selector = formValueSelector("representationForm"); // <-- same as form name
|
||||||
|
|
||||||
|
RepLPA = connect((state) => {
|
||||||
|
const representationType = selector(state, "representationType");
|
||||||
|
const procedureType = selector(state, "procedureType");
|
||||||
|
|
||||||
|
return {
|
||||||
|
procedureType,
|
||||||
|
representationType,
|
||||||
|
};
|
||||||
|
})(RepLPA);
|
||||||
|
|
||||||
|
const mapStateToProps = (state, props) => {
|
||||||
|
let initialValuesTemp = Object.assign(
|
||||||
|
state.currentView.caseReference.hasOwnProperty("repDetails")
|
||||||
|
? state.currentView.caseReference.repDetails
|
||||||
|
: state.currentView.caseReference,
|
||||||
|
{
|
||||||
|
"onBehalfOfLPA":
|
||||||
|
props.props.props.accountDetails.accountDetails[
|
||||||
|
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
search: state.search,
|
||||||
|
searchResultsObj: state.searchResultsObj,
|
||||||
|
formData: state.formData,
|
||||||
|
appealType: state.appealType,
|
||||||
|
currentView: state.currentView,
|
||||||
|
myRepresentations: state.myRepresentations,
|
||||||
|
initialValues: initialValuesTemp,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps)(
|
||||||
|
reduxForm({
|
||||||
|
form: "representationForm",
|
||||||
|
enableReinitialize: true,
|
||||||
|
destroyOnUnmount: false,
|
||||||
|
})(RepLPA)
|
||||||
|
);
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import {
|
||||||
|
Field,
|
||||||
|
reduxForm,
|
||||||
|
formValueSelector,
|
||||||
|
handleSubmit,
|
||||||
|
reset,
|
||||||
|
} from "redux-form";
|
||||||
|
import {
|
||||||
|
RenderPickList,
|
||||||
|
RenderTextfield,
|
||||||
|
RenderRadioList,
|
||||||
|
RenderMultiline,
|
||||||
|
} from "./representationElements";
|
||||||
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import RepDetails from "./representationDetails";
|
||||||
|
import RepLPADetails from "./representationLPADetails";
|
||||||
|
import { setRepresentationCapacity } from "../../../store/currentView/action";
|
||||||
|
|
||||||
|
let RepLPACapacitySelection = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
const {
|
||||||
|
formObj,
|
||||||
|
capacityOptionsArr,
|
||||||
|
currentType,
|
||||||
|
casesObj,
|
||||||
|
validate,
|
||||||
|
handleSubmit,
|
||||||
|
} = props;
|
||||||
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||||
|
const files = acceptedFiles.map((file) => (
|
||||||
|
<li key={file.path}>
|
||||||
|
{file.path} - {file.size} bytes
|
||||||
|
</li>
|
||||||
|
));
|
||||||
|
|
||||||
|
const required = (value) => (value ? undefined : "Required");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<RepLPADetails
|
||||||
|
formObj={formObj}
|
||||||
|
currentType={currentType}
|
||||||
|
casesObj={casesObj}
|
||||||
|
caseReference={props.props.caseReference}
|
||||||
|
searchResultsObj={props.props.searchResultsObj}
|
||||||
|
props={props.props}
|
||||||
|
/>{" "}
|
||||||
|
<div id="rep-details" className="vo_hiddens">
|
||||||
|
<div className="govuk-grid-column-three-quarters">
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
{/* <h2 className="govuk-heading-m ">
|
||||||
|
Your details - {props.firstValue}
|
||||||
|
</h2> */}
|
||||||
|
|
||||||
|
{/* <div className="">
|
||||||
|
<label className="govuk-visually-hidden2">
|
||||||
|
<Field
|
||||||
|
name="representationCapacity"
|
||||||
|
datafieldname="representationCapacity"
|
||||||
|
label={t("myrepresentations:capacity-select-what-capacity-label")}
|
||||||
|
options={["LPA"]}
|
||||||
|
id="representationCapacity"
|
||||||
|
//className="govuk-radios__input "
|
||||||
|
errorMsg={t(
|
||||||
|
"newappeal:select-an-option-label"
|
||||||
|
)}
|
||||||
|
component="input"
|
||||||
|
validate={[required]}
|
||||||
|
value="LPA"
|
||||||
|
checked={"true"}
|
||||||
|
type="radio"
|
||||||
|
/>
|
||||||
|
LPA
|
||||||
|
</label>
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="govuk-button"
|
||||||
|
data-module="govuk-button"
|
||||||
|
>
|
||||||
|
{t("common:continue-button")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepLPACapacitySelection;
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, reduxForm, formValueSelector } from "redux-form";
|
||||||
|
import {
|
||||||
|
RenderPickList,
|
||||||
|
RenderTextfield,
|
||||||
|
RenderRadioList,
|
||||||
|
RenderMultiline,
|
||||||
|
RenderCondtionalRadioList,
|
||||||
|
RenderLPACondtionalRadioList,
|
||||||
|
FileUploadField,
|
||||||
|
RenderRichMultiline,
|
||||||
|
RenderDatePicker,
|
||||||
|
} from "./representationElements";
|
||||||
|
|
||||||
|
let RepLPAQuestionnaire = (props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("myrepresentations:enter-comment-label")}
|
||||||
|
</p>
|
||||||
|
<fieldset
|
||||||
|
className="govuk-fieldset"
|
||||||
|
aria-describedby="commentBox-hint"
|
||||||
|
>
|
||||||
|
<div id="commentBox-hint" className="govuk-hint">
|
||||||
|
{t("myrepresentations:comments-set-out-label")}:
|
||||||
|
</div>
|
||||||
|
<div className="govuk-form-group">
|
||||||
|
<Field
|
||||||
|
name="representationComments"
|
||||||
|
id="representationComments"
|
||||||
|
component={RenderMultiline}
|
||||||
|
type="text"
|
||||||
|
rows="5"
|
||||||
|
className="govuk-textarea govuk-input--width-30"
|
||||||
|
aria-describedby={props.name + "-hint"}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const selector = formValueSelector("representationForm"); // <-- same as form name
|
||||||
|
|
||||||
|
RepLPAQuestionnaire = connect((state) => {
|
||||||
|
const representationTypeValue = selector(state, "representationType");
|
||||||
|
const procedureTypeValue = selector(state, "procedureType");
|
||||||
|
|
||||||
|
return {
|
||||||
|
procedureTypeValue,
|
||||||
|
representationTypeValue,
|
||||||
|
};
|
||||||
|
})(RepLPAQuestionnaire);
|
||||||
|
|
||||||
|
const mapStateToProps = (state, props) => {
|
||||||
|
console.log();
|
||||||
|
return {
|
||||||
|
search: state.search,
|
||||||
|
searchResultsObj: state.searchResultsObj,
|
||||||
|
formData: state.formData,
|
||||||
|
appealType: state.appealType,
|
||||||
|
currentView: state.currentView,
|
||||||
|
myRepresentations: state.myRepresentations,
|
||||||
|
initialValues: state.currentView.caseReference.repDetails,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps)(
|
||||||
|
reduxForm({
|
||||||
|
form: "representationForm",
|
||||||
|
enableReinitialize: true,
|
||||||
|
destroyOnUnmount: false,
|
||||||
|
})(RepLPAQuestionnaire)
|
||||||
|
);
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { Field, reduxForm } from "redux-form";
|
||||||
|
import { RenderPickList, RenderTextfield } from "./representationElements";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
|
||||||
|
const RepLPADetails = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
|
const { currentType, casesObj, caseReference } = props;
|
||||||
|
|
||||||
|
let setCaseDetailsObj = router.query.hasOwnProperty("state")
|
||||||
|
? router.query.state == "edit"
|
||||||
|
? props.props.myRepresentations.myRepresentations
|
||||||
|
: props.props.searchResultsObj.searchDetailsObj
|
||||||
|
: props.props.searchResultsObj.searchDetailsObj;
|
||||||
|
|
||||||
|
var detailsObj = {};
|
||||||
|
|
||||||
|
detailsObj = jsonpath.query(
|
||||||
|
setCaseDetailsObj,
|
||||||
|
'$..[?(@.pinswg_name=="' + caseReference + '")]'
|
||||||
|
);
|
||||||
|
|
||||||
|
detailsObj = detailsObj[0];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{" "}
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<div id="rep-sumamry" className="govuk-grid-row">
|
||||||
|
<dl className="govuk-summary-list govuk-!-margin-bottom-9">
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-applicant-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{casesObj.appellantApplicant || ""}
|
||||||
|
{detailsObj[
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] || "not entered"}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
{/* <div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-agent-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
Mr A Agent
|
||||||
|
</dd>
|
||||||
|
</div> */}
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dt className="govuk-summary-list__key">
|
||||||
|
{t("case:summary-site-address-label")}
|
||||||
|
</dt>
|
||||||
|
<dd className="govuk-summary-list__value">
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
|
? detailsObj.pinswg_siteaddressline1
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
||||||
|
detailsObj.pinswg_siteaddressline1 !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline2")
|
||||||
|
? detailsObj.pinswg_siteaddressline2
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
||||||
|
detailsObj.pinswg_siteaddressline2 !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
|
? detailsObj.pinswg_siteaddresstown
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
|
detailsObj.pinswg_siteaddresstown !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||||
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
|
: ""}
|
||||||
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_siteaddresscounty"
|
||||||
|
) &&
|
||||||
|
detailsObj.pinswg_siteaddresscounty !=
|
||||||
|
null && <br />}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
||||||
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
|
: ""}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<p className="govuk-body">
|
||||||
|
{t("myrepresentations:lpa-capacity-para-one")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepLPADetails;
|
||||||
@@ -7,6 +7,8 @@ import {
|
|||||||
RenderTextfield,
|
RenderTextfield,
|
||||||
RenderRadioList,
|
RenderRadioList,
|
||||||
RenderMultiline,
|
RenderMultiline,
|
||||||
|
RenderRichMultiline,
|
||||||
|
FileUploadField,
|
||||||
} from "./representationElements";
|
} from "./representationElements";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
@@ -37,7 +39,7 @@ const RepLandOwner = (props) => {
|
|||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<h2 className="govuk-heading-m ">
|
<h2 className="govuk-heading-m ">
|
||||||
Representation - landowner
|
Representation for a Land owner
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
@@ -45,7 +47,10 @@ const RepLandOwner = (props) => {
|
|||||||
className="govuk-label govuk-body-m"
|
className="govuk-label govuk-body-m"
|
||||||
htmlFor="representationType"
|
htmlFor="representationType"
|
||||||
>
|
>
|
||||||
What kind of representation are you making?
|
{t(
|
||||||
|
"myrepresentations:representation-from-an-agent-heading"
|
||||||
|
)}
|
||||||
|
?
|
||||||
</label>
|
</label>
|
||||||
<Field
|
<Field
|
||||||
name="representationType"
|
name="representationType"
|
||||||
@@ -55,7 +60,7 @@ const RepLandOwner = (props) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
{/* <div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<Field
|
<Field
|
||||||
className="govuk-input govuk-!-width-three-quarters"
|
className="govuk-input govuk-!-width-three-quarters"
|
||||||
@@ -68,138 +73,52 @@ const RepLandOwner = (props) => {
|
|||||||
label="Description of representation"
|
label="Description of representation"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
You can enter your comments in the space provided or
|
{t("myrepresentations:enter-comment-label")}
|
||||||
attach a separate document.
|
|
||||||
</p>
|
</p>
|
||||||
<fieldset
|
<fieldset
|
||||||
className="govuk-fieldset"
|
className="govuk-fieldset"
|
||||||
aria-describedby="commentBox-hint"
|
aria-describedby="commentBox-hint"
|
||||||
>
|
>
|
||||||
<div id="commentBox-hint" className="govuk-hint">
|
<div id="commentBox-hint" className="govuk-hint">
|
||||||
My comments are set out in:*
|
{t("myrepresentations:comments-set-out-label")}:
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div className="govuk-form-group">
|
||||||
className="govuk-checkboxes"
|
<Field
|
||||||
data-module="govuk-checkboxes"
|
name="representationComments"
|
||||||
>
|
id="representationComments"
|
||||||
<div className="govuk-checkboxes__item">
|
component={RenderRichMultiline}
|
||||||
<Field
|
type="text"
|
||||||
className="govuk-checkboxes__input"
|
rows="5"
|
||||||
id="commentBox"
|
className="govuk-textarea govuk-input--width-30"
|
||||||
name="commentBox"
|
aria-describedby={props.name + "-hint"}
|
||||||
value="email"
|
/>
|
||||||
data-aria-controls="commentBox"
|
</div>
|
||||||
type="checkbox"
|
|
||||||
component={RenderTextfield}
|
<div className="govuk-form-group govuk-!-margin-bottom-9">
|
||||||
/>
|
<FileUploadField
|
||||||
<label
|
name={"representationDocuments"}
|
||||||
className="govuk-label govuk-checkboxes__label"
|
label={t(
|
||||||
htmlFor="commentBox"
|
"myrepresentations:add-files-label"
|
||||||
>
|
)}
|
||||||
the box below{" "}
|
ticketnumber={props.props.caseReference}
|
||||||
</label>
|
hint={"sdsd"}
|
||||||
</div>
|
fileList={[]}
|
||||||
<div
|
setFilesForRepresentation={[]}
|
||||||
className={
|
containerID={
|
||||||
_.isEmpty(formObj["representationForm"])
|
props.props.props.accountDetails
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
.containerID
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden q11 "
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values.commentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.commentBox == false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden wwwaqqqq"
|
|
||||||
}
|
}
|
||||||
id="conditional-commentBox"
|
/>
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<Field
|
|
||||||
name="representationComments"
|
|
||||||
id="representationComments"
|
|
||||||
component={RenderMultiline}
|
|
||||||
type="text"
|
|
||||||
rows="5"
|
|
||||||
className="govuk-textarea govuk-input--width-30"
|
|
||||||
aria-describedby={
|
|
||||||
props.name + "-hint"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-checkboxes__item">
|
|
||||||
<Field
|
|
||||||
className="govuk-checkboxes__input"
|
|
||||||
id="documentBox"
|
|
||||||
name="documentBox"
|
|
||||||
value="email"
|
|
||||||
data-aria-controls="documentBox"
|
|
||||||
type="checkbox"
|
|
||||||
component={RenderTextfield}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
className="govuk-label govuk-checkboxes__label"
|
|
||||||
htmlFor="documentBox"
|
|
||||||
>
|
|
||||||
separate documents
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
_.isEmpty(formObj["representationForm"])
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden rr"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values
|
|
||||||
)
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: _.isEmpty(
|
|
||||||
formObj["representationForm"]
|
|
||||||
.values.documentBox
|
|
||||||
)
|
|
||||||
? formObj["representationForm"]
|
|
||||||
.values.documentBox == false
|
|
||||||
? "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden www"
|
|
||||||
: "govuk-checkboxes__conditional"
|
|
||||||
: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden"
|
|
||||||
}
|
|
||||||
id="conditional-documentBox"
|
|
||||||
>
|
|
||||||
<div className="govuk-form-group">
|
|
||||||
<section className="container">
|
|
||||||
<div
|
|
||||||
{...getRootProps({
|
|
||||||
className: "dropzone",
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<input {...getInputProps()} />
|
|
||||||
<p>
|
|
||||||
Drag and drop files here or
|
|
||||||
click to select files
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<aside>
|
|
||||||
<h4>Files</h4>
|
|
||||||
<ul>{files}</ul>
|
|
||||||
</aside>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>{" "}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<button
|
<button
|
||||||
@@ -207,7 +126,7 @@ const RepLandOwner = (props) => {
|
|||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button"
|
||||||
>
|
>
|
||||||
Continue
|
{t("common:continue-button")}
|
||||||
</button>
|
</button>
|
||||||
{/* <Link href="/representation">
|
{/* <Link href="/representation">
|
||||||
<a
|
<a
|
||||||
@@ -216,7 +135,7 @@ const RepLandOwner = (props) => {
|
|||||||
}}
|
}}
|
||||||
className="govuk-button"
|
className="govuk-button"
|
||||||
>
|
>
|
||||||
Continue
|
{t("common:continue-button")}
|
||||||
</a>
|
</a>
|
||||||
</Link> */}
|
</Link> */}
|
||||||
<a
|
<a
|
||||||
@@ -225,7 +144,7 @@ const RepLandOwner = (props) => {
|
|||||||
}}
|
}}
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
>
|
>
|
||||||
Back
|
{t("common:back-link")}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+540
@@ -0,0 +1,540 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, reduxForm, formValueSelector } from "redux-form";
|
||||||
|
import {
|
||||||
|
RenderPickList,
|
||||||
|
RenderTextfield,
|
||||||
|
RenderRadioList,
|
||||||
|
RenderMultiline,
|
||||||
|
RenderCondtionalRadioList,
|
||||||
|
RenderLPACondtionalRadioList,
|
||||||
|
FileUploadField,
|
||||||
|
RenderRichMultiline,
|
||||||
|
RenderDatePicker,
|
||||||
|
} from "../representationElements";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
} from "../../../../store/currentView/action";
|
||||||
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import { select } from "xpath";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
|
||||||
|
const RepresentationProgress_enforcement = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
const router = useRouter();
|
||||||
|
const {
|
||||||
|
formObj,
|
||||||
|
appellantApplicantRepresentationArr,
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
currentView,
|
||||||
|
procedureTypeValue,
|
||||||
|
onBehalfOfLPA,
|
||||||
|
setShowQuestionnaireSection,
|
||||||
|
showQuestionnaireSection,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<nav
|
||||||
|
role="navigation"
|
||||||
|
aria-labelledby="progress-list"
|
||||||
|
className="at-nav"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
id="step-by-step-navigation"
|
||||||
|
data-module="gemstepnav"
|
||||||
|
className="app-step-nav app-step-nav--active"
|
||||||
|
data-id="e01e924b-9c7c-4c71-8241-66a575c2f61f"
|
||||||
|
data-show-text="show"
|
||||||
|
data-hide-text="hide"
|
||||||
|
data-show-all-text="Show all"
|
||||||
|
data-hide-all-text="Hide all"
|
||||||
|
>
|
||||||
|
<ol className="app-step-nav__steps">
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 1
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
1
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(1);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-one"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 2
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
2
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(2);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-two"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 3
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
3
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(3);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-three"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 4
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
4
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(4);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-four"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 5
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
5
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(5);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-five"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 6
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
6
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(6);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-six"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>{" "}
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 7
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
7
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(7);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-seven"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 8
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
8
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(8);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:add-files-label"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 9
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
9
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(9);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:enf-section-heading-eight"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepresentationProgress_enforcement;
|
||||||
@@ -0,0 +1,435 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { Field, reduxForm, formValueSelector } from "redux-form";
|
||||||
|
import {
|
||||||
|
RenderPickList,
|
||||||
|
RenderTextfield,
|
||||||
|
RenderRadioList,
|
||||||
|
RenderMultiline,
|
||||||
|
RenderCondtionalRadioList,
|
||||||
|
RenderLPACondtionalRadioList,
|
||||||
|
FileUploadField,
|
||||||
|
RenderRichMultiline,
|
||||||
|
RenderDatePicker,
|
||||||
|
} from "../representationElements";
|
||||||
|
import {
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
} from "../../../../store/currentView/action";
|
||||||
|
import { useDropzone } from "react-dropzone";
|
||||||
|
import { select } from "xpath";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
|
||||||
|
const RepresentationProgress_s78 = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const {
|
||||||
|
formObj,
|
||||||
|
appellantApplicantRepresentationArr,
|
||||||
|
setRepresentationCapacity,
|
||||||
|
setRepresentationSubmit,
|
||||||
|
currentView,
|
||||||
|
procedureTypeValue,
|
||||||
|
onBehalfOfLPA,
|
||||||
|
setShowQuestionnaireSection,
|
||||||
|
showQuestionnaireSection,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<nav
|
||||||
|
role="navigation"
|
||||||
|
aria-labelledby="progress-list"
|
||||||
|
className="at-nav"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
id="step-by-step-navigation"
|
||||||
|
data-module="gemstepnav"
|
||||||
|
className="app-step-nav app-step-nav--active"
|
||||||
|
data-id="e01e924b-9c7c-4c71-8241-66a575c2f61f"
|
||||||
|
data-show-text="show"
|
||||||
|
data-hide-text="hide"
|
||||||
|
data-show-all-text="Show all"
|
||||||
|
data-hide-all-text="Hide all"
|
||||||
|
>
|
||||||
|
<ol className="app-step-nav__steps">
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 1
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
1
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(1);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-heading-one"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 2
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
2
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(2);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-heading-two"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 3
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
3
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(3);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-heading-three"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 4
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
4
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(4);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-heading-four"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 5
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
5
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(5);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-heading-five"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>{" "}
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 6
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
6
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(6);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:add-files-label"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
className={
|
||||||
|
"app-step-nav__step js-step app-step-nav__step--active" +
|
||||||
|
(showQuestionnaireSection >= 7
|
||||||
|
? " sectionComplete"
|
||||||
|
: " sectionIncomplete")
|
||||||
|
}
|
||||||
|
aria-current="step"
|
||||||
|
data-show=""
|
||||||
|
id="check-youre-allowed-to-drive"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="app-step-nav__header js-toggle-panel "
|
||||||
|
data-position="1"
|
||||||
|
>
|
||||||
|
<h3 className="app-step-nav__title ">
|
||||||
|
<span className="app-step-nav__circle app-step-nav__circle--number">
|
||||||
|
<span className="app-step-nav__circle-inner">
|
||||||
|
<span className="app-step-nav__circle-background">
|
||||||
|
<span className="app-step-nav__circle-step-label govuk-visually-hidden">
|
||||||
|
Step
|
||||||
|
</span>{" "}
|
||||||
|
7
|
||||||
|
<span
|
||||||
|
className="app-step-nav__circle-step-colon govuk-visually-hidden"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className="js-step-title">
|
||||||
|
<a
|
||||||
|
href="#"
|
||||||
|
onClick={() => {
|
||||||
|
setShowQuestionnaireSection(7);
|
||||||
|
}}
|
||||||
|
className="app-step-nav__button app-step-nav__button--title js-step-title-button"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="step-panel-check-youre-allowed-to-drive-1"
|
||||||
|
>
|
||||||
|
<span className="js-step-title-text govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-heading-seven"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RepresentationProgress_s78;
|
||||||
+1213
File diff suppressed because it is too large
Load Diff
+1024
File diff suppressed because it is too large
Load Diff
+1786
File diff suppressed because it is too large
Load Diff
+1786
File diff suppressed because it is too large
Load Diff
@@ -6,10 +6,11 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import { getRepresentations } from "../../actions";
|
import { getRepresentations } from "../../actions";
|
||||||
import { setRepresentations } from "../../store/searchOutput/action";
|
import { setRepresentations } from "../../store/searchOutput/action";
|
||||||
import PaginationControl from "./pagination";
|
import PaginationControl from "./pagination";
|
||||||
|
import { formatDates } from "../utils";
|
||||||
|
|
||||||
const RepresentationList = (props) => {
|
const RepresentationList = (props) => {
|
||||||
const { incidentid, representationsObj, setRepresentations } = props;
|
const { incidentid, representationsObj, setRepresentations } = props;
|
||||||
@@ -153,15 +154,6 @@ const RepresentationList = (props) => {
|
|||||||
const representationResultsObj = representationDetailsObj();
|
const representationResultsObj = representationDetailsObj();
|
||||||
}, [incidentid, setRepresentations]);
|
}, [incidentid, setRepresentations]);
|
||||||
|
|
||||||
function formatDates(dateObj) {
|
|
||||||
var dateObj = new Date(dateObj);
|
|
||||||
var dd = String(dateObj.getDate()).padStart(2, "0");
|
|
||||||
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
|
||||||
var yyyy = dateObj.getFullYear();
|
|
||||||
|
|
||||||
return dd + "/" + mm + "/" + yyyy;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pagesCount = Math.ceil(representationsObj["@odata.count"] / 10);
|
const pagesCount = Math.ceil(representationsObj["@odata.count"] / 10);
|
||||||
|
|
||||||
let currentPage = 0;
|
let currentPage = 0;
|
||||||
@@ -224,11 +216,6 @@ const RepresentationList = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
+315
-21
@@ -6,16 +6,27 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
|
|
||||||
import { getLinkedCases } from "../../actions";
|
import {
|
||||||
|
getLinkedCases,
|
||||||
|
createWatchedCases,
|
||||||
|
getWatchedCasesProxy,
|
||||||
|
getPortalModuleDetailsProxy,
|
||||||
|
deleteWatchedCases,
|
||||||
|
} from "../../actions";
|
||||||
import {
|
import {
|
||||||
setCurrentLinkedCases,
|
setCurrentLinkedCases,
|
||||||
setCurrentReference,
|
setCurrentReference,
|
||||||
} from "../../store/currentView/action";
|
} from "../../store/currentView/action";
|
||||||
|
|
||||||
|
import {
|
||||||
|
setWatchedCases,
|
||||||
|
setWatchedCasesDetails,
|
||||||
|
} from "../../store/watchedCases/action";
|
||||||
|
|
||||||
import { getFormCollectionByID } from "../utils";
|
import { getFormCollectionByID } from "../utils";
|
||||||
import { getSession, useSession } from "next-auth/react";
|
import { getSession, useSession, signIn } from "next-auth/react";
|
||||||
|
import { parseCookies, setCookie, destroyCookie } from "nookies";
|
||||||
|
|
||||||
import Pinswg_advertsid from "./summaryTypes/pinswg_advertsid";
|
import Pinswg_advertsid from "./summaryTypes/pinswg_advertsid";
|
||||||
import Pinswg_callinss77id from "./summaryTypes/pinswg_callinss77id";
|
import Pinswg_callinss77id from "./summaryTypes/pinswg_callinss77id";
|
||||||
@@ -62,12 +73,92 @@ const CaseSummary = (props) => {
|
|||||||
setCurrentLinkedCases,
|
setCurrentLinkedCases,
|
||||||
linkedCasesReference,
|
linkedCasesReference,
|
||||||
setCurrentReference,
|
setCurrentReference,
|
||||||
|
setWatchedCases,
|
||||||
|
setWatchedCasesDetails,
|
||||||
showMap,
|
showMap,
|
||||||
|
showLoginCheck,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const { data: session, status } = useSession();
|
const { data: session, status } = useSession();
|
||||||
//console.log("session status:", status, session);
|
//console.log("session status:", status, session);
|
||||||
|
|
||||||
|
const cookies = parseCookies();
|
||||||
|
|
||||||
|
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
|
||||||
|
let updateBody = {
|
||||||
|
"pinswg_WatchedCase@odata.bind": "/incidents(" + incidentID + ")",
|
||||||
|
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
|
||||||
|
"pinswg_appealcasetype": +appealType,
|
||||||
|
};
|
||||||
|
|
||||||
|
createWatchedCases(updateBody)
|
||||||
|
.then((data) => data)
|
||||||
|
.then(() => {
|
||||||
|
getWatchedCasesProxy(loggedInUser).then((data) => {
|
||||||
|
setWatchedCases(data),
|
||||||
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
|
setWatchedCasesDetails(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getDetails = (resultsObj, detailsType) => {
|
||||||
|
console.log(resultsObj);
|
||||||
|
let detailsArr = [];
|
||||||
|
resultsObj = resultsObj.value;
|
||||||
|
const detailsObj = resultsObj.map((searchDetail, index) => {
|
||||||
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
|
console.log(
|
||||||
|
detailsType != "myWatchedCases"
|
||||||
|
? searchDetail.ticketnumber
|
||||||
|
: searchDetail[
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
detailsArr.push(
|
||||||
|
getPortalModuleDetailsProxy(
|
||||||
|
getFormCollectionByID(
|
||||||
|
searchDetail.pinswg_appealcasetype
|
||||||
|
).LogicalCollectionName,
|
||||||
|
detailsType != "myWatchedCases"
|
||||||
|
? searchDetail.ticketnumber
|
||||||
|
: searchDetail[
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//console.log(detailsArr);
|
||||||
|
return Promise.all(detailsArr);
|
||||||
|
};
|
||||||
|
|
||||||
|
const isWatchedCase = (whichIncident) => {
|
||||||
|
let isWatched = jsonpath.query(
|
||||||
|
watchedCases,
|
||||||
|
"$..value[?(@._pinswg_watchedcase_value=='" + whichIncident + "')]"
|
||||||
|
);
|
||||||
|
|
||||||
|
return isWatched;
|
||||||
|
};
|
||||||
|
|
||||||
|
const deleteItem = (caseID, topThreeType) => {
|
||||||
|
let cookies = parseCookies();
|
||||||
|
topThreeType == "watchedCases" &&
|
||||||
|
deleteWatchedCases(caseID)
|
||||||
|
.then((data) => data)
|
||||||
|
.then(() => {
|
||||||
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
|
setWatchedCases(data),
|
||||||
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
|
setWatchedCasesDetails(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const noRepresentationLink = ["/dnsdetails", "/dns/[developmentName]"];
|
const noRepresentationLink = ["/dnsdetails", "/dns/[developmentName]"];
|
||||||
|
|
||||||
let setCaseQueryObj = props[currentType];
|
let setCaseQueryObj = props[currentType];
|
||||||
@@ -113,6 +204,18 @@ const CaseSummary = (props) => {
|
|||||||
|
|
||||||
let showDetails = typeof detailsObj != "undefined" ? true : false;
|
let showDetails = typeof detailsObj != "undefined" ? true : false;
|
||||||
|
|
||||||
|
var timestamp = showDetails
|
||||||
|
? detailsObj.hasOwnProperty("pinswg_representation_period_end_date")
|
||||||
|
? Date.parse(detailsObj.pinswg_representation_period_end_date)
|
||||||
|
: "n/a"
|
||||||
|
: "n/a";
|
||||||
|
|
||||||
|
if (isNaN(timestamp) == false) {
|
||||||
|
var d = new Date(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
let hasEndDate = typeof d != "undefined";
|
||||||
|
|
||||||
let showDetailsBlock =
|
let showDetailsBlock =
|
||||||
showDetails == true ? (
|
showDetails == true ? (
|
||||||
<div>
|
<div>
|
||||||
@@ -143,7 +246,6 @@ const CaseSummary = (props) => {
|
|||||||
] || "not entered"}
|
] || "not entered"}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{detailsObj.pinswg_agentcontactname != null &&
|
{detailsObj.pinswg_agentcontactname != null &&
|
||||||
(_.has(
|
(_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
@@ -283,6 +385,182 @@ const CaseSummary = (props) => {
|
|||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* <div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
todays date - {formatDates(new Date())}
|
||||||
|
<br />
|
||||||
|
pinswg_startdate -{" "}
|
||||||
|
{formatDates(detailsObj.pinswg_startdate)}
|
||||||
|
<br />
|
||||||
|
days between pinswg_startdate & todays date -
|
||||||
|
{Math.floor(
|
||||||
|
(new Date(detailsObj.pinswg_startdate) -
|
||||||
|
new Date()) /
|
||||||
|
(24 * 3600 * 1000)
|
||||||
|
)}
|
||||||
|
<br />
|
||||||
|
pinswg_statementduedate -{" "}
|
||||||
|
{formatDates(detailsObj.pinswg_statementduedate)}
|
||||||
|
<br />
|
||||||
|
pinswg_finalcommentsduedate -{" "}
|
||||||
|
{formatDates(detailsObj.pinswg_finalcommentsduedate)}
|
||||||
|
<br />
|
||||||
|
pinswg_startdatetimeiftheevent -{" "}
|
||||||
|
{formatDates(detailsObj.pinswg_startdatetimeiftheevent)}
|
||||||
|
<br /> <br />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
*/}
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<div className="govuk-button-group">
|
||||||
|
{_.has(detailsObj, "pinswg_startdate") &&
|
||||||
|
showReps(
|
||||||
|
detailsObj.pinswg_startdate,
|
||||||
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
|
) && (
|
||||||
|
<>
|
||||||
|
<Link
|
||||||
|
href={{
|
||||||
|
pathname:
|
||||||
|
"/myportal/representation",
|
||||||
|
query: {
|
||||||
|
case:
|
||||||
|
currentType ==
|
||||||
|
"searchResultsObj"
|
||||||
|
? detailsObj.pinswg_name
|
||||||
|
: casesObj.reference,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
className="govuk-button"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"case:summary-make-representation-label"
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
//spinnerState();
|
||||||
|
router.back();
|
||||||
|
}}
|
||||||
|
className="govuk-button govuk-button--secondary"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"case:summary-back-button-label"
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
<div className="govuk-body">
|
||||||
|
{session &&
|
||||||
|
(isWatchedCase(
|
||||||
|
props.currentView.caseReference
|
||||||
|
.incidentid
|
||||||
|
).length >
|
||||||
|
0 ==
|
||||||
|
true ? (
|
||||||
|
<span
|
||||||
|
className="govuk-link"
|
||||||
|
onClick={() => {
|
||||||
|
deleteItem(
|
||||||
|
isWatchedCase(
|
||||||
|
props.currentView
|
||||||
|
.caseReference
|
||||||
|
.incidentid
|
||||||
|
)[0].pinswg_watchlistid,
|
||||||
|
|
||||||
|
"watchedCases"
|
||||||
|
);
|
||||||
|
alert(
|
||||||
|
t(
|
||||||
|
"case:you-have-stopped-watching-label"
|
||||||
|
) +
|
||||||
|
props.currentView
|
||||||
|
.caseReference
|
||||||
|
.currentReference
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
title={t(
|
||||||
|
"case:stop-watching-case-link"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{t("case:stop-watching-case-link")}{" "}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span
|
||||||
|
className=" govuk-link"
|
||||||
|
onClick={() => {
|
||||||
|
selectWatchedCase(
|
||||||
|
props.accountDetails
|
||||||
|
.loggedinUserId,
|
||||||
|
props.currentView
|
||||||
|
.caseReference
|
||||||
|
.incidentid,
|
||||||
|
props.currentView
|
||||||
|
.caseReference
|
||||||
|
.appealType
|
||||||
|
);
|
||||||
|
alert(
|
||||||
|
t(
|
||||||
|
"case:you-are-watching-label"
|
||||||
|
) +
|
||||||
|
" " +
|
||||||
|
props.currentView
|
||||||
|
.caseReference
|
||||||
|
.currentReference
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("case:watch-this-case-link")}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{!session && (
|
||||||
|
<span
|
||||||
|
className="govuk-link"
|
||||||
|
onClick={() => {
|
||||||
|
// signIn("email");
|
||||||
|
signIn();
|
||||||
|
// selectWatchedCase(
|
||||||
|
// cookies.pinsUser,
|
||||||
|
// item.incidentid,
|
||||||
|
// item.pinswg_appealcasetype
|
||||||
|
// );
|
||||||
|
// alert(
|
||||||
|
// "Trying to watch case " +
|
||||||
|
// item.title
|
||||||
|
// );
|
||||||
|
}}
|
||||||
|
title={t("case:watch-this-case-link")}
|
||||||
|
>
|
||||||
|
{t("case:watch-this-case-link")}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
{_.has(detailsObj, "pinswg_startdate") &&
|
||||||
|
showRepsEnded(
|
||||||
|
detailsObj.pinswg_startdate,
|
||||||
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
|
) && (
|
||||||
|
<div className="govuk-body">
|
||||||
|
{t(
|
||||||
|
"case:representation-period-ended-on-label"
|
||||||
|
)}
|
||||||
|
|
||||||
|
{formatDates(
|
||||||
|
detailsObj.pinswg_finalcommentsduedate
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{/* 1{" "}
|
{/* 1{" "}
|
||||||
{_.has(detailsObj, "pinswg_startdatetimeiftheevent") &&
|
{_.has(detailsObj, "pinswg_startdatetimeiftheevent") &&
|
||||||
detailsObj.pinswg_startdatetimeiftheevent}
|
detailsObj.pinswg_startdatetimeiftheevent}
|
||||||
@@ -345,12 +623,13 @@ const CaseSummary = (props) => {
|
|||||||
true ? (
|
true ? (
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
<Link href="/representation">
|
<Link
|
||||||
<a className="govuk-button">
|
href="/representation"
|
||||||
{t(
|
className="govuk-button"
|
||||||
"case:summary-make-representation-label"
|
>
|
||||||
)}
|
{t(
|
||||||
</a>
|
"case:summary-make-representation-label"
|
||||||
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -717,8 +996,9 @@ const CaseSummary = (props) => {
|
|||||||
item.title +
|
item.title +
|
||||||
"&lk=1"
|
"&lk=1"
|
||||||
}
|
}
|
||||||
|
className=""
|
||||||
>
|
>
|
||||||
<a className="">{item.title}</a>
|
{item.title}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
@@ -729,16 +1009,24 @@ const CaseSummary = (props) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
function showReps(startDate, endDate) {
|
||||||
<>
|
let date = new Date();
|
||||||
{showDetailsBlock}
|
date = new Date(date.toDateString());
|
||||||
{/* <LoadingOverlay
|
const start = new Date(startDate);
|
||||||
active={showSpinnerState}
|
const end = new Date(endDate);
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
return date >= start && date <= end ? true : false;
|
||||||
/> */}
|
}
|
||||||
</>
|
|
||||||
);
|
function showRepsEnded(startDate, endDate) {
|
||||||
|
let date = new Date();
|
||||||
|
date = new Date(date.toDateString());
|
||||||
|
const start = new Date(startDate);
|
||||||
|
const end = new Date(endDate);
|
||||||
|
return date > start && date > end ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <>{showDetailsBlock}</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
@@ -755,6 +1043,12 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
setCurrentReference: (currentReference) => {
|
setCurrentReference: (currentReference) => {
|
||||||
dispatch(setCurrentReference(currentReference));
|
dispatch(setCurrentReference(currentReference));
|
||||||
},
|
},
|
||||||
|
setWatchedCases: (watchedCases) => {
|
||||||
|
dispatch(setWatchedCases(watchedCases));
|
||||||
|
},
|
||||||
|
setWatchedCasesDetails: (watchedCasesDetails) => {
|
||||||
|
dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ const Pinswg_dnsid = (props) => {
|
|||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const point = {};
|
let point = {};
|
||||||
const siteCoords = {};
|
let siteCoords = {};
|
||||||
let center = {};
|
let center = {};
|
||||||
|
|
||||||
point = new OSPoint(
|
point = new OSPoint(
|
||||||
|
|||||||
+10
-10
@@ -25,17 +25,17 @@ export default function Search({ children, pages }) {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<Link href="/advancedsearch">
|
<Link href="/advancedsearch" className="govuk-button">
|
||||||
<a className="govuk-button">
|
|
||||||
{t("search:searchresults-search-button-label")}
|
{t("search:searchresults-search-button-label")}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/advancedsearch">
|
<Link href="/advancedsearch" className="govuk-button govuk-button--secondary">
|
||||||
<a className="govuk-button govuk-button--secondary">
|
|
||||||
{t(
|
{t(
|
||||||
"search:searchresults-new-search-button-label"
|
"search:searchresults-new-search-button-label"
|
||||||
)}
|
)}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ const CheckAnswers = (props) => {
|
|||||||
id="main-content"
|
id="main-content"
|
||||||
role="main"
|
role="main"
|
||||||
>
|
>
|
||||||
sss
|
|
||||||
<BuildCheckSection
|
<BuildCheckSection
|
||||||
formXML={formXML}
|
formXML={formXML}
|
||||||
sectionCount={sectionCount}
|
sectionCount={sectionCount}
|
||||||
|
|||||||
+87
-89
@@ -36,104 +36,102 @@ const CookieBanner = () => {
|
|||||||
setBannerVisible(false);
|
setBannerVisible(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
{bannerVisible ? (
|
||||||
{bannerVisible ? (
|
<CookieConsent
|
||||||
<CookieConsent
|
style={{
|
||||||
style={{
|
position: "inherit",
|
||||||
position: "inherit",
|
background: "#eeeeee",
|
||||||
background: "#eeeeee",
|
display: "block",
|
||||||
display: "block",
|
}}
|
||||||
}}
|
containerClasses="app-cookie-banner"
|
||||||
containerClasses="app-cookie-banner"
|
buttonClasses="cookies-banner__button"
|
||||||
buttonClasses="cookies-banner__button"
|
buttonWrapperClasses="govuk-width-container consentBanner hidden"
|
||||||
buttonWrapperClasses="govuk-width-container consentBanner hidden"
|
declineButtonClasses="cookies-banner__button"
|
||||||
declineButtonClasses="cookies-banner__button"
|
buttonText={t("common:cookie-banner-accept")}
|
||||||
buttonText={t("common:cookie-banner-accept")}
|
declineButtonText={t("common:cookie-banner-decline")}
|
||||||
declineButtonText={t("common:cookie-banner-decline")}
|
disableStyles={true}
|
||||||
disableStyles={true}
|
enableDeclineButton={true}
|
||||||
enableDeclineButton={true}
|
flipButtons={true}
|
||||||
flipButtons={true}
|
hideOnAccept={true}
|
||||||
hideOnAccept={true}
|
cookieName="planning_casework"
|
||||||
cookieName="planning_casework"
|
>
|
||||||
>
|
<div className="app-cookie-banner">
|
||||||
<div className="app-cookie-banner">
|
<div
|
||||||
<div
|
id="global-cookie-message"
|
||||||
id="global-cookie-message"
|
className="govuk-clearfix"
|
||||||
className="govuk-clearfix"
|
data-module="cookie-banner"
|
||||||
data-module="cookie-banner"
|
role="region"
|
||||||
role="region"
|
aria-label="cookie banner"
|
||||||
aria-label="cookie banner"
|
data-nosnippet=""
|
||||||
data-nosnippet=""
|
>
|
||||||
>
|
<div className="govuk-width-container">
|
||||||
<div className="govuk-width-container">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-column-two-thirds">
|
||||||
<div className="govuk-grid-column-two-thirds">
|
<div className="">
|
||||||
<div className="">
|
<p className="cookies-banner__description">
|
||||||
<p className="cookies-banner__description">
|
{t(
|
||||||
|
"common:cookie-banner-line-1"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<ul className="cookies-banner__description">
|
||||||
|
<li>
|
||||||
|
{" "}
|
||||||
{t(
|
{t(
|
||||||
"common:cookie-banner-line-1"
|
"common:cookie-banner-list-item-1"
|
||||||
)}
|
)}
|
||||||
</p>
|
</li>
|
||||||
<ul className="cookies-banner__description">
|
</ul>
|
||||||
<li>
|
<p className="cookies-banner__description">
|
||||||
{" "}
|
{t(
|
||||||
{t(
|
"common:cookie-banner-line-2"
|
||||||
"common:cookie-banner-list-item-1"
|
)}
|
||||||
)}
|
</p>
|
||||||
</li>
|
<ul className="cookies-banner__description">
|
||||||
</ul>
|
<li>
|
||||||
<p className="cookies-banner__description">
|
|
||||||
{t(
|
{t(
|
||||||
"common:cookie-banner-line-2"
|
"common:cookie-banner-list-item-2"
|
||||||
)}
|
)}
|
||||||
</p>
|
</li>
|
||||||
<ul className="cookies-banner__description">
|
<li>
|
||||||
<li>
|
{t(
|
||||||
{t(
|
"common:cookie-banner-list-item-3"
|
||||||
"common:cookie-banner-list-item-2"
|
)}
|
||||||
)}
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
<li>
|
|
||||||
{t(
|
|
||||||
"common:cookie-banner-list-item-3"
|
|
||||||
)}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-width-container consentBannerShow">
|
|
||||||
<button
|
|
||||||
className="cookies-banner__button"
|
|
||||||
id="rcc-confirm-button"
|
|
||||||
aria-label="Accept cookies"
|
|
||||||
onClick={() => {
|
|
||||||
accept();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("common:cookie-banner-accept")}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<Link href="/help/cookies">
|
|
||||||
<a
|
|
||||||
className="cookies-banner__button govuk-link--no-underline"
|
|
||||||
id="rcc-decline-button"
|
|
||||||
aria-label="Decline cookies"
|
|
||||||
>
|
|
||||||
{t("common:cookie-banner-change-settings")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</CookieConsent>
|
<div className="govuk-width-container consentBannerShow">
|
||||||
) : (
|
<button
|
||||||
""
|
className="cookies-banner__button"
|
||||||
)}
|
id="rcc-confirm-button"
|
||||||
</>
|
aria-label="Accept cookies"
|
||||||
);
|
onClick={() => {
|
||||||
|
accept();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:cookie-banner-accept")}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
href="/help/cookies"
|
||||||
|
className="cookies-banner__button govuk-link--no-underline"
|
||||||
|
id="rcc-decline-button"
|
||||||
|
aria-label="Decline cookies">
|
||||||
|
|
||||||
|
{t("common:cookie-banner-change-settings")}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</CookieConsent>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CookieBanner;
|
export default CookieBanner;
|
||||||
|
|||||||
@@ -431,12 +431,12 @@ const CookieManagementMain = (props) => {
|
|||||||
href={t(
|
href={t(
|
||||||
"cookies:cookie-settings-essential-link"
|
"cookies:cookie-settings-essential-link"
|
||||||
)}
|
)}
|
||||||
>
|
className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold">
|
||||||
<a className="govuk-link govuk-link--no-underline govuk-!-font-weight-bold">
|
|
||||||
{t(
|
{t(
|
||||||
"cookies:cookie-settings-essential-link-label"
|
"cookies:cookie-settings-essential-link-label"
|
||||||
)}
|
)}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</legend>
|
</legend>
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ const ApplicationIntro = (props) => {
|
|||||||
</ul>
|
</ul>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("dnsApplications:page-intro-paragraph-2")}{" "}
|
{t("dnsApplications:page-intro-paragraph-2")}{" "}
|
||||||
<Link href="/dns/calendar">
|
<Link href="/dns/calendar" className="govuk-link">
|
||||||
<a className="govuk-link">
|
|
||||||
{t("dnsApplications:page-intro-paragraph-2-link")}
|
{t("dnsApplications:page-intro-paragraph-2-link")}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
.
|
.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -9,505 +9,487 @@ const ApplicationList = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
<div className="govuk-grid-row govuk-!-margin-top-9">
|
||||||
<div className="govuk-grid-row govuk-!-margin-top-9">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-form-group">
|
||||||
<div className="govuk-form-group">
|
<label className="govuk-label-s " htmlFor="sort">
|
||||||
<label className="govuk-label-s " htmlFor="sort">
|
{t("dnsCommon:result-list-show-label")}{" "}
|
||||||
{t("dnsCommon:result-list-show-label")}{" "}
|
<select
|
||||||
<select
|
className="govuk-select"
|
||||||
className="govuk-select"
|
id="showNo"
|
||||||
id="showNo"
|
name="showNo"
|
||||||
name="showNo"
|
>
|
||||||
>
|
<option value="1">10</option>
|
||||||
<option value="1">10</option>
|
<option value="1">25</option>
|
||||||
<option value="1">25</option>
|
<option value="1">50</option>
|
||||||
<option value="1">50</option>
|
<option value="1">100</option>
|
||||||
<option value="1">100</option>
|
</select>{" "}
|
||||||
</select>{" "}
|
{t("dnsCommon:result-list-entries-label")}
|
||||||
{t("dnsCommon:result-list-entries-label")}
|
</label>
|
||||||
</label>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{t("dnsCommon:result-list-showing-label", {
|
||||||
|
recordIndex: "1",
|
||||||
|
pagingIndex: "10",
|
||||||
|
totalRecords: "55",
|
||||||
|
})}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-grid-row ">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<dl className="govuk-summary-list govuk-!-margin-bottom-0 results">
|
||||||
|
<div className="govuk-summary-list__row results-headings">
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-16 results_wider ">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-application"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-type"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-status"
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="govuk-summary-list__row">
|
||||||
</div>
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
<div className="govuk-grid-row">
|
<span className="results-visually-hidden">
|
||||||
<div className="govuk-grid-column-full">
|
|
||||||
<p className="govuk-body-s">
|
|
||||||
{t("dnsCommon:result-list-showing-label", {
|
|
||||||
recordIndex: "1",
|
|
||||||
pagingIndex: "10",
|
|
||||||
totalRecords: "55",
|
|
||||||
})}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-grid-row ">
|
|
||||||
<div className="govuk-grid-column-full">
|
|
||||||
<dl className="govuk-summary-list govuk-!-margin-bottom-0 results">
|
|
||||||
<div className="govuk-summary-list__row results-headings">
|
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16 results_wider ">
|
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
)}
|
)}
|
||||||
</dd>
|
:
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</span>
|
||||||
{t(
|
CAS-00009-W8N6W4
|
||||||
"dnsApplications:result-list-heading-label-application"
|
</dd>
|
||||||
)}
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
</dd>
|
<Link href="/dns/application-view">
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-application"
|
||||||
|
)}
|
||||||
|
:{" "}
|
||||||
|
</span>TWA - Morlais Demonstration Zone
|
||||||
|
</Link>
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
)}
|
)}
|
||||||
</dd>
|
:
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</span>
|
||||||
|
Menter Mon
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-type"
|
"dnsApplications:result-list-heading-label-type"
|
||||||
)}
|
)}
|
||||||
</dd>
|
:
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
</span>
|
||||||
|
Energy
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-status"
|
"dnsApplications:result-list-heading-label-status"
|
||||||
)}
|
)}
|
||||||
</dd>
|
:
|
||||||
</div>
|
</span>
|
||||||
<div className="govuk-summary-list__row">
|
Recommendation
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
CAS-00009-W8N6W4
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<Link href="/dns/application-view">
|
||||||
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
"dnsApplications:result-list-heading-label-application"
|
||||||
)}
|
)}
|
||||||
:
|
:{" "}
|
||||||
</span>
|
</span>TWA - Morlais Demonstration Zone
|
||||||
CAS-00009-W8N6W4
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<Link href="/dns/application-view">
|
<span className="results-visually-hidden">
|
||||||
<a>
|
{t(
|
||||||
<span className="results-visually-hidden">
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
{t(
|
)}
|
||||||
"dnsApplications:result-list-heading-label-application"
|
:
|
||||||
)}
|
</span>
|
||||||
:{" "}
|
Menter Mon
|
||||||
</span>
|
</dd>
|
||||||
TWA - Morlais Demonstration Zone
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
</a>
|
<span className="results-visually-hidden">
|
||||||
</Link>
|
{t(
|
||||||
</dd>
|
"dnsApplications:result-list-heading-label-type"
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Energy
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-status"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Recommendation
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
CAS-00009-W8N6W4
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<Link href="/dns/application-view">
|
||||||
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
"dnsApplications:result-list-heading-label-application"
|
||||||
)}
|
)}
|
||||||
:
|
:{" "}
|
||||||
</span>
|
</span>TWA - Morlais Demonstration Zone
|
||||||
Menter Mon
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Menter Mon
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-type"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Energy
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-status"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Recommendation
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
CAS-00009-W8N6W4
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<Link href="/dns/application-view">
|
||||||
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-type"
|
"dnsApplications:result-list-heading-label-application"
|
||||||
)}
|
)}
|
||||||
:
|
:{" "}
|
||||||
</span>
|
</span>TWA - Morlais Demonstration Zone
|
||||||
Energy
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Menter Mon
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-type"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Energy
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-status"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Recommendation
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
CAS-00009-W8N6W4
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<Link href="/dns/application-view">
|
||||||
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-status"
|
"dnsApplications:result-list-heading-label-application"
|
||||||
)}
|
)}
|
||||||
:
|
:{" "}
|
||||||
</span>
|
</span>TWA - Morlais Demonstration Zone
|
||||||
Recommendation
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<div className="govuk-summary-list__row">
|
<span className="results-visually-hidden">
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Menter Mon
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-type"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Energy
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-status"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Recommendation
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
CAS-00009-W8N6W4
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<Link href="/dns/application-view">
|
||||||
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
"dnsApplications:result-list-heading-label-application"
|
||||||
)}
|
)}
|
||||||
:
|
:{" "}
|
||||||
</span>
|
</span>TWA - Morlais Demonstration Zone
|
||||||
CAS-00009-W8N6W4
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<Link href="/dns/application-view">
|
<span className="results-visually-hidden">
|
||||||
<a>
|
{t(
|
||||||
<span className="results-visually-hidden">
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
{t(
|
)}
|
||||||
"dnsApplications:result-list-heading-label-application"
|
:
|
||||||
)}
|
</span>
|
||||||
:{" "}
|
Menter Mon
|
||||||
</span>
|
</dd>
|
||||||
TWA - Morlais Demonstration Zone
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
</a>
|
<span className="results-visually-hidden">
|
||||||
</Link>
|
{t(
|
||||||
</dd>
|
"dnsApplications:result-list-heading-label-type"
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Energy
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-status"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Recommendation
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
CAS-00009-W8N6W4
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<Link href="/dns/application-view">
|
||||||
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
"dnsApplications:result-list-heading-label-application"
|
||||||
)}
|
)}
|
||||||
:
|
:{" "}
|
||||||
</span>
|
</span>TWA - Morlais Demonstration Zone
|
||||||
Menter Mon
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Menter Mon
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-type"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Energy
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-status"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
Recommendation
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div className="govuk-summary-list__row">
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"dnsApplications:result-list-heading-label-reference"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
CAS-00009-W8N6W4
|
||||||
|
</dd>
|
||||||
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
<Link href="/dns/application-view">
|
||||||
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-type"
|
"dnsApplications:result-list-heading-label-application"
|
||||||
)}
|
)}
|
||||||
:
|
:{" "}
|
||||||
</span>
|
</span>TWA - Morlais Demonstration Zone
|
||||||
Energy
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t(
|
{t(
|
||||||
"dnsApplications:result-list-heading-label-status"
|
"dnsApplications:result-list-heading-label-developer"
|
||||||
)}
|
)}
|
||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
Recommendation
|
Menter Mon
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<div className="govuk-summary-list__row">
|
<span className="results-visually-hidden">
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
{t(
|
||||||
<span className="results-visually-hidden">
|
"dnsApplications:result-list-heading-label-type"
|
||||||
{t(
|
)}
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
:
|
||||||
)}
|
</span>
|
||||||
:
|
Energy
|
||||||
</span>
|
</dd>
|
||||||
CAS-00009-W8N6W4
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
</dd>
|
<span className="results-visually-hidden">
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
{t(
|
||||||
<Link href="/dns/application-view">
|
"dnsApplications:result-list-heading-label-status"
|
||||||
<a>
|
)}
|
||||||
<span className="results-visually-hidden">
|
:
|
||||||
{t(
|
</span>
|
||||||
"dnsApplications:result-list-heading-label-application"
|
Recommendation
|
||||||
)}
|
</dd>
|
||||||
:{" "}
|
</div>
|
||||||
</span>
|
</dl>
|
||||||
TWA - Morlais Demonstration Zone
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Menter Mon
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-type"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Energy
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-status"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Recommendation
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
CAS-00009-W8N6W4
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<Link href="/dns/application-view">
|
|
||||||
<a>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-application"
|
|
||||||
)}
|
|
||||||
:{" "}
|
|
||||||
</span>
|
|
||||||
TWA - Morlais Demonstration Zone
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Menter Mon
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-type"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Energy
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-status"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Recommendation
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
CAS-00009-W8N6W4
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<Link href="/dns/application-view">
|
|
||||||
<a>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-application"
|
|
||||||
)}
|
|
||||||
:{" "}
|
|
||||||
</span>
|
|
||||||
TWA - Morlais Demonstration Zone
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Menter Mon
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-type"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Energy
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-status"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Recommendation
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
CAS-00009-W8N6W4
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<Link href="/dns/application-view">
|
|
||||||
<a>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-application"
|
|
||||||
)}
|
|
||||||
:{" "}
|
|
||||||
</span>
|
|
||||||
TWA - Morlais Demonstration Zone
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Menter Mon
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-type"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Energy
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-status"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Recommendation
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
CAS-00009-W8N6W4
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<Link href="/dns/application-view">
|
|
||||||
<a>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-application"
|
|
||||||
)}
|
|
||||||
:{" "}
|
|
||||||
</span>
|
|
||||||
TWA - Morlais Demonstration Zone
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Menter Mon
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-type"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Energy
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-status"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Recommendation
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div className="govuk-summary-list__row">
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-reference"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
CAS-00009-W8N6W4
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<Link href="/dns/application-view">
|
|
||||||
<a>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-application"
|
|
||||||
)}
|
|
||||||
:{" "}
|
|
||||||
</span>
|
|
||||||
TWA - Morlais Demonstration Zone
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-developer"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Menter Mon
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-type"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Energy
|
|
||||||
</dd>
|
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"dnsApplications:result-list-heading-label-status"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
Recommendation
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row ">
|
</div>
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-row ">
|
||||||
<p>
|
<div className="govuk-grid-column-full">
|
||||||
{t("dnsCommon:result-list-previous-label")}{" "}
|
<p>
|
||||||
<span>1</span>{" "}
|
{t("dnsCommon:result-list-previous-label")}{" "}
|
||||||
<span>
|
<span>1</span>{" "}
|
||||||
<Link href="#">2</Link>
|
<span>
|
||||||
</span>{" "}
|
<Link href="#">2</Link>
|
||||||
<span>
|
</span>{" "}
|
||||||
<Link href="#">3</Link>
|
<span>
|
||||||
</span>{" "}
|
<Link href="#">3</Link>
|
||||||
<span>
|
</span>{" "}
|
||||||
<Link href="#">4</Link>
|
<span>
|
||||||
</span>{" "}
|
<Link href="#">4</Link>
|
||||||
<span>
|
</span>{" "}
|
||||||
<Link href="#">5</Link>
|
<span>
|
||||||
</span>{" "}
|
<Link href="#">5</Link>
|
||||||
<Link href="#">
|
</span>{" "}
|
||||||
{t("dnsCommon:result-list-next-label")}
|
<Link href="#" legacyBehavior>
|
||||||
</Link>
|
{t("dnsCommon:result-list-next-label")}
|
||||||
</p>
|
</Link>
|
||||||
</div>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
);
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ApplicationList;
|
export default ApplicationList;
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ const ApplicationsForComment = (props) => {
|
|||||||
<div className="govuk-panel__body">
|
<div className="govuk-panel__body">
|
||||||
<ul className="govuk-list">
|
<ul className="govuk-list">
|
||||||
<li>
|
<li>
|
||||||
<Link href="/dns/application-view">
|
<Link href="/dns/application-view" className="govuk-body-s ">
|
||||||
<a className="govuk-body-s ">
|
|
||||||
Holyhead Harbour Revision Order
|
Holyhead Harbour Revision Order
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ const DNSLinks = (props) => {
|
|||||||
<ul className="govuk-list">
|
<ul className="govuk-list">
|
||||||
<li>
|
<li>
|
||||||
<h3 className="govuk-heading-l govuk-!-font-size-27">
|
<h3 className="govuk-heading-l govuk-!-font-size-27">
|
||||||
<Link href="/dnsapplications">
|
<Link href="/dnsapplications" className="govuk-link govuk-link--no-underline">
|
||||||
<a className="govuk-link govuk-link--no-underline">
|
|
||||||
{t("dnsHome:links-applications-title")}
|
{t("dnsHome:links-applications-title")}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
<p className="govuk-body-s govuk-!-padding-top-2">
|
<p className="govuk-body-s govuk-!-padding-top-2">
|
||||||
{t(
|
{t(
|
||||||
@@ -43,10 +43,12 @@ const DNSLinks = (props) => {
|
|||||||
<ul className="govuk-list">
|
<ul className="govuk-list">
|
||||||
<li>
|
<li>
|
||||||
<h3 className="govuk-heading-l govuk-!-font-size-27">
|
<h3 className="govuk-heading-l govuk-!-font-size-27">
|
||||||
<Link href="https://gov.wales/developments-national-significance-dns-guidance">
|
<Link
|
||||||
<a className="govuk-link govuk-link--no-underline ">
|
href="https://gov.wales/developments-national-significance-dns-guidance"
|
||||||
{t("dnsHome:links-help-title")}
|
className="govuk-link govuk-link--no-underline ">
|
||||||
</a>
|
|
||||||
|
{t("dnsHome:links-help-title")}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
<p className="govuk-body-s govuk-!-padding-top-2">
|
<p className="govuk-body-s govuk-!-padding-top-2">
|
||||||
{t("dnsHome:links-guidance-intro-paragraph")}
|
{t("dnsHome:links-guidance-intro-paragraph")}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import useTranslation from "next-translate/useTranslation";
|
|||||||
|
|
||||||
const LatestApplications = (props) => {
|
const LatestApplications = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
const { dnsList } = props;
|
let { dnsList } = props;
|
||||||
|
|
||||||
dnsList = dnsList.value;
|
dnsList = dnsList.value;
|
||||||
let dnsListArr = dnsList.slice(0, 3);
|
let dnsListArr = dnsList.slice(0, 3);
|
||||||
@@ -33,7 +33,7 @@ const LatestApplications = (props) => {
|
|||||||
.join("-"))
|
.join("-"))
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<a>{dnsList[key].title}</a>
|
{dnsList[key].title}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ const TitleContent = (props) => {
|
|||||||
? value.split(" - ")[1].split(" ").join("-")
|
? value.split(" - ")[1].split(" ").join("-")
|
||||||
: value)
|
: value)
|
||||||
}
|
}
|
||||||
>
|
className="govuk-button govuk-!-margin-bottom-0 ">
|
||||||
<a className="govuk-button govuk-!-margin-bottom-0 ">
|
|
||||||
{t("dnsHome:title-application-search-button")}
|
{t("dnsHome:title-application-search-button")}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+116
-165
@@ -1,8 +1,6 @@
|
|||||||
import useSWR from "swr";
|
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
|
import DatePicker, { registerLocale, setDefaultLocale } from "react-datepicker";
|
||||||
import cy from "date-fns/locale/cy";
|
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import "react-datepicker/dist/react-datepicker.css";
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
@@ -22,6 +20,12 @@ import {
|
|||||||
import { setFilesForAppeal } from "../../store/appealType/action";
|
import { setFilesForAppeal } from "../../store/appealType/action";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getThumbnailIconByExtension,
|
||||||
|
bytesToSize,
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addYears,
|
addYears,
|
||||||
addMonths,
|
addMonths,
|
||||||
@@ -289,7 +293,6 @@ const RenderDatePicker = ({
|
|||||||
...custom
|
...custom
|
||||||
}) => {
|
}) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
registerLocale("cy", cy);
|
|
||||||
|
|
||||||
var startDateArr =
|
var startDateArr =
|
||||||
custom.dateStart != "0" ? custom.dateStart.split("") : custom.dateStart;
|
custom.dateStart != "0" ? custom.dateStart.split("") : custom.dateStart;
|
||||||
@@ -1312,13 +1315,6 @@ const RenderFileUpload = (field) => {
|
|||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
|
|
||||||
function bytesToSize(bytes) {
|
|
||||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
||||||
if (bytes == 0) return "0 Byte";
|
|
||||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
|
||||||
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
const getThumbnailIcon = (fileObj, fileType) => {
|
const getThumbnailIcon = (fileObj, fileType) => {
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
case "text/html":
|
case "text/html":
|
||||||
@@ -1356,47 +1352,6 @@ const RenderFileUpload = (field) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getThumbnailIconByExtension = (blobName) => {
|
|
||||||
let fileType = blobName.slice(blobName.lastIndexOf(".") + 1);
|
|
||||||
|
|
||||||
switch (fileType) {
|
|
||||||
case "html":
|
|
||||||
return "/assets/images/documenttypes/html.png";
|
|
||||||
break;
|
|
||||||
case "txt":
|
|
||||||
return "/assets/images/documenttypes/txt.png";
|
|
||||||
break;
|
|
||||||
case "doc":
|
|
||||||
return "/assets/images/documenttypes/doc.png";
|
|
||||||
break;
|
|
||||||
case "pdf":
|
|
||||||
return "/assets/images/documenttypes/pdf.png";
|
|
||||||
break;
|
|
||||||
case "docx":
|
|
||||||
return "/assets/images/documenttypes/docx.png";
|
|
||||||
break;
|
|
||||||
case "csv":
|
|
||||||
return "/assets/images/documenttypes/csv.png";
|
|
||||||
break;
|
|
||||||
case "xlsx":
|
|
||||||
return "/assets/images/documenttypes/xlsx.png";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "zip":
|
|
||||||
return "/assets/images/documenttypes/zip.png";
|
|
||||||
break;
|
|
||||||
case "jpeg":
|
|
||||||
case "jpg":
|
|
||||||
return "/assets/images/documenttypes/jpg.png";
|
|
||||||
case "png":
|
|
||||||
return "/assets/images/documenttypes/png.png";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return "/assets/images/documenttypes/txt.png";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getDocumentType = (docCode) => {
|
const getDocumentType = (docCode) => {
|
||||||
switch (docCode) {
|
switch (docCode) {
|
||||||
case "000001":
|
case "000001":
|
||||||
@@ -1476,125 +1431,121 @@ const RenderFileUpload = (field) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
<Dropzone
|
||||||
<Dropzone
|
accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/tiff,image/jpeg,application/zip"
|
||||||
accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/tiff,image/jpeg,application/zip"
|
onDrop={(filesToUpload, e) => {
|
||||||
onDrop={(filesToUpload, e) => {
|
const renamedAcceptedFiles = filesToUpload.map(
|
||||||
const renamedAcceptedFiles = filesToUpload.map(
|
(file) =>
|
||||||
(file) =>
|
new File(
|
||||||
new File(
|
[file],
|
||||||
[file],
|
`${getDocumentType(field.documentTypeCode)}_${
|
||||||
`${getDocumentType(field.documentTypeCode)}_${
|
file.name
|
||||||
file.name
|
}`,
|
||||||
}`,
|
{
|
||||||
{
|
type: file.type,
|
||||||
type: file.type,
|
}
|
||||||
}
|
)
|
||||||
)
|
);
|
||||||
);
|
field.input.onChange(renamedAcceptedFiles);
|
||||||
field.input.onChange(renamedAcceptedFiles);
|
}}
|
||||||
}}
|
>
|
||||||
>
|
{({ getRootProps, getInputProps }) => (
|
||||||
{({ getRootProps, getInputProps }) => (
|
<>
|
||||||
<>
|
{/* {field.hint != false && (
|
||||||
{/* {field.hint != false && (
|
<div className="govuk-hint">ss{t(field.hint)}</div>
|
||||||
<div className="govuk-hint">ss{t(field.hint)}</div>
|
)}
|
||||||
)}
|
<div className="govuk-form-group"></div> */}
|
||||||
<div className="govuk-form-group"></div> */}
|
<section className="container">
|
||||||
<section className="container">
|
<div {...getRootProps({ style })}>
|
||||||
<div {...getRootProps({ style })}>
|
{" "}
|
||||||
{" "}
|
<input id={field.id} {...getInputProps()} />
|
||||||
<input id={field.id} {...getInputProps()} />
|
<div>
|
||||||
<div>
|
{t(
|
||||||
{t(
|
"newappeal:new-appeal-fileupload-drop-label"
|
||||||
"newappeal:new-appeal-fileupload-drop-label"
|
)}
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<em>
|
|
||||||
(
|
|
||||||
{t(
|
|
||||||
"newappeal:new-appeal-fileupload-file-list-label"
|
|
||||||
)}
|
|
||||||
)
|
|
||||||
</em>
|
|
||||||
</div>
|
</div>
|
||||||
<aside>{thumbs}</aside>
|
<em>
|
||||||
</section>
|
(
|
||||||
</>
|
{t(
|
||||||
)}
|
"newappeal:new-appeal-fileupload-file-list-label"
|
||||||
</Dropzone>
|
)}
|
||||||
{field.meta.touched && field.meta.error && (
|
)
|
||||||
<span className="error">{field.meta.error}</span>
|
</em>
|
||||||
)}
|
|
||||||
{files && Array.isArray(files) && (
|
|
||||||
<ul>
|
|
||||||
{files.map((file, i) => (
|
|
||||||
<div
|
|
||||||
key={file.name}
|
|
||||||
className="govuk-!-margin-bottom-5 fileThumb"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src={getThumbnailIcon(file, file.type)}
|
|
||||||
alt={file.name}
|
|
||||||
width="50"
|
|
||||||
/>
|
|
||||||
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
|
||||||
{file.name.slice(file.name.indexOf("_") + 1)} (
|
|
||||||
({bytesToSize(file.size)})
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
))}
|
<aside>{thumbs}</aside>
|
||||||
</ul>
|
</section>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
{blobList.map((blob, i) => (
|
</Dropzone>
|
||||||
<div
|
{field.meta.touched && field.meta.error && (
|
||||||
key={blob.name + "_" + i}
|
<span className="error">{field.meta.error}</span>
|
||||||
className="govuk-!-margin-bottom-5 fileThumb govuk-!-margin-top-5"
|
)}
|
||||||
>
|
{files && Array.isArray(files) && (
|
||||||
<div className="">
|
<ul>
|
||||||
<span
|
{files.map((file, i) => (
|
||||||
className="govuk-summary-list__actionLink watched_link govuk-!-margin-right-5 govuk-!-text-align-left"
|
<div
|
||||||
onClick={() => {
|
key={file.name}
|
||||||
deleteThisBlob(
|
className="govuk-!-margin-bottom-5 fileThumb"
|
||||||
field.containerID,
|
>
|
||||||
blob.name,
|
<img
|
||||||
blob.hasheddeletepath,
|
src={getThumbnailIcon(file, file.type)}
|
||||||
blob.hashgetblobs,
|
alt={file.name}
|
||||||
field.ticketnumber
|
width="50"
|
||||||
);
|
/>
|
||||||
}}
|
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||||
title="Remove this file"
|
{/* {file.name.slice(file.name.indexOf("_") + 1)} ( */}{" "}
|
||||||
>
|
{file.name}( ({bytesToSize(file.size)})
|
||||||
−
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<img
|
))}
|
||||||
src={getThumbnailIconByExtension(blob.name)}
|
</ul>
|
||||||
alt={blob.name}
|
)}
|
||||||
width="50"
|
{blobList.map((blob, i) => (
|
||||||
/>
|
<div
|
||||||
|
key={blob.name + "_" + i}
|
||||||
<Link
|
className="govuk-!-margin-bottom-5 fileThumb govuk-!-margin-top-5"
|
||||||
key={i}
|
>
|
||||||
scroll={false}
|
<div className="">
|
||||||
href={
|
<span
|
||||||
"/api/file/downloadblob?container=" +
|
className="govuk-summary-list__actionLink watched_link govuk-!-margin-right-5 govuk-!-text-align-left"
|
||||||
field.containerID +
|
onClick={() => {
|
||||||
"&casefolderID=" +
|
deleteThisBlob(
|
||||||
field.ticketnumber +
|
field.containerID,
|
||||||
"&blobname=" +
|
blob.name,
|
||||||
blob.name +
|
blob.hasheddeletepath,
|
||||||
blob.hashedfilepath
|
blob.hashgetblobs,
|
||||||
}
|
field.ticketnumber
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
title="Remove this file"
|
||||||
>
|
>
|
||||||
<a className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link">
|
−
|
||||||
{blob.name.slice(blob.name.indexOf("_") + 1)} (
|
</span>
|
||||||
{bytesToSize(blob.contentLength)})
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
))}{" "}
|
<img
|
||||||
</>
|
src={getThumbnailIconByExtension(blob.name)}
|
||||||
);
|
alt={blob.name}
|
||||||
|
width="50"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
key={i}
|
||||||
|
scroll={false}
|
||||||
|
href={
|
||||||
|
"/api/file/downloadblob?container=" +
|
||||||
|
field.containerID +
|
||||||
|
"&casefolderID=" +
|
||||||
|
field.ticketnumber +
|
||||||
|
"&blobname=" +
|
||||||
|
blob.name +
|
||||||
|
blob.hashedfilepath
|
||||||
|
}
|
||||||
|
className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5 govuk-link">
|
||||||
|
|
||||||
|
{blob.name.slice(blob.name.indexOf("_") + 1)}({bytesToSize(blob.contentLength)})
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
))}{" "}
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,15 +35,15 @@ const Errorpage = () => {
|
|||||||
Unfortunately something has gone wrong!
|
Unfortunately something has gone wrong!
|
||||||
</p>
|
</p>
|
||||||
<p className="govuk-body govuk-!-margin-top-9">{dateString}</p>
|
<p className="govuk-body govuk-!-margin-top-9">{dateString}</p>
|
||||||
<Link href="/">
|
<Link
|
||||||
<a
|
href="/"
|
||||||
role="button"
|
role="button"
|
||||||
draggable="false"
|
draggable="false"
|
||||||
className="govuk-button govuk-button--start govuk-!-margin-top-2 govuk-!-margin-bottom-8"
|
className="govuk-button govuk-button--start govuk-!-margin-top-2 govuk-!-margin-bottom-8"
|
||||||
data-module="govuk-button"
|
data-module="govuk-button">
|
||||||
>
|
|
||||||
Try again
|
Try again
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+223
-233
@@ -13,8 +13,8 @@ export default function Footer(props) {
|
|||||||
|
|
||||||
const linksBlock = Object.keys(linksArr).map((key) => (
|
const linksBlock = Object.keys(linksArr).map((key) => (
|
||||||
<li className="govuk-footer__inline-list-item" key={key}>
|
<li className="govuk-footer__inline-list-item" key={key}>
|
||||||
<Link href={linksArr[key].path || "/"}>
|
<Link href={linksArr[key].path || "/"} className="govuk-footer__link">
|
||||||
<a className="govuk-footer__link">{linksArr[key].title}</a>
|
{linksArr[key].title}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
));
|
));
|
||||||
@@ -34,257 +34,247 @@ export default function Footer(props) {
|
|||||||
" " +
|
" " +
|
||||||
t("common:gov-wales-label").toLowerCase();
|
t("common:gov-wales-label").toLowerCase();
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
<div className="sharebar" id="sharebar">
|
||||||
<div className="sharebar" id="sharebar">
|
<div className="sharebar__components container-fluid">
|
||||||
<div className="sharebar__components container-fluid">
|
<div className="main__sharebar">
|
||||||
<div className="main__sharebar">
|
<div
|
||||||
<div
|
className={
|
||||||
|
showShareState
|
||||||
|
? "block-share active"
|
||||||
|
: "block-share"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
id="sharePage"
|
||||||
|
aria-controls="sharePageLinks"
|
||||||
|
aria-expanded="true"
|
||||||
|
onClick={() => {
|
||||||
|
shareState();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("common:social-bar-share-link")}
|
||||||
|
</button>
|
||||||
|
<ul
|
||||||
className={
|
className={
|
||||||
showShareState
|
showShareState
|
||||||
? "block-share active"
|
? "block-share active"
|
||||||
: "block-share"
|
: "block-share"
|
||||||
}
|
}
|
||||||
|
id="sharePageLinks"
|
||||||
|
aria-labelledby="sharePage"
|
||||||
>
|
>
|
||||||
<button
|
<li>
|
||||||
id="sharePage"
|
<a
|
||||||
aria-controls="sharePageLinks"
|
href={
|
||||||
aria-expanded="true"
|
"https://twitter.com/intent/tweet?url=" +
|
||||||
onClick={() => {
|
shareBodyStr
|
||||||
shareState();
|
}
|
||||||
}}
|
className="twitter"
|
||||||
>
|
>
|
||||||
{t("common:social-bar-share-link")}
|
<span className="vo_hidden">
|
||||||
</button>
|
{t(
|
||||||
<ul
|
"common:social-bar-share-via-link"
|
||||||
className={
|
)}{" "}
|
||||||
showShareState
|
</span>
|
||||||
? "block-share active"
|
Twitter
|
||||||
: "block-share"
|
</a>
|
||||||
}
|
</li>
|
||||||
id="sharePageLinks"
|
<li>
|
||||||
aria-labelledby="sharePage"
|
<a
|
||||||
>
|
href={
|
||||||
<li>
|
"https://www.facebook.com/sharer/sharer.php?u=" +
|
||||||
|
shareBodyStr
|
||||||
|
}
|
||||||
|
className="facebook"
|
||||||
|
>
|
||||||
|
<span className="vo_hidden">
|
||||||
|
Share this page via{" "}
|
||||||
|
</span>
|
||||||
|
Facebook
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href={
|
||||||
|
"mailto:?body=" +
|
||||||
|
shareBodyStr +
|
||||||
|
"&subject=" +
|
||||||
|
shareSubjectStr
|
||||||
|
} //</li>https%3A//gov.wales/&subject=Shared%20from%20gov.wales"
|
||||||
|
className="email"
|
||||||
|
>
|
||||||
|
<span className="vo_hidden">
|
||||||
|
Share this page via{" "}
|
||||||
|
</span>
|
||||||
|
Email
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="sharebar__backtotop"
|
||||||
|
className="btn--outlined btn--arrow-up"
|
||||||
|
>
|
||||||
|
<a href="#page_wrapper">
|
||||||
|
{t("common:back-to-top-link")}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<footer className="govuk-footer " role="contentinfo">
|
||||||
|
<div className="govuk-width-container ">
|
||||||
|
<div className="govuk-footer__meta">
|
||||||
|
<div className="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
||||||
|
<h2 className="govuk-visually-hidden">
|
||||||
|
Support links
|
||||||
|
</h2>
|
||||||
|
<nav
|
||||||
|
role="navigation"
|
||||||
|
aria-labelledby="footer_links"
|
||||||
|
>
|
||||||
|
<ul className="govuk-footer__inline-list">
|
||||||
|
<li className="govuk-footer__inline-list-item govuk-!-font-weight-bold govuk-!-margin-right-7">
|
||||||
<a
|
<a
|
||||||
href={
|
href={t(
|
||||||
"https://twitter.com/intent/tweet?url=" +
|
"common:footer-guidance-link"
|
||||||
shareBodyStr
|
)}
|
||||||
}
|
className="nav-link"
|
||||||
className="twitter"
|
|
||||||
>
|
>
|
||||||
<span className="vo_hidden">
|
{t(
|
||||||
{t(
|
"common:footer-guidance-link-label"
|
||||||
"common:social-bar-share-via-link"
|
)}
|
||||||
)}{" "}
|
|
||||||
</span>
|
|
||||||
Twitter
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li className="govuk-footer__inline-list-item govuk-!-font-weight-bold">
|
||||||
<a
|
<a
|
||||||
href={
|
href={t(
|
||||||
"https://www.facebook.com/sharer/sharer.php?u=" +
|
"common:footer-contact-us-link"
|
||||||
shareBodyStr
|
)}
|
||||||
}
|
className="govuk-footer__link"
|
||||||
className="facebook"
|
id="aContactUs"
|
||||||
>
|
>
|
||||||
<span className="vo_hidden">
|
{t(
|
||||||
Share this page via{" "}
|
"common:footer-contact-us-link-label"
|
||||||
</span>
|
)}
|
||||||
Facebook
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href={
|
|
||||||
"mailto:?body=" +
|
|
||||||
shareBodyStr +
|
|
||||||
"&subject=" +
|
|
||||||
shareSubjectStr
|
|
||||||
} //</li>https%3A//gov.wales/&subject=Shared%20from%20gov.wales"
|
|
||||||
className="email"
|
|
||||||
>
|
|
||||||
<span className="vo_hidden">
|
|
||||||
Share this page via{" "}
|
|
||||||
</span>
|
|
||||||
Email
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
<ul
|
||||||
|
className="govuk-footer__inline-list"
|
||||||
|
id="footer_links"
|
||||||
|
>
|
||||||
|
<li className="govuk-footer__inline-list-item">
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/hygyrchedd"
|
||||||
|
: "/accessibility"
|
||||||
|
}
|
||||||
|
className="govuk-footer__link"
|
||||||
|
id="aAccessibility">
|
||||||
|
|
||||||
|
{t(
|
||||||
|
"common:footer-accessibility-link-label"
|
||||||
|
)}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li className="govuk-footer__inline-list-item">
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/help/cwcis"
|
||||||
|
: "/help/cookies"
|
||||||
|
}
|
||||||
|
id="aCookies"
|
||||||
|
className="govuk-footer__link">
|
||||||
|
|
||||||
|
{t(
|
||||||
|
"common:footer-cookies-link"
|
||||||
|
)}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
<li className="govuk-footer__inline-list-item">
|
||||||
|
<a
|
||||||
|
href={t(
|
||||||
|
"common:footer-copyright-link"
|
||||||
|
)}
|
||||||
|
className="govuk-footer__link"
|
||||||
|
id="Access"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"common:footer-copyright-link-label"
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li className="govuk-footer__inline-list-item">
|
||||||
|
<Link
|
||||||
|
href={t(
|
||||||
|
"common:footer-privacy-link"
|
||||||
|
)}
|
||||||
|
id="aPrivacy"
|
||||||
|
className="govuk-footer__link">
|
||||||
|
|
||||||
|
{t(
|
||||||
|
"common:footer-privacy-link-label"
|
||||||
|
)}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li className="govuk-footer__inline-list-item">
|
||||||
|
<Link
|
||||||
|
href={t(
|
||||||
|
"common:footer-terms-conditions-link"
|
||||||
|
)}
|
||||||
|
id="aTermsConds"
|
||||||
|
className="govuk-footer__link">
|
||||||
|
|
||||||
|
{t(
|
||||||
|
"common:footer-terms-conditions-link-label"
|
||||||
|
)}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
{/* <li className="govuk-footer__inline-list-item">
|
||||||
|
<a
|
||||||
|
href={t(
|
||||||
|
"common:footer-alternative-languages-link"
|
||||||
|
)}
|
||||||
|
id="aTermsConds"
|
||||||
|
className="govuk-footer__link"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"common:footer-alternative-languages-link-label"
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
</li> */}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
<div
|
<div
|
||||||
id="sharebar__backtotop"
|
className="footer_logo container-fluid"
|
||||||
className="btn--outlined btn--arrow-up"
|
id="footer_logo"
|
||||||
>
|
>
|
||||||
<a href="#page_wrapper">
|
<a
|
||||||
{t("common:back-to-top-link")}
|
href={t("common:gov-wales-link")}
|
||||||
|
className="footer__logo"
|
||||||
|
id="footerlogo"
|
||||||
|
>
|
||||||
|
<span className="visually-hidden">
|
||||||
|
{t("common:gov-wales-label")}
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer className="govuk-footer " role="contentinfo">
|
</footer>
|
||||||
<div className="govuk-width-container ">
|
</>;
|
||||||
<div className="govuk-footer__meta">
|
|
||||||
<div className="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
|
||||||
<h2 className="govuk-visually-hidden">
|
|
||||||
Support links
|
|
||||||
</h2>
|
|
||||||
<nav
|
|
||||||
role="navigation"
|
|
||||||
aria-labelledby="footer_links"
|
|
||||||
>
|
|
||||||
<ul className="govuk-footer__inline-list">
|
|
||||||
<li className="govuk-footer__inline-list-item govuk-!-font-weight-bold govuk-!-margin-right-7">
|
|
||||||
<a
|
|
||||||
href={t(
|
|
||||||
"common:footer-guidance-link"
|
|
||||||
)}
|
|
||||||
className="nav-link"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-guidance-link-label"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li className="govuk-footer__inline-list-item govuk-!-font-weight-bold">
|
|
||||||
<a
|
|
||||||
href={t(
|
|
||||||
"common:footer-contact-us-link"
|
|
||||||
)}
|
|
||||||
className="govuk-footer__link"
|
|
||||||
id="aContactUs"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-contact-us-link-label"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul
|
|
||||||
className="govuk-footer__inline-list"
|
|
||||||
id="footer_links"
|
|
||||||
>
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/hygyrchedd"
|
|
||||||
: "/accessibility"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
className="govuk-footer__link"
|
|
||||||
id="aAccessibility"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-accessibility-link-label"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/help/cwcis"
|
|
||||||
: "/help/cookies"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
id="aCookies"
|
|
||||||
className="govuk-footer__link"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-cookies-link"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
|
||||||
<a
|
|
||||||
href={t(
|
|
||||||
"common:footer-copyright-link"
|
|
||||||
)}
|
|
||||||
className="govuk-footer__link"
|
|
||||||
id="Access"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-copyright-link-label"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
|
||||||
<Link
|
|
||||||
href={t(
|
|
||||||
"common:footer-privacy-link"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
id="aPrivacy"
|
|
||||||
className="govuk-footer__link"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-privacy-link-label"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li className="govuk-footer__inline-list-item">
|
|
||||||
<Link
|
|
||||||
href={t(
|
|
||||||
"common:footer-terms-conditions-link"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
id="aTermsConds"
|
|
||||||
className="govuk-footer__link"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-terms-conditions-link-label"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
{/* <li className="govuk-footer__inline-list-item">
|
|
||||||
<a
|
|
||||||
href={t(
|
|
||||||
"common:footer-alternative-languages-link"
|
|
||||||
)}
|
|
||||||
id="aTermsConds"
|
|
||||||
className="govuk-footer__link"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
{t(
|
|
||||||
"common:footer-alternative-languages-link-label"
|
|
||||||
)}
|
|
||||||
</a>
|
|
||||||
</li> */}
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
<div
|
|
||||||
className="footer_logo container-fluid"
|
|
||||||
id="footer_logo"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href={t("common:gov-wales-link")}
|
|
||||||
className="footer__logo"
|
|
||||||
id="footerlogo"
|
|
||||||
>
|
|
||||||
<span className="visually-hidden">
|
|
||||||
{t("common:gov-wales-label")}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
+62
-44
@@ -56,6 +56,16 @@ const Header = (props) => {
|
|||||||
domainSwitch = process.env.I18N_DOMAIN;
|
domainSwitch = process.env.I18N_DOMAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleLogout = () => {
|
||||||
|
console.info("////////////\n" + "logout" + "\n////////////");
|
||||||
|
window.localStorage.clear(),
|
||||||
|
destroyCookie(null, "next-auth.csrf-token"),
|
||||||
|
destroyCookie(null, "next-auth.callback-url"),
|
||||||
|
destroyCookie(null, "pedw_locale"),
|
||||||
|
destroyCookie(null, "pinsUser"),
|
||||||
|
signOut({ callbackUrl: "/logout" });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header
|
<header
|
||||||
className="govuk-header "
|
className="govuk-header "
|
||||||
@@ -64,15 +74,17 @@ const Header = (props) => {
|
|||||||
>
|
>
|
||||||
<div className="govuk-header__container govuk-width-container">
|
<div className="govuk-header__container govuk-width-container">
|
||||||
<div className="govuk-header__logo govuk-!-width-one-quarter">
|
<div className="govuk-header__logo govuk-!-width-one-quarter">
|
||||||
<Link href={t("common:gov-wales-link")}>
|
<Link
|
||||||
<a className="govuk-header__link govuk-link--no-underline govuk-header__link--homepage">
|
href={t("common:gov-wales-link")}
|
||||||
<span className="govuk-header__logotype header__logo">
|
className="govuk-header__link govuk-link--no-underline govuk-header__link--homepage">
|
||||||
<img
|
|
||||||
alt="gov.wales"
|
<span className="govuk-header__logotype header__logo">
|
||||||
src="/assets/images/cymru.svg"
|
<img
|
||||||
/>
|
alt="gov.wales"
|
||||||
</span>
|
src="/assets/images/cymru.svg"
|
||||||
</a>
|
/>
|
||||||
|
</span>
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -199,10 +211,12 @@ const Header = (props) => {
|
|||||||
</div> */}
|
</div> */}
|
||||||
<div className="fullNavs">
|
<div className="fullNavs">
|
||||||
{hasContactLink.includes(router.pathname) == true ? (
|
{hasContactLink.includes(router.pathname) == true ? (
|
||||||
<Link href="/dns/contact-us">
|
<Link
|
||||||
<a className="govuk-header__link govuk-!-margin-right-3">
|
href="/dns/contact-us"
|
||||||
|
className="govuk-header__link govuk-!-margin-right-3">
|
||||||
|
|
||||||
Contact
|
Contact
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
@@ -210,24 +224,20 @@ const Header = (props) => {
|
|||||||
{noSignoutLink.includes(router.pathname) == true ? (
|
{noSignoutLink.includes(router.pathname) == true ? (
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
<Link
|
(<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? "/allgofnodi"
|
? "/allgofnodi"
|
||||||
: "/logout"
|
: "/logout"
|
||||||
}
|
}
|
||||||
>
|
onClick={() => {
|
||||||
<a
|
handleLogout();
|
||||||
onClick={() => {
|
}}
|
||||||
window.localStorage.clear(),
|
className="govuk-header__link govuk-!-margin-right-3">
|
||||||
destroyCookie({}, "pinsUser"),
|
|
||||||
signOut({ callbackUrl: "/logout" });
|
{t("common:signout-label")}
|
||||||
}}
|
|
||||||
className="govuk-header__link govuk-!-margin-right-3"
|
</Link>)
|
||||||
>
|
|
||||||
{t("common:signout-label")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
@@ -257,25 +267,33 @@ const Header = (props) => {
|
|||||||
: router.asPath
|
: router.asPath
|
||||||
}
|
}
|
||||||
locale={locale == "en" ? "cy" : "en"}
|
locale={locale == "en" ? "cy" : "en"}
|
||||||
>
|
className="govuk-header__link "
|
||||||
<a
|
lang={locale == "en" ? "cy" : "en"}
|
||||||
className="govuk-header__link "
|
hrefLang={locale == "en" ? "cy" : "en"}
|
||||||
lang={locale == "en" ? "cy" : "en"}
|
data-journey-click={
|
||||||
hrefLang={locale == "en" ? "cy" : "en"}
|
locale == "en"
|
||||||
data-journey-click={
|
? "link - click:lang-select:Cymraeg"
|
||||||
locale == "en"
|
: "link - click:lang-select:English"
|
||||||
? "link - click:lang-select:Cymraeg"
|
}
|
||||||
: "link - click:lang-select:English"
|
aria-label={
|
||||||
}
|
locale == "en"
|
||||||
aria-label={
|
? "Dewiswch Cymraeg"
|
||||||
locale == "en"
|
: "Select English"
|
||||||
? "Dewiswch Cymraeg"
|
}
|
||||||
: "Select English"
|
onClick={() => {
|
||||||
}
|
setCookie(
|
||||||
>
|
null,
|
||||||
{" "}
|
"pedw_locale",
|
||||||
{t("common:available-in")}
|
locale == "en" ? "cy" : "en",
|
||||||
</a>
|
{
|
||||||
|
path: "/",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{" "}
|
||||||
|
{t("common:available-in")}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -95,69 +94,62 @@ let CaseSearch = (props) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
<div className="card" id="casesearch-card">
|
||||||
<div className="card" id="casesearch-card">
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<div className="card-body">
|
||||||
<div className="card-body">
|
<h3 className="heading-small card-heading">
|
||||||
<h3 className="heading-small card-heading">
|
{t("home:casesearch-card-title")}
|
||||||
{t("home:casesearch-card-title")}
|
</h3>
|
||||||
</h3>
|
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
validate={[
|
validate={[
|
||||||
required(
|
required(
|
||||||
t(
|
t(
|
||||||
"home:casesearch-search-validation-required"
|
"home:casesearch-search-validation-required"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
minLength(
|
minLength(
|
||||||
t(
|
t(
|
||||||
"home:casesearch-search-validation-minlength"
|
"home:casesearch-search-validation-minlength"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]}
|
]}
|
||||||
className="govuk-input"
|
className="govuk-input"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
id="basicSearch"
|
id="basicSearch"
|
||||||
name="basicSearch"
|
name="basicSearch"
|
||||||
type="text"
|
type="text"
|
||||||
aria-describedby="basicSearch-hint"
|
aria-describedby="basicSearch-hint"
|
||||||
hint1={t("home:casesearch-card-search-hint")}
|
hint1={t("home:casesearch-card-search-hint")}
|
||||||
hint2={t(
|
hint2={t(
|
||||||
"home:casesearch-card-search-example-label-1"
|
"home:casesearch-card-search-example-label-1"
|
||||||
)}
|
)}
|
||||||
hint3={t(
|
hint3={t(
|
||||||
"home:casesearch-card-search-example-label-2"
|
"home:casesearch-card-search-example-label-2"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<button type="submit" className="govuk-button">
|
<button type="submit" className="govuk-button">
|
||||||
{t("home:casesearch-card-button")}
|
{t("home:casesearch-card-button")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/chwiliouwch"
|
|
||||||
: "/advancedsearch"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<a className="govuk-link--no-underline">
|
|
||||||
{t("home:casesearch-card-advanced-link")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<Link
|
||||||
{/* <LoadingOverlay
|
href={
|
||||||
active={showSpinnerState}
|
router.locale == "cy"
|
||||||
spinner
|
? "/chwiliouwch"
|
||||||
text={t("common:spinner-searching")}
|
: "/advancedsearch"
|
||||||
/> */}
|
}
|
||||||
</div>
|
className="govuk-link--no-underline">
|
||||||
</>
|
|
||||||
);
|
{t("home:casesearch-card-advanced-link")}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import Link from "next/link";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
|
|
||||||
export default function Dns() {
|
export default function Dns() {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -34,23 +33,16 @@ export default function Dns() {
|
|||||||
? "/ceisiadaudns"
|
? "/ceisiadaudns"
|
||||||
: "/dnsapplications"
|
: "/dnsapplications"
|
||||||
}
|
}
|
||||||
>
|
// onClick={() => {
|
||||||
<a
|
// spinnerState();
|
||||||
className="govuk-button withChevron govuk-button-cta"
|
// }}
|
||||||
// onClick={() => {
|
className="govuk-button withChevron govuk-button-cta">
|
||||||
// spinnerState();
|
|
||||||
// }}
|
{t("home:dns-card-button")}
|
||||||
>
|
|
||||||
{t("home:dns-card-button")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-loading")}
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default function Inspectorate() {
|
|||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("home:inspectorate-card-visit-label")}:{" "}
|
{t("home:inspectorate-card-visit-label")}:{" "}
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<a>{t("home:inspectorate-card-visit-link")}</a>
|
{t("home:inspectorate-card-visit-link")}
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import { getLogin } from "../../actions";
|
import { getLogin } from "../../actions";
|
||||||
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
||||||
import { parseCookies, setCookie, destroyCookie } from "nookies";
|
import { parseCookies, setCookie, destroyCookie } from "nookies";
|
||||||
@@ -184,6 +184,16 @@ let Login = (props) => {
|
|||||||
</button>
|
</button>
|
||||||
</>;
|
</>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const signInButton = () => {
|
||||||
|
router.push(
|
||||||
|
`${
|
||||||
|
router.locale == "cy" ? "/awd/mewngofnodi" : "/auth/signin"
|
||||||
|
}?callbackUrl=${encodeURIComponent(
|
||||||
|
window.location.href
|
||||||
|
)}&error=EmailSignin`
|
||||||
|
);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="card" id="login-card">
|
<div className="card" id="login-card">
|
||||||
@@ -197,14 +207,19 @@ let Login = (props) => {
|
|||||||
{session && "Signed in as " + session.user?.email}
|
{session && "Signed in as " + session.user?.email}
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
{!session && (
|
{!session && (
|
||||||
<button
|
<button
|
||||||
className="govuk-button withChevron govuk-button-cta"
|
className="govuk-button withChevron govuk-button-cta"
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={
|
||||||
signIn("email", {
|
() => signInButton()
|
||||||
callbackUrl: "/",
|
// signIn("email", {
|
||||||
})
|
// callbackUrl:
|
||||||
|
// (router.locale != "en"
|
||||||
|
// ? "/cy"
|
||||||
|
// : "") + "/",
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t("home:login-via-nextuth-label")}
|
{t("home:login-via-nextuth-label")}
|
||||||
@@ -371,12 +386,6 @@ let Login = (props) => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text="Logging in"
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
+2
-2
@@ -12,7 +12,7 @@ import Dns from "./homepage/dns";
|
|||||||
const MainHome = (props) => {
|
const MainHome = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const { showLogin, session } = props;
|
const { showLogin, session, siteurl } = props;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ const MainHome = (props) => {
|
|||||||
{showLogin == "true" && (
|
{showLogin == "true" && (
|
||||||
<>
|
<>
|
||||||
<CaseSearch />
|
<CaseSearch />
|
||||||
<Login session={session} />
|
<Login session={session} siteurl={siteurl} />
|
||||||
</>
|
</>
|
||||||
)}{" "}
|
)}{" "}
|
||||||
<CaseComment />
|
<CaseComment />
|
||||||
|
|||||||
+139
-113
@@ -25,126 +25,152 @@ const MyPortal = (props) => {
|
|||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
console.info("////////////\n" + "logout" + "\n////////////");
|
console.info("////////////\n" + "logout" + "\n////////////");
|
||||||
window.localStorage.clear(),
|
window.localStorage.clear(),
|
||||||
destroyCookie({}, "pinsUser"),
|
destroyCookie(null, "next-auth.csrf-token"),
|
||||||
|
destroyCookie(null, "next-auth.callback-url"),
|
||||||
|
destroyCookie(null, "pedw_locale"),
|
||||||
|
destroyCookie(null, "pinsUser"),
|
||||||
signOut({ callbackUrl: "/logout" });
|
signOut({ callbackUrl: "/logout" });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
const isLPA =
|
||||||
<>
|
props.accountDetails.accountDetails[
|
||||||
<main className="" id="main-content" role="main">
|
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||||
<div className="servicebanner myportal govuk-!-margin-bottom-4">
|
] == "LPA"
|
||||||
<h1>
|
? true
|
||||||
<img
|
: false;
|
||||||
src={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/assets/images/planning-casework-cy.svg"
|
|
||||||
: "/assets/images/planning-casework-en.svg"
|
|
||||||
}
|
|
||||||
alt={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "Fy mhorth"
|
|
||||||
: "My Portal"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<div className="serviceBanner_userDetails">
|
return <>
|
||||||
<img
|
<main className="" id="main-content" role="main">
|
||||||
className="user_logo"
|
<div className="servicebanner myportal govuk-!-margin-bottom-4">
|
||||||
src="/assets/images/user.svg"
|
<h1>
|
||||||
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
|
<img
|
||||||
/>{" "}
|
src={
|
||||||
<div className="serviceBanner_userDetails_name">
|
router.locale == "cy"
|
||||||
<Link href="/account/personaldetails">
|
? "/assets/images/planning-casework-cy.svg"
|
||||||
<a className="govuk-button-secondary">
|
: "/assets/images/planning-casework-en.svg"
|
||||||
{
|
}
|
||||||
props.accountDetails.accountDetails
|
alt={
|
||||||
.firstname
|
router.locale == "cy"
|
||||||
}{" "}
|
? "Fy mhorth"
|
||||||
{
|
: "My Portal"
|
||||||
props.accountDetails.accountDetails
|
}
|
||||||
.lastname
|
/>
|
||||||
}
|
</h1>
|
||||||
{" - "}
|
|
||||||
{
|
<div className="serviceBanner_userDetails">
|
||||||
props.accountDetails.accountDetails[
|
<img
|
||||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
className="user_logo"
|
||||||
]
|
src="/assets/images/user.svg"
|
||||||
}
|
alt={router.locale == "cy" ? "Defnyddiwr" : "User"}
|
||||||
</a>
|
/>{" "}
|
||||||
</Link>
|
<div className="serviceBanner_userDetails_name">
|
||||||
</div>
|
<Link href="/account/personaldetails" className="govuk-button-secondary">
|
||||||
<div>
|
|
||||||
<Link
|
{
|
||||||
href={
|
props.accountDetails.accountDetails
|
||||||
router.locale == "cy"
|
.firstname
|
||||||
? "/allgofnodi"
|
}{" "}
|
||||||
: "/logout"
|
{
|
||||||
|
props.accountDetails.accountDetails
|
||||||
|
.lastname
|
||||||
|
}
|
||||||
|
{" - "}
|
||||||
|
{
|
||||||
|
props.accountDetails.accountDetails[
|
||||||
|
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/allgofnodi"
|
||||||
|
: "/logout"
|
||||||
|
}
|
||||||
|
onClick={() => {
|
||||||
|
handleLogout();
|
||||||
|
}}
|
||||||
|
className="govuk-header__link govuk-!-margin-right-3">
|
||||||
|
|
||||||
|
{t("common:signout-label")}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{isLPA && (
|
||||||
|
<div>
|
||||||
|
<h2 className="heading-small card-heading">
|
||||||
|
{
|
||||||
|
props.accountDetails.accountDetails[
|
||||||
|
"pinswg_contact_associatedlpa@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
}{" "}
|
||||||
|
LPA Portal
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<div className="flex-container grid-row govuk-body ">
|
||||||
|
{!isLPA && <MakeNewAppeal />}
|
||||||
|
<SearchCases />
|
||||||
|
{/* {props.awaitingSubmission.awaitingSubmission[
|
||||||
|
"@odata.count"
|
||||||
|
] > 0 && (
|
||||||
|
<AwaitingSubmission
|
||||||
|
awaitingSubmission={
|
||||||
|
props.awaitingSubmission
|
||||||
}
|
}
|
||||||
>
|
/>
|
||||||
<a
|
)} */}
|
||||||
onClick={() => {
|
{isLPA
|
||||||
handleLogout();
|
? ""
|
||||||
}}
|
: props.awaitingSubmission
|
||||||
className="govuk-header__link govuk-!-margin-right-3"
|
.awaitingSubmissionFromBlob[
|
||||||
>
|
"@odata.count"
|
||||||
{t("common:signout-label")}
|
] > 0 && (
|
||||||
</a>
|
<AwaitingSubmissionFromBlob
|
||||||
</Link>
|
containerID={props.containerID}
|
||||||
</div>
|
awaitingSubmissionFromBlob={
|
||||||
|
props.awaitingSubmission
|
||||||
|
.awaitingSubmissionFromBlob
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{props.myCases.myCases["@odata.count"] > 0 && (
|
||||||
|
<MyCases
|
||||||
|
myCases={props.myCases}
|
||||||
|
isLPA={isLPA}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{props.watchedCases.watchedCases["@odata.count"] >
|
||||||
|
0 && (
|
||||||
|
<WatchedCases
|
||||||
|
watchedCases={props.watchedCases}
|
||||||
|
isLPA={isLPA}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{props.myRepresentations.myRepresentations[
|
||||||
|
"@odata.count"
|
||||||
|
] > 0 && (
|
||||||
|
<MyRepresentations
|
||||||
|
myRepresentations={props.myRepresentations}
|
||||||
|
isLPA={isLPA}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!isLPA && <Dns />}
|
||||||
|
|
||||||
|
{/* <YourAccount /> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="govuk-grid-row">
|
</div>
|
||||||
<div className="govuk-grid-column-full">
|
</main>
|
||||||
<div className="flex-container grid-row govuk-body ">
|
<TimeOut />
|
||||||
<MakeNewAppeal />
|
</>;
|
||||||
<SearchCases />
|
|
||||||
{/* {props.awaitingSubmission.awaitingSubmission[
|
|
||||||
"@odata.count"
|
|
||||||
] > 0 && (
|
|
||||||
<AwaitingSubmission
|
|
||||||
awaitingSubmission={
|
|
||||||
props.awaitingSubmission
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)} */}
|
|
||||||
{props.awaitingSubmission
|
|
||||||
.awaitingSubmissionFromBlob["@odata.count"] >
|
|
||||||
0 && (
|
|
||||||
<AwaitingSubmissionFromBlob
|
|
||||||
containerID={props.containerID}
|
|
||||||
awaitingSubmissionFromBlob={
|
|
||||||
props.awaitingSubmission
|
|
||||||
.awaitingSubmissionFromBlob
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{props.myCases.myCases["@odata.count"] > 0 && (
|
|
||||||
<MyCases myCases={props.myCases} />
|
|
||||||
)}
|
|
||||||
{props.watchedCases.watchedCases["@odata.count"] >
|
|
||||||
0 && (
|
|
||||||
<WatchedCases
|
|
||||||
watchedCases={props.watchedCases}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{props.myRepresentations.myRepresentations[
|
|
||||||
"@odata.count"
|
|
||||||
] > 0 && (
|
|
||||||
<MyRepresentations
|
|
||||||
myRepresentations={props.myRepresentations}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Dns />
|
|
||||||
{/* <YourAccount /> */}
|
|
||||||
{showFileUpload == "true" && <UploadFile />}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<TimeOut />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default MyPortal;
|
export default MyPortal;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { reduxForm, formValueSelector, Field } from "redux-form";
|
|||||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import data from "../../data/collections.json";
|
import data from "../../data/collections.json";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
@@ -179,98 +179,96 @@ let AdvancedSearch = (props) => {
|
|||||||
label,
|
label,
|
||||||
errormsg,
|
errormsg,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return <>
|
||||||
<>
|
<div
|
||||||
<div
|
className={
|
||||||
className={
|
touched && error
|
||||||
touched && error
|
? "govuk-form-group govuk-form-group--error"
|
||||||
? "govuk-form-group govuk-form-group--error"
|
: "govuk-form-group "
|
||||||
: "govuk-form-group "
|
}
|
||||||
}
|
>
|
||||||
>
|
<label className="govuk-label" htmlFor={id}>
|
||||||
<label className="govuk-label" htmlFor={id}>
|
{label}
|
||||||
{label}
|
{name}
|
||||||
{name}
|
</label>
|
||||||
</label>
|
{touched && error && (
|
||||||
{touched && error && (
|
<span
|
||||||
<span
|
id="passport-issued-error"
|
||||||
id="passport-issued-error"
|
className="govuk-error-message"
|
||||||
className="govuk-error-message"
|
>
|
||||||
>
|
<span className="govuk-visually-hidden">
|
||||||
<span className="govuk-visually-hidden">
|
Error:
|
||||||
Error:
|
</span>{" "}
|
||||||
</span>{" "}
|
{errormsg}
|
||||||
{errormsg}
|
</span>
|
||||||
</span>
|
)}
|
||||||
)}
|
<div>
|
||||||
<div>
|
<select
|
||||||
<select
|
{...input}
|
||||||
{...input}
|
className="govuk-select"
|
||||||
className="govuk-select"
|
id={id}
|
||||||
id={id}
|
name={name}
|
||||||
name={name}
|
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
||||||
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
>
|
||||||
>
|
<option value="" disabled defaultValue>
|
||||||
<option value="" disabled defaultValue>
|
{t("common:drop-down-select")}
|
||||||
{t("common:drop-down-select")}
|
</option>
|
||||||
</option>
|
{_.isEmpty(optionsObj)
|
||||||
{_.isEmpty(optionsObj)
|
? ""
|
||||||
? ""
|
: Object.keys(optionsObj).map((key, index) => {
|
||||||
: Object.keys(optionsObj).map((key, index) => {
|
return (
|
||||||
return (
|
<option
|
||||||
<option
|
key={key}
|
||||||
key={key}
|
value={
|
||||||
value={
|
_.isEmpty(optionsObj[key])
|
||||||
_.isEmpty(optionsObj[key])
|
|
||||||
? ""
|
|
||||||
: _.isEmpty(
|
|
||||||
optionsObj[key]
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: _.isEmpty(
|
|
||||||
optionsObj[key]
|
|
||||||
.value
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: optionsObj[key]
|
|
||||||
.attributevalue +
|
|
||||||
"," +
|
|
||||||
optionsObj[key].value
|
|
||||||
.replace(
|
|
||||||
/(\band|[\s\-\+\(\)\,\&])/g,
|
|
||||||
""
|
|
||||||
)
|
|
||||||
.toLowerCase()
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{_.isEmpty(optionsObj[key])
|
|
||||||
? ""
|
|
||||||
: _.isEmpty(optionsObj[key])
|
|
||||||
? ""
|
? ""
|
||||||
: _.isEmpty(
|
: _.isEmpty(
|
||||||
optionsObj[key].value
|
optionsObj[key]
|
||||||
)
|
)
|
||||||
? ""
|
? ""
|
||||||
: router.locale == "cy"
|
: _.isEmpty(
|
||||||
? jsonpath.query(
|
optionsObj[key]
|
||||||
transLookup,
|
.value
|
||||||
'$..[?(@.value=="' +
|
|
||||||
optionsObj[key]
|
|
||||||
.value +
|
|
||||||
'")].value_cy'
|
|
||||||
)
|
)
|
||||||
: optionsObj[key].value ||
|
? ""
|
||||||
t(
|
: optionsObj[key]
|
||||||
"case:summary-no-date-entered-label"
|
.attributevalue +
|
||||||
)}
|
"," +
|
||||||
</option>
|
optionsObj[key].value
|
||||||
);
|
.replace(
|
||||||
})}
|
/(\band|[\s\-\+\(\)\,\&])/g,
|
||||||
</select>
|
""
|
||||||
</div>
|
)
|
||||||
|
.toLowerCase()
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{_.isEmpty(optionsObj[key])
|
||||||
|
? ""
|
||||||
|
: _.isEmpty(optionsObj[key])
|
||||||
|
? ""
|
||||||
|
: _.isEmpty(
|
||||||
|
optionsObj[key].value
|
||||||
|
)
|
||||||
|
? ""
|
||||||
|
: router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
optionsObj[key]
|
||||||
|
.value +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: optionsObj[key].value ||
|
||||||
|
t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)}
|
||||||
|
</option>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
);
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
@@ -471,11 +469,6 @@ let AdvancedSearch = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,18 +32,24 @@ const AwaitingSubmission = (props) => {
|
|||||||
{props.awaitingSubmission.awaitingSubmission["@odata.count"] >
|
{props.awaitingSubmission.awaitingSubmission["@odata.count"] >
|
||||||
3 && (
|
3 && (
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/myportal/viewall">
|
<Link
|
||||||
<a
|
href={
|
||||||
className="govuk-link--no-underline"
|
router.locale != "en"
|
||||||
onClick={() => {
|
? "/" +
|
||||||
setCurrentView({
|
router.locale +
|
||||||
"viewName": "Awaiting Submission",
|
"/fymhorth/gweldpopeth"
|
||||||
"viewKey": "awaitingSubmission",
|
: "/myportal/viewall"
|
||||||
});
|
}
|
||||||
}}
|
className="govuk-link--no-underline"
|
||||||
>
|
onClick={() => {
|
||||||
{t("myportal:viewall-link")}
|
setCurrentView({
|
||||||
</a>
|
"viewName": "Awaiting Submission",
|
||||||
|
"viewKey": "awaitingSubmission",
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -60,45 +60,42 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
|
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
router.locale == "cy"
|
(router.locale == "cy"
|
||||||
? "/fymhorth/parhauigyflwyno"
|
? "/fymhorth"
|
||||||
: "/myportal" +
|
: "/myportal") +
|
||||||
"/" +
|
"/" +
|
||||||
urlname +
|
urlname +
|
||||||
"?lpa=" +
|
"?lpa=" +
|
||||||
showTopThreeArr[key][
|
showTopThreeArr[key][
|
||||||
"_pinswg_associatedlpa_value"
|
"_pinswg_associatedlpa_value"
|
||||||
] +
|
] +
|
||||||
"&apt=" +
|
"&apt=" +
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key].pinswg_appealcasetype +
|
||||||
.pinswg_appealcasetype +
|
"&casereference=" +
|
||||||
"&casereference=" +
|
showTopThreeArr[key].pinswg_name +
|
||||||
showTopThreeArr[key].pinswg_name +
|
"&inid=" +
|
||||||
"&inid=" +
|
showTopThreeArr[key].incidentid
|
||||||
showTopThreeArr[key].incidentid
|
|
||||||
}
|
}
|
||||||
>
|
className="govuk-link--no-underline"
|
||||||
<a
|
data-id={index}
|
||||||
className="govuk-link--no-underline"
|
onClick={() => {
|
||||||
data-id={index}
|
props.setCurrentReference({
|
||||||
onClick={() => {
|
"currentReference":
|
||||||
props.setCurrentReference({
|
showTopThreeArr[key].ticketnumber,
|
||||||
"currentReference":
|
|
||||||
showTopThreeArr[key].ticketnumber,
|
|
||||||
|
|
||||||
"currentType": "awaitingSubmission",
|
"currentType": "awaitingSubmission",
|
||||||
|
|
||||||
"incidentid":
|
"incidentid":
|
||||||
showTopThreeArr[key].incidentid,
|
showTopThreeArr[key].incidentid,
|
||||||
|
|
||||||
|
"appealType":
|
||||||
|
showTopThreeArr[key]
|
||||||
|
.pinswg_appealcasetype,
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{showTopThreeArr[index].pinswg_name}
|
||||||
|
|
||||||
"appealType":
|
|
||||||
showTopThreeArr[key]
|
|
||||||
.pinswg_appealcasetype,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{showTopThreeArr[index].pinswg_name}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -215,18 +212,24 @@ const AwaitingSubmissionFromBlob = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
{props.awaitingSubmissionFromBlob["@odata.count"] > 3 && (
|
{props.awaitingSubmissionFromBlob["@odata.count"] > 3 && (
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/myportal/viewall">
|
<Link
|
||||||
<a
|
href={
|
||||||
className="govuk-link--no-underline"
|
router.locale != "en"
|
||||||
onClick={() => {
|
? "/" +
|
||||||
setCurrentView({
|
router.locale +
|
||||||
"viewName": "Awaiting Submission",
|
"/fymhorth/gweldpopeth"
|
||||||
"viewKey": "awaitingSubmissionDetails",
|
: "/myportal/viewall"
|
||||||
});
|
}
|
||||||
}}
|
className="govuk-link--no-underline"
|
||||||
>
|
onClick={() => {
|
||||||
{t("myportal:viewall-link")}
|
setCurrentView({
|
||||||
</a>
|
"viewName": "Awaiting Submission",
|
||||||
|
"viewKey": "awaitingSubmissionDetails",
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import Link from "next/link";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
|
|
||||||
export default function Dns() {
|
export default function Dns() {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
@@ -34,23 +33,16 @@ export default function Dns() {
|
|||||||
? "/fymhorth/ceisiadaudns"
|
? "/fymhorth/ceisiadaudns"
|
||||||
: "/myportal/dnsapplications"
|
: "/myportal/dnsapplications"
|
||||||
}
|
}
|
||||||
>
|
// onClick={() => {
|
||||||
<a
|
// spinnerState();
|
||||||
className="govuk-button withChevron govuk-button-cta"
|
// }}
|
||||||
// onClick={() => {
|
className="govuk-button withChevron govuk-button-cta">
|
||||||
// spinnerState();
|
|
||||||
// }}
|
{t("home:dns-card-button")}
|
||||||
>
|
|
||||||
{t("home:dns-card-button")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-loading")}
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ export default function MakeNewAppeal() {
|
|||||||
{t("myportal:makenewappeal-card-paragraph-two")}
|
{t("myportal:makenewappeal-card-paragraph-two")}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<Link href={"/newappeal"}>
|
<Link href={"/newappeal"} className="govuk-button">
|
||||||
<a className="govuk-button">
|
|
||||||
{t("myportal:makenewappeal-card-button-label")}
|
{t("myportal:makenewappeal-card-button-label")}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,18 +26,27 @@ const MyCases = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
{props.myCases.myCases["@odata.count"] > 3 && (
|
{props.myCases.myCases["@odata.count"] > 3 && (
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/myportal/viewall">
|
<Link
|
||||||
<a
|
href={
|
||||||
className="govuk-link--no-underline"
|
router.locale != "en"
|
||||||
onClick={() => {
|
? "/" +
|
||||||
setCurrentView({
|
router.locale +
|
||||||
"viewName": "My Cases",
|
"/fymhorth/gweldpopeth"
|
||||||
"viewKey": "myCases",
|
: "/myportal/viewall"
|
||||||
});
|
}
|
||||||
}}
|
className="govuk-link--no-underline"
|
||||||
>
|
onClick={() => {
|
||||||
{t("myportal:viewall-link")}
|
setCurrentView({
|
||||||
</a>
|
"viewName": "My Cases",
|
||||||
|
"viewKey": "myCases",
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{t("myportal:viewall-link")}{" "}
|
||||||
|
{props.isLPA &&
|
||||||
|
props.myCases.myCases["@odata.count"] +
|
||||||
|
" appeals"}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import TopThree from "./topthree";
|
import TopThree from "./topthree_reps";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { setCurrentView } from "../../store/currentView/action";
|
import { setCurrentView } from "../../store/currentView/action";
|
||||||
|
|
||||||
@@ -31,18 +31,25 @@ const MyRepresentations = (props) => {
|
|||||||
{props.myRepresentations.myRepresentations["@odata.count"] >
|
{props.myRepresentations.myRepresentations["@odata.count"] >
|
||||||
3 && (
|
3 && (
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/myportal/viewall" shallow>
|
<Link
|
||||||
<a
|
href={
|
||||||
className="govuk-link--no-underline"
|
router.locale != "en"
|
||||||
onClick={() => {
|
? "/" +
|
||||||
setCurrentView({
|
router.locale +
|
||||||
"viewName": "My Representations",
|
"/fymhorth/gweldpopeth"
|
||||||
"viewKey": "myRepresentations",
|
: "/myportal/viewall"
|
||||||
});
|
}
|
||||||
}}
|
shallow
|
||||||
>
|
className="govuk-link--no-underline"
|
||||||
{t("myportal:viewall-link")}
|
onClick={() => {
|
||||||
</a>
|
setCurrentView({
|
||||||
|
"viewName": "My Representations",
|
||||||
|
"viewKey": "myRepresentations",
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import TopThree from "./topthree_reps";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { setCurrentView } from "../../store/currentView/action";
|
||||||
|
|
||||||
|
const MyRepresentations = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
const { setCurrentView } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="card" id="casescomment-card">
|
||||||
|
<div className="card-body">
|
||||||
|
<h3 className="heading-small card-heading">
|
||||||
|
{t("myportal:myrepresentations-card-title")}dd
|
||||||
|
</h3>
|
||||||
|
<div className="cardModuleContainer">
|
||||||
|
<TopThree
|
||||||
|
showTopThree={props.myRepresentations.myRepresentations}
|
||||||
|
showDetails={
|
||||||
|
props.myRepresentations.myRepresentationsDetails
|
||||||
|
}
|
||||||
|
topThreeType={"myRepresentations"}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{props.myRepresentations.myRepresentations["@odata.count"] >
|
||||||
|
3 && (
|
||||||
|
<div className="cardVieAll">
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale != "en"
|
||||||
|
? "/" +
|
||||||
|
router.locale +
|
||||||
|
"/fymhorth/gweldpopeth"
|
||||||
|
: "/myportal/viewall"
|
||||||
|
}
|
||||||
|
shallow
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentView({
|
||||||
|
"viewName": "My Representations",
|
||||||
|
"viewKey": "myRepresentations",
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setCurrentView: (currentView) => {
|
||||||
|
dispatch(setCurrentView(currentView));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, mapDispatchToProps)(MyRepresentations);
|
||||||
@@ -4,7 +4,6 @@ import { useRouter } from "next/router";
|
|||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -96,69 +95,62 @@ let CaseSearch = (props) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return <>
|
||||||
<>
|
<div className="card" id="casesearch-card">
|
||||||
<div className="card" id="casesearch-card">
|
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
<div className="card-body">
|
||||||
<div className="card-body">
|
<h3 className="heading-small card-heading">
|
||||||
<h3 className="heading-small card-heading">
|
{t("myportal:searchcases-card-title")}
|
||||||
{t("myportal:searchcases-card-title")}
|
</h3>
|
||||||
</h3>
|
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
validate={[
|
validate={[
|
||||||
required(
|
required(
|
||||||
t(
|
t(
|
||||||
"myportal:searchcases-validation-required"
|
"myportal:searchcases-validation-required"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
minLength(
|
minLength(
|
||||||
t(
|
t(
|
||||||
"myportal:searchcases-validation-minlength"
|
"myportal:searchcases-validation-minlength"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]}
|
]}
|
||||||
className="govuk-input"
|
className="govuk-input"
|
||||||
component={RenderTextfield}
|
component={RenderTextfield}
|
||||||
id="basicSearch"
|
id="basicSearch"
|
||||||
name="basicSearch"
|
name="basicSearch"
|
||||||
type="text"
|
type="text"
|
||||||
aria-describedby="basicSearch-hint"
|
aria-describedby="basicSearch-hint"
|
||||||
hint1={t("myportal:searchcases-card-search-hint")}
|
hint1={t("myportal:searchcases-card-search-hint")}
|
||||||
hint2={t(
|
hint2={t(
|
||||||
"myportal:searchcases-card-search-example-label-1"
|
"myportal:searchcases-card-search-example-label-1"
|
||||||
)}
|
)}
|
||||||
hint3={t(
|
hint3={t(
|
||||||
"myportal:searchcases-card-search-example-label-2"
|
"myportal:searchcases-card-search-example-label-2"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="govuk-form-group">
|
<div className="govuk-form-group">
|
||||||
<button type="submit" className="govuk-button">
|
<button type="submit" className="govuk-button">
|
||||||
{t("myportal:searchcases-card-button")}
|
{t("myportal:searchcases-card-button")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
<Link
|
|
||||||
href={
|
|
||||||
router.locale == "cy"
|
|
||||||
? "/fymhorth/chwiliouwch"
|
|
||||||
: "/myportal/advancedsearch"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<a>
|
|
||||||
{t("myportal:searchcases-card-advanced-link")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<Link
|
||||||
{/* <LoadingOverlay
|
href={
|
||||||
active={showSpinnerState}
|
router.locale == "cy"
|
||||||
spinner
|
? "/fymhorth/chwiliouwch"
|
||||||
text={t("common:spinner-searching")}
|
: "/myportal/advancedsearch"
|
||||||
/> */}
|
}
|
||||||
</div>
|
>
|
||||||
</>
|
|
||||||
);
|
{t("myportal:searchcases-card-advanced-link")}
|
||||||
|
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
|||||||
@@ -167,47 +167,45 @@ const TopThree = (props) => {
|
|||||||
? "/fymhorth/achos"
|
? "/fymhorth/achos"
|
||||||
: "/myportal/case"
|
: "/myportal/case"
|
||||||
}
|
}
|
||||||
>
|
className="govuk-link--no-underline"
|
||||||
<a
|
data-id={index}
|
||||||
className="govuk-link--no-underline"
|
onClick={() => {
|
||||||
data-id={index}
|
setCurrentReference({
|
||||||
onClick={() => {
|
"currentReference":
|
||||||
setCurrentReference({
|
topThreeType != "watchedCases"
|
||||||
"currentReference":
|
? topThreeType !=
|
||||||
topThreeType != "watchedCases"
|
"myRepresentations"
|
||||||
? topThreeType !=
|
? showTopThreeArr[key]
|
||||||
"myRepresentations"
|
.ticketnumber
|
||||||
? showTopThreeArr[key]
|
|
||||||
.ticketnumber
|
|
||||||
: showTopThreeArr[key][
|
|
||||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
: showTopThreeArr[key][
|
: showTopThreeArr[key][
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||||
],
|
]
|
||||||
"currentType": topThreeType,
|
: showTopThreeArr[key][
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
"currentType": topThreeType,
|
||||||
|
|
||||||
"incidentid": getIncidentId(
|
"incidentid": getIncidentId(
|
||||||
topThreeType,
|
topThreeType,
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key]
|
||||||
),
|
),
|
||||||
|
|
||||||
"appealType":
|
"appealType":
|
||||||
showTopThreeArr[key]
|
showTopThreeArr[key]
|
||||||
.pinswg_appealcasetype,
|
.pinswg_appealcasetype,
|
||||||
});
|
});
|
||||||
}}
|
}}>
|
||||||
>
|
|
||||||
{topThreeType != "watchedCases"
|
{topThreeType != "watchedCases"
|
||||||
? topThreeType != "myRepresentations"
|
? topThreeType != "myRepresentations"
|
||||||
? showTopThreeArr[key].ticketnumber
|
? showTopThreeArr[key].ticketnumber
|
||||||
: showTopThreeArr[key][
|
|
||||||
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]
|
|
||||||
: showTopThreeArr[key][
|
: showTopThreeArr[key][
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_case_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]}{" "}
|
]
|
||||||
</a>
|
: showTopThreeArr[key][
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]}{" "}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
{/* {(topThreeType == "awaitingSubmission" ||
|
{/* {(topThreeType == "awaitingSubmission" ||
|
||||||
|
|||||||
@@ -0,0 +1,270 @@
|
|||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import { parseCookies } from "nookies";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import {
|
||||||
|
deleteAwaitingSubmissions,
|
||||||
|
deleteWatchedCases,
|
||||||
|
getAwaitingSubmissionProxy,
|
||||||
|
getPortalModuleDetailsProxy,
|
||||||
|
getWatchedCasesProxy,
|
||||||
|
} from "../../actions";
|
||||||
|
import {
|
||||||
|
setAwaitingSubmission,
|
||||||
|
setAwaitingSubmissionDetails,
|
||||||
|
} from "../../store/awaitingSubmission/action";
|
||||||
|
import { setCurrentReference } from "../../store/currentView/action";
|
||||||
|
import {
|
||||||
|
setWatchedCases,
|
||||||
|
setWatchedCasesDetails,
|
||||||
|
} from "../../store/watchedCases/action";
|
||||||
|
import { getFormCollectionByID } from "../utils";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
|
||||||
|
const TopThree = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
const {
|
||||||
|
showTopThree,
|
||||||
|
showDetails,
|
||||||
|
setCurrentReference,
|
||||||
|
topThreeType,
|
||||||
|
setWatchedCases,
|
||||||
|
setWatchedCasesDetails,
|
||||||
|
setAwaitingSubmission,
|
||||||
|
setAwaitingSubmissionDetails,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
|
||||||
|
let topthreeRow = [];
|
||||||
|
let showTopThreeArr = showTopThree.value;
|
||||||
|
|
||||||
|
Object.keys(showTopThreeArr).map((key, index) => {
|
||||||
|
let createdDate = parseInt(
|
||||||
|
showTopThreeArr[key].repfile_name.split("-")[3]
|
||||||
|
);
|
||||||
|
showTopThreeArr[key].createdDate = createdDate;
|
||||||
|
});
|
||||||
|
|
||||||
|
showTopThreeArr.sort(function compare(a, b) {
|
||||||
|
console.log(a.createdDate, b.createdDate);
|
||||||
|
var dateA = new Date(a.createdDate);
|
||||||
|
var dateB = new Date(b.createdDate);
|
||||||
|
return dateB - dateA;
|
||||||
|
});
|
||||||
|
|
||||||
|
const deleteItem = (caseID, topThreeType) => {
|
||||||
|
let cookies = parseCookies();
|
||||||
|
//console.log("sssss", caseID, topThreeType);
|
||||||
|
topThreeType == "watchedCases" &&
|
||||||
|
deleteWatchedCases(caseID)
|
||||||
|
.then((data) => data)
|
||||||
|
.then(() => {
|
||||||
|
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
||||||
|
setWatchedCases(data),
|
||||||
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
|
setWatchedCasesDetails(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
topThreeType == "awaitingSubmission" &&
|
||||||
|
deleteAwaitingSubmissions(caseID)
|
||||||
|
.then((data) => {
|
||||||
|
return data;
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getAwaitingSubmissionProxy(cookies.pinsUser).then(
|
||||||
|
(data) => {
|
||||||
|
setAwaitingSubmission(data),
|
||||||
|
getDetails(data, "awaitingSubmission").then(
|
||||||
|
(data) => {
|
||||||
|
// console.log(
|
||||||
|
// "submission get details:",
|
||||||
|
// data
|
||||||
|
// );
|
||||||
|
setAwaitingSubmissionDetails(data);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getDetails = (resultsObj, detailsType) => {
|
||||||
|
//console.log(resultsObj);
|
||||||
|
let detailsArr = [];
|
||||||
|
resultsObj = resultsObj.value;
|
||||||
|
const detailsObj = resultsObj.map((searchDetail, index) => {
|
||||||
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
|
console.log(
|
||||||
|
detailsType != "myWatchedCases"
|
||||||
|
? searchDetail.ticketnumber
|
||||||
|
: searchDetail[
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
detailsArr.push(
|
||||||
|
getPortalModuleDetailsProxy(
|
||||||
|
getFormCollectionByID(
|
||||||
|
searchDetail.pinswg_appealcasetype
|
||||||
|
).LogicalCollectionName,
|
||||||
|
detailsType != "myWatchedCases"
|
||||||
|
? searchDetail.ticketnumber
|
||||||
|
: searchDetail[
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//console.log(detailsArr);
|
||||||
|
return Promise.all(detailsArr);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getIncidentId = (topThreeType, objArr) => {
|
||||||
|
switch (topThreeType) {
|
||||||
|
case "myCases":
|
||||||
|
return objArr.incidentid;
|
||||||
|
break;
|
||||||
|
case "watchedCases":
|
||||||
|
return objArr._pinswg_watchedcase_value;
|
||||||
|
break;
|
||||||
|
case "myRepresentations":
|
||||||
|
return objArr.casereference;
|
||||||
|
break;
|
||||||
|
case "awaitingSubmission":
|
||||||
|
return objArr.ticketnumber;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// code block
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const repRaisedDate = (datePart) => {
|
||||||
|
var dateObj = new Date(parseInt(datePart.split("-")[3]));
|
||||||
|
return dateObj.toLocaleString();
|
||||||
|
};
|
||||||
|
|
||||||
|
let topThreeOnlyArr = showTopThreeArr.slice(0, 3);
|
||||||
|
Object.keys(topThreeOnlyArr).map((key, index) => {
|
||||||
|
topthreeRow.push(
|
||||||
|
<div className="cardModuleItem" key={index}>
|
||||||
|
<div className="cardModuleDetails">
|
||||||
|
<div className="cardModuleReference">
|
||||||
|
<b>{t("myportal:case-reference")}:</b>{" "}
|
||||||
|
<Link
|
||||||
|
// href="#"
|
||||||
|
href={{
|
||||||
|
pathname: "/myportal/representation",
|
||||||
|
query: {
|
||||||
|
case: showTopThreeArr[key].caseRef,
|
||||||
|
state: "edit",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
data-id={index}
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentReference({
|
||||||
|
"currentReference":
|
||||||
|
showTopThreeArr[key].caseRef,
|
||||||
|
"currentType": topThreeType,
|
||||||
|
"incidentid":
|
||||||
|
showTopThreeArr[key].incidentID,
|
||||||
|
"appealType":
|
||||||
|
showTopThreeArr[key].appealType,
|
||||||
|
"repDetails": showTopThreeArr[key],
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{showTopThreeArr[key].pinswg_name}
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
<div className="cardModuleReference">
|
||||||
|
<b>{t("myportal:representation-type")}:</b>
|
||||||
|
{" "}
|
||||||
|
{showTopThreeArr[key].representationType}
|
||||||
|
</div>
|
||||||
|
<div className="cardModuleReference">
|
||||||
|
<b>{t("myportal:capacity")}:</b>
|
||||||
|
{" "}
|
||||||
|
{showTopThreeArr[key].representationCapacity}
|
||||||
|
</div>
|
||||||
|
<div className="cardModuleReference">
|
||||||
|
<b>{t("myportal:date-raised")}:</b>
|
||||||
|
{" "}
|
||||||
|
{repRaisedDate(showTopThreeArr[key].repfile_name)}
|
||||||
|
</div>{" "}
|
||||||
|
<div className="cardModuleReference">
|
||||||
|
<b>LPA:</b>
|
||||||
|
{" "}
|
||||||
|
|
||||||
|
{router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
showTopThreeArr[key][
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: showTopThreeArr[key][
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] || ""}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
let noRecordsLabel = "";
|
||||||
|
switch (topThreeType) {
|
||||||
|
case "watchedCases":
|
||||||
|
noRecordsLabel = t("myportal:norecords-watched-cases");
|
||||||
|
break;
|
||||||
|
case "myRepresentations":
|
||||||
|
noRecordsLabel = t("myportal:norecords-representations");
|
||||||
|
break;
|
||||||
|
case "myCases":
|
||||||
|
noRecordsLabel = t("myportal:norecords-cases");
|
||||||
|
break;
|
||||||
|
case "awaitingSubmission":
|
||||||
|
noRecordsLabel = t("myportal:norecords-awaiting-submissions");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{topthreeRow.length == 0 ? (
|
||||||
|
<div>{noRecordsLabel}</div>
|
||||||
|
) : (
|
||||||
|
topthreeRow
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => {
|
||||||
|
return {
|
||||||
|
setCurrentReference: (currentReference) => {
|
||||||
|
dispatch(setCurrentReference(currentReference));
|
||||||
|
},
|
||||||
|
setWatchedCases: (watchedCases) => {
|
||||||
|
dispatch(setWatchedCases(watchedCases));
|
||||||
|
},
|
||||||
|
setWatchedCasesDetails: (watchedCasesDetails) => {
|
||||||
|
dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||||
|
},
|
||||||
|
setAwaitingSubmission: (awaitingSubmission) => {
|
||||||
|
dispatch(setAwaitingSubmission(awaitingSubmission));
|
||||||
|
},
|
||||||
|
setAwaitingSubmissionDetails: (awaitingSubmissionDetails) => {
|
||||||
|
dispatch(setAwaitingSubmissionDetails(awaitingSubmissionDetails));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(null, mapDispatchToProps)(TopThree);
|
||||||
@@ -2,13 +2,18 @@ import Link from "next/link";
|
|||||||
import { useState, useMemo } from "react";
|
import { useState, useMemo } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import DropzoneComponent from "../newappeal/fileupload";
|
import DropzoneComponent from "../newappeal/fileupload";
|
||||||
import { Field, reduxForm } from "redux-form";
|
import { Field, reduxForm } from "redux-form";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import Dropzone, { useDropzone } from "react-dropzone";
|
import Dropzone, { useDropzone } from "react-dropzone";
|
||||||
import { uploadFiles } from "../../actions";
|
import { uploadFiles } from "../../actions";
|
||||||
import { getContainers } from "../../actions/azurestorage";
|
import { getContainers } from "../../actions/azurestorage";
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getThumbnailIconByExtension,
|
||||||
|
bytesToSize,
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
value || typeof value === "number" ? undefined : errorMsg;
|
value || typeof value === "number" ? undefined : errorMsg;
|
||||||
@@ -119,13 +124,6 @@ const RenderFileUpload = (field) => {
|
|||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
|
|
||||||
function bytesToSize(bytes) {
|
|
||||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
||||||
if (bytes == 0) return "0 Byte";
|
|
||||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
|
||||||
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
const getThumbnailIcon = (fileObj, fileType) => {
|
const getThumbnailIcon = (fileObj, fileType) => {
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
case "text/html":
|
case "text/html":
|
||||||
|
|||||||
+199
-70
@@ -20,7 +20,10 @@ const ViewAllResults = (props) => {
|
|||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
const repRaisedDate = (datePart) => {
|
||||||
|
var dateObj = new Date(datePart);
|
||||||
|
return dateObj.toLocaleString();
|
||||||
|
};
|
||||||
var resultsArr =
|
var resultsArr =
|
||||||
currentView.viewKey == "awaitingSubmissionDetails"
|
currentView.viewKey == "awaitingSubmissionDetails"
|
||||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||||
@@ -35,15 +38,11 @@ const ViewAllResults = (props) => {
|
|||||||
return dd + "/" + mm + "/" + yyyy;
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(
|
|
||||||
// currentView.viewKey,
|
|
||||||
// props[currentView.viewKey],
|
|
||||||
// props[currentView.viewKey][currentView.viewKey].value
|
|
||||||
// );
|
|
||||||
|
|
||||||
var searchDetailsObj =
|
var searchDetailsObj =
|
||||||
currentView.viewKey == "awaitingSubmissionDetails"
|
currentView.viewKey == "awaitingSubmissionDetails"
|
||||||
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
||||||
|
: currentView.viewKey == "myRepresentations"
|
||||||
|
? props["myRepresentations"].myRepresentations.value
|
||||||
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
|
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
|
||||||
|
|
||||||
let resultsRowArr = [];
|
let resultsRowArr = [];
|
||||||
@@ -54,12 +53,28 @@ const ViewAllResults = (props) => {
|
|||||||
);
|
);
|
||||||
detailsObj = detailsObj[0];
|
detailsObj = detailsObj[0];
|
||||||
|
|
||||||
|
//console.log(searchDetailsObj[key]);
|
||||||
|
|
||||||
|
// searchDetailsObj[key] =
|
||||||
|
// currentView.viewKey == "myRepresentations"
|
||||||
|
// ? searchDetailsObj[key].value[0]
|
||||||
|
// : searchDetailsObj[key];
|
||||||
|
|
||||||
resultsRowArr.push(
|
resultsRowArr.push(
|
||||||
<div className="govuk-summary-list__row" key={key}>
|
<div className="govuk-summary-list__row" key={key}>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
currentView.viewKey == "awaitingSubmissionDetails"
|
currentView.viewKey == "myRepresentations"
|
||||||
|
? {
|
||||||
|
pathname: "/myportal/representation",
|
||||||
|
query: {
|
||||||
|
case: resultsArr[key].caseRef,
|
||||||
|
state: "edit",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: currentView.viewKey ==
|
||||||
|
"awaitingSubmissionDetails"
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
? "/fymhorth/parhauigyflwyno"
|
? "/fymhorth/parhauigyflwyno"
|
||||||
: "/myportal" +
|
: "/myportal" +
|
||||||
@@ -85,40 +100,47 @@ const ViewAllResults = (props) => {
|
|||||||
? "/myportal/case"
|
? "/myportal/case"
|
||||||
: "/case"
|
: "/case"
|
||||||
}
|
}
|
||||||
>
|
onClick={() => {
|
||||||
<a
|
setCurrentReference({
|
||||||
onClick={() => {
|
"currentReference":
|
||||||
setCurrentReference({
|
currentView.viewKey != "watchedCases"
|
||||||
"currentReference":
|
? currentView.viewKey ==
|
||||||
currentView.viewKey != "watchedCases"
|
"myRepresentations"
|
||||||
? resultsArr[key].ticketnumber
|
? resultsArr[key].caseRef
|
||||||
: resultsArr[key][
|
: resultsArr[key].ticketnumber
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
: resultsArr[key][
|
||||||
],
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
],
|
||||||
|
|
||||||
"currentType": currentView.viewKey,
|
"currentType": currentView.viewKey,
|
||||||
"incidentid":
|
"incidentid":
|
||||||
currentView.viewKey != "watchedCases"
|
currentView.viewKey != "watchedCases"
|
||||||
? resultsArr[key].incidentid
|
? resultsArr[key].incidentid
|
||||||
: resultsArr[key][
|
: resultsArr[key][
|
||||||
"_pinswg_watchedcase_value"
|
"_pinswg_watchedcase_value"
|
||||||
],
|
],
|
||||||
|
|
||||||
"appealType":
|
"appealType":
|
||||||
resultsArr[key].pinswg_appealcasetype,
|
resultsArr[key].pinswg_appealcasetype,
|
||||||
});
|
"repDetails":
|
||||||
}}
|
currentView.viewKey ==
|
||||||
>
|
"myRepresentations" &&
|
||||||
<span className="results-visually-hidden">
|
resultsArr[key],
|
||||||
Case Reference:
|
});
|
||||||
</span>
|
}}>
|
||||||
|
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t("search:searchresults-case-reference-label")}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
{currentView.viewKey != "watchedCases"
|
||||||
|
? currentView.viewKey == "myRepresentations"
|
||||||
|
? resultsArr[key].caseRef
|
||||||
|
: resultsArr[key].ticketnumber
|
||||||
|
: resultsArr[key][
|
||||||
|
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]}
|
||||||
|
|
||||||
{currentView.viewKey != "watchedCases"
|
|
||||||
? resultsArr[key].ticketnumber
|
|
||||||
: resultsArr[key][
|
|
||||||
"_pinswg_watchedcase_value@OData.Community.Display.V1.FormattedValue"
|
|
||||||
]}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -139,16 +161,20 @@ const ViewAllResults = (props) => {
|
|||||||
)[0]
|
)[0]
|
||||||
: ""
|
: ""
|
||||||
: ""} */}
|
: ""} */}
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline1
|
? searchDetailsObj[key].pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline1
|
? detailsObj.pinswg_siteaddressline1
|
||||||
: ""}
|
: ""}
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||||
|
? searchDetailsObj[key].value[0].pinswg_siteaddressline1
|
||||||
|
: ""}
|
||||||
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
|
? detailsObj.pinswg_siteaddressline1
|
||||||
|
: ""}
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
@@ -156,15 +182,20 @@ const ViewAllResults = (props) => {
|
|||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
_.has(searchDetailsObj[key].pinswg_siteaddressline1) &&
|
||||||
|
searchDetailsObj[key].value[0]
|
||||||
|
.pinswg_siteaddressline1 != null && <br />}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
||||||
detailsObj.pinswg_siteaddressline1 != null && <br />}
|
detailsObj.pinswg_siteaddressline1 != null && <br />}
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
_.has(searchDetailsObj[key].pinswg_siteaddressline1)
|
||||||
|
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||||
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||||
? detailsObj.pinswg_siteaddressline2
|
? detailsObj.pinswg_siteaddressline2
|
||||||
: ""}
|
: ""}
|
||||||
@@ -176,18 +207,24 @@ const ViewAllResults = (props) => {
|
|||||||
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
|
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
_.has(searchDetailsObj[key].pinswg_siteaddressline2) &&
|
||||||
|
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||||
|
null && <br />}
|
||||||
|
|
||||||
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
||||||
detailsObj.pinswg_siteaddressline2 != null && <br />}
|
detailsObj.pinswg_siteaddressline2 != null && <br />}
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||||
|
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||||
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||||
? detailsObj.pinswg_siteaddresstown
|
? detailsObj.pinswg_siteaddresstown
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
@@ -196,18 +233,27 @@ const ViewAllResults = (props) => {
|
|||||||
searchDetailsObj[key].pinswg_siteaddresstown !=
|
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
|
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
_.has(
|
||||||
|
searchDetailsObj[key],
|
||||||
|
"pinswg_siteaddresstown"
|
||||||
|
) &&
|
||||||
|
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||||
|
null && <br />}
|
||||||
|
|
||||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||||
detailsObj.pinswg_siteaddresstown != null && <br />}
|
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||||
|
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||||
|
: ""}
|
||||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||||
? detailsObj.pinswg_siteaddresscounty
|
? detailsObj.pinswg_siteaddresscounty
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(
|
_.has(
|
||||||
searchDetailsObj[key],
|
searchDetailsObj[key],
|
||||||
@@ -215,15 +261,12 @@ const ViewAllResults = (props) => {
|
|||||||
) &&
|
) &&
|
||||||
searchDetailsObj[key].pinswg_siteaddresscounty !=
|
searchDetailsObj[key].pinswg_siteaddresscounty !=
|
||||||
null && <br />}
|
null && <br />}
|
||||||
|
|
||||||
{_.has(detailsObj, "pinswg_siteaddresscounty") &&
|
{_.has(detailsObj, "pinswg_siteaddresscounty") &&
|
||||||
detailsObj.pinswg_siteaddresscounty != null && <br />}
|
detailsObj.pinswg_siteaddresscounty != null && <br />}
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(searchDetailsObj[key], "pinswg_siteaddresspostcode")
|
_.has(searchDetailsObj[key], "pinswg_siteaddresspostcode")
|
||||||
? searchDetailsObj[key].pinswg_siteaddresspostcode
|
? searchDetailsObj[key].pinswg_siteaddresspostcode
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
||||||
? detailsObj.pinswg_siteaddresspostcode
|
? detailsObj.pinswg_siteaddresspostcode
|
||||||
: ""}
|
: ""}
|
||||||
@@ -234,7 +277,6 @@ const ViewAllResults = (props) => {
|
|||||||
? t("search:searchresults-created-on-label")
|
? t("search:searchresults-created-on-label")
|
||||||
: t("search:searchresults-applicant-label")}
|
: t("search:searchresults-applicant-label")}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||||
? formatDates(item.createdon)
|
? formatDates(item.createdon)
|
||||||
: _.has(detailsObj, [
|
: _.has(detailsObj, [
|
||||||
@@ -243,6 +285,10 @@ const ViewAllResults = (props) => {
|
|||||||
? detailsObj[
|
? detailsObj[
|
||||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]
|
]
|
||||||
|
: currentView.viewKey == "myRepresentations"
|
||||||
|
? searchDetailsObj[key][
|
||||||
|
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
]
|
||||||
: resultsArr[key][
|
: resultsArr[key][
|
||||||
"_customerid_value@OData.Community.Display.V1.FormattedValue"
|
"_customerid_value@OData.Community.Display.V1.FormattedValue"
|
||||||
]}
|
]}
|
||||||
@@ -251,7 +297,6 @@ const ViewAllResults = (props) => {
|
|||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t("search:searchresults-authority-label")}:
|
{t("search:searchresults-authority-label")}:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||||
_.has(resultsArr[key], "pinswg_lpaname")
|
_.has(resultsArr[key], "pinswg_lpaname")
|
||||||
? router.locale == "cy"
|
? router.locale == "cy"
|
||||||
@@ -263,7 +308,6 @@ const ViewAllResults = (props) => {
|
|||||||
)
|
)
|
||||||
: resultsArr[key].pinswg_lpaname || "N/A"
|
: resultsArr[key].pinswg_lpaname || "N/A"
|
||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
{_.has(resultsArr[key], [
|
{_.has(resultsArr[key], [
|
||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
||||||
])
|
])
|
||||||
@@ -280,6 +324,52 @@ const ViewAllResults = (props) => {
|
|||||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"
|
] || "N/A"
|
||||||
: ""}
|
: ""}
|
||||||
|
{_.has(searchDetailsObj[key], [
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
|
||||||
|
])
|
||||||
|
? router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
searchDetailsObj[key].value[0][
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
|
||||||
|
] +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: currentView.viewKey == "myRepresentations"
|
||||||
|
? searchDetailsObj[key].value
|
||||||
|
: searchDetailsObj[key].value[0][
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] || "N/A"
|
||||||
|
: ""}
|
||||||
|
{_.has(resultsArr[key], [
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue",
|
||||||
|
])
|
||||||
|
? router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
resultsArr[key][
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValuee"
|
||||||
|
] +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: resultsArr[key][
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] ||
|
||||||
|
(currentView.viewKey == "myRepresentations"
|
||||||
|
? ""
|
||||||
|
: "N/A")
|
||||||
|
: currentView.viewKey == "myRepresentations" &&
|
||||||
|
router.locale == "cy" &&
|
||||||
|
jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
searchDetailsObj[key][
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
] +
|
||||||
|
'")].value_cy'
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -309,11 +399,35 @@ const ViewAllResults = (props) => {
|
|||||||
)
|
)
|
||||||
: item[
|
: item[
|
||||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"}
|
] ||
|
||||||
|
(currentView.viewKey == "myRepresentations"
|
||||||
|
? ""
|
||||||
|
: "N/A")}
|
||||||
|
|
||||||
|
{currentView.viewKey == "myRepresentations" &&
|
||||||
|
(router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
getFormCollectionByID(
|
||||||
|
searchDetailsObj[key].appealType
|
||||||
|
).value +
|
||||||
|
'")].value_cy'
|
||||||
|
)[0]
|
||||||
|
: getFormCollectionByID(
|
||||||
|
searchDetailsObj[key].appealType
|
||||||
|
).value)}
|
||||||
|
{_.has(
|
||||||
|
searchDetailsObj[key],
|
||||||
|
"_pinswg_localplanningauthority_value@OData.Community.Display.V1.FormattedValue"
|
||||||
|
)}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
{t("search:searchresults-status-label")}:
|
{currentView.viewKey == "myRepresentations"
|
||||||
|
? "Created"
|
||||||
|
: t("search:searchresults-status-label")}
|
||||||
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||||
@@ -330,16 +444,29 @@ const ViewAllResults = (props) => {
|
|||||||
item.statuscode +
|
item.statuscode +
|
||||||
'")].value'
|
'")].value'
|
||||||
) || "N/A"
|
) || "N/A"
|
||||||
: router.locale == "cy"
|
: currentView.viewKey == "myRepresentations"
|
||||||
? jsonpath.query(
|
? repRaisedDate(item.createdDate) // ? router.locale == "cy"
|
||||||
transLookup,
|
: // ? jsonpath.query(
|
||||||
'$..[?(@.value=="' +
|
// transLookup,
|
||||||
item[
|
// '$..[?(@.value=="' +
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
// searchDetailsObj[key].value[0][
|
||||||
] +
|
// "statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
'")].value_cy'
|
// ] +
|
||||||
)
|
// '")].value_cy'
|
||||||
: item[
|
// )
|
||||||
|
// : searchDetailsObj[key].value[0][
|
||||||
|
// "statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
// ] || "N/A"
|
||||||
|
// : router.locale == "cy"
|
||||||
|
// ? jsonpath.query(
|
||||||
|
// transLookup,
|
||||||
|
// '$..[?(@.value=="' +
|
||||||
|
// item[
|
||||||
|
// "statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
|
// ] +
|
||||||
|
// '")].value_cy'
|
||||||
|
// )
|
||||||
|
item[
|
||||||
"statuscode@OData.Community.Display.V1.FormattedValue"
|
"statuscode@OData.Community.Display.V1.FormattedValue"
|
||||||
] || "N/A"}
|
] || "N/A"}
|
||||||
</dd>
|
</dd>
|
||||||
@@ -387,7 +514,9 @@ const ViewAllResults = (props) => {
|
|||||||
{t("search:searchresults-case-type-label")}
|
{t("search:searchresults-case-type-label")}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||||
{t("search:searchresults-status-label")}
|
{currentView.viewKey == "myRepresentations"
|
||||||
|
? "Created"
|
||||||
|
: t("search:searchresults-status-label")}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -28,18 +28,25 @@ const WatchedCases = (props) => {
|
|||||||
|
|
||||||
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
|
{props.watchedCases.watchedCases["@odata.count"] > 3 && (
|
||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link href="/myportal/viewall" shallow>
|
<Link
|
||||||
<a
|
href={
|
||||||
className="govuk-link--no-underline"
|
router.locale != "en"
|
||||||
onClick={() => {
|
? "/" +
|
||||||
setCurrentView({
|
router.locale +
|
||||||
"viewName": "Watched Cases",
|
"/fymhorth/gweldpopeth"
|
||||||
"viewKey": "watchedCases",
|
: "/myportal/viewall"
|
||||||
});
|
}
|
||||||
}}
|
shallow
|
||||||
>
|
className="govuk-link--no-underline"
|
||||||
{t("myportal:viewall-link")}
|
onClick={() => {
|
||||||
</a>
|
setCurrentView({
|
||||||
|
"viewName": "Watched Cases",
|
||||||
|
"viewKey": "watchedCases",
|
||||||
|
});
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{t("myportal:viewall-link")}
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -51,7 +58,7 @@ const WatchedCases = (props) => {
|
|||||||
const mapDispatchToProps = (dispatch) => {
|
const mapDispatchToProps = (dispatch) => {
|
||||||
return {
|
return {
|
||||||
setCurrentView: (currentView) => {
|
setCurrentView: (currentView) => {
|
||||||
console.log(currentView);
|
//console.log(currentView);
|
||||||
dispatch(setCurrentView(currentView));
|
dispatch(setCurrentView(currentView));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,44 +7,42 @@ export default function YourAccount() {
|
|||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
return (
|
return <>
|
||||||
<>
|
<div className="card" id="casescomment-card">
|
||||||
<div className="card" id="casescomment-card">
|
<div className="card-body">
|
||||||
<div className="card-body">
|
<h3 className="heading-small card-heading">
|
||||||
<h3 className="heading-small card-heading">
|
{t("myportal:yourdetails-card-title")}
|
||||||
{t("myportal:yourdetails-card-title")}
|
</h3>
|
||||||
</h3>
|
<p className="govuk-body-s">
|
||||||
<p className="govuk-body-s">
|
{t("myportal:yourdetails-card-paragraph-one")}
|
||||||
{t("myportal:yourdetails-card-paragraph-one")}
|
</p>
|
||||||
</p>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Link href="/account/personaldetails">
|
<Link href="/account/personaldetails" className="govuk-button-secondary">
|
||||||
<a className="govuk-button-secondary">
|
|
||||||
{t("myportal:yourdetails-card-link")}
|
{t("myportal:yourdetails-card-link")}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <div className="card-body">
|
|
||||||
<h3 className="heading-small card-heading">
|
|
||||||
{t("myportal:changepassword-card-title")}
|
|
||||||
</h3>
|
|
||||||
<p className="govuk-body-s">
|
|
||||||
{" "}
|
|
||||||
{t("myportal:changepassword-card-paragraph-one")}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<Link href="/account/changepassword">
|
|
||||||
<a className="govuk-button-secondary">
|
|
||||||
{t("myportal:changepassword-card-link")}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
);
|
{/* <div className="card-body">
|
||||||
|
<h3 className="heading-small card-heading">
|
||||||
|
{t("myportal:changepassword-card-title")}
|
||||||
|
</h3>
|
||||||
|
<p className="govuk-body-s">
|
||||||
|
{" "}
|
||||||
|
{t("myportal:changepassword-card-paragraph-one")}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Link href="/account/changepassword">
|
||||||
|
<a className="govuk-button-secondary">
|
||||||
|
{t("myportal:changepassword-card-link")}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
</>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -731,7 +731,7 @@ let AboutYou = (props) => {
|
|||||||
label={t(
|
label={t(
|
||||||
"newappeal:about-you-agent-language-preferences-label"
|
"newappeal:about-you-agent-language-preferences-label"
|
||||||
)}
|
)}
|
||||||
options="[846040000|newappeal:about-you-agent-language-preferences-value-english,846040001|newappeal:about-you-agent-language-preferences-value-welsh]"
|
options="[846040001|newappeal:about-you-agent-language-preferences-value-welsh,846040000|newappeal:about-you-agent-language-preferences-value-english]"
|
||||||
id={"pinswg_languagepreference"}
|
id={"pinswg_languagepreference"}
|
||||||
className="govuk-radios__input"
|
className="govuk-radios__input"
|
||||||
validate={[required]}
|
validate={[required]}
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ import {
|
|||||||
setFormComplete,
|
setFormComplete,
|
||||||
} from "../../store/appealType/action";
|
} from "../../store/appealType/action";
|
||||||
|
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getThumbnailIconByExtension,
|
||||||
|
bytesToSize,
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
let BuildCheckSection = (props) => {
|
let BuildCheckSection = (props) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormComplete();
|
setFormComplete();
|
||||||
@@ -64,54 +70,6 @@ let BuildCheckSection = (props) => {
|
|||||||
alert(1);
|
alert(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
function bytesToSize(bytes) {
|
|
||||||
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
||||||
if (bytes == 0) return "0 Byte";
|
|
||||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
|
||||||
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
const getThumbnailIconByExtension = (blobName) => {
|
|
||||||
let fileType = blobName.slice(blobName.lastIndexOf(".") + 1);
|
|
||||||
|
|
||||||
switch (fileType) {
|
|
||||||
case "html":
|
|
||||||
return "/assets/images/documenttypes/html.png";
|
|
||||||
break;
|
|
||||||
case "txt":
|
|
||||||
return "/assets/images/documenttypes/txt.png";
|
|
||||||
break;
|
|
||||||
case "doc":
|
|
||||||
return "/assets/images/documenttypes/doc.png";
|
|
||||||
break;
|
|
||||||
case "pdf":
|
|
||||||
return "/assets/images/documenttypes/pdf.png";
|
|
||||||
break;
|
|
||||||
case "docx":
|
|
||||||
return "/assets/images/documenttypes/docx.png";
|
|
||||||
break;
|
|
||||||
case "csv":
|
|
||||||
return "/assets/images/documenttypes/csv.png";
|
|
||||||
break;
|
|
||||||
case "xlsx":
|
|
||||||
return "/assets/images/documenttypes/xlsx.png";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "zip":
|
|
||||||
return "/assets/images/documenttypes/zip.png";
|
|
||||||
break;
|
|
||||||
case "jpeg":
|
|
||||||
case "jpg":
|
|
||||||
return "/assets/images/documenttypes/jpg.png";
|
|
||||||
case "png":
|
|
||||||
return "/assets/images/documenttypes/png.png";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return "/assets/images/documenttypes/txt.png";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="govuk-grid-row" key={1222}>
|
<div className="govuk-grid-row" key={1222}>
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
@@ -140,9 +98,9 @@ let BuildCheckSection = (props) => {
|
|||||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list">
|
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list">
|
||||||
<div className="govuk-summary-list__row" key={"9999"}>
|
<div className="govuk-summary-list__row" key={"9999"}>
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{props.props.appealType.fileList.files.length >
|
{props.props.appealType.fileList.value.length >
|
||||||
0
|
0
|
||||||
? props.props.appealType.fileList.files.map(
|
? props.props.appealType.fileList.value.map(
|
||||||
(blob, i) => (
|
(blob, i) => (
|
||||||
<div
|
<div
|
||||||
key={blob.name + "_" + i}
|
key={blob.name + "_" + i}
|
||||||
@@ -150,10 +108,10 @@ let BuildCheckSection = (props) => {
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={getThumbnailIconByExtension(
|
src={getThumbnailIconByExtension(
|
||||||
blob.name
|
blob[i].name
|
||||||
)}
|
)}
|
||||||
alt={blob.name.slice(
|
alt={blob[i].name.slice(
|
||||||
blob.name.indexOf(
|
blob[i].name.indexOf(
|
||||||
"_"
|
"_"
|
||||||
) + 1
|
) + 1
|
||||||
)}
|
)}
|
||||||
@@ -161,14 +119,14 @@ let BuildCheckSection = (props) => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
|
||||||
{blob.name.slice(
|
{blob[i].name.slice(
|
||||||
blob.name.indexOf(
|
blob[i].name.indexOf(
|
||||||
"_"
|
"_"
|
||||||
) + 1
|
) + 1
|
||||||
)}
|
)}
|
||||||
(
|
(
|
||||||
{bytesToSize(
|
{bytesToSize(
|
||||||
blob.contentLength
|
blob[i].contentLength
|
||||||
)}
|
)}
|
||||||
)
|
)
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ let BuildSection = (props) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const isProgressComplete = (progObj) => {
|
const isProgressComplete = (progObj) => {
|
||||||
const progressCount = 0;
|
let progressCount = 0;
|
||||||
|
|
||||||
for (let key in progObj) {
|
for (let key in progObj) {
|
||||||
progObj[key].allFieldsComplete === true && progressCount++;
|
progObj[key].allFieldsComplete === true && progressCount++;
|
||||||
@@ -175,13 +175,14 @@ let BuildSection = (props) => {
|
|||||||
|
|
||||||
const reference = "PEDW-PARTIAL";
|
const reference = "PEDW-PARTIAL";
|
||||||
const templateId = "021b0a7b-df00-41f1-b94e-c269bee98c75";
|
const templateId = "021b0a7b-df00-41f1-b94e-c269bee98c75";
|
||||||
|
const templateIdCY = "f3c4a56b-bfb8-4d39-97dd-888df3062b0a";
|
||||||
const emailAddress = props.props.accountDetails.loggedinUserEmail;
|
const emailAddress = props.props.accountDetails.loggedinUserEmail;
|
||||||
const personalisation = {
|
const personalisation = {
|
||||||
"caseReference": props.appealType.caseReference.ticketnumber,
|
"caseReference": props.appealType.caseReference.ticketnumber,
|
||||||
"emailAddress": props.props.accountDetails.loggedinUserEmail,
|
"emailAddress": props.props.accountDetails.loggedinUserEmail,
|
||||||
"returnLink":
|
"returnLink":
|
||||||
props.props.url +
|
props.props.url +
|
||||||
"/myportal/" +
|
(router.locale != "en" ? "/cy/fymhorth/" : "/myportal/") +
|
||||||
appTypeCollection.UrlName +
|
appTypeCollection.UrlName +
|
||||||
"?lpa=" +
|
"?lpa=" +
|
||||||
props.appealType.appealLPA +
|
props.appealType.appealLPA +
|
||||||
@@ -195,12 +196,17 @@ let BuildSection = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
sendSavedEmail == true &&
|
sendSavedEmail == true &&
|
||||||
sendEmail(templateId, emailAddress, personalisation, reference);
|
sendEmail(
|
||||||
|
router.locale != "en" ? templateIdCY : templateId,
|
||||||
|
emailAddress,
|
||||||
|
personalisation,
|
||||||
|
reference
|
||||||
|
);
|
||||||
|
|
||||||
useSaveStatus &&
|
useSaveStatus &&
|
||||||
router.replace(
|
router.replace(
|
||||||
router.locale != "en"
|
router.locale != "en"
|
||||||
? router.locale + "/myportal"
|
? "/" + router.locale + "/myportal"
|
||||||
: "/myportal"
|
: "/myportal"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import jsonpath from "jsonpath";
|
|
||||||
import useTranslation from "next-translate/useTranslation";
|
import useTranslation from "next-translate/useTranslation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { formValueSelector } from "redux-form";
|
import { formValueSelector } from "redux-form";
|
||||||
import xpath from "xpath";
|
import {
|
||||||
import { updateCase, patchCase, sendEmail } from "../../actions";
|
patchCase,
|
||||||
import data from "../../data/collections.json";
|
sendCaseCompleteMessage,
|
||||||
|
sendEmail,
|
||||||
|
updateCase,
|
||||||
|
} from "../../actions";
|
||||||
import { setCurrentSection } from "../../store/appealType/action";
|
import { setCurrentSection } from "../../store/appealType/action";
|
||||||
import { getFormCollectionByID } from "../utils";
|
import { getFormCollectionByID } from "../utils";
|
||||||
|
|
||||||
@@ -60,6 +62,11 @@ let CompleteAppeal = (props) => {
|
|||||||
};
|
};
|
||||||
sendEmail(templateId, emailAddress, personalisation, reference);
|
sendEmail(templateId, emailAddress, personalisation, reference);
|
||||||
|
|
||||||
|
sendCaseCompleteMessage(
|
||||||
|
props.appealType.caseReference.ticketnumber,
|
||||||
|
props.props.accountDetails.loggedinUserEmail
|
||||||
|
);
|
||||||
|
|
||||||
console.log("patching////////");
|
console.log("patching////////");
|
||||||
patchCase(incidentId);
|
patchCase(incidentId);
|
||||||
}, [
|
}, [
|
||||||
@@ -131,17 +138,10 @@ let CompleteAppeal = (props) => {
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
<Link href="/myportal">
|
<Link href="/myportal" className="govuk-link">
|
||||||
<a className="govuk-link">Back to My Portal</a>
|
Back to My Portal
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p className="govuk-body">
|
|
||||||
<a href="#" className="govuk-link">
|
|
||||||
What did you think of this service?
|
|
||||||
</a>
|
|
||||||
(takes 30 seconds)
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
import Head from "next/head";
|
||||||
|
import Header from "../components/header";
|
||||||
|
import Banner from "../components/banner";
|
||||||
|
import CookieBanner from "../components/cookieBanner";
|
||||||
|
import Breadcrumbs from "../components/breadcrumbs";
|
||||||
|
import Footer from "../components/footer";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
const NoSessionWarning = (props) => {
|
||||||
|
let { footerLinks, loading } = props;
|
||||||
|
|
||||||
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Head>
|
||||||
|
<title>
|
||||||
|
{t("search:page-title")} - {t("common:service-name")}
|
||||||
|
</title>
|
||||||
|
</Head>
|
||||||
|
<div id="page_wrapper">
|
||||||
|
<CookieBanner />
|
||||||
|
<Header courseName={t("common:service-name")} />
|
||||||
|
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-full">
|
||||||
|
<div className="govuk-width-container">
|
||||||
|
<main
|
||||||
|
className="govuk-main-wrapper--auto-spacing"
|
||||||
|
id="main-content"
|
||||||
|
role="main"
|
||||||
|
>
|
||||||
|
<div className="govuk-grid-row">
|
||||||
|
<div className="govuk-grid-column-two-thirds">
|
||||||
|
<h1>
|
||||||
|
{
|
||||||
|
(loading = !true
|
||||||
|
? "Loading"
|
||||||
|
: "You are not logged in")
|
||||||
|
}{" "}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Footer footerLinks={footerLinks} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NoSessionWarning;
|
||||||
@@ -0,0 +1,348 @@
|
|||||||
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
import xpath from "xpath";
|
||||||
|
import jsonpath from "jsonpath";
|
||||||
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
||||||
|
import fieldLookup from "../../data/crmfieldlookuptranslations.json";
|
||||||
|
import {
|
||||||
|
getFormCollectionByID,
|
||||||
|
getPickListLabel,
|
||||||
|
getRadioLabel,
|
||||||
|
} from "../../components/utils";
|
||||||
|
|
||||||
|
import ReactPDF, {
|
||||||
|
Document,
|
||||||
|
Page,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
Image,
|
||||||
|
StyleSheet,
|
||||||
|
PDFViewer,
|
||||||
|
Font,
|
||||||
|
} from "@react-pdf/renderer";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
|
||||||
|
|
||||||
|
export const AppealRow_pdf = (props) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
// const router = useRouter();
|
||||||
|
// console.log(router);
|
||||||
|
// const { locale } = router;
|
||||||
|
|
||||||
|
const {
|
||||||
|
formXML,
|
||||||
|
whichSection,
|
||||||
|
sectionCount,
|
||||||
|
onSubmit,
|
||||||
|
updateCurrentSection,
|
||||||
|
mandatoryFieldsData,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
page: {
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
paddingBottom: 50,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
fontSize: 25,
|
||||||
|
fontFamily: "Helvetica",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
},
|
||||||
|
subHeader: {
|
||||||
|
fontSize: 20,
|
||||||
|
},
|
||||||
|
logoImage: { width: "200pt" },
|
||||||
|
questionBullet: { width: "5%", fontSize: 12 },
|
||||||
|
questionText: { width: "30%", fontSize: 12 },
|
||||||
|
questionTextMid: { width: "80%", fontSize: 12 },
|
||||||
|
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||||
|
questionAnswer: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "65%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerMid: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "20%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerWide: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "95%",
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: "5%",
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
|
||||||
|
sectionContainer: {
|
||||||
|
backgroundColor: "#F8F8F8",
|
||||||
|
padding: 10,
|
||||||
|
marginTop: 20,
|
||||||
|
fontSize: 15,
|
||||||
|
},
|
||||||
|
pageNumber: {
|
||||||
|
position: "absolute",
|
||||||
|
fontSize: 12,
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
textAlign: "center",
|
||||||
|
color: "grey",
|
||||||
|
},
|
||||||
|
|
||||||
|
richArea: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: "red",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const parser = new DOMParser();
|
||||||
|
var doc = parser.parseFromString(formXML, "text/xml");
|
||||||
|
|
||||||
|
var rowXML = xpath.select(
|
||||||
|
"/form/tabs/tab[" +
|
||||||
|
whichSection +
|
||||||
|
"]/columns//sections/section/rows/row",
|
||||||
|
doc
|
||||||
|
);
|
||||||
|
|
||||||
|
//console.log(rowXML);
|
||||||
|
|
||||||
|
function formatDate(dateObj) {
|
||||||
|
var m = new Date(dateObj);
|
||||||
|
var dateString;
|
||||||
|
dateObj != null
|
||||||
|
? (dateString =
|
||||||
|
("0" + m.getDate()).slice(-2) +
|
||||||
|
"/" +
|
||||||
|
("0" + (m.getMonth() + 1)).slice(-2) +
|
||||||
|
"/" +
|
||||||
|
m.getFullYear())
|
||||||
|
: (dateString = "");
|
||||||
|
|
||||||
|
return dateString;
|
||||||
|
}
|
||||||
|
|
||||||
|
const FieldsTranslations = (label) => {
|
||||||
|
// const router = useRouter();
|
||||||
|
// const { locale } = router;
|
||||||
|
const { appealtypes } = router.query;
|
||||||
|
|
||||||
|
let formObj = jsonpath.query(fieldLookup, "$['" + appealtypes + "']");
|
||||||
|
|
||||||
|
// let labelTrans =
|
||||||
|
// router.locale == "cy"
|
||||||
|
// ? jsonpath.query(
|
||||||
|
// formObj,
|
||||||
|
// "$..[?(@.value=='" + label + "')].value_cy"
|
||||||
|
// )
|
||||||
|
// : label;
|
||||||
|
|
||||||
|
let labelTrans = label;
|
||||||
|
return labelTrans;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{Object.keys(rowXML).map((key, index) => {
|
||||||
|
var newRowXML = new XMLSerializer().serializeToString(
|
||||||
|
rowXML[key]
|
||||||
|
);
|
||||||
|
//console.log(newRowXML);
|
||||||
|
var doc = parser.parseFromString(newRowXML, "text/xml");
|
||||||
|
|
||||||
|
var rows = xpath.select("//label/@description", doc);
|
||||||
|
var fieldtype = xpath.select("//@classid", doc);
|
||||||
|
var datafieldname = xpath.select("//@datafieldname", doc);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{(() => {
|
||||||
|
switch (fieldtype[0].value) {
|
||||||
|
case "{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}":
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={styles.questionTextWide}
|
||||||
|
>
|
||||||
|
{/* {FieldsTranslations(rows[0].value)} */}
|
||||||
|
{rows[0].value}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Text
|
||||||
|
style={
|
||||||
|
styles.questionAnswerWide
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{formatDate(
|
||||||
|
props.props[
|
||||||
|
datafieldname[0].value
|
||||||
|
]
|
||||||
|
)}{" "}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "{E0DECE4B-6FC8-4a8f-A065-082708572369}":
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "column",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={
|
||||||
|
styles.questionTextMid
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{rows[0].value}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
style={
|
||||||
|
styles.questionAnswerWide
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Text>
|
||||||
|
{
|
||||||
|
props.props[
|
||||||
|
datafieldname[0]
|
||||||
|
.value
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}":
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "column",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={styles.questionText}
|
||||||
|
>
|
||||||
|
{rows[0].value}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.questionAnswer}>
|
||||||
|
<Text>
|
||||||
|
{
|
||||||
|
props.props[
|
||||||
|
datafieldname[0]
|
||||||
|
.value
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
{/* {FieldsTranslations(rows[0].value)} */}
|
||||||
|
{rows[0].value}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Text
|
||||||
|
style={
|
||||||
|
styles.questionAnswerWide
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
props.props[
|
||||||
|
datafieldname[0].value
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})()}
|
||||||
|
|
||||||
|
{/* <Text className="govuk-summary-list__value">
|
||||||
|
{fieldtype[0].value ==
|
||||||
|
"{5B773807-9FB2-42db-97C3-7A91EFF8ADFF}"
|
||||||
|
? formatDate(
|
||||||
|
props.props.values[datafieldname[0].value]
|
||||||
|
)
|
||||||
|
: fieldtype[0].value ==
|
||||||
|
"{3EF39988-22BB-4f0b-BBBE-64B5A3748AEE}"
|
||||||
|
? getPickListLabel(
|
||||||
|
props.props.formData.pickListData,
|
||||||
|
datafieldname[0].value,
|
||||||
|
props.props.values[datafieldname[0].value]
|
||||||
|
)
|
||||||
|
: fieldtype[0].value ==
|
||||||
|
"{07FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}"
|
||||||
|
? getRadioLabel(
|
||||||
|
props.props.formData.pickListData,
|
||||||
|
datafieldname[0].value,
|
||||||
|
props.props.values[datafieldname[0].value]
|
||||||
|
)
|
||||||
|
: fieldtype[0].value ==
|
||||||
|
"{16D63FD6-119B-4353-BDCA-18358721C3FE}"
|
||||||
|
? "ssss"
|
||||||
|
: props.props.values[datafieldname[0].value]}
|
||||||
|
</Text> */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,423 @@
|
|||||||
|
import ReactPDF, {
|
||||||
|
Document,
|
||||||
|
Page,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
Image,
|
||||||
|
StyleSheet,
|
||||||
|
PDFViewer,
|
||||||
|
Font,
|
||||||
|
} from "@react-pdf/renderer";
|
||||||
|
import { createElement } from "react";
|
||||||
|
import Html from "react-pdf-html";
|
||||||
|
import { getFormCollectionByID } from "../../components/utils";
|
||||||
|
|
||||||
|
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
page: {
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
paddingBottom: 50,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
fontSize: 25,
|
||||||
|
fontFamily: "Helvetica",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
},
|
||||||
|
subHeader: {
|
||||||
|
fontSize: 20,
|
||||||
|
},
|
||||||
|
logoImage: { width: "200pt" },
|
||||||
|
questionBullet: { width: "5%", fontSize: 12 },
|
||||||
|
questionText: { width: "30%", fontSize: 12 },
|
||||||
|
questionTextMid: { width: "80%", fontSize: 12 },
|
||||||
|
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||||
|
questionAnswer: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "65%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerMid: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "20%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerWide: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "95%",
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: "5%",
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
|
||||||
|
sectionContainer: {
|
||||||
|
backgroundColor: "#F8F8F8",
|
||||||
|
padding: 10,
|
||||||
|
marginTop: 20,
|
||||||
|
fontSize: 15,
|
||||||
|
},
|
||||||
|
pageNumber: {
|
||||||
|
position: "absolute",
|
||||||
|
fontSize: 12,
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
textAlign: "center",
|
||||||
|
color: "grey",
|
||||||
|
},
|
||||||
|
|
||||||
|
richArea: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: "red",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const finalComments_pdf = ({ docProps }) => {
|
||||||
|
//console.log("----", docProps);
|
||||||
|
function formatDates(dateObj) {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
|
||||||
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
|
}
|
||||||
|
let values = docProps;
|
||||||
|
|
||||||
|
let datestr = values.repfile_name.split("-");
|
||||||
|
let signedDate = datestr[2] + "/" + datestr[1] + "/" + datestr[0];
|
||||||
|
let appealTypeValue = getFormCollectionByID(values.appealType);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Document>
|
||||||
|
<Page size="A4" style={styles.page} wrap>
|
||||||
|
<View style={{ padding: 20 }}>
|
||||||
|
<View style={styles.header}>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Final Comments
|
||||||
|
</Text>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontSize: 15,
|
||||||
|
marginTop: 20,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
For Planning, Conservation area, Listed
|
||||||
|
Building and Advertisement
|
||||||
|
applications/appeals
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Image
|
||||||
|
style={styles.logoImage}
|
||||||
|
src="public/assets/images/pedw_logo.png"
|
||||||
|
alt="PEDW Logo"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.section}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Case details</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>1a.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Case reference :
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.caseRef}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}></Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Representation capacity:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.representationCapacity}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}></Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Representation capacity{"\n"} details:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
<Html style={styles.richArea}>
|
||||||
|
{
|
||||||
|
values.conditional_representationCapacity_Comments
|
||||||
|
}
|
||||||
|
</Html>
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>3.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Site address/grid ref:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.siteAddress}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>4.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Case Type:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{appealTypeValue.value}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Comments</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "column",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>
|
||||||
|
5.
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionTextMid}>
|
||||||
|
Final Comments
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.questionAnswerWide}>
|
||||||
|
<Html style={styles.richArea}>
|
||||||
|
{values.representationComments}
|
||||||
|
</Html>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>
|
||||||
|
Supporting documents
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>11.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
List of attached files
|
||||||
|
</Text>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.questionAnswer,
|
||||||
|
{ flexDirection: "column" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{values.hasOwnProperty("filesList") &&
|
||||||
|
values.filesList.map(function (p) {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
key={p.name}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
styles={
|
||||||
|
styles.questionTextMid
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{p.name} - {p.size}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>Declaration</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{ width: "40%", fontSize: 12 }}
|
||||||
|
>
|
||||||
|
Signed:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.firstname} {values.lastname}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Date:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{signedDate}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ width: "18%", fontSize: 12 }}>
|
||||||
|
On behalf of:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswerWide}>
|
||||||
|
{values.representationCapacity}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Text
|
||||||
|
style={styles.pageNumber}
|
||||||
|
render={({ pageNumber, totalPages }) =>
|
||||||
|
`${pageNumber} / ${totalPages}`
|
||||||
|
}
|
||||||
|
fixed
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
fixed
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: 20,
|
||||||
|
left: 20,
|
||||||
|
bottom: 20,
|
||||||
|
right: 20,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
padding: 20,
|
||||||
|
paddingTop: 30,
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
</Page>
|
||||||
|
</Document>
|
||||||
|
);
|
||||||
|
};
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,403 @@
|
|||||||
|
import ReactPDF, {
|
||||||
|
Document,
|
||||||
|
Page,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
Image,
|
||||||
|
StyleSheet,
|
||||||
|
PDFViewer,
|
||||||
|
Font,
|
||||||
|
} from "@react-pdf/renderer";
|
||||||
|
import { createElement } from "react";
|
||||||
|
import Html from "react-pdf-html";
|
||||||
|
import { getFormCollectionByID } from "../../components/utils";
|
||||||
|
|
||||||
|
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
page: {
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
paddingBottom: 50,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
fontSize: 25,
|
||||||
|
fontFamily: "Helvetica",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
},
|
||||||
|
subHeader: {
|
||||||
|
fontSize: 20,
|
||||||
|
},
|
||||||
|
logoImage: { width: "200pt" },
|
||||||
|
questionBullet: { width: "5%", fontSize: 12 },
|
||||||
|
questionText: { width: "30%", fontSize: 12 },
|
||||||
|
questionTextMid: { width: "80%", fontSize: 12 },
|
||||||
|
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||||
|
questionAnswer: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "65%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerMid: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "20%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerWide: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "95%",
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: "5%",
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
|
||||||
|
sectionContainer: {
|
||||||
|
backgroundColor: "#F8F8F8",
|
||||||
|
padding: 10,
|
||||||
|
marginTop: 20,
|
||||||
|
fontSize: 15,
|
||||||
|
},
|
||||||
|
pageNumber: {
|
||||||
|
position: "absolute",
|
||||||
|
fontSize: 12,
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
textAlign: "center",
|
||||||
|
color: "grey",
|
||||||
|
},
|
||||||
|
|
||||||
|
richArea: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: "red",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const other_pdf = ({ docProps }) => {
|
||||||
|
//console.log("----", docProps);
|
||||||
|
function formatDates(dateObj) {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
|
||||||
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
|
}
|
||||||
|
let values = docProps;
|
||||||
|
|
||||||
|
let datestr = values.pinswg_name.split("-");
|
||||||
|
let signedDate = datestr[2] + "/" + datestr[1] + "/" + datestr[0];
|
||||||
|
const isLPA = values.representationCapacity == "lpa" ? true : false;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Document>
|
||||||
|
<Page size="A4" style={styles.page} wrap>
|
||||||
|
<View style={{ padding: 20 }}>
|
||||||
|
<View style={styles.header}>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Other
|
||||||
|
</Text>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontSize: 15,
|
||||||
|
marginTop: 20,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
For Planning Appeal, Planning Conditions,
|
||||||
|
Listed Building and Conservation Area
|
||||||
|
Appeal, Lawful Development Appeal, Planning
|
||||||
|
Obligations, Community Infrastructure Levy,
|
||||||
|
Enforcement Notice appeal, Enforcement
|
||||||
|
Listed Building Appeal, Maintenance of land,
|
||||||
|
Called in Application applications/appeals
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Image
|
||||||
|
style={styles.logoImage}
|
||||||
|
src="public/assets/images/pedw_logo.png"
|
||||||
|
alt="PEDW Logo"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.section}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Case details</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>1.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-question-1"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.caseRef}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>3.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Site address/grid ref:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.siteAddress}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>4.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Case Type:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{
|
||||||
|
getFormCollectionByID(values.appealType)
|
||||||
|
.value
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Comments</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "column",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>
|
||||||
|
5.
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionTextMid}>
|
||||||
|
Other Comments
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.questionAnswerWide}>
|
||||||
|
<Html style={styles.richArea}>
|
||||||
|
{values.representationComments}
|
||||||
|
</Html>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>
|
||||||
|
Supporting documents
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>11.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
List of attached files
|
||||||
|
</Text>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.questionAnswer,
|
||||||
|
{ flexDirection: "column" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{values.hasOwnProperty("filesList") &&
|
||||||
|
values.filesList.map(function (p) {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
key={p.name}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
styles={
|
||||||
|
styles.questionTextMid
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{p.name} - {p.size}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>Declaration</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{ width: "40%", fontSize: 12 }}
|
||||||
|
>
|
||||||
|
Signed:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.firstname} {values.lastname}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Date:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{signedDate}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
{isLPA && (
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{ width: "18%", fontSize: 12 }}
|
||||||
|
>
|
||||||
|
On behalf of:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswerWide}>
|
||||||
|
{values.representationCapacity}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Text
|
||||||
|
style={styles.pageNumber}
|
||||||
|
render={({ pageNumber, totalPages }) =>
|
||||||
|
`${pageNumber} / ${totalPages}`
|
||||||
|
}
|
||||||
|
fixed
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
fixed
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: 20,
|
||||||
|
left: 20,
|
||||||
|
bottom: 20,
|
||||||
|
right: 20,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
padding: 20,
|
||||||
|
paddingTop: 30,
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
</Page>
|
||||||
|
</Document>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,367 @@
|
|||||||
|
import ReactPDF, {
|
||||||
|
Document,
|
||||||
|
Page,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
Image,
|
||||||
|
StyleSheet,
|
||||||
|
PDFViewer,
|
||||||
|
Font,
|
||||||
|
} from "@react-pdf/renderer";
|
||||||
|
import { createElement } from "react";
|
||||||
|
import Html from "react-pdf-html";
|
||||||
|
import { getFormCollectionByID } from "../utils";
|
||||||
|
import fs from "fs";
|
||||||
|
import xpath from "xpath";
|
||||||
|
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { DOMParser, XMLSerializer } from "@xmldom/xmldom";
|
||||||
|
import { AppealRow_pdf } from "./appealRow_pdf";
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
page: {
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
paddingBottom: 50,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
fontSize: 25,
|
||||||
|
fontFamily: "Helvetica",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
},
|
||||||
|
subHeader: {
|
||||||
|
fontSize: 20,
|
||||||
|
},
|
||||||
|
logoImage: { width: "200pt" },
|
||||||
|
questionBullet: { width: "5%", fontSize: 12 },
|
||||||
|
questionText: { width: "30%", fontSize: 12 },
|
||||||
|
questionTextMid: { width: "80%", fontSize: 12 },
|
||||||
|
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||||
|
questionAnswer: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "65%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerMid: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "20%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerWide: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "95%",
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: "5%",
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
|
||||||
|
sectionContainer: {
|
||||||
|
backgroundColor: "#F8F8F8",
|
||||||
|
padding: 10,
|
||||||
|
marginTop: 20,
|
||||||
|
fontSize: 15,
|
||||||
|
},
|
||||||
|
pageNumber: {
|
||||||
|
position: "absolute",
|
||||||
|
fontSize: 12,
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
textAlign: "center",
|
||||||
|
color: "grey",
|
||||||
|
},
|
||||||
|
|
||||||
|
richArea: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: "red",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const planningappeals78_pdf = ({ docProps }) => {
|
||||||
|
//console.log("----", docProps);
|
||||||
|
function formatDates(dateObj) {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
|
||||||
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
|
}
|
||||||
|
let values = docProps;
|
||||||
|
|
||||||
|
let datestr = values.pinswg_name.split("-");
|
||||||
|
let signedDate = datestr[2] + "/" + datestr[1] + "/" + datestr[0];
|
||||||
|
let appealTypeValue = getFormCollectionByID(values.pinswg_appealcasetype);
|
||||||
|
|
||||||
|
var path = require("path");
|
||||||
|
const configDirectory = path.resolve(process.cwd(), "data/formsxml");
|
||||||
|
var xmlStr = fs.readFileSync(
|
||||||
|
path.join(configDirectory, "planningappeals78" + ".xml"),
|
||||||
|
"utf8"
|
||||||
|
);
|
||||||
|
|
||||||
|
xmlStr = xmlStr.replace(/\t/g, "");
|
||||||
|
xmlStr = xmlStr.replace(/\n/g, "");
|
||||||
|
xmlStr = xmlStr.replace(/> <"/g, "><");
|
||||||
|
xmlStr = xmlStr.toString();
|
||||||
|
|
||||||
|
console.log(xmlStr);
|
||||||
|
|
||||||
|
const parser = new DOMParser();
|
||||||
|
var doc = parser.parseFromString(xmlStr, "text/xml");
|
||||||
|
var titles = xpath.select(
|
||||||
|
"//form/tabs/tab[*]/labels/label/@description",
|
||||||
|
doc
|
||||||
|
);
|
||||||
|
var rowXML = xpath.select(
|
||||||
|
"/form/tabs/tab[*]/columns//sections/section/rows/row",
|
||||||
|
doc
|
||||||
|
);
|
||||||
|
|
||||||
|
var titleList = xpath.select(
|
||||||
|
"//form/tabs/tab[*]/labels/label/@description",
|
||||||
|
doc
|
||||||
|
);
|
||||||
|
|
||||||
|
//console.log(titles);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Document>
|
||||||
|
<Page size="A4" style={styles.page} wrap>
|
||||||
|
<View style={{ padding: 20 }}>
|
||||||
|
<View style={styles.header}>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Planning Appeals s78
|
||||||
|
</Text>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontSize: 15,
|
||||||
|
marginTop: 20,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
For Planning, Conservation area, Listed
|
||||||
|
Building and Advertisement
|
||||||
|
applications/appeals
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Image
|
||||||
|
style={styles.logoImage}
|
||||||
|
src="public/assets/images/pedw_logo.png"
|
||||||
|
alt="PEDW Logo"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.section}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Case details</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>1.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-question-1"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.caseRef}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>3.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Site address/grid ref:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.siteAddress}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>4.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Case Type:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{appealTypeValue.value}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{Object.keys(titles).map((key) => (
|
||||||
|
<View key={key}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>
|
||||||
|
{parseInt(key) + 1} {titles[key].value}
|
||||||
|
</Text>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "column",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<AppealRow_pdf
|
||||||
|
formXML={xmlStr}
|
||||||
|
whichSection={parseInt(key) + 1}
|
||||||
|
sectionCount={key}
|
||||||
|
props={docProps}
|
||||||
|
key={key}
|
||||||
|
mandatoryFieldsData={null}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>
|
||||||
|
Supporting documents
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>11.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
List of attached files
|
||||||
|
</Text>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.questionAnswer,
|
||||||
|
{ flexDirection: "column" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{values.hasOwnProperty("filesList") &&
|
||||||
|
values.filesList.map(function (p) {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
key={p.name}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
styles={
|
||||||
|
styles.questionTextMid
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{p.name} - {p.size}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Text
|
||||||
|
style={styles.pageNumber}
|
||||||
|
render={({ pageNumber, totalPages }) =>
|
||||||
|
`${pageNumber} / ${totalPages}`
|
||||||
|
}
|
||||||
|
fixed
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
fixed
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: 20,
|
||||||
|
left: 20,
|
||||||
|
bottom: 20,
|
||||||
|
right: 20,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
padding: 20,
|
||||||
|
paddingTop: 30,
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
</Page>
|
||||||
|
</Document>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,426 @@
|
|||||||
|
import ReactPDF, {
|
||||||
|
Document,
|
||||||
|
Page,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
Image,
|
||||||
|
StyleSheet,
|
||||||
|
PDFViewer,
|
||||||
|
Font,
|
||||||
|
} from "@react-pdf/renderer";
|
||||||
|
import { createElement } from "react";
|
||||||
|
import Html from "react-pdf-html";
|
||||||
|
import { getFormCollectionByID } from "../../components/utils";
|
||||||
|
|
||||||
|
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
page: {
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
paddingBottom: 50,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
fontSize: 25,
|
||||||
|
fontFamily: "Helvetica",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
},
|
||||||
|
subHeader: {
|
||||||
|
fontSize: 20,
|
||||||
|
},
|
||||||
|
logoImage: { width: "200pt" },
|
||||||
|
questionBullet: { width: "5%", fontSize: 12 },
|
||||||
|
questionText: { width: "30%", fontSize: 12 },
|
||||||
|
questionTextMid: { width: "80%", fontSize: 12 },
|
||||||
|
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||||
|
questionAnswer: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "65%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerMid: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "20%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerWide: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "95%",
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: "5%",
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
|
||||||
|
sectionContainer: {
|
||||||
|
backgroundColor: "#F8F8F8",
|
||||||
|
padding: 10,
|
||||||
|
marginTop: 20,
|
||||||
|
fontSize: 15,
|
||||||
|
},
|
||||||
|
pageNumber: {
|
||||||
|
position: "absolute",
|
||||||
|
fontSize: 12,
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
textAlign: "center",
|
||||||
|
color: "grey",
|
||||||
|
},
|
||||||
|
|
||||||
|
richArea: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: "red",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const statement_pdf = ({ docProps }) => {
|
||||||
|
//console.log("----", docProps);
|
||||||
|
function formatDates(dateObj) {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
|
||||||
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
|
}
|
||||||
|
let values = docProps;
|
||||||
|
|
||||||
|
let datestr = values.pinswg_name.split("-");
|
||||||
|
let signedDate = datestr[2] + "/" + datestr[1] + "/" + datestr[0];
|
||||||
|
let appealTypeValue = getFormCollectionByID(values.appealType);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Document>
|
||||||
|
<Page size="A4" style={styles.page} wrap>
|
||||||
|
<View style={{ padding: 20 }}>
|
||||||
|
<View style={styles.header}>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Statement
|
||||||
|
</Text>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontSize: 15,
|
||||||
|
marginTop: 20,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
For Planning, Conservation area, Listed
|
||||||
|
Building and Advertisement
|
||||||
|
applications/appeals
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Image
|
||||||
|
style={styles.logoImage}
|
||||||
|
src="public/assets/images/pedw_logo.png"
|
||||||
|
alt="PEDW Logo"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.section}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Case details</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>1.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-question-1"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.caseRef}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>1a.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Representation capacity:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.representationCapacity}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>1c.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Representation capacity details:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
<Html style={styles.richArea}>
|
||||||
|
{
|
||||||
|
values.conditional_representationCapacity_Comments
|
||||||
|
}
|
||||||
|
</Html>
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>3.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Site address/grid ref:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.siteAddress}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>4.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Case Type:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{appealTypeValue.value}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Comments</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "column",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>
|
||||||
|
5.
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionTextMid}>
|
||||||
|
Statement
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.questionAnswerWide}>
|
||||||
|
<Html style={styles.richArea}>
|
||||||
|
{values.representationComments}
|
||||||
|
</Html>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>
|
||||||
|
Supporting documents
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>11.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
List of attached files
|
||||||
|
</Text>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.questionAnswer,
|
||||||
|
{ flexDirection: "column" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{values.hasOwnProperty("filesList") &&
|
||||||
|
values.filesList.map(function (p) {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
key={p.name}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
styles={
|
||||||
|
styles.questionTextMid
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{p.name} - {p.size}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>Declaration</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{ width: "40%", fontSize: 12 }}
|
||||||
|
>
|
||||||
|
Signed:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.firstname} {values.lastname}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Date:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{signedDate}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ width: "18%", fontSize: 12 }}>
|
||||||
|
On behalf of:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswerWide}>
|
||||||
|
{values.representationCapacity}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Text
|
||||||
|
style={styles.pageNumber}
|
||||||
|
render={({ pageNumber, totalPages }) =>
|
||||||
|
`${pageNumber} / ${totalPages}`
|
||||||
|
}
|
||||||
|
fixed
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
fixed
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: 20,
|
||||||
|
left: 20,
|
||||||
|
bottom: 20,
|
||||||
|
right: 20,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
padding: 20,
|
||||||
|
paddingTop: 30,
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
</Page>
|
||||||
|
</Document>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,392 @@
|
|||||||
|
import ReactPDF, {
|
||||||
|
Document,
|
||||||
|
Page,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
Image,
|
||||||
|
StyleSheet,
|
||||||
|
PDFViewer,
|
||||||
|
Font,
|
||||||
|
} from "@react-pdf/renderer";
|
||||||
|
import { createElement } from "react";
|
||||||
|
import Html from "react-pdf-html";
|
||||||
|
import { getFormCollectionByID } from "../../components/utils";
|
||||||
|
|
||||||
|
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
page: {
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
paddingBottom: 50,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
fontSize: 25,
|
||||||
|
fontFamily: "Helvetica",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
},
|
||||||
|
subHeader: {
|
||||||
|
fontSize: 20,
|
||||||
|
},
|
||||||
|
logoImage: { width: "200pt" },
|
||||||
|
questionBullet: { width: "5%", fontSize: 12 },
|
||||||
|
questionText: { width: "30%", fontSize: 12 },
|
||||||
|
questionTextMid: { width: "80%", fontSize: 12 },
|
||||||
|
questionTextWide: { width: "95%", fontSize: 12, marginBottom: 5 },
|
||||||
|
questionAnswer: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "65%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerMid: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "20%",
|
||||||
|
fontSize: 12,
|
||||||
|
padding: 5,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
paddingLeft: 10,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
questionAnswerWide: {
|
||||||
|
color: "#757575",
|
||||||
|
width: "95%",
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: "5%",
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
backgroundColor: "white",
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
|
||||||
|
sectionContainer: {
|
||||||
|
backgroundColor: "#F8F8F8",
|
||||||
|
padding: 10,
|
||||||
|
marginTop: 20,
|
||||||
|
fontSize: 15,
|
||||||
|
},
|
||||||
|
pageNumber: {
|
||||||
|
position: "absolute",
|
||||||
|
fontSize: 12,
|
||||||
|
bottom: 20,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
textAlign: "center",
|
||||||
|
color: "grey",
|
||||||
|
},
|
||||||
|
|
||||||
|
richArea: {
|
||||||
|
fontSize: 12,
|
||||||
|
color: "red",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const writtenStatement_pdf = ({ docProps }) => {
|
||||||
|
//console.log("----", docProps);
|
||||||
|
function formatDates(dateObj) {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
|
||||||
|
return dd + "/" + mm + "/" + yyyy;
|
||||||
|
}
|
||||||
|
let values = docProps;
|
||||||
|
|
||||||
|
let datestr = values.pinswg_name.split("-");
|
||||||
|
let signedDate = datestr[2] + "/" + datestr[1] + "/" + datestr[0];
|
||||||
|
let appealTypeValue = getFormCollectionByID(values.appealType);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Document>
|
||||||
|
<Page size="A4" style={styles.page} wrap>
|
||||||
|
<View style={{ padding: 20 }}>
|
||||||
|
<View style={styles.header}>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Written Statement
|
||||||
|
</Text>
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: "60%",
|
||||||
|
fontSize: 15,
|
||||||
|
marginTop: 20,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
For Planning, Conservation area, Listed
|
||||||
|
Building and Advertisement
|
||||||
|
applications/appeals
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Image
|
||||||
|
style={styles.logoImage}
|
||||||
|
src="public/assets/images/pedw_logo.png"
|
||||||
|
alt="PEDW Logo"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.section}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Case details</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>1.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
{t(
|
||||||
|
"myrepresentations:s78-section-question-1"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.caseRef}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>3.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Site address/grid ref:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.siteAddress}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>4.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Case Type:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{appealTypeValue.value}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>Comments</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "column",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>
|
||||||
|
5.
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionTextMid}>
|
||||||
|
Statement
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.questionAnswerWide}>
|
||||||
|
<Html style={styles.richArea}>
|
||||||
|
{values.representationComments}
|
||||||
|
</Html>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 14 }}>
|
||||||
|
Supporting documents
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionBullet}>11.</Text>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
List of attached files
|
||||||
|
</Text>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.questionAnswer,
|
||||||
|
{ flexDirection: "column" },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{values.hasOwnProperty("filesList") &&
|
||||||
|
values.filesList.map(function (p) {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
key={p.name}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
styles={
|
||||||
|
styles.questionTextMid
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{p.name} - {p.size}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
marginTop: 10,
|
||||||
|
fontFamily: "Helvetica-Bold",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>Declaration</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.sectionContainer}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{ width: "40%", fontSize: 12 }}
|
||||||
|
>
|
||||||
|
Signed:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{values.firstname} {values.lastname}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={styles.questionText}>
|
||||||
|
Date:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswer}>
|
||||||
|
{signedDate}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
wrap={false}
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ width: "18%", fontSize: 12 }}>
|
||||||
|
On behalf of:
|
||||||
|
</Text>
|
||||||
|
<Text style={styles.questionAnswerWide}>
|
||||||
|
{values.representationCapacity}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<Text
|
||||||
|
style={styles.pageNumber}
|
||||||
|
render={({ pageNumber, totalPages }) =>
|
||||||
|
`${pageNumber} / ${totalPages}`
|
||||||
|
}
|
||||||
|
fixed
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
fixed
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: 20,
|
||||||
|
left: 20,
|
||||||
|
bottom: 20,
|
||||||
|
right: 20,
|
||||||
|
border: 1,
|
||||||
|
borderColor: "#eee",
|
||||||
|
padding: 20,
|
||||||
|
paddingTop: 30,
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
></View>
|
||||||
|
</Page>
|
||||||
|
</Document>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -6,7 +6,7 @@ import { reduxForm, formValueSelector, Field } from "redux-form";
|
|||||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||||
import jsonpath from "jsonpath";
|
import jsonpath from "jsonpath";
|
||||||
import data from "../../data/collections.json";
|
import data from "../../data/collections.json";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
|
|
||||||
const required = (errorMsg) => (value) =>
|
const required = (errorMsg) => (value) =>
|
||||||
@@ -275,98 +275,96 @@ let AdvancedSearch = (props) => {
|
|||||||
label,
|
label,
|
||||||
errormsg,
|
errormsg,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return <>
|
||||||
<>
|
<div
|
||||||
<div
|
className={
|
||||||
className={
|
touched && error
|
||||||
touched && error
|
? "govuk-form-group govuk-form-group--error"
|
||||||
? "govuk-form-group govuk-form-group--error"
|
: "govuk-form-group "
|
||||||
: "govuk-form-group "
|
}
|
||||||
}
|
>
|
||||||
>
|
<label className="govuk-label" htmlFor={id}>
|
||||||
<label className="govuk-label" htmlFor={id}>
|
{label}
|
||||||
{label}
|
{name}
|
||||||
{name}
|
</label>
|
||||||
</label>
|
{touched && error && (
|
||||||
{touched && error && (
|
<span
|
||||||
<span
|
id="passport-issued-error"
|
||||||
id="passport-issued-error"
|
className="govuk-error-message"
|
||||||
className="govuk-error-message"
|
>
|
||||||
>
|
<span className="govuk-visually-hidden">
|
||||||
<span className="govuk-visually-hidden">
|
Error:
|
||||||
Error:
|
</span>{" "}
|
||||||
</span>{" "}
|
{errormsg}
|
||||||
{errormsg}
|
</span>
|
||||||
</span>
|
)}
|
||||||
)}
|
<div>
|
||||||
<div>
|
<select
|
||||||
<select
|
{...input}
|
||||||
{...input}
|
className="govuk-select"
|
||||||
className="govuk-select"
|
id={id}
|
||||||
id={id}
|
name={name}
|
||||||
name={name}
|
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
||||||
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
>
|
||||||
>
|
<option value="" disabled defaultValue>
|
||||||
<option value="" disabled defaultValue>
|
{t("common:drop-down-select")}
|
||||||
{t("common:drop-down-select")}
|
</option>
|
||||||
</option>
|
{_.isEmpty(optionsObj)
|
||||||
{_.isEmpty(optionsObj)
|
? ""
|
||||||
? ""
|
: Object.keys(optionsObj).map((key, index) => {
|
||||||
: Object.keys(optionsObj).map((key, index) => {
|
return (
|
||||||
return (
|
<option
|
||||||
<option
|
key={key}
|
||||||
key={key}
|
value={
|
||||||
value={
|
_.isEmpty(optionsObj[key])
|
||||||
_.isEmpty(optionsObj[key])
|
|
||||||
? ""
|
|
||||||
: _.isEmpty(
|
|
||||||
optionsObj[key]
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: _.isEmpty(
|
|
||||||
optionsObj[key]
|
|
||||||
.value
|
|
||||||
)
|
|
||||||
? ""
|
|
||||||
: optionsObj[key]
|
|
||||||
.attributevalue +
|
|
||||||
"," +
|
|
||||||
optionsObj[key].value
|
|
||||||
.replace(
|
|
||||||
/(\band|[\s\-\+\(\)\,\&])/g,
|
|
||||||
""
|
|
||||||
)
|
|
||||||
.toLowerCase()
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{_.isEmpty(optionsObj[key])
|
|
||||||
? ""
|
|
||||||
: _.isEmpty(optionsObj[key])
|
|
||||||
? ""
|
? ""
|
||||||
: _.isEmpty(
|
: _.isEmpty(
|
||||||
optionsObj[key].value
|
optionsObj[key]
|
||||||
)
|
)
|
||||||
? ""
|
? ""
|
||||||
: router.locale == "cy"
|
: _.isEmpty(
|
||||||
? jsonpath.query(
|
optionsObj[key]
|
||||||
transLookup,
|
.value
|
||||||
'$..[?(@.value=="' +
|
|
||||||
optionsObj[key]
|
|
||||||
.value +
|
|
||||||
'")].value_cy'
|
|
||||||
)
|
)
|
||||||
: optionsObj[key].value ||
|
? ""
|
||||||
t(
|
: optionsObj[key]
|
||||||
"case:summary-no-date-entered-label"
|
.attributevalue +
|
||||||
)}
|
"," +
|
||||||
</option>
|
optionsObj[key].value
|
||||||
);
|
.replace(
|
||||||
})}
|
/(\band|[\s\-\+\(\)\,\&])/g,
|
||||||
</select>
|
""
|
||||||
</div>
|
)
|
||||||
|
.toLowerCase()
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{_.isEmpty(optionsObj[key])
|
||||||
|
? ""
|
||||||
|
: _.isEmpty(optionsObj[key])
|
||||||
|
? ""
|
||||||
|
: _.isEmpty(
|
||||||
|
optionsObj[key].value
|
||||||
|
)
|
||||||
|
? ""
|
||||||
|
: router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
transLookup,
|
||||||
|
'$..[?(@.value=="' +
|
||||||
|
optionsObj[key]
|
||||||
|
.value +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: optionsObj[key].value ||
|
||||||
|
t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)}
|
||||||
|
</option>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
);
|
</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
// const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
@@ -512,7 +510,9 @@ let AdvancedSearch = (props) => {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
//validate={[required]}
|
//validate={[required]}
|
||||||
label={"Case Status"}
|
label={t(
|
||||||
|
"search:case-status-label"
|
||||||
|
)}
|
||||||
errormsg="Local authority is required"
|
errormsg="Local authority is required"
|
||||||
/>
|
/>
|
||||||
{/* <fieldset className="govuk-fieldset">
|
{/* <fieldset className="govuk-fieldset">
|
||||||
@@ -613,11 +613,6 @@ let AdvancedSearch = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import _ from "lodash";
|
|||||||
import transLookup from "../../data/lookuptranslations.json";
|
import transLookup from "../../data/lookuptranslations.json";
|
||||||
import PaginationControl from "./pagination";
|
import PaginationControl from "./pagination";
|
||||||
import { useState, useEffect, useCallback } from "react";
|
import { useState, useEffect, useCallback } from "react";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
import {
|
import {
|
||||||
getBasicDNSSearchPaged,
|
getBasicDNSSearchPaged,
|
||||||
getBasicSearchDetailsPaged,
|
getBasicSearchDetailsPaged,
|
||||||
@@ -356,31 +356,29 @@ const DNSSearchResults = (props) => {
|
|||||||
: "") +
|
: "") +
|
||||||
"/dnsdetails"
|
"/dnsdetails"
|
||||||
}
|
}
|
||||||
>
|
className="govuk-link--no-underline"
|
||||||
<a
|
onClick={() => {
|
||||||
className="govuk-link--no-underline"
|
setCurrentReference({
|
||||||
onClick={() => {
|
"currentReference":
|
||||||
setCurrentReference({
|
item.title,
|
||||||
"currentReference":
|
"currentType":
|
||||||
item.title,
|
"searchResultsObj",
|
||||||
"currentType":
|
"incidentid":
|
||||||
"searchResultsObj",
|
item.incidentid,
|
||||||
"incidentid":
|
"appealType":
|
||||||
item.incidentid,
|
item.pinswg_appealcasetype,
|
||||||
"appealType":
|
"showMap": showMap,
|
||||||
item.pinswg_appealcasetype,
|
});
|
||||||
"showMap": showMap,
|
}}>
|
||||||
});
|
|
||||||
}}
|
<span className="results-visually-hidden">
|
||||||
>
|
{t(
|
||||||
<span className="results-visually-hidden">
|
"search:searchresults-case-reference-label"
|
||||||
{t(
|
)}
|
||||||
"search:searchresults-case-reference-label"
|
:
|
||||||
)}
|
</span>
|
||||||
:
|
{item.title}
|
||||||
</span>
|
|
||||||
{item.title}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -542,11 +540,14 @@ const DNSSearchResults = (props) => {
|
|||||||
"watchedCases"
|
"watchedCases"
|
||||||
);
|
);
|
||||||
alert(
|
alert(
|
||||||
"You have stopped watching case " +
|
t(
|
||||||
item.title
|
"case:you-have-stopped-watching-label"
|
||||||
|
) + item.title
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
title="Stop watching this case"
|
title={t(
|
||||||
|
"case:stop-watching-case-link"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<span className="eye"></span>
|
<span className="eye"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -560,11 +561,14 @@ const DNSSearchResults = (props) => {
|
|||||||
item.pinswg_appealcasetype
|
item.pinswg_appealcasetype
|
||||||
);
|
);
|
||||||
alert(
|
alert(
|
||||||
"You are watching case " +
|
t(
|
||||||
item.title
|
"case:you-are-watching-label"
|
||||||
|
) + item.title
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
title="Watch this case"
|
title={t(
|
||||||
|
"case:watch-this-case-link"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<span className="eye"></span>
|
<span className="eye"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -768,11 +772,6 @@ const DNSSearchResults = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ import {
|
|||||||
} from "../../actions";
|
} from "../../actions";
|
||||||
import data from "../../data/collections.json";
|
import data from "../../data/collections.json";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import LoadingOverlay from "react-loading-overlay";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setSearchResults,
|
setSearchResults,
|
||||||
setSearchDetails,
|
setSearchDetails,
|
||||||
} from "../../store/searchOutput/action";
|
} from "../../store/searchOutput/action";
|
||||||
|
import { setLoggedInUserId } from "../../store/accountDetails/action";
|
||||||
import {
|
import {
|
||||||
setWatchedCases,
|
setWatchedCases,
|
||||||
setWatchedCasesDetails,
|
setWatchedCasesDetails,
|
||||||
@@ -76,6 +76,7 @@ const SearchResults = (props) => {
|
|||||||
const [selectedOption, setSelectedOption] = useState(10);
|
const [selectedOption, setSelectedOption] = useState(10);
|
||||||
const [orderByState, setOrderbyState] = useState("createdon");
|
const [orderByState, setOrderbyState] = useState("createdon");
|
||||||
const [fieldSortState, setfieldSortState] = useState("asc");
|
const [fieldSortState, setfieldSortState] = useState("asc");
|
||||||
|
const [loginToWatch, setLoginToWatch] = useState("true");
|
||||||
|
|
||||||
let spinnerState = () => {
|
let spinnerState = () => {
|
||||||
showSpinnerState == true
|
showSpinnerState == true
|
||||||
@@ -95,12 +96,14 @@ const SearchResults = (props) => {
|
|||||||
createWatchedCases(updateBody)
|
createWatchedCases(updateBody)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
getWatchedCasesProxy(props.accountDetails.loggedinUserId).then(
|
||||||
setWatchedCases(data),
|
(data) => {
|
||||||
getDetails(data, "myWatchedCases").then((data) => {
|
setWatchedCases(data),
|
||||||
setWatchedCasesDetails(data);
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
});
|
setWatchedCasesDetails(data);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -119,7 +122,9 @@ const SearchResults = (props) => {
|
|||||||
deleteWatchedCases(caseID)
|
deleteWatchedCases(caseID)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getWatchedCasesProxy(cookies.pinsUser).then((data) => {
|
getWatchedCasesProxy(
|
||||||
|
props.accountDetails.loggedinUserId
|
||||||
|
).then((data) => {
|
||||||
setWatchedCases(data),
|
setWatchedCases(data),
|
||||||
getDetails(data, "myWatchedCases").then((data) => {
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
setWatchedCasesDetails(data);
|
setWatchedCasesDetails(data);
|
||||||
@@ -129,7 +134,7 @@ const SearchResults = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getDetails = (resultsObj, detailsType) => {
|
const getDetails = (resultsObj, detailsType) => {
|
||||||
//console.log(resultsObj);
|
console.log(resultsObj);
|
||||||
let detailsArr = [];
|
let detailsArr = [];
|
||||||
resultsObj = resultsObj.value;
|
resultsObj = resultsObj.value;
|
||||||
const detailsObj = resultsObj.map((searchDetail, index) => {
|
const detailsObj = resultsObj.map((searchDetail, index) => {
|
||||||
@@ -293,32 +298,27 @@ const SearchResults = (props) => {
|
|||||||
? "/myportal/case"
|
? "/myportal/case"
|
||||||
: "/case"
|
: "/case"
|
||||||
}
|
}
|
||||||
|
className="govuk-link--no-underline"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentReference({
|
||||||
|
"currentReference":
|
||||||
|
item.title,
|
||||||
|
"currentType":
|
||||||
|
"searchResultsObj",
|
||||||
|
"incidentid":
|
||||||
|
item.incidentid,
|
||||||
|
"appealType":
|
||||||
|
item.pinswg_appealcasetype,
|
||||||
|
});
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<a
|
<span className="results-visually-hidden">
|
||||||
className="govuk-link--no-underline"
|
{t(
|
||||||
onClick={() => {
|
"search:searchresults-case-reference-label"
|
||||||
setCurrentReference({
|
)}
|
||||||
"currentReference":
|
:
|
||||||
item.title,
|
</span>
|
||||||
"currentType":
|
{item.title}
|
||||||
"searchResultsObj",
|
|
||||||
"incidentid":
|
|
||||||
item.incidentid,
|
|
||||||
"appealType":
|
|
||||||
item.pinswg_appealcasetype,
|
|
||||||
"showreps":
|
|
||||||
props.showLoginCheck,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"search:searchresults-case-reference-label"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
{item.title}
|
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -355,7 +355,7 @@ const SearchResults = (props) => {
|
|||||||
: ""}
|
: ""}
|
||||||
|
|
||||||
{/* {detailsObj.pinswg_siteaddressline1 !=
|
{/* {detailsObj.pinswg_siteaddressline1 !=
|
||||||
null && <br />} */}
|
null && <br />} */}
|
||||||
|
|
||||||
{_.has(
|
{_.has(
|
||||||
detailsObj,
|
detailsObj,
|
||||||
@@ -507,11 +507,14 @@ const SearchResults = (props) => {
|
|||||||
"watchedCases"
|
"watchedCases"
|
||||||
);
|
);
|
||||||
alert(
|
alert(
|
||||||
"You have stopped watching case " +
|
t(
|
||||||
item.title
|
"case:you-have-stopped-watching-label"
|
||||||
|
) + item.title
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
title="Stop watching this case"
|
title={t(
|
||||||
|
"case:stop-watching-case-link"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<span className="eye"></span>
|
<span className="eye"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -520,16 +523,20 @@ const SearchResults = (props) => {
|
|||||||
className="govuk-summary-list__actionLink watchLink"
|
className="govuk-summary-list__actionLink watchLink"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
selectWatchedCase(
|
selectWatchedCase(
|
||||||
cookies.pinsUser,
|
props.accountDetails
|
||||||
|
.loggedinUserId,
|
||||||
item.incidentid,
|
item.incidentid,
|
||||||
item.pinswg_appealcasetype
|
item.pinswg_appealcasetype
|
||||||
);
|
);
|
||||||
alert(
|
alert(
|
||||||
"You are watching case " +
|
t(
|
||||||
item.title
|
"case:you-are-watching-label"
|
||||||
|
) + item.title
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
title="Watch this case"
|
title={t(
|
||||||
|
"case:watch-this-case-link"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<span className="eye"></span>
|
<span className="eye"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -541,9 +548,18 @@ const SearchResults = (props) => {
|
|||||||
<span
|
<span
|
||||||
className="govuk-summary-list__actionLink watchLink"
|
className="govuk-summary-list__actionLink watchLink"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
signIn("email");
|
// signIn("email");
|
||||||
|
signIn(undefined, {
|
||||||
|
callbackUrl:
|
||||||
|
"/myportal/searchresults?q=" +
|
||||||
|
searchString +
|
||||||
|
"&toWatch=" +
|
||||||
|
item.incidentid +
|
||||||
|
"_" +
|
||||||
|
item.pinswg_appealcasetype,
|
||||||
|
});
|
||||||
// selectWatchedCase(
|
// selectWatchedCase(
|
||||||
// cookies.pinsUser,
|
// props.accountDetails.loggedinUserId,
|
||||||
// item.incidentid,
|
// item.incidentid,
|
||||||
// item.pinswg_appealcasetype
|
// item.pinswg_appealcasetype
|
||||||
// );
|
// );
|
||||||
@@ -552,7 +568,9 @@ const SearchResults = (props) => {
|
|||||||
item.title
|
item.title
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
title="Watch this case"
|
title={t(
|
||||||
|
"case:watch-this-case-link"
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<span className="eye"></span>
|
<span className="eye"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -666,6 +684,28 @@ const SearchResults = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const selectWatchedCase = (loggedInUser, incidentID, appealType) => {
|
||||||
|
let updateBody = {
|
||||||
|
"pinswg_WatchedCase@odata.bind":
|
||||||
|
"/incidents(" + incidentID + ")",
|
||||||
|
"pinswg_Contact@odata.bind": "/contacts(" + loggedInUser + ")",
|
||||||
|
"pinswg_appealcasetype": +appealType,
|
||||||
|
};
|
||||||
|
|
||||||
|
createWatchedCases(updateBody)
|
||||||
|
.then((data) => data)
|
||||||
|
.then(() => {
|
||||||
|
getWatchedCasesProxy(
|
||||||
|
props.accountDetails.loggedinUserId
|
||||||
|
).then((data) => {
|
||||||
|
setWatchedCases(data),
|
||||||
|
getDetails(data, "myWatchedCases").then((data) => {
|
||||||
|
setWatchedCasesDetails(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if (searchLoaded) {
|
if (searchLoaded) {
|
||||||
if (selectedOption) {
|
if (selectedOption) {
|
||||||
setShowSpinnerState(true);
|
setShowSpinnerState(true);
|
||||||
@@ -674,12 +714,41 @@ const SearchResults = (props) => {
|
|||||||
} else {
|
} else {
|
||||||
setSearchLoaded(true);
|
setSearchLoaded(true);
|
||||||
}
|
}
|
||||||
|
if (loginToWatch && router.query.hasOwnProperty("toWatch")) {
|
||||||
|
console.log("am in here");
|
||||||
|
let now = new Date();
|
||||||
|
let expDate = new Date(now);
|
||||||
|
|
||||||
|
expDate.setDate(now.getDate() + 1);
|
||||||
|
|
||||||
|
setLoggedInUserId(props.accountDetails.loggedinUserId);
|
||||||
|
setCookie(null, "pinsUser", props.accountDetails.loggedinUserId, {
|
||||||
|
path: "/",
|
||||||
|
expires: expDate,
|
||||||
|
});
|
||||||
|
selectWatchedCase(
|
||||||
|
props.accountDetails.loggedinUserId,
|
||||||
|
router.query.toWatch.split("_")[0],
|
||||||
|
router.query.toWatch.split("_")[1]
|
||||||
|
);
|
||||||
|
getSearchPageResults(1, orderByState, fieldSortState);
|
||||||
|
setLoginToWatch(false);
|
||||||
|
} else {
|
||||||
|
console.log("or am in here");
|
||||||
|
|
||||||
|
setLoginToWatch(false);
|
||||||
|
}
|
||||||
}, [
|
}, [
|
||||||
selectedOption,
|
selectedOption,
|
||||||
fieldSortState,
|
fieldSortState,
|
||||||
orderByState,
|
orderByState,
|
||||||
searchLoaded,
|
searchLoaded,
|
||||||
|
loginToWatch,
|
||||||
|
setWatchedCases,
|
||||||
getSearchPageResults,
|
getSearchPageResults,
|
||||||
|
setWatchedCasesDetails,
|
||||||
|
props.accountDetails.loggedinUserId,
|
||||||
|
router.query,
|
||||||
]);
|
]);
|
||||||
// console.log(
|
// console.log(
|
||||||
// "page is here ",
|
// "page is here ",
|
||||||
@@ -766,11 +835,6 @@ const SearchResults = (props) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <LoadingOverlay
|
|
||||||
active={showSpinnerState}
|
|
||||||
spinner
|
|
||||||
text={t("common:spinner-searching")}
|
|
||||||
/> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -798,4 +862,12 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(null, mapDispatchToProps)(SearchResults);
|
const mapStateToProps = (state) => {
|
||||||
|
return {
|
||||||
|
// currentView: state.currentView,
|
||||||
|
accountDetails: state.accountDetails,
|
||||||
|
// search: state.search,
|
||||||
|
// searchResultsObj: state.searchResultsObj,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ export default function ViewAllResults(props) {
|
|||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||||
<Link href={router.locale == "cy" ? "/achos" : "/case"}>
|
<Link href={router.locale == "cy" ? "/achos" : "/case"}>
|
||||||
<a>
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
Case Reference:
|
Case Reference:
|
||||||
</span>
|
</span>
|
||||||
{resultsArr[key].title}
|
{resultsArr[key].title}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
@@ -90,12 +90,12 @@ export default function ViewAllResults(props) {
|
|||||||
: "/case"
|
: "/case"
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<a>
|
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
Case Reference:
|
Case Reference:
|
||||||
</span>
|
</span>
|
||||||
{item.title}
|
{item.title}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ export default function Search(props) {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<Link href="/advancedsearch">
|
<Link href="/advancedsearch" className="govuk-button">
|
||||||
<a className="govuk-button">
|
|
||||||
{t(
|
{t(
|
||||||
"search:searchresults-search-button-label"
|
"search:searchresults-search-button-label"
|
||||||
)}
|
)}
|
||||||
</a>
|
|
||||||
</Link>
|
</Link>
|
||||||
{/* <a
|
{/* <a
|
||||||
onClick={() => router.back()}
|
onClick={() => router.back()}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { string } from "prop-types";
|
|
||||||
|
|
||||||
// ALl options are conditional apart from title
|
// ALl options are conditional apart from title
|
||||||
const PageMeta = ({
|
const PageMeta = ({
|
||||||
@@ -96,24 +95,4 @@ const PageMeta = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
PageMeta.propTypes = {
|
|
||||||
title: string,
|
|
||||||
createdAt: string,
|
|
||||||
updatedAt: string,
|
|
||||||
ogImage: string,
|
|
||||||
ogUrl: string,
|
|
||||||
ogTitle: string,
|
|
||||||
ogType: string,
|
|
||||||
ogDescription: string,
|
|
||||||
canonicalURL: string,
|
|
||||||
description: string,
|
|
||||||
keywords: string,
|
|
||||||
createdAt: string,
|
|
||||||
updatedAt: string,
|
|
||||||
robots: string,
|
|
||||||
twitterDescription: string,
|
|
||||||
twitterTitle: string,
|
|
||||||
twitterImage: string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default PageMeta;
|
export default PageMeta;
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ const TimeOut = (props) => {
|
|||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
console.info("////////////\n" + "logout" + "\n////////////");
|
console.info("////////////\n" + "logout" + "\n////////////");
|
||||||
window.localStorage.clear(),
|
window.localStorage.clear(),
|
||||||
destroyCookie({}, "pinsUser"),
|
destroyCookie(null, "next-auth.csrf-token"),
|
||||||
|
destroyCookie(null, "next-auth.callback-url"),
|
||||||
|
destroyCookie(null, "pedw_locale"),
|
||||||
|
destroyCookie(null, "pinsUser"),
|
||||||
signOut({ callbackUrl: "/logout" });
|
signOut({ callbackUrl: "/logout" });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,15 @@ export const getSearchDetails = (searchResultsObj) => {
|
|||||||
searchResultsObj = searchResultsObj.value;
|
searchResultsObj = searchResultsObj.value;
|
||||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||||
if (searchDetail.pinswg_appealcasetype == null) {
|
if (searchDetail.pinswg_appealcasetype == null) {
|
||||||
console.log(searchDetail.title);
|
//console.log(searchDetail.title);
|
||||||
|
detailsArr.push(
|
||||||
|
getBasicSearchDetails(
|
||||||
|
"pinswg_dnses",
|
||||||
|
searchDetail.title,
|
||||||
|
"pinswg_dnsid",
|
||||||
|
searchDetail.incidentid
|
||||||
|
)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
let formMeta = getFormCollectionByID(
|
let formMeta = getFormCollectionByID(
|
||||||
searchDetail.pinswg_appealcasetype
|
searchDetail.pinswg_appealcasetype
|
||||||
@@ -220,8 +228,8 @@ export const getProgressObj = (
|
|||||||
"totalFields": formObj[key].fieldsTotal,
|
"totalFields": formObj[key].fieldsTotal,
|
||||||
"allFieldsComplete":
|
"allFieldsComplete":
|
||||||
titleList[key].value == "Upload documents"
|
titleList[key].value == "Upload documents"
|
||||||
? _.has(props.props.appealType.fileList, "files") &&
|
? _.has(props.props.appealType.fileList, "value") &&
|
||||||
props.props.appealType.fileList.files.length > 0
|
props.props.appealType.fileList.value.length > 0
|
||||||
: rowCount == formObj[key].fieldsTotal,
|
: rowCount == formObj[key].fieldsTotal,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -230,7 +238,7 @@ export const getProgressObj = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const BuildRowObj = (rowXML, titleList) => {
|
const BuildRowObj = (rowXML, titleList) => {
|
||||||
const rowObj = Object.keys(rowXML).map((key, index) => {
|
let rowObj = Object.keys(rowXML).map((key, index) => {
|
||||||
var doc = parser.parseFromString(rowXML[key].outerHTML, "text/xml");
|
var doc = parser.parseFromString(rowXML[key].outerHTML, "text/xml");
|
||||||
if (_.isEmpty(rowXML[key].innerHTML)) {
|
if (_.isEmpty(rowXML[key].innerHTML)) {
|
||||||
("");
|
("");
|
||||||
@@ -361,3 +369,69 @@ export const getTempCaseRef = () => {
|
|||||||
randomString(6).toUpperCase()
|
randomString(6).toUpperCase()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getThumbnailIconByExtension = (blobName) => {
|
||||||
|
let fileType = blobName.slice(blobName.lastIndexOf(".") + 1);
|
||||||
|
|
||||||
|
switch (fileType) {
|
||||||
|
case "html":
|
||||||
|
return "/assets/images/documenttypes/html.png";
|
||||||
|
break;
|
||||||
|
case "txt":
|
||||||
|
return "/assets/images/documenttypes/txt.png";
|
||||||
|
break;
|
||||||
|
case "doc":
|
||||||
|
return "/assets/images/documenttypes/doc.png";
|
||||||
|
break;
|
||||||
|
case "pdf":
|
||||||
|
return "/assets/images/documenttypes/pdf.png";
|
||||||
|
break;
|
||||||
|
case "docx":
|
||||||
|
return "/assets/images/documenttypes/docx.png";
|
||||||
|
break;
|
||||||
|
case "csv":
|
||||||
|
return "/assets/images/documenttypes/csv.png";
|
||||||
|
break;
|
||||||
|
case "xlsx":
|
||||||
|
return "/assets/images/documenttypes/xlsx.png";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "zip":
|
||||||
|
return "/assets/images/documenttypes/zip.png";
|
||||||
|
break;
|
||||||
|
case "jpeg":
|
||||||
|
case "jpg":
|
||||||
|
return "/assets/images/documenttypes/jpg.png";
|
||||||
|
case "png":
|
||||||
|
return "/assets/images/documenttypes/png.png";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return "/assets/images/documenttypes/txt.png";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const bytesToSize = (bytes) => {
|
||||||
|
var sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||||
|
if (bytes == 0) return "0 Byte";
|
||||||
|
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
||||||
|
return Math.round(bytes / Math.pow(1024, i), 2) + " " + sizes[i];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const formatDates = (dateObj, showTime) => {
|
||||||
|
var dateObj = new Date(dateObj);
|
||||||
|
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||||
|
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||||
|
var yyyy = dateObj.getFullYear();
|
||||||
|
var hh = dateObj.getHours();
|
||||||
|
hh = ("0" + hh).slice(-2);
|
||||||
|
var mins = dateObj.getMinutes();
|
||||||
|
mins = ("0" + mins).slice(-2);
|
||||||
|
|
||||||
|
const dateStr = showTime
|
||||||
|
? hh == 0 && mins == 0
|
||||||
|
? ""
|
||||||
|
: hh + ":" + mins
|
||||||
|
: dd + "/" + mm + "/" + yyyy + " ";
|
||||||
|
return dateStr;
|
||||||
|
};
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ export default function ViewAll(props) {
|
|||||||
<div className="govuk-grid-row">
|
<div className="govuk-grid-row">
|
||||||
<div className="govuk-grid-column-full">
|
<div className="govuk-grid-column-full">
|
||||||
<div className="govuk-button-group">
|
<div className="govuk-button-group">
|
||||||
<Link href="/myportal">
|
<Link href="/myportal" className="govuk-button">
|
||||||
<a className="govuk-button">Back</a>
|
Back
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
"pages": {
|
"pages": {
|
||||||
"*": ["common", "newappeal", "search"],
|
"*": ["common", "newappeal", "search"],
|
||||||
"/": ["common", "home"],
|
"/": ["common", "home", "case"],
|
||||||
"/error": ["common", "home", "myportal"],
|
"/error": ["common", "home", "myportal"],
|
||||||
"/myportal": ["myportal", "common", "home"],
|
"/myportal": ["myportal", "common", "home"],
|
||||||
"/myportal/viewall": ["search", "myportal"],
|
"/myportal/viewall": ["search", "myportal"],
|
||||||
"/myportal/advancedsearch": ["search", "myportal"],
|
"/myportal/advancedsearch": ["search", "myportal"],
|
||||||
"/myportal/advancedsearchresults": ["search", "myportal"],
|
"/myportal/advancedsearchresults": ["search", "myportal"],
|
||||||
"/myportal/searchresults": ["search", "myportal"],
|
"/myportal/searchresults": ["search", "myportal", "case"],
|
||||||
"/myportal/case": ["case"],
|
"/myportal/case": ["case"],
|
||||||
"/myportal/dnsapplications": ["search", "dnsCommon", "dnsApplications"],
|
"/myportal/dnsapplications": ["search", "dnsCommon", "dnsApplications"],
|
||||||
"/myportal/dnsdetails": [
|
"/myportal/dnsdetails": [
|
||||||
@@ -27,10 +27,10 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
"/advancedsearch": ["search", "myportal"],
|
"/advancedsearch": ["search", "myportal"],
|
||||||
"/advancedsearchresults": ["search"],
|
"/advancedsearchresults": ["search"],
|
||||||
"/searchresults": ["search"],
|
"/searchresults": ["search", "case"],
|
||||||
"/viewall": ["search"],
|
"/viewall": ["search"],
|
||||||
"/case": ["case"],
|
"/case": ["case"],
|
||||||
"/myportal/representation": ["case"],
|
"/myportal/representation": ["case", "myrepresentations", "common"],
|
||||||
"/myportal/error": ["myportal", "common"],
|
"/myportal/error": ["myportal", "common"],
|
||||||
"/newappeal": ["newappeal"],
|
"/newappeal": ["newappeal"],
|
||||||
"/newappeal/*": ["newappeal"],
|
"/newappeal/*": ["newappeal"],
|
||||||
@@ -44,7 +44,7 @@ module.exports = {
|
|||||||
"/dnsdetails": ["case", "search", "dnsCommon", "dnsApplications"],
|
"/dnsdetails": ["case", "search", "dnsCommon", "dnsApplications"],
|
||||||
"/help/cookies": ["common", "cookies"],
|
"/help/cookies": ["common", "cookies"],
|
||||||
"/account/register": ["common", "account"],
|
"/account/register": ["common", "account"],
|
||||||
"/account/personaldetails": ["common", "search"],
|
"/account/personaldetails": ["common", "search", "account"],
|
||||||
"/details-about-cookies": ["common", "cookies"],
|
"/details-about-cookies": ["common", "cookies"],
|
||||||
"/terms-and-conditions": ["common"],
|
"/terms-and-conditions": ["common"],
|
||||||
"/account/passwordreset": ["common", "home"],
|
"/account/passwordreset": ["common", "home"],
|
||||||
|
|||||||
+21
-1
@@ -37,5 +37,25 @@
|
|||||||
"register-new-account-sub-heading-what-next": "Beth sy'n digwydd nesaf",
|
"register-new-account-sub-heading-what-next": "Beth sy'n digwydd nesaf",
|
||||||
"register-new-account-paragraph-what-next": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a metus non quam mollis egestas. Integer ac leo cursus, laoreet nulla sed, tempus tellus. Mauris condimentum erat arcu.",
|
"register-new-account-paragraph-what-next": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a metus non quam mollis egestas. Integer ac leo cursus, laoreet nulla sed, tempus tellus. Mauris condimentum erat arcu.",
|
||||||
"register-new-account-my-portal-link": "Mewngofnodi i'm Porth",
|
"register-new-account-my-portal-link": "Mewngofnodi i'm Porth",
|
||||||
"register-new-account-account-failed": "Rhowch gynnig arall arni gyda chyfeiriad e-bost gwahanol"
|
"register-new-account-account-failed": "Rhowch gynnig arall arni gyda chyfeiriad e-bost gwahanol",
|
||||||
|
"account-title": "Eich cyfrif",
|
||||||
|
"account-about-you-label": "Amdanat ti",
|
||||||
|
"account-role-label": "Rôl",
|
||||||
|
"account-preferred-language-label": "Hoff iaith",
|
||||||
|
"account-preferred-language-english": "Saesneg",
|
||||||
|
"account-preferred-language-welsh": "Cymraeg",
|
||||||
|
"account-first-name-label": "Enw cyntaf",
|
||||||
|
"account-last-name-label": "Enw olaf",
|
||||||
|
"account-email-address-label": "Cyfeiriad ebost",
|
||||||
|
"account-telephone-label": "Ffon",
|
||||||
|
"account-company-group-label": "Cwmni/Grŵp",
|
||||||
|
"account-your-address-label": "Beth yw eich cyfeiriad?",
|
||||||
|
"account-address-line-1-label": "Llinell Cyfeiriad 1",
|
||||||
|
"account-address-line-2-label": "Llinell cyfeiriad 2",
|
||||||
|
"account-town-city-label": "Tref/Dinas",
|
||||||
|
"account-county-label": "Sir",
|
||||||
|
"account-postcode-label": "Côd post",
|
||||||
|
"account-complete-para-1": "Mae eich manylion wedi'u diweddaru",
|
||||||
|
"account-complete-para-2": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a metus non quam mollis egestas. Integer ac leo cursus, laoreet nulla sed, tempus tellus. Mauris condimentum erat arcu.",
|
||||||
|
"account-complete-return-to-portal-link": "Dychwelyd i Fy mhorth"
|
||||||
}
|
}
|
||||||
+12
-2
@@ -2,7 +2,7 @@
|
|||||||
"page-title": "Cyfeirnod",
|
"page-title": "Cyfeirnod",
|
||||||
"case-card-title": "Reference: APP/B1415/W/20/3271702",
|
"case-card-title": "Reference: APP/B1415/W/20/3271702",
|
||||||
"summary-reference-label": "Cyfeirnod",
|
"summary-reference-label": "Cyfeirnod",
|
||||||
"summary-applicant-label": "Apelydd/Ymgeisydd",
|
"summary-applicant-label": "Apelydd",
|
||||||
"summary-applicantonly-label": "Ymgeisydd",
|
"summary-applicantonly-label": "Ymgeisydd",
|
||||||
"summary-appellantonly-label": "Apelydd",
|
"summary-appellantonly-label": "Apelydd",
|
||||||
"summary-agent-label": "Asiant",
|
"summary-agent-label": "Asiant",
|
||||||
@@ -79,5 +79,15 @@
|
|||||||
"summary-case-website-label": "Gwefan",
|
"summary-case-website-label": "Gwefan",
|
||||||
"summary-case-recommendation-label": "Argymhelliad",
|
"summary-case-recommendation-label": "Argymhelliad",
|
||||||
"summary-no-details-label": "Nid oes unrhyw fanylion ar gael ar hyn o bryd",
|
"summary-no-details-label": "Nid oes unrhyw fanylion ar gael ar hyn o bryd",
|
||||||
"summary-case-relevant-authoritylabel": "Awdurdod perthnasol"
|
"summary-case-relevant-authoritylabel": "Awdurdod perthnasol",
|
||||||
|
"representation-representation-type": "Pa fath o gynrychiolaeth ydych chi'n ei wneud?",
|
||||||
|
"representation-onbehalfof": "A ydych yn gweithredu ar ran cwmni, grŵp neu sefydliad",
|
||||||
|
"representation-onbehalfof-details": "Enw'r cwmni/grŵp/sefydliad",
|
||||||
|
"representation-comments": "Sylwadau",
|
||||||
|
"representation-files": "Ffeiliau perthnasol",
|
||||||
|
"representation-period-ended-on-label": "Daeth y Cyfnod Cynrychiolaeth i ben ar ",
|
||||||
|
"stop-watching-case-link": "Stopiwch wylio'r achos hwn",
|
||||||
|
"watch-this-case-link": "Gwyliwch yr achos hwn",
|
||||||
|
"you-are-watching-label": "Rydych chi'n gwylio achos ",
|
||||||
|
"you-have-stopped-watching-label": "Rydych chi wedi rhoi'r gorau i wylio'r achos "
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user