diff --git a/src/container/DDAgreements/ViewDDAgreementModal.tsx b/src/container/DDAgreements/ViewDDAgreementModal.tsx index 9610eaf..d12582c 100644 --- a/src/container/DDAgreements/ViewDDAgreementModal.tsx +++ b/src/container/DDAgreements/ViewDDAgreementModal.tsx @@ -36,8 +36,8 @@ export default function ViewDataAgreementModal(props: Props) {
- - + + View Data Disclosure Agreement: {selectedData?.purpose} {mode !== "Create" && ( diff --git a/src/container/DDAgreements/dataPolicyCardModal.tsx b/src/container/DDAgreements/dataPolicyCardModal.tsx index c12b156..ea724a4 100644 --- a/src/container/DDAgreements/dataPolicyCardModal.tsx +++ b/src/container/DDAgreements/dataPolicyCardModal.tsx @@ -70,14 +70,7 @@ export default function DataAgreementPolicyCardModal(props: Props) { name: "Agreement Period", value:selectedData.agreementPeriod, }, - { - name: "Blink", - value: "", - }, - { - name: "did:mydata", - value: "", - }, + ]; return ( diff --git a/src/container/DDAgreements/ddaTable.tsx b/src/container/DDAgreements/ddaTable.jsx similarity index 90% rename from src/container/DDAgreements/ddaTable.tsx rename to src/container/DDAgreements/ddaTable.jsx index 8364d18..d94e2fb 100644 --- a/src/container/DDAgreements/ddaTable.tsx +++ b/src/container/DDAgreements/ddaTable.jsx @@ -26,7 +26,6 @@ const StyledTableCell = styled(TableCell)({ fontWeight: "lighter !important", fontSize: "14px !important", border: "1px solid #D7D6D6", - textTransform: "capitalize", }); const StyledTableRow = styled(TableRow)({ @@ -46,6 +45,20 @@ const DDAtable = ({ }) => { const { t } = useTranslation("translation"); + const getStatus = (status) => { + if (status === "unlisted") { + return "Unlisted"; + } else if (status === "awaitingForApproval") { + return "In Review"; + } else if (status === "approved") { + return "Approved"; + } else if (status === "rejected") { + return "Rejected"; + } else if (status === "listed") { + return "Listed"; + } + }; + return ( @@ -61,12 +74,12 @@ const DDAtable = ({ {tabledata?.dataDisclosureAgreements?.length > 0 ? ( tabledata.dataDisclosureAgreements.map((row, index) => ( - + {row.purpose} - {row.status} + {getStatus(row.status)} {row.lawfulBasis} - - + + {headerText}: {selectedData?.purpose} @@ -93,7 +93,7 @@ export default function GeneralModal(props: Props) { value={confirmationTextInput} onChange={handleCancelConfirmationText} size="small" - sx={{marginTop:"5px"}} + sx={{ marginTop: "5px" }} /> diff --git a/src/container/DDAgreements/listDDAModal.tsx b/src/container/DDAgreements/listDDAModal.tsx index 0ef5c33..d0357ff 100644 --- a/src/container/DDAgreements/listDDAModal.tsx +++ b/src/container/DDAgreements/listDDAModal.tsx @@ -13,6 +13,7 @@ import { import CloseIcon from "@mui/icons-material/Close"; import { useTranslation } from "react-i18next"; import { HttpService } from "../../service/HttpService"; +import SnackbarComponent from "../../component/notification"; interface Props { open: boolean; @@ -37,8 +38,10 @@ export default function ListDDAModal(props: Props) { confirmButtonText, } = props; const [isOk, setIsOk] = useState(false); - const [status, setStatus] = useState(""); + const [status, setStatus] = useState(""); const { t } = useTranslation("translation"); + const [openSnackBar, setOpenSnackBar] = useState(false); + const [error, setError] = useState(""); useEffect(() => { if (selectedData && selectedData.status) { @@ -59,14 +62,18 @@ export default function ListDDAModal(props: Props) { status: status, }; - HttpService.updateDDAStatus(selectedData?.templateId, payload).then( - () => { + HttpService.updateDDAStatus(selectedData?.templateId, payload) + .then(() => { setOpen(false); setIsOk(false); setStatus(""); setRefetchTable(!refetchTable); - } - ); + }) + .catch((error) => { + console.log("error", error.response.data.error); + setError(error.response.data.error); + setOpenSnackBar(true); + }); } }; @@ -75,8 +82,14 @@ export default function ListDDAModal(props: Props) { - - + + + {headerText}: {selectedData?.purpose} @@ -112,12 +125,17 @@ export default function ListDDAModal(props: Props) { variant="outlined" sx={{ marginTop: "5px" }} size="small" + defaultValue="" > Unlisted - - Awaiting for Approval - + In Review Listed + + Approved + + + Rejected + diff --git a/src/container/DDAgreements/style.scss b/src/container/DDAgreements/style.scss index 2cd975c..ad20962 100644 --- a/src/container/DDAgreements/style.scss +++ b/src/container/DDAgreements/style.scss @@ -112,3 +112,10 @@ border-radius: 0 !important; border: 1px solid #EAEAEA !important; } + +.dd-modal-header-text { + color: #F3F3F6; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis +} \ No newline at end of file