-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sidebar component * fix * css * Update Config.js * pr fix (#1412) Co-authored-by: aaradhya-egov <[email protected]> * added util * fix --------- Co-authored-by: nabeelmd-eGov <[email protected]>
- Loading branch information
1 parent
78eecd1
commit ecce3f8
Showing
8 changed files
with
204 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@egovernments/digit-ui-css", | ||
"version": "1.8.2-beta.24", | ||
"version": "1.8.2-beta.25", | ||
"license": "MIT", | ||
"main": "dist/index.css", | ||
"author": "Jagankumar <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...o-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/QuickStart/Config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React, { Fragment, useState } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { CardText, CardLabelError, Toast, CardLabel, Card, CardHeader, LinkLabel,Loader } from "@egovernments/digit-ui-components"; | ||
import QuickSetupComponent from "."; | ||
|
||
const QuickSetupConfigComponent = ({ onSelect, formData, control, formState, ...props }) => { | ||
const { t } = useTranslation(); | ||
const { isLoading, data } = Digit.Hooks.useAccessControl(); | ||
const isMultiRootTenant = Digit.Utils.getMultiRootTenant(); | ||
const tenantId = Digit.ULBService.getStateId(); | ||
|
||
// const transformURL = (url = "") => { | ||
// if (url == "/") { | ||
// return; | ||
// } | ||
// if (Digit.Utils.isContextPathMissing(url)) { | ||
// let updatedUrl = null; | ||
// if (isMultiRootTenant) { | ||
// url = url.replace("/sandbox-ui/employee", `/sandbox-ui/${tenantId}/employee`); | ||
// updatedUrl = url; | ||
// } else { | ||
// updatedUrl = DIGIT_UI_CONTEXTS?.every((e) => url?.indexOf(`/${e}`) === -1) ? "/employee/" + url : url; | ||
// } | ||
// return updatedUrl; | ||
// } else { | ||
// return url; | ||
// } | ||
// }; | ||
|
||
const configEmployeeSideBar = data?.actions | ||
.filter((e) => e.url === "card" && e.parentModule) | ||
.reduce((acc, item) => { | ||
const module = item.parentModule; | ||
if (!acc[module]) { | ||
acc[module] = { | ||
module: module, | ||
label: Digit.Utils.locale.getTransformedLocale(`${module}_CARD_HEADER`), | ||
links: [], | ||
}; | ||
} | ||
const linkUrl = Digit.Utils.transformURL(item.navigationURL,tenantId); | ||
const queryParamIndex = linkUrl.indexOf("?"); | ||
acc[module].links.push({ | ||
link: queryParamIndex === -1 ? linkUrl : linkUrl.substring(0, queryParamIndex), | ||
label: t(Digit.Utils.locale.getTransformedLocale(`${module}_LINK_${item.displayName}`)), | ||
queryParams: queryParamIndex === -1 ? null : linkUrl.substring(queryParamIndex), | ||
description: t(Digit.Utils.locale.getTransformedLocale(`${module}_LINK_${item.displayName}_DESCRIPTION`)), | ||
}); | ||
return acc; | ||
}, {}); | ||
|
||
if (!configEmployeeSideBar) { | ||
return ""; | ||
} | ||
const QuickSetupConfig = [ | ||
{ | ||
sectionHeader:"WELCOME_TO_SANDBOX", | ||
sections:[ | ||
{ | ||
label:"SANDBOX_DESCRIPTION_1" | ||
}, | ||
{ | ||
label:"SANDBOX_DESCRIPTION_2" | ||
}, | ||
{ | ||
label:"SANDBOX_DESCRIPTION_3" | ||
} | ||
] | ||
}, | ||
{ | ||
sectionHeader:"QUICK_SETUP", | ||
links:configEmployeeSideBar | ||
} | ||
]; | ||
return ( | ||
<QuickSetupComponent config={QuickSetupConfig}></QuickSetupComponent> | ||
); | ||
}; | ||
|
||
export default QuickSetupConfigComponent; |
36 changes: 36 additions & 0 deletions
36
micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/QuickStart/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { CardText, Card, CardHeader, LinkLabel } from "@egovernments/digit-ui-components"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const QuickSetupComponent = ({ config }) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Card> | ||
{config.map((section, sectionIndex) => ( | ||
<React.Fragment key={sectionIndex}> | ||
<CardHeader>{t(section.sectionHeader)}</CardHeader> | ||
{section.sections && section.sections.map((item, itemIndex) => ( | ||
<CardText key={itemIndex}>{t(item.label)}</CardText> | ||
))} | ||
{section.links && Object.values(section.links).map((linkGroup, linkIndex) => ( | ||
<div key={linkIndex}> | ||
<CardText>{t(linkGroup.description)}</CardText> | ||
{linkGroup.links.map((link, linkItemIndex) => ( | ||
<div key={linkItemIndex}> | ||
<Link to={{ pathname: link.link, search: link.queryParams }} className="quickLink"> | ||
{t(link.label)} | ||
</Link> | ||
<CardText>{t(link.description)}</CardText> | ||
</div> | ||
))} | ||
</div> | ||
))} | ||
</React.Fragment> | ||
))} | ||
</Card> | ||
); | ||
}; | ||
|
||
export default QuickSetupComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap" | ||
rel="stylesheet" type="text/css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].24/dist/index.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].25/dist/index.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#00bcd1" /> | ||
|