Merged PR 2009: partial synch with ph2 updates
partial synch with ph2 updates Related work items: #20553
This commit is contained in:
+96
-19
@@ -19,6 +19,7 @@ RELAY_ROOT = https://ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net/ar-hc-lz-pe
|
|||||||
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
|
RELAYURI = "ar-ns-lz-pedw-dev-uks-01.servicebus.windows.net"
|
||||||
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
|
RELAYPATH = "ar-hc-lz-pedw-dev-uks-01"
|
||||||
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
|
||||||
|
CRMURL_VERSION = "v8.2"
|
||||||
|
|
||||||
# //New Test
|
# //New Test
|
||||||
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||||
@@ -27,6 +28,7 @@ RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-p
|
|||||||
RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
|
RELAYURI = "ar-ns-lz-pedw-test-uks-01.servicebus.windows.net"
|
||||||
RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
|
RELAYPATH = "ar-hc-lz-pedw-test-uks-01"
|
||||||
CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
||||||
|
CRMURL_VERSION = "v8.2"
|
||||||
|
|
||||||
# # //New PreProd
|
# # //New PreProd
|
||||||
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||||
@@ -38,6 +40,7 @@ CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
|||||||
# # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
|
# # RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
|
||||||
# # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
|
# # RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
|
||||||
# CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
|
# CRMURL = "ppcrm2016.llcdt.gov.wales/PPPINSWales"
|
||||||
|
# CRMURL_VERSION = "v8.2"
|
||||||
|
|
||||||
|
|
||||||
# //Prod Oauth WGO
|
# //Prod Oauth WGO
|
||||||
@@ -49,15 +52,55 @@ CRMURL = "tscrm2016.llcdt.gov.wales/UATPINS"
|
|||||||
# CRMURL = "crm2016.llc.gov.wales/PEDW"
|
# CRMURL = "crm2016.llc.gov.wales/PEDW"
|
||||||
|
|
||||||
# //New Prod
|
# //New Prod
|
||||||
CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
|
# CLIENT_ID = 3e4141a3-1fbd-454e-98f0-7f3a4f14a3cc
|
||||||
CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
|
# CLIENT_SECRET = tFk8Q~E.R-HFjROTu1sRKqwb_ONzy05uPYoF6awR
|
||||||
RELAY_ROOT = https://ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-prod-uks-01/
|
# RELAY_ROOT = https://ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net/ar-hc-lz-pedw-prod-uks-01/
|
||||||
RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
|
# RELAYURI = "ar-ns-lz-pedw-prod-uks-01.servicebus.windows.net"
|
||||||
RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
|
# RELAYPATH = "ar-hc-lz-pedw-prod-uks-01"
|
||||||
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-prod-ukw-01/
|
# # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-prod-ukw-01/
|
||||||
# RELAYURI = "ar-ns-lz-pedw-prod-ukw-01.servicebus.windows.net"
|
# # RELAYURI = "ar-ns-lz-pedw-prod-ukw-01.servicebus.windows.net"
|
||||||
# RELAYPATH = "ar-hc-lz-pedw-prod-ukw-01"
|
# # RELAYPATH = "ar-hc-lz-pedw-prod-ukw-01"
|
||||||
CRMURL = "crm2016.llcdt.gov.wales/PEDW"
|
# CRMURL = "crm2016.llc.gov.wales/PEDW"
|
||||||
|
# CRMURL_VERSION = "v8.2"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# D365 cnr WGO
|
||||||
|
# CLIENT_ID = 3125ac03-91ac-46a7-a166-0086f0ed90b3
|
||||||
|
# CLIENT_SECRET = bFq8Q~9VX5Ra3lKnGGIXsB.G6-ZGMx7LqyqXjdr4
|
||||||
|
# RELAY_ROOT = https://ar-ns-lz-pedw-d365cnr-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365cnr-uks-01/
|
||||||
|
# RELAYURI = "ar-ns-lz-pedw-d365cnr-uks-01.servicebus.windows.net"
|
||||||
|
# RELAYPATH = "ar-hc-lz-pedw-d365cnr-uks-01"
|
||||||
|
# CRMURL = "dv-pedw.crm11.dynamics.com"
|
||||||
|
# CRMURL_VERSION = "v9.2"
|
||||||
|
|
||||||
|
# D365 Dev WGO
|
||||||
|
# CLIENT_ID = 9b834097-03d7-409b-b038-ecfec31a394a
|
||||||
|
# CLIENT_SECRET = .Jf8Q~tKMObCJjhh_hy3J5AIctFrBalU4FS~tdxk
|
||||||
|
# RELAY_ROOT = https://ar-ns-lz-pedw-d365dev-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365dev-uks-01/
|
||||||
|
# RELAYURI = "ar-ns-lz-pedw-d365dev-uks-01.servicebus.windows.net"
|
||||||
|
# RELAYPATH = "ar-hc-lz-pedw-d365dev-uks-01"
|
||||||
|
# CRMURL = "dv-pedw.crm11.dynamics.com"
|
||||||
|
# CRMURL_VERSION = "v9.2"
|
||||||
|
|
||||||
|
# D365 Test WGO
|
||||||
|
# CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||||
|
# CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
|
||||||
|
# RELAY_ROOT = https://ar-ns-lz-pedw-d365test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365test-uks-01/
|
||||||
|
# RELAYURI = "ar-ns-lz-pedw-d365test-uks-01.servicebus.windows.net"
|
||||||
|
# RELAYPATH = "ar-hc-lz-pedw-d365test-uks-01"
|
||||||
|
# CRMURL = "ts-pedw.crm11.dynamics.com"
|
||||||
|
# CRMURL_VERSION = "v9.2"
|
||||||
|
|
||||||
|
# D365 PP WGO
|
||||||
|
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
|
||||||
|
# CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
|
||||||
|
# RELAY_ROOT = https://ar-ns-lz-pedw-d365ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-d365ppe-uks-01/
|
||||||
|
# RELAYURI = "ar-ns-lz-pedw-d365ppe-uks-01.servicebus.windows.net"
|
||||||
|
# RELAYPATH = "ar-hc-lz-pedw-d365ppe-uks-01"
|
||||||
|
# CRMURL = "wg-pp-pedw.crm11.dynamics.com"
|
||||||
|
# CRMURL_VERSION = "v9.2"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
//GOOGLE_TAG_MANAGER = GTM-T78CBC3
|
||||||
@@ -69,8 +112,8 @@ SHOWMAPS = false
|
|||||||
API_ROOT = "http://localhost:3000"
|
API_ROOT = "http://localhost:3000"
|
||||||
CY_API_ROOT = "http://cymru.local:3000"
|
CY_API_ROOT = "http://cymru.local:3000"
|
||||||
I18N_DOMAIN = "cymru.local"
|
I18N_DOMAIN = "cymru.local"
|
||||||
# DOCAPI_OFFLINE = "12:00:00,14:00:00"
|
DOCAPI_OFFLINE = "07:00:00,14:00:00"
|
||||||
DOCAPI_OFFLINE = "02:00:00,04:00:00"
|
# DOCAPI_OFFLINE = "01:00:00,04:00:00"
|
||||||
SHOWFILTERDOCS = true
|
SHOWFILTERDOCS = true
|
||||||
|
|
||||||
|
|
||||||
@@ -84,7 +127,7 @@ DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433
|
|||||||
|
|
||||||
// dev test sql server
|
// dev test sql server
|
||||||
# DATABASE_URL = sqlserver://pedw-dev-test-sql-svr.database.windows.net:1433;database=PEDWDev;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;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=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
// DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
DATABASE_URL = sqlserver://sql-srv-plt-pedw-dev-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// test sql server
|
// test sql server
|
||||||
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
DATABASE_URL = sqlserver://sql-srv-plt-pedw-test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
@@ -97,7 +140,18 @@ DATABASE_URL = sqlserver://sql-srv-plt-pedw-cnr-uks-01.database.windows.net:1433
|
|||||||
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
# DATABASE_URL = sqlserver://pp-pedw-sql.database.windows.net:1433;database=PEDWPreProd;user=RobBondSQL;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
// Prod sql server
|
// Prod sql server
|
||||||
DATABASE_URL = sqlserver://sql-srv-plt-pedw-prod-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-prod-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
|
// D365 CNR sql server
|
||||||
|
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365cnr-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
|
// D365 Test sql server
|
||||||
|
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365test-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
|
|
||||||
|
// D365 PPE sql server
|
||||||
|
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-d365ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;authentication=ActiveDirectoryPassword
|
||||||
|
|
||||||
|
|
||||||
SECRET = SuperSecret
|
SECRET = SuperSecret
|
||||||
|
|
||||||
@@ -119,9 +173,9 @@ AZURE_STORAGE_ACCOUNT_KEY = MmrsrCjBfop9pI2oImsP/+lJUWU2DrXsAB8nq5bOVROTmPovSGxj
|
|||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
|
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwdevuks.blob.core.windows.net
|
||||||
|
|
||||||
// New test key
|
// New test key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwtestuks"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
|
# AZURE_STORAGE_ACCOUNT_KEY = 5NdDO9GGlbTFLHFOXZRw8H2C0Ow5bFTvHwUHEbStyzg2mbd1uwHSeBSvM/dkN+HfdwrFzqAkwL5P+AStdO6cig==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
||||||
|
|
||||||
// New preprod key
|
// New preprod key
|
||||||
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwppeuks"
|
||||||
@@ -135,9 +189,32 @@ AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwtestuks.blob.core.windows.net
|
|||||||
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
|
||||||
|
|
||||||
# // New PROD key
|
# // New PROD key
|
||||||
AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwproduks"
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwproduks"
|
||||||
AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
|
# AZURE_STORAGE_ACCOUNT_KEY = OfV9MFqXcLLPam9GhEdMWadIOwIzhc5hd5TUqzIuQoswFdtV4ybaemjatSv+Kht0Ny1qQKjLplwY+AStUTZJrg==
|
||||||
AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwproduks.blob.core.windows.net
|
||||||
|
|
||||||
|
# D365 CNR key
|
||||||
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365cnruks"
|
||||||
|
# AZURE_STORAGE_ACCOUNT_KEY = nEwCp+4FuVf/9a4DOyKuQO2yRRV4Ypigg20ch1YaiL09YmEhWMEO5pNLpYtI3WnQCkIqeu1CUqwM+AStCLW01g==
|
||||||
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365cnruks.blob.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
|
# D365 DEV key
|
||||||
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365devuks"
|
||||||
|
# AZURE_STORAGE_ACCOUNT_KEY = XzwQxuZXSwYrVgemDUD2ymTpYTIfWqhypbmEALw1ZEEP0M4D3b3Gh28clSymxwFu7Gu9mhwkW4/V+AStZ6RF8Q==
|
||||||
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365devuks.blob.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
|
# D365 TEST key
|
||||||
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365testuks"
|
||||||
|
# AZURE_STORAGE_ACCOUNT_KEY = 5NdDO9GGlbTFLHFOXZRw8H2C0Ow5bFTvHwUHEbStyzg2mbd1uwHSeBSvM/dkN+HfdwrFzqAkwL5P+AStdO6cig==
|
||||||
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365testuks.blob.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
|
# D365 PP key
|
||||||
|
# AZURE_STORAGE_ACCOUNT_NAME = "sapltpedwd365ppeuks"
|
||||||
|
# AZURE_STORAGE_ACCOUNT_KEY = xQz4FWDnQDE09uPOCj1t7axRiquvZG9vbxL88ywzVsJnTsAgewrHnuAGkxGPBCp2xGE53ffYOme6+AStSr8OoQ==
|
||||||
|
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwd365ppeuks.blob.core.windows.net
|
||||||
|
|
||||||
|
|
||||||
AZURE_PEDW_CONTAINER = "pedwapplications"
|
AZURE_PEDW_CONTAINER = "pedwapplications"
|
||||||
|
|||||||
+3
-3
@@ -45,6 +45,6 @@ public/swagger.json
|
|||||||
certificates/cert-key.pem
|
certificates/cert-key.pem
|
||||||
certificates/cert.pem
|
certificates/cert.pem
|
||||||
gitclean.sh
|
gitclean.sh
|
||||||
|
pages/admin/logcheck.js
|
||||||
dockerfile
|
pages/admin/logchecker.js
|
||||||
Jenkinsfile
|
pages/baracuda.html
|
||||||
|
|||||||
+25
-27
@@ -210,31 +210,31 @@ export const getBlobs = async (containerName, casefolderID) => {
|
|||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casefolderID +
|
encodeURIComponent(casefolderID) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name,
|
encodeURIComponent(blob.name),
|
||||||
"hashedfilepath": hashAPIPath(
|
"hashedfilepath": hashAPIPath(
|
||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casefolderID +
|
encodeURIComponent(casefolderID) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name.split("/")[2]
|
encodeURIComponent(blob.name.split("/")[2])
|
||||||
),
|
),
|
||||||
"deletepath":
|
"deletepath":
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casefolderID +
|
encodeURIComponent(casefolderID) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name.split("/")[2],
|
encodeURIComponent(blob.name.split("/")[2]),
|
||||||
"hasheddeletepath": hashAPIPath(
|
"hasheddeletepath": hashAPIPath(
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casefolderID +
|
encodeURIComponent(casefolderID) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name.split("/")[2]
|
encodeURIComponent(blob.name.split("/")[2])
|
||||||
),
|
),
|
||||||
"hashgetblobs": hashAPIPath(
|
"hashgetblobs": hashAPIPath(
|
||||||
"/api/file/getbloblist?container=" +
|
"/api/file/getbloblist?container=" +
|
||||||
@@ -432,7 +432,6 @@ export const createRepPDFBlob = async (
|
|||||||
containerid: containerName,
|
containerid: containerName,
|
||||||
caseID: caseID,
|
caseID: caseID,
|
||||||
blobType: "Representation PDF",
|
blobType: "Representation PDF",
|
||||||
documentLocationId: whichLocation,
|
|
||||||
ishareLocation: whichLocation,
|
ishareLocation: whichLocation,
|
||||||
documentLocationId: whichLocation,
|
documentLocationId: whichLocation,
|
||||||
};
|
};
|
||||||
@@ -624,7 +623,6 @@ export const uploadFile = async (formContent, containerName, foldername) => {
|
|||||||
caseID: foldername.split("/")[0],
|
caseID: foldername.split("/")[0],
|
||||||
documentType: files[prop][0].fieldName.split(".")[1],
|
documentType: files[prop][0].fieldName.split(".")[1],
|
||||||
blobType: "RepresentationFile",
|
blobType: "RepresentationFile",
|
||||||
documentLocationId: whichLocation,
|
|
||||||
ishareLocation: whichLocation,
|
ishareLocation: whichLocation,
|
||||||
documentLocationId: whichLocation,
|
documentLocationId: whichLocation,
|
||||||
};
|
};
|
||||||
@@ -1244,17 +1242,17 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
|||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
caseReference +
|
encodeURIComponent(caseReference) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name.split("/")[1]
|
encodeURIComponent(blob.name.split("/")[1])
|
||||||
),
|
),
|
||||||
"hasheddeletepath": hashAPIPath(
|
"hasheddeletepath": hashAPIPath(
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
caseReference +
|
encodeURIComponent(caseReference) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name.split("/")[1]
|
encodeURIComponent(blob.name.split("/")[1])
|
||||||
),
|
),
|
||||||
"hashgetblobs": hashAPIPath(
|
"hashgetblobs": hashAPIPath(
|
||||||
"/api/file/getbloblist?container=" +
|
"/api/file/getbloblist?container=" +
|
||||||
@@ -1415,20 +1413,20 @@ export const getRepsFilesBlobs = async (
|
|||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
blob.name.split("/")[0] +
|
encodeURIComponent(
|
||||||
"/" +
|
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
||||||
blob.name.split("/")[1] +
|
) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name.split("/")[3],
|
encodeURIComponent(blob.name.split("/")[3]),
|
||||||
"hashedfilepath": hashAPIPath(
|
"hashedfilepath": hashAPIPath(
|
||||||
"/api/file/downloadblob?container=" +
|
"/api/file/downloadblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
blob.name.split("/")[0] +
|
encodeURIComponent(
|
||||||
"/" +
|
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
||||||
blob.name.split("/")[1] +
|
) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name
|
encodeURIComponent(blob.name.split("/")[3])
|
||||||
),
|
),
|
||||||
"deletepath":
|
"deletepath":
|
||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
@@ -1443,11 +1441,11 @@ export const getRepsFilesBlobs = async (
|
|||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
blob.name.split("/")[0] +
|
encodeURIComponent(
|
||||||
"/" +
|
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
|
||||||
blob.name.split("/")[1] +
|
) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blob.name.split("/")[3]
|
encodeURIComponent(blob.name.split("/")[3])
|
||||||
),
|
),
|
||||||
"hashgetblobs": hashAPIPath(
|
"hashgetblobs": hashAPIPath(
|
||||||
"/api/file/getbloblist?container=" +
|
"/api/file/getbloblist?container=" +
|
||||||
@@ -1459,7 +1457,7 @@ export const getRepsFilesBlobs = async (
|
|||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//console.log("blobObj:", blobObj);
|
console.log("blobObj:", blobObj);
|
||||||
|
|
||||||
return blobObj;
|
return blobObj;
|
||||||
};
|
};
|
||||||
|
|||||||
+65
-31
@@ -389,7 +389,7 @@ export const getDNSCoords = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDNSList = async (searchString) => {
|
export const getDNSList = (searchString) => {
|
||||||
return axios
|
return axios
|
||||||
.get(BASE_URL + "/api/endpoint/getdnslist_api")
|
.get(BASE_URL + "/api/endpoint/getdnslist_api")
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
@@ -544,23 +544,42 @@ export const getBasicSearchDetailsPaged = async (
|
|||||||
appealTypeName,
|
appealTypeName,
|
||||||
caseReference,
|
caseReference,
|
||||||
primaryIdAttribute,
|
primaryIdAttribute,
|
||||||
incidentID
|
incidentIDs
|
||||||
) => {
|
) => {
|
||||||
//console.log("check appealtype:", appealType, caseReference);
|
if (!incidentIDs || incidentIDs.length === 0) return [];
|
||||||
|
|
||||||
return axios
|
console.log("=======", primaryIdAttribute);
|
||||||
.get(
|
// Build OData filter correctly
|
||||||
"/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=" +
|
// const filter = incidentIDs
|
||||||
appealTypeName +
|
// .map((id) => `_${primaryIdAttribute}s_value eq ${id}`)
|
||||||
"&primaryIdAttribute=" +
|
// .join(" or ");
|
||||||
primaryIdAttribute +
|
|
||||||
"&incidentID=" +
|
const filter = incidentIDs
|
||||||
incidentID
|
.map((id) => {
|
||||||
)
|
const suffix =
|
||||||
.then((res) => res.data)
|
primaryIdAttribute === "pinswg_sipscase"
|
||||||
.catch((error) => {
|
? `_${primaryIdAttribute}_value`
|
||||||
consoleLogger(error);
|
: `_${primaryIdAttribute}s_value`;
|
||||||
});
|
|
||||||
|
return `${suffix} eq ${id}`;
|
||||||
|
})
|
||||||
|
.join(" or ");
|
||||||
|
|
||||||
|
const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
|
||||||
|
filter
|
||||||
|
)}`;
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await axios.get(url);
|
||||||
|
return res.data.value || []; // ensure returning an array
|
||||||
|
} catch (error) {
|
||||||
|
consoleLogger(error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchDocumentDetails = (incidentID) => {
|
export const getSearchDocumentDetails = (incidentID) => {
|
||||||
@@ -1507,10 +1526,9 @@ export const deleteMyRepresentationsFromBlob = (
|
|||||||
|
|
||||||
export const deleteWatchedCases = async (watchedCaseID) => {
|
export const deleteWatchedCases = async (watchedCaseID) => {
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" +
|
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
|
||||||
watchedCaseID;
|
|
||||||
var config = {
|
var config = {
|
||||||
method: "get",
|
method: "delete",
|
||||||
url: queryUrl,
|
url: queryUrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1824,9 +1842,9 @@ export const deleteBlob = async (
|
|||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casefolderID +
|
encodeURIComponent(casefolderID) +
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blobName +
|
encodeURIComponent(blobName) +
|
||||||
deleteblobhash
|
deleteblobhash
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -1847,11 +1865,9 @@ export const deleteRepBlob = async (
|
|||||||
"/api/file/deleteblob?container=" +
|
"/api/file/deleteblob?container=" +
|
||||||
containerName +
|
containerName +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casefolderID +
|
encodeURIComponent(casefolderID + "/" + filenamePrefix) +
|
||||||
"/" +
|
|
||||||
filenamePrefix +
|
|
||||||
"&blobname=" +
|
"&blobname=" +
|
||||||
blobName +
|
encodeURIComponent(blobName) +
|
||||||
deleteblobhash
|
deleteblobhash
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -1905,14 +1921,14 @@ export const getProgressFromBlob = async (containerName, casereference) => {
|
|||||||
const res = await axios.get(
|
const res = await axios.get(
|
||||||
BASE_URL +
|
BASE_URL +
|
||||||
"/api/file/getprogressobjblob?container=" +
|
"/api/file/getprogressobjblob?container=" +
|
||||||
containerName +
|
encodeURIComponent(containerName) +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casereference +
|
encodeURIComponent(casereference) +
|
||||||
hashAPIPath(
|
hashAPIPath(
|
||||||
"/api/file/getprogressobjblob?container=" +
|
"/api/file/getprogressobjblob?container=" +
|
||||||
containerName +
|
encodeURIComponent(containerName) +
|
||||||
"&casefolderID=" +
|
"&casefolderID=" +
|
||||||
casereference
|
encodeURIComponent(casereference)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -2220,7 +2236,6 @@ export const getAppealPDFDocument = async (incidentid) => {
|
|||||||
return error.response;
|
return error.response;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getNewAppeals = async (searchString) => {
|
export const getNewAppeals = async (searchString) => {
|
||||||
try {
|
try {
|
||||||
const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
|
const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
|
||||||
@@ -2266,8 +2281,25 @@ export const getNewDocumentsPaged = async (
|
|||||||
fieldSort,
|
fieldSort,
|
||||||
showNumberOfRecords,
|
showNumberOfRecords,
|
||||||
documentType,
|
documentType,
|
||||||
|
documentOrigin,
|
||||||
selectedWeeks
|
selectedWeeks
|
||||||
) => {
|
) => {
|
||||||
|
console.log(
|
||||||
|
"/api/admin/getlatestdocuments_api?pageNumber=" +
|
||||||
|
pageNumber +
|
||||||
|
"&orderby=" +
|
||||||
|
orderBy +
|
||||||
|
"&fieldSort=" +
|
||||||
|
fieldSort +
|
||||||
|
"&showNumberOfRecords=" +
|
||||||
|
showNumberOfRecords +
|
||||||
|
"&documentType=" +
|
||||||
|
documentType +
|
||||||
|
"&numberWeeks=" +
|
||||||
|
selectedWeeks +
|
||||||
|
"&documentOrigin=" +
|
||||||
|
documentOrigin
|
||||||
|
);
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
"/api/admin/getlatestdocuments_api?pageNumber=" +
|
"/api/admin/getlatestdocuments_api?pageNumber=" +
|
||||||
@@ -2281,7 +2313,9 @@ export const getNewDocumentsPaged = async (
|
|||||||
"&documentType=" +
|
"&documentType=" +
|
||||||
documentType +
|
documentType +
|
||||||
"&numberWeeks=" +
|
"&numberWeeks=" +
|
||||||
selectedWeeks
|
selectedWeeks +
|
||||||
|
"&documentOrigin=" +
|
||||||
|
documentOrigin
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export const getSelectQuery = (appealTypeName) => {
|
|||||||
return "&$select=pinswg_detailedeiascreeningrequired,pinswg_speacialistcaseprocess,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_procedure,pinswg_questionnaireduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_startdate,pinswg_otherpartiesstatement,pinswg_finalcommentsduedate,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_speacialistcaseprocess,pinswg_statementduedate";
|
return "&$select=pinswg_detailedeiascreeningrequired,pinswg_speacialistcaseprocess,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_procedure,pinswg_questionnaireduedate,statuscode,pinswg_startdateoftheevent,pinswg_typeofevent,pinswg_startdate,pinswg_otherpartiesstatement,pinswg_finalcommentsduedate,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_speacialistcaseprocess,pinswg_statementduedate";
|
||||||
break;
|
break;
|
||||||
case "pinswg_callinss77s":
|
case "pinswg_callinss77s":
|
||||||
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_startdate,statuscode,pinswg_dateexportedtoiss,pinswg_startdateofevent,pinswg_typeofevent,pinswg_statementsduedate";
|
return "&$select=pinswg_eiarequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_startdate,statuscode,pinswg_dateexportedtoiss,pinswg_startdateofevent,pinswg_typeofevent,pinswg_statementsduedate,pinswg_otherpartiesstatement";
|
||||||
break;
|
break;
|
||||||
case "pinswg_commonlands":
|
case "pinswg_commonlands":
|
||||||
return "&$select=pinswg_detailedeiascreeningrequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_starttimeoftheevent,pinswg_typeofevent,pinswg_statementsduedate";
|
return "&$select=pinswg_detailedeiascreeningrequired,modifiedon,_pinswg_appellant_value,pinswg_name,pinswg_siteaddresscounty,pinswg_siteaddressline1,pinswg_siteaddressline2,pinswg_siteaddresspostcode,pinswg_siteaddresstown,_pinswg_associatedlpa_value,pinswg_casedecisiondate,pinswg_dateeventrequested,pinswg_decision,pinswg_finalcommentsduedate,pinswg_otherpartiesstatement,pinswg_procedure,pinswg_proofsofevidencewrittenstatementsofeviden,pinswg_questionnaireduedate,pinswg_relevantauthorityname,pinswg_startdate,statuscode,pinswg_starttimeoftheevent,pinswg_typeofevent,pinswg_statementsduedate";
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export default function AccountsTab({ userData }) {
|
|||||||
>
|
>
|
||||||
{user.email}
|
{user.email}
|
||||||
</Link>
|
</Link>
|
||||||
|
<br />
|
||||||
|
{user.id}
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||||
Last accessed: {user.created}
|
Last accessed: {user.created}
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ function AppealsTab(props) {
|
|||||||
resultsArr.map((item, key) => {
|
resultsArr.map((item, key) => {
|
||||||
let detailsObj = jsonpath({
|
let detailsObj = jsonpath({
|
||||||
path:
|
path:
|
||||||
'$..value[?(@ && @.ticketnumber=="' +
|
'$..[?(@ && @.ticketnumber=="' +
|
||||||
item.ticketnumber +
|
item.ticketnumber +
|
||||||
'")]',
|
'")]',
|
||||||
json: searchDetailsObj,
|
json: searchDetailsObj,
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import { connect } from "react-redux";
|
|||||||
import transLookup from "../../../data/lookuptranslations.json";
|
import transLookup from "../../../data/lookuptranslations.json";
|
||||||
import { formatDates } from "../../utils";
|
import { formatDates } from "../../utils";
|
||||||
import PaginationControl from "../../../components/case/pagination";
|
import PaginationControl from "../../../components/case/pagination";
|
||||||
|
import DocumentLink from "../../utils/downloads";
|
||||||
|
import { useDownloadQueue } from "../../utils/downloadmanager";
|
||||||
|
|
||||||
import { sendGAEvent } from "@next/third-parties/google";
|
import { sendGAEvent } from "@next/third-parties/google";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -170,6 +173,21 @@ const getDocumentTypes = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const getOrigin = [
|
||||||
|
{
|
||||||
|
"Value": 846040000,
|
||||||
|
"Label": "MDU",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Value": 846040001,
|
||||||
|
"Label": "Portal",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Value": 846040002,
|
||||||
|
"Label": "Manual",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const DocumentsTab = (props) => {
|
const DocumentsTab = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
const firstRender = useRef(false);
|
const firstRender = useRef(false);
|
||||||
@@ -189,12 +207,15 @@ const DocumentsTab = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
var documentDetailsArr = documentDetailsObj || [];
|
var documentDetailsArr = documentDetailsObj || [];
|
||||||
|
const { startDownload, getStatus } = useDownloadQueue(3);
|
||||||
const [selectedOption, setSelectedOption] = useState(10);
|
const [selectedOption, setSelectedOption] = useState(10);
|
||||||
const [selectedWeeks, setSelectedWeeks] = useState(1);
|
const [selectedWeeks, setSelectedWeeks] = useState(1);
|
||||||
const [documentTypes, setDocumentTypes] = useState(getDocumentTypes);
|
const [documentTypes, setDocumentTypes] = useState(getDocumentTypes);
|
||||||
|
const [documentOrigin, setDocumentOrigin] = useState(getOrigin);
|
||||||
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
|
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
|
||||||
|
const [selectedDocumentOrigin, setSelectedDocumentOrigin] = useState("all");
|
||||||
const [selectAll, setSelectAll] = useState(false);
|
const [selectAll, setSelectAll] = useState(false);
|
||||||
|
const [selectOriginAll, setSelectOriginAll] = useState(false);
|
||||||
|
|
||||||
const [checkedItems, setCheckedItems] = useState(
|
const [checkedItems, setCheckedItems] = useState(
|
||||||
documentTypes.reduce((acc, item) => {
|
documentTypes.reduce((acc, item) => {
|
||||||
@@ -203,6 +224,13 @@ const DocumentsTab = (props) => {
|
|||||||
}, {})
|
}, {})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [checkedOriginItems, setCheckedOriginItems] = useState(
|
||||||
|
documentOrigin.reduce((acc, item) => {
|
||||||
|
acc[item.pinswg_origin] = false;
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
);
|
||||||
|
|
||||||
const handleCheckboxChange = (e) => {
|
const handleCheckboxChange = (e) => {
|
||||||
const { name, checked } = e.target;
|
const { name, checked } = e.target;
|
||||||
|
|
||||||
@@ -213,6 +241,16 @@ const DocumentsTab = (props) => {
|
|||||||
setSelectAll(false);
|
setSelectAll(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCheckboxOriginChange = (e) => {
|
||||||
|
const { name, checked } = e.target;
|
||||||
|
|
||||||
|
setCheckedOriginItems((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[name]: checked,
|
||||||
|
}));
|
||||||
|
setSelectOriginAll(false);
|
||||||
|
};
|
||||||
|
|
||||||
const handleSelectAllChange = (e) => {
|
const handleSelectAllChange = (e) => {
|
||||||
const { checked } = e.target;
|
const { checked } = e.target;
|
||||||
setSelectAll(checked); // Set the 'Select All' state
|
setSelectAll(checked); // Set the 'Select All' state
|
||||||
@@ -230,16 +268,42 @@ const DocumentsTab = (props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSelectOriginAllChange = (e) => {
|
||||||
|
const { checked } = e.target;
|
||||||
|
setSelectOriginAll(checked); // Set the 'Select All' state
|
||||||
|
if (checked) {
|
||||||
|
// If 'Select All' is checked, check all the other checkboxes
|
||||||
|
|
||||||
|
setCheckedOriginItems(
|
||||||
|
documentOrigin.reduce((acc, item) => {
|
||||||
|
acc[item.pinswg_origin] = true;
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
clearCheckboxes();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const clearCheckboxes = () => {
|
const clearCheckboxes = () => {
|
||||||
setSelectAll(false);
|
setSelectAll(false);
|
||||||
|
setSelectOriginAll(false);
|
||||||
setCheckedItems(
|
setCheckedItems(
|
||||||
documentTypes.reduce((acc, item) => {
|
documentTypes.reduce((acc, item) => {
|
||||||
acc[item.pinswg_isharedocumentlocations] = false;
|
acc[item.pinswg_isharedocumentlocations] = false;
|
||||||
return acc;
|
return acc;
|
||||||
}, {}),
|
}, {}),
|
||||||
|
|
||||||
setSelectedDocumentType("all"),
|
setSelectedDocumentType("all"),
|
||||||
setCurrentPage(1)
|
setCurrentPage(1)
|
||||||
);
|
);
|
||||||
|
setCheckedOriginItems(
|
||||||
|
documentOrigin.reduce((acc, item) => {
|
||||||
|
acc["origin_" + item.pinswg_origin] = false;
|
||||||
|
return acc;
|
||||||
|
}, {}),
|
||||||
|
setSelectedDocumentOrigin("all")
|
||||||
|
);
|
||||||
};
|
};
|
||||||
let ShowDocLinks = false;
|
let ShowDocLinks = false;
|
||||||
let checkShowDocLinks = docsOffline != false ? true : false;
|
let checkShowDocLinks = docsOffline != false ? true : false;
|
||||||
@@ -314,6 +378,9 @@ const DocumentsTab = (props) => {
|
|||||||
{t("search:clear-filter-button-label")}
|
{t("search:clear-filter-button-label")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<h4 className="govuk-body govuk-!-font-size-14 govuk-!-margin-bottom-0">
|
||||||
|
Document Type
|
||||||
|
</h4>
|
||||||
<div className="govuk-checkboxes govuk-checkboxes--small">
|
<div className="govuk-checkboxes govuk-checkboxes--small">
|
||||||
{" "}
|
{" "}
|
||||||
<>
|
<>
|
||||||
@@ -335,17 +402,6 @@ const DocumentsTab = (props) => {
|
|||||||
{router.locale == "cy"
|
{router.locale == "cy"
|
||||||
? "Pawb"
|
? "Pawb"
|
||||||
: "All"}{" "}
|
: "All"}{" "}
|
||||||
- (
|
|
||||||
{documentTypes.reduce(
|
|
||||||
(accumulator, currentItem) => {
|
|
||||||
return (
|
|
||||||
accumulator +
|
|
||||||
currentItem.count
|
|
||||||
);
|
|
||||||
},
|
|
||||||
0
|
|
||||||
)}
|
|
||||||
)
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
@@ -389,17 +445,105 @@ const DocumentsTab = (props) => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>{" "}
|
</div>{" "}
|
||||||
|
<h4 className="govuk-body govuk-!-font-size-14 govuk-!-margin-bottom-0">
|
||||||
|
Document Origin
|
||||||
|
</h4>
|
||||||
|
<div className="govuk-checkboxes govuk-checkboxes_short govuk-checkboxes--small">
|
||||||
|
{" "}
|
||||||
|
<>
|
||||||
|
<div className="govuk-checkboxes__item">
|
||||||
|
<input
|
||||||
|
className="govuk-checkboxes__input"
|
||||||
|
type="checkbox"
|
||||||
|
id={"all_" + "_" + 0}
|
||||||
|
key={0}
|
||||||
|
name={"all_" + "_" + 0}
|
||||||
|
checked={selectOriginAll}
|
||||||
|
value={"all"}
|
||||||
|
onChange={
|
||||||
|
handleSelectOriginAllChange
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label-s govuk-checkboxes__label"
|
||||||
|
htmlFor={"all" + "__" + 0}
|
||||||
|
>
|
||||||
|
{router.locale == "cy"
|
||||||
|
? "Pawb"
|
||||||
|
: "All"}{" "}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
{documentOrigin.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="govuk-checkboxes__item"
|
||||||
|
key={key}
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
className="govuk-checkboxes__input"
|
||||||
|
type="checkbox"
|
||||||
|
id={"origin_" + item.Value}
|
||||||
|
key={key}
|
||||||
|
value={"origin_" + item.Value}
|
||||||
|
name={"origin_" + item.Value}
|
||||||
|
checked={
|
||||||
|
checkedOriginItems[
|
||||||
|
"origin_" + item.Value
|
||||||
|
]
|
||||||
|
}
|
||||||
|
onChange={
|
||||||
|
handleCheckboxOriginChange
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="govuk-label-s govuk-checkboxes__label"
|
||||||
|
htmlFor={"origin_" + item.Value}
|
||||||
|
>
|
||||||
|
{router.locale == "cy"
|
||||||
|
? jsonpath({
|
||||||
|
path:
|
||||||
|
'$..[?(@ && @.value=="' +
|
||||||
|
item.Label +
|
||||||
|
'")].value_cy',
|
||||||
|
json: transLookup,
|
||||||
|
eval: true,
|
||||||
|
})
|
||||||
|
: item.Label ||
|
||||||
|
t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)}{" "}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>{" "}
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
className="govuk-button "
|
className="govuk-button "
|
||||||
type="button"
|
type="button"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
const data = [
|
const checkedValues = [
|
||||||
...document.querySelectorAll(
|
...document.querySelectorAll(
|
||||||
".govuk-checkboxes__input:checked"
|
".govuk-checkboxes__input:checked"
|
||||||
),
|
),
|
||||||
].map((e) => e.value);
|
].map((e) => e.value);
|
||||||
setSelectedDocumentType(data);
|
|
||||||
|
const origins = checkedValues
|
||||||
|
.filter((val) =>
|
||||||
|
val.startsWith("origin_")
|
||||||
|
)
|
||||||
|
.map((val) =>
|
||||||
|
val.replace(/^origin_/, "")
|
||||||
|
); // strip prefix
|
||||||
|
|
||||||
|
const types = checkedValues.filter(
|
||||||
|
(val) => !val.startsWith("origin_")
|
||||||
|
);
|
||||||
|
|
||||||
|
setSelectedDocumentType(types);
|
||||||
|
setSelectedDocumentOrigin(origins);
|
||||||
|
|
||||||
setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -610,43 +754,63 @@ const DocumentsTab = (props) => {
|
|||||||
|
|
||||||
{!ShowDocLinks ? (
|
{!ShowDocLinks ? (
|
||||||
detailsObj.pinswg_publishtoweb ? (
|
detailsObj.pinswg_publishtoweb ? (
|
||||||
<Link
|
// <Link
|
||||||
scroll={
|
// scroll={
|
||||||
false
|
// false
|
||||||
|
// }
|
||||||
|
// href={
|
||||||
|
// detailsObj.pinswg_hashlink
|
||||||
|
// }
|
||||||
|
// key={key}
|
||||||
|
// onClick={() => {
|
||||||
|
// toggleDownLoadLink(
|
||||||
|
// key
|
||||||
|
// ),
|
||||||
|
// sendGAEvent(
|
||||||
|
// "event",
|
||||||
|
// "DownloadedFile",
|
||||||
|
// {
|
||||||
|
// caseReference:
|
||||||
|
// props.caseReference,
|
||||||
|
// filename:
|
||||||
|
// detailsObj.pinswg_name,
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// <span className="results-visually-hidden">
|
||||||
|
// {t(
|
||||||
|
// "case:documents-name-label"
|
||||||
|
// )}
|
||||||
|
// :
|
||||||
|
// </span>
|
||||||
|
// {_.has(
|
||||||
|
// detailsObj,
|
||||||
|
// "pinswg_name"
|
||||||
|
// )
|
||||||
|
// ? detailsObj.pinswg_name
|
||||||
|
// : ""}
|
||||||
|
// </Link>
|
||||||
|
<DocumentLink
|
||||||
|
key={
|
||||||
|
detailsObj.pinswg_documentid
|
||||||
}
|
}
|
||||||
href={
|
id={
|
||||||
detailsObj.pinswg_hashlink
|
detailsObj.pinswg_documentid
|
||||||
}
|
}
|
||||||
key={key}
|
detailsObj={
|
||||||
onClick={() => {
|
detailsObj
|
||||||
toggleDownLoadLink(
|
}
|
||||||
key
|
caseReference={
|
||||||
),
|
caseReference
|
||||||
sendGAEvent(
|
}
|
||||||
"event",
|
startDownload={
|
||||||
"DownloadedFile",
|
startDownload
|
||||||
{
|
}
|
||||||
caseReference:
|
getStatus={
|
||||||
props.caseReference,
|
getStatus
|
||||||
filename:
|
}
|
||||||
detailsObj.pinswg_name,
|
/>
|
||||||
}
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span className="results-visually-hidden">
|
|
||||||
{t(
|
|
||||||
"case:documents-name-label"
|
|
||||||
)}
|
|
||||||
:
|
|
||||||
</span>
|
|
||||||
{_.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_name"
|
|
||||||
)
|
|
||||||
? detailsObj.pinswg_name
|
|
||||||
: ""}
|
|
||||||
</Link>
|
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -797,6 +961,7 @@ const DocumentsTab = (props) => {
|
|||||||
fieldSort,
|
fieldSort,
|
||||||
selectedOption,
|
selectedOption,
|
||||||
selectedDocumentType,
|
selectedDocumentType,
|
||||||
|
selectedDocumentOrigin,
|
||||||
selectedWeeks
|
selectedWeeks
|
||||||
)
|
)
|
||||||
.then((data) => data)
|
.then((data) => data)
|
||||||
@@ -810,6 +975,7 @@ const DocumentsTab = (props) => {
|
|||||||
selectedOption,
|
selectedOption,
|
||||||
selectedDocumentType,
|
selectedDocumentType,
|
||||||
selectedWeeks,
|
selectedWeeks,
|
||||||
|
selectedDocumentOrigin,
|
||||||
props.setDocumentDetails,
|
props.setDocumentDetails,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@@ -942,6 +1108,7 @@ const DocumentsTab = (props) => {
|
|||||||
fieldSortState,
|
fieldSortState,
|
||||||
orderByState,
|
orderByState,
|
||||||
getDocumentTypes,
|
getDocumentTypes,
|
||||||
|
getOrigin,
|
||||||
getDocumentResults,
|
getDocumentResults,
|
||||||
lang,
|
lang,
|
||||||
selectedWeeks,
|
selectedWeeks,
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import {
|
|||||||
import { setCurrentPage } from "../../store/currentView/action";
|
import { setCurrentPage } from "../../store/currentView/action";
|
||||||
|
|
||||||
import { setDocumentDetails } from "../../store/searchOutput/action";
|
import { setDocumentDetails } from "../../store/searchOutput/action";
|
||||||
|
import DocumentLink from "../utils/downloads";
|
||||||
|
import { useDownloadQueue } from "../utils/downloadmanager";
|
||||||
|
|
||||||
const DocumentDetails = (props) => {
|
const DocumentDetails = (props) => {
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
@@ -37,7 +39,7 @@ const DocumentDetails = (props) => {
|
|||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
var documentDetailsArr = documentDetailsObj || [];
|
var documentDetailsArr = documentDetailsObj || [];
|
||||||
|
const { startDownload, getStatus } = useDownloadQueue(3);
|
||||||
const [selectedOption, setSelectedOption] = useState(10);
|
const [selectedOption, setSelectedOption] = useState(10);
|
||||||
const [documentTypes, setDocumentTypes] = useState([{}]);
|
const [documentTypes, setDocumentTypes] = useState([{}]);
|
||||||
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
|
const [selectedDocumentType, setSelectedDocumentType] = useState("all");
|
||||||
@@ -287,12 +289,9 @@ const DocumentDetails = (props) => {
|
|||||||
{/* {t("case:documents-date-published-label")} */}
|
{/* {t("case:documents-date-published-label")} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() => sortDataBy("createdon")}
|
||||||
sortDataBy("pinswg_documentpublisheddate")
|
|
||||||
}
|
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState == "createdon"
|
||||||
"pinswg_documentpublisheddate"
|
|
||||||
? fieldSortState == "asc"
|
? fieldSortState == "asc"
|
||||||
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
|
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
|
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
|
||||||
@@ -700,14 +699,9 @@ const DocumentDetails = (props) => {
|
|||||||
{/* {t("case:documents-date-published-label")} */}
|
{/* {t("case:documents-date-published-label")} */}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() => sortDataBy("createdon")}
|
||||||
sortDataBy(
|
|
||||||
"pinswg_documentpublisheddate"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
className={
|
className={
|
||||||
orderByState ==
|
orderByState == "createdon"
|
||||||
"pinswg_documentpublisheddate"
|
|
||||||
? fieldSortState == "asc"
|
? fieldSortState == "asc"
|
||||||
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
|
? `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortAsc`
|
||||||
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
|
: `govuk-link govuk-link--no-underline govuk-!-font-weight-bold govuk-!-font-size-16 sortDesc`
|
||||||
@@ -772,41 +766,63 @@ const DocumentDetails = (props) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{!ShowDocLinks ? (
|
{!ShowDocLinks ? (
|
||||||
<Link
|
<>
|
||||||
scroll={false}
|
<DocumentLink
|
||||||
href={
|
key={
|
||||||
detailsObj.pinswg_hashlink
|
detailsObj.pinswg_documentid
|
||||||
}
|
}
|
||||||
key={key}
|
id={
|
||||||
onClick={() => {
|
detailsObj.pinswg_documentid
|
||||||
toggleDownLoadLink(
|
}
|
||||||
key
|
detailsObj={
|
||||||
),
|
detailsObj
|
||||||
sendGAEvent(
|
}
|
||||||
"event",
|
caseReference={
|
||||||
"DownloadedFile",
|
caseReference
|
||||||
{
|
}
|
||||||
caseReference:
|
startDownload={
|
||||||
props.caseReference,
|
startDownload
|
||||||
filename:
|
}
|
||||||
detailsObj.pinswg_name,
|
getStatus={
|
||||||
}
|
getStatus
|
||||||
);
|
}
|
||||||
}}
|
/>
|
||||||
>
|
{/* <Link
|
||||||
<span className="results-visually-hidden">
|
scroll={false}
|
||||||
{t(
|
href={
|
||||||
"case:documents-name-label"
|
detailsObj.pinswg_hashlink
|
||||||
)}
|
}
|
||||||
:
|
key={key}
|
||||||
</span>
|
onClick={() => {
|
||||||
{_.has(
|
toggleDownLoadLink(
|
||||||
detailsObj,
|
key
|
||||||
"pinswg_name"
|
),
|
||||||
)
|
sendGAEvent(
|
||||||
? detailsObj.pinswg_name
|
"event",
|
||||||
: ""}
|
"DownloadedFile",
|
||||||
</Link>
|
{
|
||||||
|
caseReference:
|
||||||
|
props.caseReference,
|
||||||
|
filename:
|
||||||
|
detailsObj.pinswg_name,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{t(
|
||||||
|
"case:documents-name-label"
|
||||||
|
)}
|
||||||
|
:
|
||||||
|
</span>
|
||||||
|
{_.has(
|
||||||
|
detailsObj,
|
||||||
|
"pinswg_name"
|
||||||
|
)
|
||||||
|
? detailsObj.pinswg_name
|
||||||
|
: ""}
|
||||||
|
</Link> */}
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span className="results-visually-hidden">
|
<span className="results-visually-hidden">
|
||||||
@@ -858,36 +874,14 @@ const DocumentDetails = (props) => {
|
|||||||
:
|
:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{/* {
|
{_.has(
|
||||||
detailsObj.pinswg_documentpublisheddate
|
|
||||||
}
|
|
||||||
{
|
|
||||||
detailsObj.pinswg_latestpublisheddate
|
|
||||||
} */}
|
|
||||||
|
|
||||||
{detailsObj.pinswg_documentpublisheddate !=
|
|
||||||
null
|
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_documentpublisheddate
|
|
||||||
)
|
|
||||||
: formatDates(
|
|
||||||
detailsObj.pinswg_latestpublisheddate
|
|
||||||
)}
|
|
||||||
{/* {_.has(
|
|
||||||
detailsObj,
|
detailsObj,
|
||||||
"pinswg_documentpublisheddate"
|
"pinswg_latestpublisheddate"
|
||||||
)
|
)
|
||||||
? formatDates(
|
|
||||||
detailsObj.pinswg_documentpublisheddate
|
|
||||||
)
|
|
||||||
: _.has(
|
|
||||||
detailsObj,
|
|
||||||
"pinswg_latestpublisheddate"
|
|
||||||
)
|
|
||||||
? formatDates(
|
? formatDates(
|
||||||
detailsObj.pinswg_latestpublisheddate
|
detailsObj.pinswg_latestpublisheddate
|
||||||
)
|
)
|
||||||
: ""} */}
|
: ""}
|
||||||
</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">
|
||||||
@@ -931,9 +925,8 @@ const DocumentDetails = (props) => {
|
|||||||
selectedOption,
|
selectedOption,
|
||||||
selectedDocumentType
|
selectedDocumentType
|
||||||
)
|
)
|
||||||
// .then((data) => data)
|
.then((data) => data)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setDocumentSearchState(true);
|
|
||||||
setDocumentDetails(data);
|
setDocumentDetails(data);
|
||||||
setShowSpinnerState(false);
|
setShowSpinnerState(false);
|
||||||
});
|
});
|
||||||
@@ -1003,10 +996,8 @@ const DocumentDetails = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const [showDocumentSearchState, setDocumentSearchState] = useState(false);
|
const [showDocumentSearchState, setDocumentSearchState] = useState(false);
|
||||||
const [orderByState, setOrderbyState] = useState(
|
const [orderByState, setOrderbyState] = useState("createdon");
|
||||||
"pinswg_documentpublisheddate"
|
const [fieldSortState, setfieldSortState] = useState("asc");
|
||||||
);
|
|
||||||
const [fieldSortState, setfieldSortState] = useState("desc");
|
|
||||||
|
|
||||||
let documentSearchState = () => {
|
let documentSearchState = () => {
|
||||||
showDocumentSearchState == true
|
showDocumentSearchState == true
|
||||||
@@ -1016,14 +1007,14 @@ const DocumentDetails = (props) => {
|
|||||||
|
|
||||||
const sortDataBy = (whichField) => {
|
const sortDataBy = (whichField) => {
|
||||||
setOrderbyState(whichField);
|
setOrderbyState(whichField);
|
||||||
setfieldSortState("desc");
|
setfieldSortState("asc");
|
||||||
|
|
||||||
getDocumentResults(1, whichField, fieldSortState);
|
getDocumentResults(1, whichField, fieldSortState);
|
||||||
whichField == orderByState
|
whichField == orderByState
|
||||||
? fieldSortState == "asc"
|
? fieldSortState == "desc"
|
||||||
? setfieldSortState("desc")
|
? setfieldSortState("asc")
|
||||||
: setfieldSortState("asc")
|
: setfieldSortState("desc")
|
||||||
: setfieldSortState("desc");
|
: setfieldSortState("asc");
|
||||||
setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
setShowSpinnerState(true);
|
setShowSpinnerState(true);
|
||||||
};
|
};
|
||||||
@@ -1058,7 +1049,7 @@ const DocumentDetails = (props) => {
|
|||||||
return docObj;
|
return docObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
//const searchDocumentResultsObj = docDetailsObj();
|
const searchDocumentResultsObj = docDetailsObj();
|
||||||
}, [
|
}, [
|
||||||
incidentid,
|
incidentid,
|
||||||
setDocumentDetails,
|
setDocumentDetails,
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ const CaseSummary = (props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
const {
|
const {
|
||||||
|
appealTypeID,
|
||||||
incidentid,
|
incidentid,
|
||||||
caseReference,
|
caseReference,
|
||||||
myCases,
|
myCases,
|
||||||
@@ -79,7 +80,6 @@ const CaseSummary = (props) => {
|
|||||||
ticketnumber,
|
ticketnumber,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
let appealTypeID = props.appealTypeID || router.query.appealType;
|
|
||||||
const showLoginCheck =
|
const showLoginCheck =
|
||||||
currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
currentType == "directResultsObj" ? "true" : currentView.showLogin;
|
||||||
const { data: session, status } = useSession();
|
const { data: session, status } = useSession();
|
||||||
@@ -482,14 +482,19 @@ const CaseSummary = (props) => {
|
|||||||
<div className="govuk-summary-list__row">
|
<div className="govuk-summary-list__row">
|
||||||
<dt className="govuk-summary-list__key">
|
<dt className="govuk-summary-list__key">
|
||||||
{getFormCollectionByID(
|
{getFormCollectionByID(
|
||||||
appealTypeID
|
appealTypeID ||
|
||||||
|
setCaseQueryObj.value[0]
|
||||||
|
.pinswg_appealcasetype
|
||||||
).PrimaryIdAttribute ==
|
).PrimaryIdAttribute ==
|
||||||
"pinswg_dnsid"
|
"pinswg_dnsid"
|
||||||
? t(
|
? t(
|
||||||
"case:summary-applicantonly-label"
|
"case:summary-applicantonly-label"
|
||||||
)
|
)
|
||||||
: getFormCollectionByID(
|
: getFormCollectionByID(
|
||||||
appealTypeID
|
appealTypeID ||
|
||||||
|
setCaseQueryObj
|
||||||
|
.value[0]
|
||||||
|
.pinswg_appealcasetype
|
||||||
).PrimaryIdAttribute ==
|
).PrimaryIdAttribute ==
|
||||||
"pinswg_nonvalidationid"
|
"pinswg_nonvalidationid"
|
||||||
? t(
|
? t(
|
||||||
@@ -542,7 +547,9 @@ const CaseSummary = (props) => {
|
|||||||
</dt>
|
</dt>
|
||||||
<dd className="govuk-summary-list__value">
|
<dd className="govuk-summary-list__value">
|
||||||
{getFormCollectionByID(
|
{getFormCollectionByID(
|
||||||
appealTypeID
|
appealTypeID ||
|
||||||
|
setCaseQueryObj.value[0]
|
||||||
|
.pinswg_appealcasetype
|
||||||
).PrimaryIdAttribute ==
|
).PrimaryIdAttribute ==
|
||||||
"pinswg_dnsid" ||
|
"pinswg_dnsid" ||
|
||||||
getFormCollectionByID(
|
getFormCollectionByID(
|
||||||
@@ -1980,6 +1987,67 @@ const CaseSummary = (props) => {
|
|||||||
|
|
||||||
expDate.setDate(now.getDate() + 365);
|
expDate.setDate(now.getDate() + 365);
|
||||||
|
|
||||||
|
function 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
function linkedCasesList(linkedCasesReference) {
|
||||||
|
//console.log(linkedCasesReference);
|
||||||
|
|
||||||
|
linkedCasesReference = linkedCasesReference.value || [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ul className="govuk-list govuk-!-font-size-16">
|
||||||
|
{linkedCasesReference.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<li key={key}>
|
||||||
|
<Link
|
||||||
|
href={
|
||||||
|
router.locale == "cy"
|
||||||
|
? "/canlyniadauchwilio?q=" +
|
||||||
|
item.title +
|
||||||
|
"&lk=1"
|
||||||
|
: "/searchresults?q=" +
|
||||||
|
item.title +
|
||||||
|
"&lk=1"
|
||||||
|
}
|
||||||
|
className=""
|
||||||
|
>
|
||||||
|
{item.title}
|
||||||
|
</Link>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
//console.log(item.incidentid, item.title);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showReps(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;
|
||||||
|
}
|
||||||
|
|
||||||
function showRepButton(appealType) {
|
function showRepButton(appealType) {
|
||||||
switch (appealType) {
|
switch (appealType) {
|
||||||
case 846040012:
|
case 846040012:
|
||||||
@@ -2027,6 +2095,14 @@ const CaseSummary = (props) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (status == "authenticated" && cookies.pedwWatchCase != null) {
|
if (status == "authenticated" && cookies.pedwWatchCase != null) {
|
||||||
selectWatchedCase(
|
selectWatchedCase(
|
||||||
props.accountDetails.accountDetails.contactid,
|
props.accountDetails.accountDetails.contactid,
|
||||||
|
|||||||
@@ -748,7 +748,7 @@ const RenderDatePicker = ({
|
|||||||
: value
|
: value
|
||||||
: null
|
: null
|
||||||
} //{parseISO(value) || null}
|
} //{parseISO(value) || null}
|
||||||
className="govuk-input govuk-input--width-12"
|
className="govuk-input govuk-input--width-10"
|
||||||
minDate={minDate}
|
minDate={minDate}
|
||||||
maxDate={maxDate}
|
maxDate={maxDate}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
@@ -1973,10 +1973,6 @@ const RenderFileUpload = (field) => {
|
|||||||
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||||
return "/assets/images/documenttypes/xlsx.png";
|
return "/assets/images/documenttypes/xlsx.png";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "application/zip":
|
|
||||||
return "/assets/images/documenttypes/zip.png";
|
|
||||||
break;
|
|
||||||
case "image/jpeg":
|
case "image/jpeg":
|
||||||
return "/assets/images/documenttypes/jpg.png";
|
return "/assets/images/documenttypes/jpg.png";
|
||||||
case "image/png":
|
case "image/png":
|
||||||
@@ -2145,7 +2141,6 @@ const RenderFileUpload = (field) => {
|
|||||||
[".docx"],
|
[".docx"],
|
||||||
"image/tiff": [".tif", ".tiff"],
|
"image/tiff": [".tif", ".tiff"],
|
||||||
"image/jpeg": [".jpg", ".jpeg"],
|
"image/jpeg": [".jpg", ".jpeg"],
|
||||||
"application/zip": [".zip"],
|
|
||||||
"image/png": [".png"],
|
"image/png": [".png"],
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
|
||||||
[".xlsx"],
|
[".xlsx"],
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
|
|||||||
import transLookup from "../data/lookuptranslations.json";
|
import transLookup from "../data/lookuptranslations.json";
|
||||||
|
|
||||||
const MyPortal = (props) => {
|
const MyPortal = (props) => {
|
||||||
const { showFileUpload, showLoginCheck } = props;
|
const { showFileUpload, showLoginCheck, docsOffline } = props;
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -126,7 +126,9 @@ const MyPortal = (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="flex-container grid-row govuk-body ">
|
<div className="flex-container grid-row govuk-body ">
|
||||||
{!isLPA && <MakeNewAppeal />}
|
{!isLPA && (
|
||||||
|
<MakeNewAppeal docsOffline={docsOffline} />
|
||||||
|
)}
|
||||||
<SearchCases />
|
<SearchCases />
|
||||||
{/* {props.awaitingSubmission.awaitingSubmission[
|
{/* {props.awaitingSubmission.awaitingSubmission[
|
||||||
"@odata.count"
|
"@odata.count"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const AwaitingSubmission = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
(router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=awaitingSubmission"
|
"/fymhorth/gweldpopeth?key=awaitingSubmission"
|
||||||
|
|||||||
@@ -2,11 +2,46 @@ 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";
|
||||||
|
|
||||||
export default function MakeNewAppeal() {
|
export default function MakeNewAppeal(props) {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
|
const { docsOffline } = props;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = router;
|
const { locale } = router;
|
||||||
|
|
||||||
|
let ShowDocLinks = false;
|
||||||
|
let checkShowDocLinks = docsOffline != false ? true : false;
|
||||||
|
|
||||||
|
const getDocLink = (docsOffline) => {
|
||||||
|
var startTime = docsOffline.split(",")[0];
|
||||||
|
var endTime = docsOffline.split(",")[1];
|
||||||
|
|
||||||
|
// console.log(startTime);
|
||||||
|
// console.log(endTime);
|
||||||
|
|
||||||
|
var currentDate = new Date();
|
||||||
|
|
||||||
|
var startDate = new Date(currentDate.getTime());
|
||||||
|
startDate.setHours(startTime.split(":")[0]);
|
||||||
|
startDate.setMinutes(startTime.split(":")[1]);
|
||||||
|
startDate.setSeconds(startTime.split(":")[2]);
|
||||||
|
|
||||||
|
var endDate = new Date(currentDate.getTime());
|
||||||
|
endDate.setHours(endTime.split(":")[0]);
|
||||||
|
endDate.setMinutes(endTime.split(":")[1]);
|
||||||
|
endDate.setSeconds(endTime.split(":")[2]);
|
||||||
|
|
||||||
|
// console.log(startDate);
|
||||||
|
// console.log(endDate);
|
||||||
|
// console.log(currentDate);
|
||||||
|
|
||||||
|
var valid = startDate < currentDate && endDate > currentDate;
|
||||||
|
ShowDocLinks = valid;
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("docsOffline", docsOffline, getDocLink(docsOffline));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card" id="new-appeal-card">
|
<div className="card" id="new-appeal-card">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
@@ -22,11 +57,29 @@ export default function MakeNewAppeal() {
|
|||||||
<p className="govuk-body-s">
|
<p className="govuk-body-s">
|
||||||
{t("myportal:makenewappeal-card-paragraph-two")}
|
{t("myportal:makenewappeal-card-paragraph-two")}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
{ShowDocLinks ? (
|
||||||
<Link href={"/newappeal"} className="govuk-button">
|
<div className="govuk-warning-text ">
|
||||||
{t("myportal:makenewappeal-card-button-label")}
|
<span
|
||||||
</Link>
|
className="govuk-warning-text__icon"
|
||||||
</div>
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
!
|
||||||
|
</span>
|
||||||
|
<strong className="govuk-warning-text__text govuk-!-margin-top-2">
|
||||||
|
<span className="govuk-visually-hidden">
|
||||||
|
Notice
|
||||||
|
</span>
|
||||||
|
{t("myportal:docsoffline-newappeal-label")}
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div>
|
||||||
|
<Link href={"/newappeal"} className="govuk-button">
|
||||||
|
{t("myportal:makenewappeal-card-button-label")}
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<p className="govuk-body-s govuk govuk-!-margin-top-5">
|
<p className="govuk-body-s govuk govuk-!-margin-top-5">
|
||||||
{t("myportal:makenewappeal-card-paragraph-three")}
|
{t("myportal:makenewappeal-card-paragraph-three")}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const MyRepresentations = (props) => {
|
|||||||
<div className="cardVieAll">
|
<div className="cardVieAll">
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
(router.locale != "en"
|
router.locale != "en"
|
||||||
? "/" +
|
? "/" +
|
||||||
router.locale +
|
router.locale +
|
||||||
"/fymhorth/gweldpopeth?key=myRepresentations"
|
"/fymhorth/gweldpopeth?key=myRepresentations"
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const ServiceBanner = (props) => {
|
|||||||
<div className="serviceBanner_userDetails_name">
|
<div className="serviceBanner_userDetails_name">
|
||||||
<Link
|
<Link
|
||||||
href="/account/personaldetails"
|
href="/account/personaldetails"
|
||||||
className="govuk-button-secondary govuk-link--no-underline"
|
className="govuk-button-secondary govuk-link"
|
||||||
>
|
>
|
||||||
{props.accountDetails.accountDetails.firstname}{" "}
|
{props.accountDetails.accountDetails.firstname}{" "}
|
||||||
{props.accountDetails.accountDetails.lastname}
|
{props.accountDetails.accountDetails.lastname}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const SearchResults = (props) => {
|
|||||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||||
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("desc");
|
||||||
const [loginToWatch, setLoginToWatch] = useState("true");
|
const [loginToWatch, setLoginToWatch] = useState("true");
|
||||||
|
|
||||||
let spinnerState = () => {
|
let spinnerState = () => {
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import { useState, useCallback } from "react";
|
||||||
|
|
||||||
|
export function useDownloadQueue(maxConcurrent = 3) {
|
||||||
|
const [queue, setQueue] = useState([]); // queued tasks
|
||||||
|
const [activeCount, setActiveCount] = useState(0);
|
||||||
|
const [statuses, setStatuses] = useState({}); // { id: "idle"|"queued"|"downloading"|"done"|"failed" }
|
||||||
|
|
||||||
|
const scheduleNext = useCallback(() => {
|
||||||
|
setQueue((queueCurr) => {
|
||||||
|
if (activeCount >= maxConcurrent || queueCurr.length === 0)
|
||||||
|
return queueCurr;
|
||||||
|
|
||||||
|
const [task, ...rest] = queueCurr;
|
||||||
|
|
||||||
|
setStatuses((s) => ({ ...s, [task.id]: "downloading" }));
|
||||||
|
setActiveCount((c) => c + 1);
|
||||||
|
|
||||||
|
// Run the download fully in async IIFE
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
await task.downloadFn(); // triggers fetch + blob + <a> click
|
||||||
|
setStatuses((s) => ({ ...s, [task.id]: "done" }));
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
setStatuses((s) => ({ ...s, [task.id]: "failed" }));
|
||||||
|
} finally {
|
||||||
|
setActiveCount((c) => c - 1);
|
||||||
|
scheduleNext(); // promote next in queue
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
return rest;
|
||||||
|
});
|
||||||
|
}, [activeCount, maxConcurrent]);
|
||||||
|
|
||||||
|
const startDownload = useCallback(
|
||||||
|
(id, downloadFn) => {
|
||||||
|
setStatuses((s) => ({ ...s, [id]: "queued" }));
|
||||||
|
setQueue((curr) => [...curr, { id, downloadFn }]);
|
||||||
|
scheduleNext();
|
||||||
|
},
|
||||||
|
[scheduleNext]
|
||||||
|
);
|
||||||
|
|
||||||
|
const getStatus = useCallback((id) => statuses[id] || "idle", [statuses]);
|
||||||
|
|
||||||
|
return { startDownload, getStatus };
|
||||||
|
}
|
||||||
@@ -0,0 +1,325 @@
|
|||||||
|
// // import { useState } from "react";
|
||||||
|
|
||||||
|
// // export default function DocumentLink({ detailsObj, caseReference }) {
|
||||||
|
// // const [downloadStatus, setDownloadStatus] = useState("");
|
||||||
|
// // const [progress, setProgress] = useState(null);
|
||||||
|
|
||||||
|
// // const handleDownload = async () => {
|
||||||
|
// // setDownloadStatus("Downloading");
|
||||||
|
// // setProgress(0);
|
||||||
|
|
||||||
|
// // try {
|
||||||
|
// // const res = await fetch(detailsObj.pinswg_hashlink);
|
||||||
|
// // if (!res.ok) throw new Error("Download failed");
|
||||||
|
|
||||||
|
// // const contentDisposition = res.headers.get("content-disposition");
|
||||||
|
// // const filename = contentDisposition
|
||||||
|
// // ? contentDisposition.split("filename=")[1]
|
||||||
|
// // : detailsObj.pinswg_name || "document";
|
||||||
|
|
||||||
|
// // const contentLength = res.headers.get("content-length");
|
||||||
|
// // const totalBytes = contentLength
|
||||||
|
// // ? parseInt(contentLength, 10)
|
||||||
|
// // : null;
|
||||||
|
|
||||||
|
// // const reader = res.body.getReader();
|
||||||
|
// // let receivedBytes = 0;
|
||||||
|
// // const chunks = [];
|
||||||
|
|
||||||
|
// // while (true) {
|
||||||
|
// // const { done, value } = await reader.read();
|
||||||
|
// // if (done) break;
|
||||||
|
|
||||||
|
// // chunks.push(value);
|
||||||
|
// // receivedBytes += value.length;
|
||||||
|
|
||||||
|
// // if (totalBytes) {
|
||||||
|
// // const percent = Math.round(
|
||||||
|
// // (receivedBytes / totalBytes) * 100
|
||||||
|
// // );
|
||||||
|
// // setProgress(percent);
|
||||||
|
// // }
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// // // Combine chunks into one blob
|
||||||
|
// // const blob = new Blob(chunks);
|
||||||
|
// // const url = window.URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// // const link = document.createElement("a");
|
||||||
|
// // link.href = url;
|
||||||
|
// // link.download = filename;
|
||||||
|
// // document.body.appendChild(link);
|
||||||
|
// // link.click();
|
||||||
|
// // document.body.removeChild(link);
|
||||||
|
|
||||||
|
// // setDownloadStatus("Download complete!");
|
||||||
|
// // setProgress(100);
|
||||||
|
|
||||||
|
// // // Fire GA event
|
||||||
|
// // window.gtag?.("event", "DownloadedFile", {
|
||||||
|
// // caseReference,
|
||||||
|
// // filename,
|
||||||
|
// // });
|
||||||
|
// // } catch (err) {
|
||||||
|
// // console.error(err);
|
||||||
|
// // setDownloadStatus("Download failed");
|
||||||
|
// // setProgress(null);
|
||||||
|
// // }
|
||||||
|
// // };
|
||||||
|
|
||||||
|
// // return (
|
||||||
|
// // <>
|
||||||
|
// // {detailsObj.pinswg_publishtoweb ? (
|
||||||
|
// // <button className="documentLink" onClick={handleDownload}>
|
||||||
|
// // <span className="results-visually-hidden">
|
||||||
|
// // Document name:
|
||||||
|
// // </span>
|
||||||
|
// // {detailsObj.pinswg_name || ""}
|
||||||
|
// // </button>
|
||||||
|
// // ) : (
|
||||||
|
// // <>
|
||||||
|
// // <span className="results-visually-hidden">
|
||||||
|
// // Document name:
|
||||||
|
// // </span>
|
||||||
|
// // {detailsObj.pinswg_name || ""}
|
||||||
|
// // </>
|
||||||
|
// // )}
|
||||||
|
|
||||||
|
// // {downloadStatus && (
|
||||||
|
// // <p
|
||||||
|
// // className={
|
||||||
|
// // downloadStatus == "Downloading"
|
||||||
|
// // ? "govuk-!-font-size-14 govuk-!-margin-left-0 textloading"
|
||||||
|
// // : "govuk-!-font-size-14 govuk-!-margin-left-0 "
|
||||||
|
// // }
|
||||||
|
// // >
|
||||||
|
// // {downloadStatus}
|
||||||
|
// // {/* {progress !== null && ` (${progress}%)`} */}
|
||||||
|
// // </p>
|
||||||
|
// // )}
|
||||||
|
// // </>
|
||||||
|
// // );
|
||||||
|
// // }
|
||||||
|
// import { useState } from "react";
|
||||||
|
|
||||||
|
// export default function DocumentLink({
|
||||||
|
// id,
|
||||||
|
// detailsObj,
|
||||||
|
// caseReference,
|
||||||
|
// startDownload,
|
||||||
|
// getStatus,
|
||||||
|
// }) {
|
||||||
|
// const [downloadStatus, setDownloadStatus] = useState("");
|
||||||
|
// const [progress, setProgress] = useState(null);
|
||||||
|
|
||||||
|
// const downloadFile = async () => {
|
||||||
|
// setDownloadStatus("Downloading");
|
||||||
|
// setProgress(0);
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// const res = await fetch(detailsObj.pinswg_hashlink);
|
||||||
|
// if (!res.ok) throw new Error("Download failed");
|
||||||
|
|
||||||
|
// const contentDisposition = res.headers.get("content-disposition");
|
||||||
|
// const filename = contentDisposition
|
||||||
|
// ? contentDisposition.split("filename=")[1]
|
||||||
|
// : detailsObj.pinswg_name || "document";
|
||||||
|
|
||||||
|
// const contentLength = res.headers.get("content-length");
|
||||||
|
// const totalBytes = contentLength
|
||||||
|
// ? parseInt(contentLength, 10)
|
||||||
|
// : null;
|
||||||
|
|
||||||
|
// const reader = res.body.getReader();
|
||||||
|
// let receivedBytes = 0;
|
||||||
|
// const chunks = [];
|
||||||
|
|
||||||
|
// while (true) {
|
||||||
|
// const { done, value } = await reader.read();
|
||||||
|
// if (done) break;
|
||||||
|
|
||||||
|
// chunks.push(value);
|
||||||
|
// receivedBytes += value.length;
|
||||||
|
|
||||||
|
// if (totalBytes) {
|
||||||
|
// const percent = Math.round(
|
||||||
|
// (receivedBytes / totalBytes) * 100
|
||||||
|
// );
|
||||||
|
// setProgress(percent);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const blob = new Blob(chunks);
|
||||||
|
// const url = window.URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// const link = document.createElement("a");
|
||||||
|
// link.href = url;
|
||||||
|
// link.download = filename;
|
||||||
|
// document.body.appendChild(link);
|
||||||
|
// link.click();
|
||||||
|
// document.body.removeChild(link);
|
||||||
|
|
||||||
|
// setDownloadStatus("Download complete!");
|
||||||
|
// setProgress(100);
|
||||||
|
|
||||||
|
// window.gtag?.("event", "DownloadedFile", {
|
||||||
|
// caseReference,
|
||||||
|
// filename,
|
||||||
|
// });
|
||||||
|
// } catch (err) {
|
||||||
|
// console.error(err);
|
||||||
|
// setDownloadStatus("Download failed");
|
||||||
|
// setProgress(null);
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const handleClick = () => {
|
||||||
|
// if (getStatus(id) !== "idle") return; // don't double enqueue
|
||||||
|
// startDownload(id, downloadFile);
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const status = getStatus(id);
|
||||||
|
|
||||||
|
// return (
|
||||||
|
// <>
|
||||||
|
// {detailsObj.pinswg_publishtoweb ? (
|
||||||
|
// <button className="documentLink" onClick={handleClick}>
|
||||||
|
// <span className="results-visually-hidden">
|
||||||
|
// Document name:
|
||||||
|
// </span>
|
||||||
|
// {detailsObj.pinswg_name || ""}
|
||||||
|
// </button>
|
||||||
|
// ) : (
|
||||||
|
// <>
|
||||||
|
// <span className="results-visually-hidden">
|
||||||
|
// Document name:
|
||||||
|
// </span>
|
||||||
|
// {detailsObj.pinswg_name || ""}
|
||||||
|
// </>
|
||||||
|
// )}
|
||||||
|
|
||||||
|
// {status !== "idle" && (
|
||||||
|
// <p
|
||||||
|
// className={
|
||||||
|
// status === "downloading"
|
||||||
|
// ? "govuk-!-font-size-14 govuk-!-margin-left-0 textloading"
|
||||||
|
// : "govuk-!-font-size-14 govuk-!-margin-left-0"
|
||||||
|
// }
|
||||||
|
// >
|
||||||
|
// {status === "downloading" && progress !== null
|
||||||
|
// ? `Downloading (${progress}%)`
|
||||||
|
// : status === "queued"
|
||||||
|
// ? "Queued"
|
||||||
|
// : status === "done"
|
||||||
|
// ? "Download complete!"
|
||||||
|
// : status === "failed"
|
||||||
|
// ? "Download failed"
|
||||||
|
// : ""}
|
||||||
|
// </p>
|
||||||
|
// )}
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import useTranslation from "next-translate/useTranslation";
|
||||||
|
|
||||||
|
export default function DocumentLink({
|
||||||
|
id,
|
||||||
|
detailsObj,
|
||||||
|
caseReference,
|
||||||
|
startDownload,
|
||||||
|
getStatus,
|
||||||
|
}) {
|
||||||
|
const [progress, setProgress] = useState(null);
|
||||||
|
let { t } = useTranslation();
|
||||||
|
const downloadFile = async () => {
|
||||||
|
setProgress(0);
|
||||||
|
|
||||||
|
const res = await fetch(detailsObj.pinswg_hashlink);
|
||||||
|
if (!res.ok) throw new Error("Download failed");
|
||||||
|
|
||||||
|
const contentDisposition = res.headers.get("content-disposition");
|
||||||
|
const filename = contentDisposition
|
||||||
|
? contentDisposition.split("filename=")[1]
|
||||||
|
: detailsObj.pinswg_name || "document";
|
||||||
|
|
||||||
|
const contentLength = res.headers.get("content-length");
|
||||||
|
const totalBytes = contentLength ? parseInt(contentLength, 10) : null;
|
||||||
|
|
||||||
|
const reader = res.body.getReader();
|
||||||
|
let receivedBytes = 0;
|
||||||
|
const chunks = [];
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
const { done, value } = await reader.read();
|
||||||
|
if (done) break;
|
||||||
|
|
||||||
|
chunks.push(value);
|
||||||
|
receivedBytes += value.length;
|
||||||
|
|
||||||
|
if (totalBytes) {
|
||||||
|
const percent = Math.round((receivedBytes / totalBytes) * 100);
|
||||||
|
setProgress(percent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob(chunks);
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = url;
|
||||||
|
link.download = filename;
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
|
||||||
|
setProgress(100);
|
||||||
|
window.gtag?.("event", "DownloadedFile", { caseReference, filename });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClick = () => {
|
||||||
|
if (getStatus(id) !== "idle") return; // avoid double enqueue
|
||||||
|
startDownload(id, downloadFile);
|
||||||
|
};
|
||||||
|
|
||||||
|
const status = getStatus(id);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{detailsObj.pinswg_publishtoweb ? (
|
||||||
|
<button className="documentLink" onClick={handleClick}>
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
Document name:
|
||||||
|
</span>
|
||||||
|
{detailsObj.pinswg_name || ""}
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<span className="results-visually-hidden">
|
||||||
|
{detailsObj.pinswg_name || ""}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{status !== "idle" && (
|
||||||
|
<p
|
||||||
|
className={
|
||||||
|
status === "downloading"
|
||||||
|
? "govuk-!-font-size-14 govuk-!-margin-left-0 textloading"
|
||||||
|
: "govuk-!-font-size-14 govuk-!-margin-left-0"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{status === "downloading" && progress !== null
|
||||||
|
? t("case:downloading-label")
|
||||||
|
: status === "queued"
|
||||||
|
? t("case:download-queued-label")
|
||||||
|
: status === "done"
|
||||||
|
? t("case:download-complete-label")
|
||||||
|
: status === "failed"
|
||||||
|
? t("case:download-failed-label")
|
||||||
|
: ""}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
+50
-21
@@ -179,29 +179,58 @@ export const getPartSavedDetails = (searchResultsObj) => {
|
|||||||
* Get the details of a case from the appeal type
|
* Get the details of a case from the appeal type
|
||||||
* @param object searchResultsObj
|
* @param object searchResultsObj
|
||||||
*/
|
*/
|
||||||
export const getSearchDetailsPaged = (searchResultsObj) => {
|
export const getSearchDetailsPaged = async (searchResultsObj) => {
|
||||||
let detailsArr = [];
|
|
||||||
searchResultsObj = searchResultsObj.value;
|
searchResultsObj = searchResultsObj.value;
|
||||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
|
||||||
if (searchDetail.pinswg_appealcasetype == null) {
|
// Group incidents by appeal type
|
||||||
console.log(searchDetail.title);
|
const groupedByAppealType = searchResultsObj.reduce((acc, detail) => {
|
||||||
} else {
|
const appealType = detail.pinswg_appealcasetype;
|
||||||
let formMeta = getFormCollectionByID(
|
if (!appealType) {
|
||||||
searchDetail.pinswg_appealcasetype
|
console.log("No appeal type for:", detail.title);
|
||||||
);
|
return acc;
|
||||||
// formMeta?.LogicalCollectionName &&
|
|
||||||
// formMeta?.LogicalCollectionName != "pinswg_sipses" &&
|
|
||||||
detailsArr.push(
|
|
||||||
getBasicSearchDetailsPaged(
|
|
||||||
formMeta.LogicalCollectionName,
|
|
||||||
searchDetail.title,
|
|
||||||
formMeta.PrimaryIdAttribute,
|
|
||||||
searchDetail.incidentid
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
return Promise.all(detailsArr);
|
if (!acc[appealType]) acc[appealType] = [];
|
||||||
|
acc[appealType].push({
|
||||||
|
incidentID: detail.incidentid,
|
||||||
|
title: detail.title,
|
||||||
|
});
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
const allDetails = [];
|
||||||
|
|
||||||
|
// For each appeal type, call getBasicSearchDetailsPaged once with all incident IDs
|
||||||
|
for (const [appealType, incidents] of Object.entries(groupedByAppealType)) {
|
||||||
|
const incidentIDs = incidents.map((i) => i.incidentID);
|
||||||
|
|
||||||
|
// Get the form meta for this appeal type to access primaryIdAttribute
|
||||||
|
const formMeta = getFormCollectionByID(appealType);
|
||||||
|
|
||||||
|
if (!formMeta || !formMeta.PrimaryIdAttribute) {
|
||||||
|
console.log(`Missing form metadata for appeal type: ${appealType}`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(
|
||||||
|
// `Fetching ${incidentIDs.length} incidents for appeal type: ${appealType} with primaryIdAttribute: ${formMeta.PrimaryIdAttribute}`
|
||||||
|
// );
|
||||||
|
|
||||||
|
try {
|
||||||
|
const details = await getBasicSearchDetailsPaged(
|
||||||
|
formMeta.LogicalCollectionName, // appealTypeName
|
||||||
|
null, // caseReference is no longer used in batch
|
||||||
|
formMeta.PrimaryIdAttribute, // primaryIdAttribute
|
||||||
|
incidentIDs // pass array of incidentIDs
|
||||||
|
);
|
||||||
|
|
||||||
|
allDetails.push(...details);
|
||||||
|
} catch (err) {
|
||||||
|
consoleLogger(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return allDetails;
|
||||||
};
|
};
|
||||||
|
|
||||||
// export const absoluteUrl = (req, setLocalhost) => {
|
// export const absoluteUrl = (req, setLocalhost) => {
|
||||||
|
|||||||
@@ -114,6 +114,11 @@
|
|||||||
"representation-date-passed-label": "Mae'r cyfnod cyflwyno sylwadau ar gyfer yr apêl hon rhwng {{startDate}} a {{endDate}}",
|
"representation-date-passed-label": "Mae'r cyfnod cyflwyno sylwadau ar gyfer yr apêl hon rhwng {{startDate}} a {{endDate}}",
|
||||||
"representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio,",
|
"representation-date-passed-additional-label": "Gallwch wneud sylw drwy e-bostio,",
|
||||||
"date-raised": "Dyddiad codi",
|
"date-raised": "Dyddiad codi",
|
||||||
|
"download-complete-label": "Lawrlwytho wedi'i gwblhau!",
|
||||||
|
"downloading-label": "Wrthi'n llwytho i lawr",
|
||||||
|
"download-failed-label": "Methodd y lawrlwythiad",
|
||||||
|
"download-queued-label": "Wedi'i giwio",
|
||||||
|
"docsoffline-reps-label": "Oherwydd cynnal a chadw'r system, ni allwn dderbyn sylwadau ar hyn o bryd. Rhowch gynnig arall arni yn nes ymlaen.",
|
||||||
"event-title": "Digwyddiadau",
|
"event-title": "Digwyddiadau",
|
||||||
"event-name-label": " Enw",
|
"event-name-label": " Enw",
|
||||||
"event-event-name-label": "Enw'r digwyddiad ",
|
"event-event-name-label": "Enw'r digwyddiad ",
|
||||||
|
|||||||
@@ -52,5 +52,6 @@
|
|||||||
"date-raised": "Dyddiad codi",
|
"date-raised": "Dyddiad codi",
|
||||||
"representation-submitted": "Cyflwynwyd y sylw",
|
"representation-submitted": "Cyflwynwyd y sylw",
|
||||||
"submission-processing-label": "Prosesu cyflwyniad",
|
"submission-processing-label": "Prosesu cyflwyniad",
|
||||||
"appeal-pending-label": "Yn yr arfaeth"
|
"appeal-pending-label": "Yn yr arfaeth",
|
||||||
|
"docsoffline-newappeal-label": "Oherwydd gwaith cynnal a chadw'r system, ni allwn dderbyn apeliadau newydd ar hyn o bryd. Rhowch gynnig arall arni yn nes ymlaen."
|
||||||
}
|
}
|
||||||
@@ -115,6 +115,11 @@
|
|||||||
"representation-date-passed-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}",
|
"representation-date-passed-label": "The representation period for this appeal is between {{startDate}} and {{endDate}}",
|
||||||
"representation-date-passed-additional-label": "You can make a representation by emailing,",
|
"representation-date-passed-additional-label": "You can make a representation by emailing,",
|
||||||
"date-raised": "Date raised",
|
"date-raised": "Date raised",
|
||||||
|
"download-complete-label": "Download complete!",
|
||||||
|
"downloading-label": "Downloading",
|
||||||
|
"download-failed-label": "Download failed",
|
||||||
|
"download-queued-label": "Queued",
|
||||||
|
"docsoffline-reps-label": "Due to system maintenance, we are unable to accept representations at this time. Please try again later.",
|
||||||
"event-title": "Events",
|
"event-title": "Events",
|
||||||
"event-name-label": "Name",
|
"event-name-label": "Name",
|
||||||
"event-event-name-label": "Event name",
|
"event-event-name-label": "Event name",
|
||||||
|
|||||||
@@ -52,5 +52,6 @@
|
|||||||
"date-raised": "Date raised",
|
"date-raised": "Date raised",
|
||||||
"representation-submitted": "Representation submitted",
|
"representation-submitted": "Representation submitted",
|
||||||
"submission-processing-label": "Submission processing",
|
"submission-processing-label": "Submission processing",
|
||||||
"appeal-pending-label": "Pending"
|
"appeal-pending-label": "Pending",
|
||||||
|
"docsoffline-newappeal-label": "Due to system maintenance, we are unable to accept new appeals at this time. Please try again later."
|
||||||
}
|
}
|
||||||
+36
-35
@@ -54,10 +54,10 @@ const StoragePage = (props) => {
|
|||||||
{/* Tabs */}
|
{/* Tabs */}
|
||||||
<ul className="govuk-tabs__list">
|
<ul className="govuk-tabs__list">
|
||||||
{[
|
{[
|
||||||
|
"documents",
|
||||||
|
"appeals",
|
||||||
"storage",
|
"storage",
|
||||||
"accounts",
|
"accounts",
|
||||||
"appeals",
|
|
||||||
"documents",
|
|
||||||
].map((tab) => (
|
].map((tab) => (
|
||||||
<li
|
<li
|
||||||
key={tab}
|
key={tab}
|
||||||
@@ -76,20 +76,50 @@ const StoragePage = (props) => {
|
|||||||
props.setCurrentPage(1);
|
props.setCurrentPage(1);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{" "}
|
||||||
|
{tab === "documents" &&
|
||||||
|
"Latest Documents"}
|
||||||
|
{tab === "appeals" &&
|
||||||
|
"Latest Appeals"}
|
||||||
{tab === "storage" &&
|
{tab === "storage" &&
|
||||||
"Storage Account"}
|
"Storage Account"}
|
||||||
{tab === "accounts" &&
|
{tab === "accounts" &&
|
||||||
"User Accounts"}
|
"User Accounts"}
|
||||||
{tab === "appeals" &&
|
|
||||||
"Latest Appeals"}
|
|
||||||
{tab === "documents" &&
|
|
||||||
"Latest Documents"}
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{/* Panels */}
|
{/* Panels */}
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
whichTab === "documents"
|
||||||
|
? "govuk-tabs__panel"
|
||||||
|
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<DocumentsTab
|
||||||
|
documentDetailsObj={
|
||||||
|
props.searchResultsObj
|
||||||
|
.documentDetailsObj
|
||||||
|
}
|
||||||
|
docsOffline={docsOffline}
|
||||||
|
showFilteredDocs={props.showFilteredDocs}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
whichTab === "appeals"
|
||||||
|
? "govuk-tabs__panel"
|
||||||
|
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<AppealsTab
|
||||||
|
searchResultsObj={searchResultsObj}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
whichTab === "storage"
|
whichTab === "storage"
|
||||||
@@ -112,35 +142,6 @@ const StoragePage = (props) => {
|
|||||||
>
|
>
|
||||||
<AccountsTab userData={userData} />
|
<AccountsTab userData={userData} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
whichTab === "appeals"
|
|
||||||
? "govuk-tabs__panel"
|
|
||||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<AppealsTab
|
|
||||||
searchResultsObj={searchResultsObj}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
className={
|
|
||||||
whichTab === "documents"
|
|
||||||
? "govuk-tabs__panel"
|
|
||||||
: "govuk-tabs__panel govuk-tabs__panel--hidden"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<DocumentsTab
|
|
||||||
documentDetailsObj={
|
|
||||||
props.searchResultsObj
|
|
||||||
.documentDetailsObj
|
|
||||||
}
|
|
||||||
docsOffline={docsOffline}
|
|
||||||
showFilteredDocs={props.showFilteredDocs}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -124,8 +124,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
// "=============================== Advanced Search results:",
|
// "=============================== Advanced Search results:",
|
||||||
// searchResultsObj
|
// searchResultsObj
|
||||||
// );
|
// );
|
||||||
const searchDetailsObj =
|
// const searchDetailsObj =
|
||||||
(await getSearchDetails(searchResultsObj)) || null;
|
// (await getSearchDetails(searchResultsObj)) || null;
|
||||||
// console.log(
|
// console.log(
|
||||||
// "=============================== Advanced Search results details:",
|
// "=============================== Advanced Search results details:",
|
||||||
// searchDetailsObj
|
// searchDetailsObj
|
||||||
@@ -136,7 +136,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
store.dispatch(setShowReps(showReps, showLoginCheck));
|
store.dispatch(setShowReps(showReps, showLoginCheck));
|
||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
// store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
store.dispatch(setSearch(Object.entries(query)));
|
store.dispatch(setSearch(Object.entries(query)));
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -64,9 +64,11 @@ export default async function ApiProxy(req, res) {
|
|||||||
var fieldSort = req.query.fieldSort || "desc";
|
var fieldSort = req.query.fieldSort || "desc";
|
||||||
var showNumberOfRecords = req.query.showNumberOfRecords || 10;
|
var showNumberOfRecords = req.query.showNumberOfRecords || 10;
|
||||||
var documentType = req.query.documentType || "all";
|
var documentType = req.query.documentType || "all";
|
||||||
|
var documentOrigin = req.query.documentOrigin || "all";
|
||||||
var numberOfWeeks = req.query.numberWeeks || 1;
|
var numberOfWeeks = req.query.numberWeeks || 1;
|
||||||
|
|
||||||
var docTypeQueryString = "";
|
var docTypeQueryString = "";
|
||||||
|
var docOriginQueryString = "";
|
||||||
|
|
||||||
if (documentType != "all") {
|
if (documentType != "all") {
|
||||||
if (documentType.indexOf(",") >= 0) {
|
if (documentType.indexOf(",") >= 0) {
|
||||||
@@ -91,6 +93,27 @@ export default async function ApiProxy(req, res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (documentOrigin != "all") {
|
||||||
|
if (documentOrigin.indexOf(",") >= 0) {
|
||||||
|
const documentOriginArr = documentOrigin.split(",");
|
||||||
|
|
||||||
|
docOriginQueryString = " and (";
|
||||||
|
documentOriginArr.forEach(function (item, index) {
|
||||||
|
console.log(item, index);
|
||||||
|
|
||||||
|
if (item != "all") {
|
||||||
|
docOriginQueryString += " pinswg_origin eq " + item;
|
||||||
|
|
||||||
|
docOriginQueryString +=
|
||||||
|
index < documentOriginArr.length - 1 ? " or " : "";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
docOriginQueryString += " )";
|
||||||
|
} else {
|
||||||
|
docOriginQueryString += " and pinswg_origin eq " + documentOrigin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function daysAgoISO(days) {
|
function daysAgoISO(days) {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const resultDate = new Date(today);
|
const resultDate = new Date(today);
|
||||||
@@ -103,6 +126,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
"pinswg_documents?$select=pinswg_name,createdon,pinswg_publishtoweb,_pinswg_documentids_value,pinswg_isharedocumentlocations,pinswg_isharedocumentreference,pinswg_uploadurl,pinswg_uploadstatus,pinswg_origin&$filter=createdon ge " +
|
"pinswg_documents?$select=pinswg_name,createdon,pinswg_publishtoweb,_pinswg_documentids_value,pinswg_isharedocumentlocations,pinswg_isharedocumentreference,pinswg_uploadurl,pinswg_uploadstatus,pinswg_origin&$filter=createdon ge " +
|
||||||
daysAgoISO(numberOfWeeks) +
|
daysAgoISO(numberOfWeeks) +
|
||||||
docTypeQueryString +
|
docTypeQueryString +
|
||||||
|
docOriginQueryString +
|
||||||
"&$orderby=" +
|
"&$orderby=" +
|
||||||
orderby +
|
orderby +
|
||||||
" " +
|
" " +
|
||||||
@@ -115,7 +139,7 @@ export default async function ApiProxy(req, res) {
|
|||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
"\n==========================================\n",
|
"\n==========================================\n",
|
||||||
"\nnew docs search ",
|
"\nnew docs search---- ",
|
||||||
"\n\nQuery url: " + queryUrl,
|
"\n\nQuery url: " + queryUrl,
|
||||||
"\n\nRelay link: " + WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
"\n\nRelay link: " + WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
|
||||||
"\n==========================================\n"
|
"\n==========================================\n"
|
||||||
|
|||||||
@@ -1,110 +1,203 @@
|
|||||||
/**
|
// /**
|
||||||
* @swagger
|
// * @swagger
|
||||||
* /api/documents/download/{id}:
|
// * /api/documents/download/{id}:
|
||||||
* get:
|
// * get:
|
||||||
* tags:
|
// * tags:
|
||||||
* - Documents
|
// * - Documents
|
||||||
* description: Get document
|
// * description: Get document
|
||||||
* parameters:
|
// * parameters:
|
||||||
* - name: id
|
// * - name: id
|
||||||
* in: path
|
// * in: path
|
||||||
* description: iShare ID
|
// * description: iShare ID
|
||||||
* type: string
|
// * type: string
|
||||||
* required: true
|
// * required: true
|
||||||
* default: A41567436
|
// * default: A41567436
|
||||||
* - name: hash
|
// * - name: hash
|
||||||
* in: query
|
// * in: query
|
||||||
* description: Hash string
|
// * description: Hash string
|
||||||
* default: e0a1c9cd2817826a25bca67e60b807eae747cbed769e3ec42cf997541c32be71
|
// * default: e0a1c9cd2817826a25bca67e60b807eae747cbed769e3ec42cf997541c32be71
|
||||||
* responses:
|
// * responses:
|
||||||
* 200:
|
// * 200:
|
||||||
* description: Success
|
// * description: Success
|
||||||
*/
|
// */
|
||||||
|
|
||||||
|
// import axios from "axios";
|
||||||
|
// import CryptoJS from "crypto-js";
|
||||||
|
// import { getToken, consoleLogger } from "../../../../actions";
|
||||||
|
|
||||||
|
// const WORDKEY = process.env.HASHKEY;
|
||||||
|
// const accessTokenEndpoint = process.env.ACCESS_TOKEN_ENDPOINT;
|
||||||
|
// const tenantId = process.env.TENANT;
|
||||||
|
|
||||||
|
// const WEBAPI_URL =
|
||||||
|
// process.env.RELAY_ROOT ||
|
||||||
|
// "https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
|
// const hashAPIPath = (queryPath) => {
|
||||||
|
// var hashlink = CryptoJS.HmacSHA256(
|
||||||
|
// queryPath,
|
||||||
|
// CryptoJS.enc.Hex.parse(WORDKEY)
|
||||||
|
// );
|
||||||
|
// hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||||
|
|
||||||
|
// //return "&hash=" + hashlink;
|
||||||
|
|
||||||
|
// return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const azureHeadersPaged = (access_token) => {
|
||||||
|
// return {
|
||||||
|
// headers: {
|
||||||
|
// "OData-MaxVersion": "4.0",
|
||||||
|
// "OData-Version": "4.0",
|
||||||
|
// "Accept": "application/json;odata.metadata=none",
|
||||||
|
// "Prefer":
|
||||||
|
// 'odata.include-annotations="*",return=representation, odata.maxpagesize=10',
|
||||||
|
// "Content-Type": "application/json",
|
||||||
|
// "Authorization": "Bearer " + access_token,
|
||||||
|
// },
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|
||||||
|
// export default async function ApiProxy(req, res) {
|
||||||
|
// var token = await getToken();
|
||||||
|
|
||||||
|
// var docRef = req.query;
|
||||||
|
|
||||||
|
// var queryUrl = "documents/download/" + docRef.id + "?hash=" + docRef.hash;
|
||||||
|
|
||||||
|
// const configDocument = (access_token) => {
|
||||||
|
// return {
|
||||||
|
// headers: {
|
||||||
|
// "OData-MaxVersion": "4.0",
|
||||||
|
// "OData-Version": "4.0",
|
||||||
|
// "Accept": "application/json",
|
||||||
|
// "Prefer": 'odata.include-annotations="*",return=representation',
|
||||||
|
// "Content-Type": "application/json",
|
||||||
|
// "Authorization": "Bearer " + access_token,
|
||||||
|
// },
|
||||||
|
// responseType: "arraybuffer",
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return axios
|
||||||
|
// .get(
|
||||||
|
// WEBAPI_URL + queryUrl, // + hashAPIPath(queryUrl),
|
||||||
|
// configDocument(token.access_token)
|
||||||
|
// )
|
||||||
|
// .then((response) => {
|
||||||
|
// const bytes = response.data.byteLength;
|
||||||
|
// console.log(bytes);
|
||||||
|
|
||||||
|
// res.setHeader(
|
||||||
|
// "content-disposition",
|
||||||
|
// "attachment; filename=" +
|
||||||
|
// response.headers["content-disposition"].split(
|
||||||
|
// "filename="
|
||||||
|
// )[1]
|
||||||
|
// );
|
||||||
|
// return res.status(200).send(response.data);
|
||||||
|
// })
|
||||||
|
// .then(() => {
|
||||||
|
// console.log(docRef.id + "has downloaded");
|
||||||
|
|
||||||
|
// return "downloadComplete";
|
||||||
|
// })
|
||||||
|
// .catch((error) => {
|
||||||
|
// consoleLogger(error);
|
||||||
|
// res.redirect("/filenotavailable");
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import CryptoJS from "crypto-js";
|
|
||||||
import { getToken, consoleLogger } from "../../../../actions";
|
import { getToken, consoleLogger } from "../../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
|
||||||
const accessTokenEndpoint = process.env.ACCESS_TOKEN_ENDPOINT;
|
|
||||||
const tenantId = process.env.TENANT;
|
|
||||||
|
|
||||||
const WEBAPI_URL =
|
const WEBAPI_URL =
|
||||||
process.env.RELAY_ROOT ||
|
process.env.RELAY_ROOT ||
|
||||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||||
|
|
||||||
const hashAPIPath = (queryPath) => {
|
// Retry utility with logging
|
||||||
var hashlink = CryptoJS.HmacSHA256(
|
async function retry(fn, retries = 3, delay = 1000) {
|
||||||
queryPath,
|
for (let attempt = 1; attempt <= retries; attempt++) {
|
||||||
CryptoJS.enc.Hex.parse(WORDKEY)
|
try {
|
||||||
);
|
return { response: await fn(), attempts: attempt };
|
||||||
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
} catch (err) {
|
||||||
|
if (attempt === retries) throw err;
|
||||||
//return "&hash=" + hashlink;
|
console.log(`Retry ${attempt} failed, retrying in ${delay}ms...`);
|
||||||
|
await new Promise((res) => setTimeout(res, delay));
|
||||||
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
|
delay *= 2; // exponential backoff
|
||||||
};
|
}
|
||||||
|
}
|
||||||
const azureHeadersPaged = (access_token) => {
|
|
||||||
return {
|
|
||||||
headers: {
|
|
||||||
"OData-MaxVersion": "4.0",
|
|
||||||
"OData-Version": "4.0",
|
|
||||||
"Accept": "application/json;odata.metadata=none",
|
|
||||||
"Prefer":
|
|
||||||
'odata.include-annotations="*",return=representation, odata.maxpagesize=10',
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"Authorization": "Bearer " + access_token,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default async function ApiProxy(req, res) {
|
|
||||||
var token = await getToken();
|
|
||||||
|
|
||||||
var docRef = req.query;
|
|
||||||
|
|
||||||
var queryUrl = "documents/download/" + docRef.id + "?hash=" + docRef.hash;
|
|
||||||
|
|
||||||
const configDocument = (access_token) => {
|
|
||||||
return {
|
|
||||||
headers: {
|
|
||||||
"OData-MaxVersion": "4.0",
|
|
||||||
"OData-Version": "4.0",
|
|
||||||
"Accept": "application/json",
|
|
||||||
"Prefer": 'odata.include-annotations="*",return=representation',
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"Authorization": "Bearer " + access_token,
|
|
||||||
},
|
|
||||||
responseType: "arraybuffer",
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
return axios
|
|
||||||
.get(
|
|
||||||
WEBAPI_URL + queryUrl, // + hashAPIPath(queryUrl),
|
|
||||||
configDocument(token.access_token)
|
|
||||||
)
|
|
||||||
.then((response) => {
|
|
||||||
const bytes = response.data.byteLength;
|
|
||||||
console.log(bytes);
|
|
||||||
|
|
||||||
res.setHeader(
|
|
||||||
"content-disposition",
|
|
||||||
"attachment; filename=" +
|
|
||||||
response.headers["content-disposition"].split(
|
|
||||||
"filename="
|
|
||||||
)[1]
|
|
||||||
);
|
|
||||||
return res.status(200).send(response.data);
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
console.log(docRef.id + "has downloaded");
|
|
||||||
|
|
||||||
return "downloadComplete";
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
res.redirect("/filenotavailable");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ApiProxy = async (req, res) => {
|
||||||
|
const docRef = req.query;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const token = await getToken();
|
||||||
|
const startTime = Date.now();
|
||||||
|
|
||||||
|
const fetchStream = async () => {
|
||||||
|
const queryUrl =
|
||||||
|
"documents/download/" + docRef.id + "?hash=" + docRef.hash;
|
||||||
|
|
||||||
|
return axios.get(WEBAPI_URL + queryUrl, {
|
||||||
|
headers: {
|
||||||
|
"OData-MaxVersion": "4.0",
|
||||||
|
"OData-Version": "4.0",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Prefer":
|
||||||
|
'odata.include-annotations="*",return=representation',
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": "Bearer " + token.access_token,
|
||||||
|
},
|
||||||
|
responseType: "stream",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const { response, attempts } = await retry(fetchStream, 3, 1000);
|
||||||
|
|
||||||
|
// Extract filename
|
||||||
|
const contentDisposition = response.headers["content-disposition"];
|
||||||
|
const filename = contentDisposition
|
||||||
|
? contentDisposition.split("filename=")[1]
|
||||||
|
: docRef.id;
|
||||||
|
|
||||||
|
res.setHeader(
|
||||||
|
"Content-Disposition",
|
||||||
|
`attachment; filename=${filename}`
|
||||||
|
);
|
||||||
|
res.setHeader("Content-Type", "application/octet-stream");
|
||||||
|
|
||||||
|
let totalBytes = 0;
|
||||||
|
|
||||||
|
response.data.on("data", (chunk) => {
|
||||||
|
totalBytes += chunk.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
response.data.pipe(res);
|
||||||
|
|
||||||
|
response.data.on("end", () => {
|
||||||
|
const durationMs = Date.now() - startTime;
|
||||||
|
console.log(
|
||||||
|
`[Download Complete] Document: ${filename}, ID: ${docRef.id}, Size: ${totalBytes} bytes, Duration: ${durationMs}ms, Attempts: ${attempts}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
response.data.on("error", (err) => {
|
||||||
|
consoleLogger(err);
|
||||||
|
if (!res.headersSent) res.redirect("/filenotavailable");
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
consoleLogger(error);
|
||||||
|
if (!res.headersSent) res.redirect("/filenotavailable");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
api: {
|
||||||
|
responseLimit: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ApiProxy;
|
||||||
|
|||||||
@@ -64,13 +64,16 @@ export default async function ApiProxy(req, res) {
|
|||||||
primaryIdAttribute
|
primaryIdAttribute
|
||||||
).NavigationProperty;
|
).NavigationProperty;
|
||||||
|
|
||||||
|
// "?$filter=_" +
|
||||||
|
// (primaryIdAttribute == "pinswg_sipscase"
|
||||||
|
// ? "pinswg_sipscase_value"
|
||||||
|
// : primaryIdAttribute + "s_value ") +
|
||||||
|
// " eq " +
|
||||||
|
// incidentID +
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
appealTypeName +
|
appealTypeName +
|
||||||
"?$filter=_" +
|
"?$filter=" +
|
||||||
(primaryIdAttribute == "pinswg_sipscase"
|
|
||||||
? "pinswg_sipscase_value"
|
|
||||||
: primaryIdAttribute + "s_value ") +
|
|
||||||
" eq " +
|
|
||||||
incidentID +
|
incidentID +
|
||||||
"&$count=true" +
|
"&$count=true" +
|
||||||
"&$expand=" +
|
"&$expand=" +
|
||||||
|
|||||||
+30
-27
@@ -124,38 +124,41 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
"public, s-maxage=10, stale-while-revalidate=59"
|
"public, s-maxage=10, stale-while-revalidate=59"
|
||||||
);
|
);
|
||||||
|
|
||||||
let searchResultsObj = await getBasicDNSSearch();
|
// let searchResultsObj = await getBasicDNSSearch();
|
||||||
|
|
||||||
searchResultsObj =
|
// searchResultsObj =
|
||||||
searchResultsObj.status == 502
|
// searchResultsObj.status == 502
|
||||||
? {
|
// ? {
|
||||||
value: [],
|
// value: [],
|
||||||
errorCode: searchResultsObj.status,
|
// errorCode: searchResultsObj.status,
|
||||||
errorMsg: searchResultsObj.statusText,
|
// errorMsg: searchResultsObj.statusText,
|
||||||
}
|
// }
|
||||||
: searchResultsObj;
|
// : searchResultsObj;
|
||||||
|
|
||||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||||
const showMapCheck = process.env.SHOWMAPS || false;
|
const showMapCheck = process.env.SHOWMAPS || false;
|
||||||
|
|
||||||
if (_.has(searchResultsObj, "status") == true) {
|
// if (_.has(searchResultsObj, "status") == true) {
|
||||||
return {
|
// return {
|
||||||
redirect: {
|
// redirect: {
|
||||||
//destination: "/dns-not-found",
|
// //destination: "/dns-not-found",
|
||||||
destination: "/error",
|
// destination: "/error",
|
||||||
permanent: false,
|
// permanent: false,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
} else {
|
// } else {
|
||||||
const searchDetailsObj = await getSearchDetails(
|
// // const searchDetailsObj = await getSearchDetails(
|
||||||
searchResultsObj
|
// // searchResultsObj
|
||||||
);
|
// // );
|
||||||
const dnsCoords = await getDNSCoords();
|
// const dnsCoords = await getDNSCoords();
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
// // store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
// // store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
store.dispatch(setSearch("DNS"));
|
// store.dispatch(setSearch("DNS"));
|
||||||
store.dispatch(setDNSCoords(dnsCoords));
|
// store.dispatch(setDNSCoords(dnsCoords));
|
||||||
}
|
// }
|
||||||
|
const dnsCoords = await getDNSCoords();
|
||||||
|
store.dispatch(setSearch("DNS"));
|
||||||
|
store.dispatch(setDNSCoords(dnsCoords));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -106,8 +106,11 @@ const CaseHome = (props) => {
|
|||||||
props.awaitingSubmission.awaitingSubmission
|
props.awaitingSubmission.awaitingSubmission
|
||||||
}
|
}
|
||||||
caseReference={
|
caseReference={
|
||||||
props.searchResultsObj.searchResultsObj.value[0]
|
props.currentView.caseReference.currentReference
|
||||||
.ticketnumber
|
}
|
||||||
|
ticketnumber={
|
||||||
|
props.currentView.caseReference.ticketnumber ||
|
||||||
|
router.query.ticketnumber
|
||||||
}
|
}
|
||||||
ticketnumber={
|
ticketnumber={
|
||||||
props.currentView.caseReference.ticketnumber ||
|
props.currentView.caseReference.ticketnumber ||
|
||||||
@@ -115,13 +118,9 @@ const CaseHome = (props) => {
|
|||||||
}
|
}
|
||||||
currentType={props.currentType}
|
currentType={props.currentType}
|
||||||
appealTypeID={
|
appealTypeID={
|
||||||
props.searchResultsObj.searchResultsObj.value[0]
|
props.currentView.caseReference.appealType
|
||||||
.pinswg_appealcasetype
|
|
||||||
}
|
|
||||||
incidentid={
|
|
||||||
props.searchResultsObj.searchResultsObj.value[0]
|
|
||||||
.incidentid
|
|
||||||
}
|
}
|
||||||
|
incidentid={props.currentView.caseReference.incidentid}
|
||||||
representationsObj={
|
representationsObj={
|
||||||
props.searchResultsObj.representationsObj
|
props.searchResultsObj.representationsObj
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,9 +58,10 @@ const Home = (props) => {
|
|||||||
showLoginCheck,
|
showLoginCheck,
|
||||||
currentView,
|
currentView,
|
||||||
mySubmittedReps,
|
mySubmittedReps,
|
||||||
|
docsOffline,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const { t } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale, query } = router;
|
const { locale, query } = router;
|
||||||
const { appealtypes } = query;
|
const { appealtypes } = query;
|
||||||
@@ -150,6 +151,7 @@ const Home = (props) => {
|
|||||||
containerID={accountDetails.containerID}
|
containerID={accountDetails.containerID}
|
||||||
showLoginCheck={showLoginCheck}
|
showLoginCheck={showLoginCheck}
|
||||||
currentView={currentView}
|
currentView={currentView}
|
||||||
|
docsOffline={docsOffline}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
<Footer footerLinks={footerLinks} ticketnumber={props} />
|
||||||
@@ -357,6 +359,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
showFileUpload: Boolean(process.env.SHOWFILEUPLOAD),
|
showFileUpload: Boolean(process.env.SHOWFILEUPLOAD),
|
||||||
containerID: thisSession.user.id,
|
containerID: thisSession.user.id,
|
||||||
showLoginCheck,
|
showLoginCheck,
|
||||||
|
docsOffline: process.env.DOCAPI_OFFLINE || false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-23
@@ -132,33 +132,34 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||||
store.dispatch(setShowReps(showReps, showLoginCheck));
|
store.dispatch(setShowReps(showReps, showLoginCheck));
|
||||||
|
|
||||||
let searchResultsObj = await getBasicSearch(query.q);
|
// let searchResultsObj = await getBasicSearch(query.q);
|
||||||
|
|
||||||
searchResultsObj =
|
// searchResultsObj =
|
||||||
searchResultsObj.status == 502
|
// searchResultsObj.status == 502
|
||||||
? {
|
// ? {
|
||||||
value: [],
|
// value: [],
|
||||||
errorCode: searchResultsObj.status,
|
// errorCode: searchResultsObj.status,
|
||||||
errorMsg: searchResultsObj.statusText,
|
// errorMsg: searchResultsObj.statusText,
|
||||||
}
|
// }
|
||||||
: searchResultsObj;
|
// : searchResultsObj;
|
||||||
|
|
||||||
if (_.has(searchResultsObj, "status") == true) {
|
// if (_.has(searchResultsObj, "status") == true) {
|
||||||
return {
|
// return {
|
||||||
redirect: {
|
// redirect: {
|
||||||
//destination: "/dns-not-found",
|
// //destination: "/dns-not-found",
|
||||||
destination: "/error",
|
// destination: "/error",
|
||||||
permanent: false,
|
// permanent: false,
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
} else {
|
// } else {
|
||||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
// // const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||||
|
|
||||||
store.dispatch(setSearchResults(searchResultsObj));
|
// store.dispatch(setSearchResults(searchResultsObj));
|
||||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
// // store.dispatch(setSearchDetails(searchDetailsObj));
|
||||||
store.dispatch(setSearch(query.q));
|
// store.dispatch(setSearch(query.q));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
store.dispatch(setSearch(query.q));
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
isLinkedCase: isLinked,
|
isLinkedCase: isLinked,
|
||||||
|
|||||||
@@ -550,7 +550,7 @@ a.longLinkBreak {
|
|||||||
label {
|
label {
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
background-color: $lightgrey_semi;
|
background-color: $lightgrey_semi;
|
||||||
padding: 20px 20px 20px 20px;
|
padding: 20px 20px 20px 50px;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
top: 18px;
|
top: 18px;
|
||||||
@@ -753,7 +753,7 @@ textarea,
|
|||||||
right: -10px;
|
right: -10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.govuk-header__link {
|
a.govuk-header__link {
|
||||||
background-color: $black;
|
background-color: $black;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
@@ -765,9 +765,9 @@ textarea,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.govuk-header__link:focus {
|
a.govuk-header__link:focus {
|
||||||
background-color: $black;
|
background-color: $black;
|
||||||
padding: 10px 20px;
|
padding: 10px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
@@ -1476,6 +1476,22 @@ textarea,
|
|||||||
top: calc(50% - 10px);
|
top: calc(50% - 10px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.documentLink {
|
||||||
|
border: none;
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #0360a6;
|
||||||
|
display: block;
|
||||||
|
padding-left: 0px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $white;
|
||||||
|
color: #3b7dc5;
|
||||||
|
border: none;
|
||||||
|
padding-left: 0px
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.appealModule {
|
.appealModule {
|
||||||
@@ -2906,8 +2922,6 @@ fade {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.fieldArrayLink {
|
.fieldArrayLink {
|
||||||
border: none;
|
border: none;
|
||||||
background: no-repeat;
|
background: no-repeat;
|
||||||
@@ -3029,6 +3043,10 @@ fade {
|
|||||||
.govuk-label-s {
|
.govuk-label-s {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.govuk-checkboxes_short {
|
||||||
|
height: 180px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user