-
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
Tenant info screen #1388
Closed
Closed
Tenant info screen #1388
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1d3ab4e
tenant info screen
mithunhegde-egov 0e00242
Merge branch 'develop' into tenant-info-screen
mithunhegde-egov fa3a1ed
Update SandboxCard.js
nabeelmd-eGov 1e5fd4e
Delete micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/p…
nabeelmd-eGov e6f1745
state removed
mithunhegde-egov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
73 changes: 73 additions & 0 deletions
73
...cro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantInfoCard.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,73 @@ | ||
import React, { Fragment, useState } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Header, Table } from "@egovernments/digit-ui-react-components"; | ||
import { useHistory, useLocation } from "react-router-dom"; | ||
import { Button, Card, CardHeader, CardText, Loader, SVG } from "@egovernments/digit-ui-components"; | ||
import { setupMasterConfig } from "../applicationMgmt/config/setupMasterConfig"; | ||
|
||
const TenantInfocard = () => { | ||
|
||
const { t } = useTranslation(); | ||
const location = useLocation(); | ||
const history = useHistory(); | ||
const tenantId = Digit.ULBService.getCurrentTenantId(); | ||
const searchParams = new URLSearchParams(location.search); | ||
const module = searchParams.get("module"); | ||
const config = setupMasterConfig?.SetupMaster?.filter((item) => item.module === module)?.[0]; | ||
const [showMaster, setShowMaster] = useState(false); | ||
|
||
return ( | ||
<Card className={"sandboxSetupMasterInfo"}> | ||
{!showMaster && ( | ||
<> | ||
<Header className="headerFlex" styles={{ fontSize: "32px" }}> | ||
<SVG.Announcement height={40} width={40} /> | ||
{t(config?.header || "N/A")} | ||
</Header> | ||
<CardText>{t(config?.description)}</CardText> | ||
{config?.add_organization?.length > 0 && <CardHeader className="subHeader"> {t("SUB_ORGANIZATION_ADD")}</CardHeader>} | ||
{config?.add_organization?.length > 0 && | ||
config?.add_organization?.map((item, index) => ( | ||
<li key={index} style={{ display: "flex", alignItems: "center" }}> | ||
<span style={{ marginRight: "0.5rem" }}>{index + 1}. </span> | ||
<span style={{ marginRight: "0.5rem" }}>{t(item.name)}</span> | ||
</li> | ||
))} | ||
|
||
{config?.view_organization?.length > 0 && <CardHeader className="subHeader"> {t("SUB_ORGANIZATION_VIEW")}</CardHeader>} | ||
{config?.view_organization?.length > 0 && | ||
config?.view_organization?.map((item, index) => ( | ||
<li key={index} style={{ display: "flex", alignItems: "center" }}> | ||
<span style={{ marginRight: "0.5rem" }}>{index + 1}. </span> | ||
<span style={{ marginRight: "0.5rem" }}>{t(item.name)}</span> | ||
</li> | ||
))} | ||
|
||
{config?.edit_organization?.length > 0 && <CardHeader className="subHeader"> {t("SUB_ORGANIZATION_EDIT")}</CardHeader>} | ||
{config?.edit_organization?.length > 0 && | ||
config?.edit_organization?.map((item, index) => ( | ||
<li key={index} style={{ display: "flex", alignItems: "center" }}> | ||
<span style={{ marginRight: "0.5rem" }}>{index + 1}. </span> | ||
<span style={{ marginRight: "0.5rem" }}>{t(item.name)}</span> | ||
</li> | ||
))} | ||
<div className="setupMasterSetupActionBar"> | ||
<Button | ||
className="actionButton" | ||
label={t(config.actionText)} | ||
variation={"secondary"} | ||
icon="ArrowForward" | ||
isSuffix={true} | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
history.push(`/${window?.contextPath}/employee/sandbox/tenant-management/create`); | ||
}} | ||
></Button> | ||
</div> | ||
</> | ||
)} | ||
</Card> | ||
); | ||
}; | ||
|
||
export default TenantInfocard; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@mithunhegde-egov can u share the screenshot of this screen ?
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.
info screens should be reusable, but here config is not that generic
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.