-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CustomErrorComponent, RoleBasedEmployeeHome, css enhancement (#…
…1407) * Added CustomErrorComponent, RoleBasedEmployeeHome, css enhancement * added new localisation module * upgrade ui component version --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com>
- Loading branch information
1 parent
c4b7328
commit ff2e006
Showing
22 changed files
with
232 additions
and
54 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
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
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
4 changes: 2 additions & 2 deletions
4
micro-ui/web/micro-ui-internals/packages/libraries/src/services/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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { useStore, useInitStore } from "../hooks/store"; | ||
import { useStore, useInitStore, useInitTenantConfig } from "../hooks/store"; | ||
|
||
export { useStore, useInitStore }; | ||
export { useStore, useInitStore, useInitTenantConfig }; |
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
49 changes: 49 additions & 0 deletions
49
micro-ui/web/micro-ui-internals/packages/modules/core/src/components/CustomErrorComponent.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,49 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { useLocation, useHistory } from "react-router-dom"; | ||
import Background from "./Background"; | ||
import { Button, Card, CardHeader, CardText } from "@egovernments/digit-ui-components"; | ||
import Header from "./Header"; | ||
|
||
const CustomErrorComponent = (props) => { | ||
const { state = {} } = useLocation(); | ||
// const module = state?.module; | ||
const { t } = useTranslation(); | ||
const stateInfo = props.stateInfo; | ||
|
||
const history = useHistory(); | ||
const ModuleBasedErrorConfig = { | ||
sandbox: { | ||
imgUrl: `https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png`, | ||
infoHeader: "WRONG_TENANT_SIGN_UP", | ||
infoMessage: "WRONG_TENANT_SIGN_UP_MESSAGE", | ||
buttonInfo: "WRONG_TENANT_SIGN_UP_BUTTON", | ||
action: () => { | ||
history.push(`/${window.globalPath}/`); | ||
}, | ||
}, | ||
}; | ||
const config = ModuleBasedErrorConfig["sandbox"]; | ||
|
||
return ( | ||
<Background> | ||
<Card className={`digit-employee-card customError`}> | ||
<Header showTenant={false} /> | ||
<CardHeader className={"center"}>{t(config.infoHeader)}</CardHeader> | ||
<CardText className={"center"}>{t(config.infoMessage)}</CardText> | ||
<Button | ||
className="customErrorButton" | ||
label={t(config?.buttonInfo)} | ||
variation={"primary"} | ||
isSuffix={true} | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
config?.action(); | ||
}} | ||
/> | ||
</Card> | ||
</Background> | ||
); | ||
}; | ||
|
||
export default CustomErrorComponent; |
Oops, something went wrong.