-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how it works and user manual link added in the card #1570
Changes from 2 commits
b110249
510c4ab
b8eb25e
9af2089
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,10 @@ export const RoleBasedEmployeeHome = ({ modules, additionalComponent }) => { | |
? "Edit" | ||
: linkUrl.includes("dss") | ||
? "Dashboard" | ||
: linkUrl.includes("user-manual") | ||
? "SpeakerNotes" | ||
: linkUrl.includes("functional-specifications") | ||
? "Book" | ||
: "PhonelinkSetup", | ||
// link: queryParamIndex === -1 ? linkUrl : linkUrl.substring(0, queryParamIndex), | ||
queryParams: queryParamIndex === -1 ? null : linkUrl.substring(queryParamIndex), | ||
|
@@ -140,12 +144,24 @@ export const RoleBasedEmployeeHome = ({ modules, additionalComponent }) => { | |
const children = Object.keys(sortedConfigEmployeesSidebar)?.map((current, index) => { | ||
const moduleData = sortedConfigEmployeesSidebar?.[current]; | ||
const configureData = moduleData?.links?.find((item) => item?.label === "Configure"); | ||
const howItWorks = moduleData?.links?.find((item) => item?.label === "How it works"); | ||
const userManual = moduleData?.links?.find((item) => item?.label === "Read User Manual"); | ||
const propsForModuleCard = { | ||
icon: "SupervisorAccount", | ||
moduleName: t(moduleData?.label), | ||
metrics: [], | ||
links: Digit.Utils.getMultiRootTenant() ? moduleData.links?.filter((item) => item.label !== "Configure") : moduleData.links, | ||
centreChildren: [<div>{t(Digit.Utils.locale.getTransformedLocale(`MODULE_CARD_DESC_${current}`))}</div>], | ||
links: Digit.Utils.getMultiRootTenant() ? moduleData.links?.filter((item) => item.label !== "Configure" && item.label !== "How it works" && item.label !== "Read User Manual") : moduleData.links, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why directly add the message ? |
||
centreChildren: [<div>{t(Digit.Utils.locale.getTransformedLocale(`MODULE_CARD_DESC_${current}`))}</div>, | ||
<Button | ||
variation="teritiary" | ||
label={userManual?.label} | ||
icon={userManual?.icon} | ||
type="button" | ||
size={"medium"} | ||
onClick={() => window.open(userManual?.link, "_blank")} | ||
style={{ padding: "0px" }} | ||
/>, | ||
], | ||
Comment on lines
+185
to
+195
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add key prop to React elements in centreChildren array. The new button for the user manual has been added correctly and aligns with the PR objectives. However, React elements in an array should have a unique Please add a unique centreChildren: [
<div key="description">{t(Digit.Utils.locale.getTransformedLocale(`MODULE_CARD_DESC_${current}`))}</div>,
<Button
key="userManual"
variation="teritiary"
label={userManual?.label}
icon={userManual?.icon}
type="button"
size={"medium"}
onClick={() => window.open(userManual?.link, "_blank")}
style={{ padding: "0px" }}
/>,
], 🧰 Tools🪛 Biome
|
||
endChildren: Digit.Utils.getMultiRootTenant() | ||
? [ | ||
<Button | ||
|
@@ -157,6 +173,15 @@ export const RoleBasedEmployeeHome = ({ modules, additionalComponent }) => { | |
onClick={() => history?.push(configureData?.link)} | ||
style={{ padding: "0px" }} | ||
/>, | ||
<Button | ||
variation="teritiary" | ||
label={howItWorks?.label} | ||
icon={howItWorks?.icon} | ||
type="button" | ||
size={"medium"} | ||
onClick={() => window.open(howItWorks?.link, "_blank")} | ||
style={{ padding: "0px" }} | ||
/>, | ||
Comment on lines
+207
to
+215
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM with minor improvements: New "How it works" button added The addition of the "How it works" button to the However, there's a minor issue to address: Add endChildren: Digit.Utils.getMultiRootTenant()
? [
<Button
key="configure"
variation="teritiary"
label={configureData?.label}
icon={configureData?.icon}
type="button"
size={"medium"}
onClick={() => history?.push(configureData?.link)}
style={{ padding: "0px" }}
/>,
<Button
key="howItWorks"
variation="teritiary"
label={howItWorks?.label}
icon={howItWorks?.icon}
type="button"
size={"medium"}
onClick={() => window.open(howItWorks?.link, "_blank")}
style={{ padding: "0px" }}
/>,
]
: null, 🧰 Tools🪛 Biome
|
||
] | ||
: null, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean it up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downt have hardcoded into system