fix for files in reps

This commit is contained in:
2024-11-11 16:01:40 +00:00
parent b54b4459aa
commit a752443ad9
5 changed files with 145 additions and 86 deletions
+23 -20
View File
@@ -21,20 +21,23 @@ HASHKEY = 028ffbae928d7191c0017f298260995f901d78eabde1436c0af0423459cc3715832136
# CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS" # CRMURL = "devcrm2016.llcdt.gov.wales/DVPINS"
# //New Test # //New Test
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1 # CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM # CLIENT_SECRET = 6hT8Q~glL~jloWpGmvXw3UY37QFwjUE0r._jobEM
RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/ # RELAY_ROOT = https://ar-ns-lz-pedw-test-uks-01.servicebus.windows.net/ar-hc-lz-pedw-test-uks-01/
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"
# //New PreProd # //New PreProd
# CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a CLIENT_ID = ab6c4678-b31a-4eb3-b429-e039120e488a
# CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E CLIENT_SECRET = V288Q~P1lFMvvX9Xnkx2pLixK~GOREH983Owqc1E
# RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/ # RELAY_ROOT = https://ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-uks-01/
# RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net" # RELAYURI = "ar-ns-lz-pedw-ppe-uks-01.servicebus.windows.net"
# RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01" # RELAYPATH = "ar-hc-lz-pedw-ppe-uks-01"
# CRMURL = "ppcrm2016.llcdt.gov.wales/UATPINS" RELAY_ROOT = https://ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net/ar-hc-lz-pedw-ppe-ukw-01/
RELAYURI = "ar-ns-lz-pedw-ppe-ukw-01.servicebus.windows.net"
RELAYPATH = "ar-hc-lz-pedw-ppe-ukw-01"
CRMURL = "ppcrm2016.llcdt.gov.wales/UATPINS"
# //Prod Oauth WGO # //Prod Oauth WGO
@@ -69,10 +72,10 @@ NEXTAUTH_SECRET = SuperSecret
// 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
// Pre prod sql server // Pre prod sql server
# DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword DATABASE_URL = sqlserver://sql-srv-plt-pedw-ppe-uks-01.database.windows.net:1433;database=PEDW;user=PedwSqlAdmin;password=GhWKr62F5sQ69dZx;encrypt=true;trustservercertificate=true;hostnameincertificate=*.database.windows.net;logintimeout=30;authentication=SqlPassword
// Prod sql server // Prod sql server
# 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
@@ -98,20 +101,20 @@ AZURE_CLIENT_SECRET = $CLIENT_SECRET
# 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 = bqJAz5pYQVGee8dnVhlsqW+xHwinNTjgY2AmojNyB+d4uAotMR20WcO4Op13yB+9dFaXAkkjtIA4+AStHT/IYg==
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"
# AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ== AZURE_STORAGE_ACCOUNT_KEY = B4GRKr+cA9b9mNM/GHFivzhzflJIZltG8bMmooXlYvGYySPAspTTHistAT30sHipnR+hh6dqUc9q+ASttAjPRQ==
# AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net AZURE_PEDW_STORAGE_ENDPOINT = https://sapltpedwppeuks.blob.core.windows.net
// PROD key // PROD key
//AZURE_STORAGE_ACCOUNT_NAME = "pedwprod" # AZURE_STORAGE_ACCOUNT_NAME = "pedwprod"
//AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg== # AZURE_STORAGE_ACCOUNT_KEY = koZ46STRqapSa2Dod8MLL6aju1eYLhhyJ6DXpCLMTnFLJvbDT6CHUv/jwr5U/Ta8a60MWzwToHQy+AStADO7sg==
//AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net # AZURE_PEDW_STORAGE_ENDPOINT = https://pedwprod.blob.core.windows.net
AZURE_PEDW_CONTAINER = "pedwapplications" AZURE_PEDW_CONTAINER = "pedwapplications"
@@ -33,14 +33,17 @@ const RepAgent = (props) => {
setRepFileName(formObj.representationForm.values); setRepFileName(formObj.representationForm.values);
let filterFilesList = let filterFilesList = props.currentView.caseReference.hasOwnProperty(
props.currentView.caseReference.repDetails.hasOwnProperty("filesList") "repDetails"
)
? props.currentView.caseReference.repDetails.hasOwnProperty("filesList")
? props.currentView.caseReference.repDetails.filesList.filter( ? props.currentView.caseReference.repDetails.filesList.filter(
function (el) { function (el) {
return el != null; return el != null;
} }
) )
: []; : []
: [];
const files = acceptedFiles.map((file) => ( const files = acceptedFiles.map((file) => (
<li key={file.path}> <li key={file.path}>
@@ -181,33 +184,37 @@ const RepAgent = (props) => {
</div> </div>
{props.currentView.caseReference.hasOwnProperty( {props.currentView.caseReference.hasOwnProperty(
"repDetails" "repDetails"
) && ) ? (
props.currentView.caseReference.repDetails.hasOwnProperty( props.currentView.caseReference.repDetails.hasOwnProperty(
"filesList" "filesList"
) && ) &&
props.currentView.caseReference.repDetails props.currentView.caseReference.repDetails
.filesList.length > 0 ? ( .filesList.length > 0 ? (
<div className="govuk-form-group govuk-!-margin-bottom-9"> <div className="govuk-form-group govuk-!-margin-bottom-9">
{filterFilesList.map((blob, i) => ( {filterFilesList.map((blob, i) => (
<div <div
key={blob.name + "_" + i} key={blob.name + "_" + i}
className="govuk-!-margin-bottom-5 fileThumb " className="govuk-!-margin-bottom-5 fileThumb "
> >
<img <img
src={getThumbnailIconByExtension( src={getThumbnailIconByExtension(
blob.name blob.name
)} )}
alt={blob.name} alt={blob.name}
width="50" width="50"
/> />
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5"> <span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{blob.name} ( {blob.name} (
{bytesToSize(blob.size)}) {bytesToSize(blob.size)}
</span> )
</div> </span>
))} </div>
</div> ))}
</div>
) : (
""
)
) : ( ) : (
"" ""
)} )}
@@ -1,6 +1,5 @@
import useTranslation from "next-translate/useTranslation"; import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useState } from "react";
@@ -37,14 +36,17 @@ const RepAppellant = (props) => {
setRepFileName(formObj.representationForm.values); setRepFileName(formObj.representationForm.values);
let filterFilesList = let filterFilesList = props.currentView.caseReference.hasOwnProperty(
props.currentView.caseReference.repDetails.hasOwnProperty("filesList") "repDetails"
)
? props.currentView.caseReference.repDetails.hasOwnProperty("filesList")
? props.currentView.caseReference.repDetails.filesList.filter( ? props.currentView.caseReference.repDetails.filesList.filter(
function (el) { function (el) {
return el != null; return el != null;
} }
) )
: []; : []
: [];
return ( return (
<> <>
@@ -160,33 +162,36 @@ const RepAppellant = (props) => {
</div> </div>
{props.currentView.caseReference.hasOwnProperty( {props.currentView.caseReference.hasOwnProperty(
"repDetails" "repDetails"
) && ) ? (
props.currentView.caseReference.repDetails.hasOwnProperty( props.currentView.caseReference.repDetails.hasOwnProperty(
"filesList" "filesList"
) && ) &&
props.currentView.caseReference.repDetails.filesList props.currentView.caseReference.repDetails
.length > 0 ? ( .filesList.length > 0 ? (
<div className="govuk-form-group govuk-!-margin-bottom-9"> <div className="govuk-form-group govuk-!-margin-bottom-9">
{filterFilesList.map((blob, i) => ( {filterFilesList.map((blob, i) => (
<div <div
key={blob.name + "_" + i} key={blob.name + "_" + i}
className="govuk-!-margin-bottom-5 fileThumb " className="govuk-!-margin-bottom-5 fileThumb "
> >
<img <img
src={getThumbnailIconByExtension( src={getThumbnailIconByExtension(
blob.name blob.name
)} )}
alt={blob.name} alt={blob.name}
width="50" width="50"
/> />
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5"> <span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{blob.name} ( {blob.name} (
{bytesToSize(blob.size)}) {bytesToSize(blob.size)})
</span> </span>
</div> </div>
))} ))}
</div> </div>
) : (
""
)
) : ( ) : (
"" ""
)} )}
@@ -1,10 +1,10 @@
import useTranslation from "next-translate/useTranslation"; import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { useDropzone } from "react-dropzone";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Field, change, reduxForm } from "redux-form"; import { Field, change, reduxForm } from "redux-form";
import { useState } from "react"; import { useState } from "react";
import { bytesToSize, getThumbnailIconByExtension } from "../../utils";
import { import {
FileUploadField, FileUploadField,
RenderCondtionalRadioList, RenderCondtionalRadioList,
@@ -12,6 +12,8 @@ import {
RenderRichMultiline, RenderRichMultiline,
} from "./representationElements"; } from "./representationElements";
import { useDropzone } from "react-dropzone";
const RepInterestedPartyPerson = (props) => { const RepInterestedPartyPerson = (props) => {
let { t } = useTranslation(); let { t } = useTranslation();
@@ -32,12 +34,17 @@ const RepInterestedPartyPerson = (props) => {
setRepFileName(formObj.representationForm.values); setRepFileName(formObj.representationForm.values);
let filterFilesList = let filterFilesList = props.currentView.caseReference.hasOwnProperty(
props.currentView.caseReference.repDetails.filesList.filter(function ( "repDetails"
el )
) { ? props.currentView.caseReference.repDetails.hasOwnProperty("filesList")
return el != null; ? props.currentView.caseReference.repDetails.filesList.filter(
}); function (el) {
return el != null;
}
)
: []
: [];
const files = acceptedFiles.map((file) => ( const files = acceptedFiles.map((file) => (
<li key={file.path}> <li key={file.path}>
@@ -171,6 +178,42 @@ const RepInterestedPartyPerson = (props) => {
filenamePrefix={props} filenamePrefix={props}
/> />
</div> </div>
{props.currentView.caseReference.hasOwnProperty(
"repDetails"
) ? (
props.currentView.caseReference.repDetails.hasOwnProperty(
"filesList"
) &&
props.currentView.caseReference.repDetails
.filesList.length > 0 ? (
<div className="govuk-form-group govuk-!-margin-bottom-9">
{filterFilesList.map((blob, i) => (
<div
key={blob.name + "_" + i}
className="govuk-!-margin-bottom-5 fileThumb "
>
<img
src={getThumbnailIconByExtension(
blob.name
)}
alt={blob.name}
width="50"
/>
<span className="govuk-body govuk-!-font-size-14 govuk-!-padding-left-5">
{blob.name} (
{bytesToSize(blob.size)}
)
</span>
</div>
))}
</div>
) : (
""
)
) : (
""
)}
</fieldset> </fieldset>
</div>{" "} </div>{" "}
</div> </div>
+1
View File
@@ -123,6 +123,7 @@
"enf-section-question-8": "A ydych yn ymwybodol o unrhyw faterion iechyd a diogelwch y byddai angen eu hystyried pan fydd yr Arolygydd yn ymweld â'r safle?", "enf-section-question-8": "A ydych yn ymwybodol o unrhyw faterion iechyd a diogelwch y byddai angen eu hystyried pan fydd yr Arolygydd yn ymweld â'r safle?",
"enf-section-question-8-hint": "Os Oes, disgrifiwch y materion iechyd a diogelwch i'w hystyried", "enf-section-question-8-hint": "Os Oes, disgrifiwch y materion iechyd a diogelwch i'w hystyried",
"enf-section-question-9": "Cyswllt ACLl ar gyfer trefniadau ymweliad safle, gwrandawiad neu ymholiad:", "enf-section-question-9": "Cyswllt ACLl ar gyfer trefniadau ymweliad safle, gwrandawiad neu ymholiad:",
"enf-section-question-9-hint": "Os Oes, disgrifiwch y materion iechyd a diogelwch i'w hystyried",
"enf-section-heading-two": "Ffi Ymgeisio Tybiedig", "enf-section-heading-two": "Ffi Ymgeisio Tybiedig",
"enf-section-question-10": "A yw'r awdurdod cynllunio lleol wedi derbyn y ffi gywir sy'n daladwy mewn perthynas â'r apêl hon er mwyn i'r cais cynllunio tybiedig/sail (a) gael ei ystyried?", "enf-section-question-10": "A yw'r awdurdod cynllunio lleol wedi derbyn y ffi gywir sy'n daladwy mewn perthynas â'r apêl hon er mwyn i'r cais cynllunio tybiedig/sail (a) gael ei ystyried?",
"enf-section-question-11": "A yw ffi'r apêl wedi'i heithrio?", "enf-section-question-11": "A yw ffi'r apêl wedi'i heithrio?",