Skip to content

Commit

Permalink
Fix: Update texts
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Apr 9, 2024
1 parent 5845832 commit b4883d0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
13 changes: 12 additions & 1 deletion src/container/AddCredential/dataAttributeCardCredentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ interface Props {
export const DataAttributeCardForDDA = (props: Props) => {
const { selectedData } = props;

const splitByDotAndGetLastWord = (text) => {
const parts = text.split(".");
const lastValue = parts[parts.length - 1];
return lastValue
}

const camelCaseToWords = (str) => {
const words = str.match(/[A-Z]*[^A-Z]+/g);
return words.map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
};

return (
<Box
style={{
Expand All @@ -48,7 +59,7 @@ export const DataAttributeCardForDDA = (props: Props) => {
}}
>
<Typography variant="subtitle2">
{attribute.attribute}
{camelCaseToWords(splitByDotAndGetLastWord(attribute.attribute))}
</Typography>
<Typography variant="subtitle2">
{attribute.value}
Expand Down
12 changes: 6 additions & 6 deletions src/container/DDAgreements/ddaTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ const DDAtable = ({

const getStatus = (status) => {
if (status === "unlisted") {
return "Unlisted";
return "Unlist";
} else if (status === "awaitingForApproval") {
return "In Review";
return "Review";
} else if (status === "approved") {
return "Approved";
return "Approve";
} else if (status === "rejected") {
return "Rejected";
return "Reject";
} else if (status === "listed") {
return "Listed";
return "List";
}
};

Expand Down Expand Up @@ -89,7 +89,7 @@ const DDAtable = ({
}}
>
<Tooltip
title={"Publish Data Disclosure Agreement"}
title={"List to Data Marketplace"}
placement="top"
>
<IconButton aria-label="delete">
Expand Down
4 changes: 2 additions & 2 deletions src/container/DDAgreements/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ const DDAgreements = () => {
<ListDDAModal
open={isOpenPublish}
setOpen={setIsOpenPublish}
headerText={"Publish Data Disclosure Agreement"}
headerText={"List to Data Marketplace"}
resourceName={"dataDisclosureAgreements"}
confirmButtonText={"PUBLISH"}
confirmButtonText={"SUBMIT"}
selectedData={selectedDDA}
setRefetchTable={setRefetchTable}
refetchTable={refetchTable}
Expand Down
14 changes: 7 additions & 7 deletions src/container/DDAgreements/listDDAModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default function ListDDAModal(props: Props) {
}}
>
<Typography variant="subtitle1">
Status
Status Action:
<span style={{ color: "rgba(224, 7, 7, 0.986)" }}>*</span>
</Typography>
<Select
Expand All @@ -125,12 +125,12 @@ export default function ListDDAModal(props: Props) {
variant="outlined"
sx={{ marginTop: "5px" }}
size="small"
defaultValue=""
defaultValue={status}
>
<MenuItem value="unlisted">Unlisted</MenuItem>
<MenuItem value="awaitingForApproval">In Review</MenuItem>
<MenuItem value="listed">Listed</MenuItem>
<span style={{ cursor: "not-allowed" }}>
<MenuItem value="unlisted">Unlist</MenuItem>
<MenuItem value="awaitingForApproval">Review</MenuItem>
<MenuItem value="listed">List</MenuItem>
{/* <span style={{ cursor: "not-allowed" }}>
<MenuItem value="approved" disabled>
Approved
</MenuItem>
Expand All @@ -139,7 +139,7 @@ export default function ListDDAModal(props: Props) {
<MenuItem value="rejected" disabled>
Rejected
</MenuItem>
</span>
</span> */}
</Select>
</Box>
</Box>
Expand Down

0 comments on commit b4883d0

Please sign in to comment.