Merged PR 2295: resolved lint warnings
resolved lint warnings Related work items: #22873
This commit is contained in:
@@ -447,14 +447,14 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
|
||||
const mediaArr = mediaObj?.value || [];
|
||||
const sourceMedia = mediaObj?.value;
|
||||
const isActive = whichTab ? whichTab === "case-media" : true;
|
||||
|
||||
// Build list of playable items (publishable only)
|
||||
const videoItems = useMemo(() => {
|
||||
const isWelsh = router.locale === "cy";
|
||||
|
||||
return (mediaArr || [])
|
||||
return (sourceMedia || [])
|
||||
.filter((x) => x?.pinswg_publishtoweb)
|
||||
.map((item) => {
|
||||
const link = isWelsh
|
||||
@@ -480,7 +480,7 @@ const MediaDetails = ({ mediaObj, whichTab, title, useNoCookie = true }) => {
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
}, [mediaArr, router.locale]);
|
||||
}, [sourceMedia, router.locale]);
|
||||
|
||||
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||
|
||||
|
||||
@@ -66,7 +66,10 @@ const RenderRepresentationTypeRadioList = ({
|
||||
const hintId = `${optionId}-hint`;
|
||||
|
||||
return (
|
||||
<div className="govuk-radios__item representation-type-option">
|
||||
<div
|
||||
key={option.value || optionId}
|
||||
className="govuk-radios__item representation-type-option"
|
||||
>
|
||||
<input
|
||||
className="govuk-radios__input"
|
||||
id={optionId}
|
||||
@@ -195,35 +198,6 @@ const RepresentationTypeSelectorBlock = ({
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
<style jsx>{`
|
||||
.representation-type-radio-item {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.representation-type-radio-choice {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.representation-type-radio-hint {
|
||||
display: block;
|
||||
clear: both;
|
||||
margin-left: 40px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 8px;
|
||||
width: calc(100% - 40px);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.representation-type-radio-hint {
|
||||
margin-left: 34px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -874,15 +874,29 @@ let MakeRepresentation = (props) => {
|
||||
// Prepare data object for upload
|
||||
const dataObj = cleanedValues;
|
||||
|
||||
const caseFolderReference =
|
||||
props.caseReference ||
|
||||
dataObj.ticketnumber ||
|
||||
currentView?.caseReference?.ticketnumber ||
|
||||
currentView?.caseReference?.currentReference ||
|
||||
dataObj.caseRef ||
|
||||
"";
|
||||
|
||||
// Update links on values
|
||||
const updatedValues = updateLinks(cleanedValues);
|
||||
|
||||
const resolvedContainerID =
|
||||
updatedValues.containerID ||
|
||||
dataObj.containerID ||
|
||||
props?.props?.accountDetails?.containerID ||
|
||||
props?.props?.accountDetails?.accountDetails?.containerID;
|
||||
|
||||
// Perform file upload and return the promise
|
||||
return uploadRepFiles(
|
||||
dataObj,
|
||||
[{}],
|
||||
updatedValues.containerID,
|
||||
`${props.caseReference}/${dataObj.repfile_name}`
|
||||
resolvedContainerID,
|
||||
`${caseFolderReference}/${dataObj.repfile_name}`
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -2076,10 +2076,12 @@ const CaseSummary = (props) => {
|
||||
) : null;
|
||||
}
|
||||
|
||||
const fallbackIncidentId = setCaseQueryObj?.value?.[0]?.incidentid;
|
||||
|
||||
useEffect(() => {
|
||||
const linkCaseObj = async () => {
|
||||
let docObj = await getLinkedCases(
|
||||
incidentid || setCaseQueryObj.value[0].incidentid
|
||||
incidentid || fallbackIncidentId
|
||||
).then((data) => {
|
||||
//console.log(data);
|
||||
setCurrentLinkedCases(data);
|
||||
@@ -2090,7 +2092,7 @@ const CaseSummary = (props) => {
|
||||
};
|
||||
|
||||
const linkedCases = linkCaseObj();
|
||||
}, [incidentid, setCurrentLinkedCases]);
|
||||
}, [incidentid, fallbackIncidentId, setCurrentLinkedCases]);
|
||||
|
||||
let now = new Date();
|
||||
let expDate = new Date(now);
|
||||
|
||||
Reference in New Issue
Block a user