Skip to content
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
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ const SandboxCard = () => {
SUPERUSER: ["SUPERUSER"],
};


if (!Digit.Utils.sandboxAccess()) {
return null;
}

const propsForModuleCard = {
Icon: <PropertyHouse />,
moduleName: t("SANDBOX_CARD_HEADER"),
Expand All @@ -27,6 +29,11 @@ const SandboxCard = () => {
link: `/${window?.contextPath}/employee/sandbox/tenant-management/search`,
roles: ROLES.SUPERUSER,
},
{
label: t("TENANT_MANAGEMENT_INFO"),
link: `/${window?.contextPath}/employee/sandbox/tenant-management/info?module=TENANT_MANAGEMENT_INFO`,
roles: ROLES.SUPERUSER,
}
// {
// label: t("SANDBOX_APPLICATION_MANAGEMENT_HOMECARD_LABEL"),
// link: `/${window?.contextPath}/employee/sandbox/application-management/home`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,56 @@ export const setupMasterConfig = {
},
],
},
{
header: "TENANT_MANAGEMENT_INFO",
subHeader:"new subheader",
module: "TENANT_MANAGEMENT_INFO",
active: true,
description: "TENANT_MANAGEMENT_DESCRIPTION",
masterDescription: "TENANT_MANAGEMENT_DESCRIPTION",
actionText: "SETUP_NOW",
add_organization: [
{
id: 1,
name: "TENANT_CLICK_ORGANIZATION_CREATE",
},
{
id: 2,
name: "TENANT_ENTER_DETAILS",
},
{
id: 3,
name: "TENANT_SUBMIT_DETAILS",
},
],
view_organization: [
{
id: 1,
name: "TENANT_CLICK_ORGANIZATION_SEARCH",
},
{
id: 2,
name: "TENANT_ORGANIZAZATION_LIST",
},
{
id: 3,
name: "TENANT_ORGANIZATION_ROW_VIEW",
},
],
edit_organization: [
{
id: 1,
name: "TENANT_CLICK_ORGANIZATION_SEARCH",
},
{
id: 2,
name: "TENANT_LIST_DISPLAYED",
},
{
id: 3,
name: "TENANT_CHANGE_STATUS",
},
],
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ApplicationHome from "./applicationMgmt/ApplicationHome";
import ModuleMasterTable from "./applicationMgmt/ModuleMasterTable";
import TenantUpdate from "./tenantMgmt/TenantUpdate";
import SetupMaster from "./applicationMgmt/SetupMaster";
import TenantInfocard from "./tenantMgmt/TenantInfoCard";

const bredCrumbStyle = { maxWidth: "min-content" };

Expand Down Expand Up @@ -54,10 +55,12 @@ const App = ({ path, stateCode, userType, tenants }) => {
<PrivateRoute path={`${path}/tenant-management/create`} component={() => <TenantCreate />} />
<PrivateRoute path={`${path}/tenant-management/search`} component={() => <TenantView />} />
<PrivateRoute path={`${path}/tenant-management/update`} component={() => <TenantUpdate />} />
<PrivateRoute path={`${path}/tenant-management/info`} component={() => <TenantInfocard />} />
<PrivateRoute path={`${path}/application-management/home`} component={() => <ApplicationHome />} />
<PrivateRoute path={`${path}/application-management/module-master`} component={() => <SandboxSearch />} />
<PrivateRoute path={`${path}/application-management/setup-master`} component={() => <SetupMaster />} />
<PrivateRoute path={`${path}/application-management/module`} component={() => <ModuleMasterTable />} />

</AppContainer>
</Switch>
);
Expand Down
Copy link
Collaborator

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 ?

Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot from 2024-09-17 11-24-09

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;