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

Updated css for summary screen #1743

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -16,7 +16,7 @@
/> -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].18/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].19/dist/index.css" />

<!-- added below css for hcm-workbench module inclusion-->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-health-css",
"version": "0.1.18",
"version": "0.1.19",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down Expand Up @@ -66,4 +66,4 @@
"digit-ui",
"css"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,7 @@ $border-color: rgba(214, 213, 212, 1);
}

.create-microplan {

.custom-action-bar,
.custom-action-bar-no-first-button {
display: flex !important;
Expand Down Expand Up @@ -1882,7 +1883,7 @@ $border-color: rgba(214, 213, 212, 1);
margin-right: auto;
}

input:checked ~ .inputIconClassname {
input:checked~.inputIconClassname {
border-color: $primary-theme-color;
}

Expand Down Expand Up @@ -2516,8 +2517,7 @@ $border-color: rgba(214, 213, 212, 1);
}
}

.popup-wrap-rest-unfocus {
}
.popup-wrap-rest-unfocus {}

.popup-wrap-rest-unfocus-active {
button:focus {
Expand Down Expand Up @@ -2555,7 +2555,7 @@ $border-color: rgba(214, 213, 212, 1);
margin: 0rem;
}

.mp-hypothesis-label-field > div > span {
.mp-hypothesis-label-field>div>span {
@extend .typography.heading-s;
color: theme(digitv2.lightTheme.text-primary);
}
Expand Down Expand Up @@ -2585,9 +2585,6 @@ $border-color: rgba(214, 213, 212, 1);
display: flex;
flex-direction: row;
justify-content: space-around;
background-color: rgba(255, 255, 255, var(--bg-opacity));
margin-bottom: 1.5rem;
box-shadow: 0px 1px 2px 0px #00000029;
}

.kpi-card {
Expand All @@ -2598,7 +2595,8 @@ $border-color: rgba(214, 213, 212, 1);
.kpi-card h2 {
@extend .typography.heading-xl;
margin: 0;
color: theme(digitv2.lightTheme.primary-2); /* Custom color */
color: theme(digitv2.lightTheme.primary-2);
/* Custom color */
}

.kpi-card p {
Expand All @@ -2614,7 +2612,7 @@ $border-color: rgba(214, 213, 212, 1);
align-items: start !important;
}

.assumptionsForm-label-field > div > span {
.assumptionsForm-label-field>div>span {
font-size: 1.5rem;
font-weight: bold;
}
Expand Down Expand Up @@ -2673,6 +2671,7 @@ $border-color: rgba(214, 213, 212, 1);

.digit-tag-container.userAccessCell {
margin: unset !important;
max-width: unset !important;
}

.digit-card-component.primary.microPlanBulkTable {
Expand Down Expand Up @@ -2738,6 +2737,7 @@ $border-color: rgba(214, 213, 212, 1);
}
}
}
.sc-fzXfNN.sc-fzXfNO.sc-fzXfNP.iSamCd.rdt_TableCell > div:first-of-type {

.sc-fzXfNN.sc-fzXfNO.sc-fzXfNP.iSamCd.rdt_TableCell>div:first-of-type {
width: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@
margin-bottom: 0rem;
}

.summary-main-heading {
@extend .typography.heading-l;
color: theme(digitv2.lightTheme.text-primary);
margin-bottom: 0rem;
}

.summary-sub-heading {
@extend .typography.heading-m;
color: theme(digitv2.lightTheme.primary-2) !important;
margin-bottom: 0rem;
}

.view-composer-header-section {
display: flex;
justify-content: space-between;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React,{Fragment} from 'react';
import React, { Fragment } from 'react';
import { Button, Card, LabelFieldPair } from '@egovernments/digit-ui-components';
import HeaderComp from './HeaderComp';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -34,7 +34,7 @@ const AssumptionsList = ({ customProps, setupCompleted }) => {
<Button
label={t("WBH_EDIT")}
variation="secondary"
icon={"EditIcon"}
icon={"Edit"}
type="button"
onClick={(e) => {
const urlParams = Digit.Hooks.useQueryParams();
Expand All @@ -53,18 +53,18 @@ const AssumptionsList = ({ customProps, setupCompleted }) => {

return (
<>
<LabelFieldPair className="as-label-field" style={{marginBottom:"1rem"}}>
<span >
<strong>{t(key)}</strong>
</span>
<span >
{t(value)}
</span>
{/* </div> */}
</LabelFieldPair>
{index < dic[item].length - 1 && (
<div style={{ borderBottom: '1px solid #D3D3D3',marginBottom:"1rem" }}></div>
)}
<LabelFieldPair className="as-label-field" style={{ marginBottom: "1rem" }}>
<span >
<strong>{t(key)}</strong>
</span>
<span >
{t(value)}
</span>
{/* </div> */}
</LabelFieldPair>
{index < dic[item].length - 1 && (
<div style={{ borderBottom: '1px solid #D3D3D3', marginBottom: "1rem" }}></div>
)}
</>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ import React from 'react';
import { Card } from '@egovernments/digit-ui-components';
import { useMyContext } from '../utils/context';
import { useTranslation } from 'react-i18next';
const BoundaryKpi = ({ data }) => {
import { Fragment } from 'react';
const BoundaryKpi = ({ data, heading }) => {
const { state: { boundaryHierarchy } } = useMyContext()
const { t } = useTranslation();
return (
<Card className="kpi-container">
{Object.keys(data).map((key) => {
return (
<div key={key} className="kpi-card">
<h2>{String(data[key]).padStart(2, '0')}</h2>
<p>{t(`MICROPLAN_${key.toUpperCase()}`)}</p> {/* Correct use of t with template literal */}
</div>
);
})}

<Card className="middle-child">
{heading && <div className="summary-main-heading">{heading}</div>}
<div className="kpi-container">
{Object.keys(data).map((key) => {
return (
<div key={key} className="kpi-card">
<h2>{String(data[key]).padStart(2, '0')}</h2>
<p>{t(`MICROPLAN_${key.toUpperCase()}`)}</p> {/* Correct use of t with template literal */}
</div>
);
})}
</div>
</Card>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import SubBoundaryView from "./subBoundaryView";
import HeaderComp from "./HeaderComp";
import { Card, Button } from "@egovernments/digit-ui-components";
import BoundaryKpi from "./BoundaryKpi";
import { Header } from "@egovernments/digit-ui-react-components";
import { useHistory } from "react-router-dom";

const CampaignBoundary = ({ customProps,setupCompleted }) => {
const CampaignBoundary = ({ customProps, setupCompleted }) => {
const { dispatch, state } = useMyContext();
const { t } = useTranslation();



const handleViewMore = (ind) => {
// Create a copy of the boundaryStatus array
Expand Down Expand Up @@ -294,57 +295,60 @@ const CampaignBoundary = ({ customProps,setupCompleted }) => {
const updatedUrl = `${window.location.pathname}?${new URLSearchParams(urlParams).toString()}`;
history.push(updatedUrl);
}
const isEditable=setupCompleted==='true'? false:true;
const isEditable = setupCompleted === 'true' ? false : true;


return (
<div>
<BoundaryKpi data={statusMap} />
<BoundaryKpi data={statusMap} heading={t("CAMPAIGN_BOUNDARY")} />
{bHierarchy.length > 1 ? (
<div className="marginBottom">
<SubBoundaryView style={{ background: "#fff" }} title={bHierarchy?.[1]} arr={parent_group?.[bHierarchy?.[1]]} editHandler={editHandler} isEditable={isEditable} />
<div>
<SubBoundaryView style={{ background: "#fff", gap: "1.5rem" }} title={bHierarchy?.[1]} arr={parent_group?.[bHierarchy?.[1]]} editHandler={editHandler} isEditable={isEditable} />
</div>
) : null}

{bHierarchy.length > 1 &&
bHierarchy.slice(1, -1).map((item, ind) => {
return (
<div key={`header_${ind}`}>
<Card className="marginBottom">
<div className="header-container">
<HeaderComp title={bHierarchy[ind + 2]} />
{!(setupCompleted==='true') &&
<Button
label={t("WBH_EDIT")}
variation="secondary"
icon={"EditIcon"}
type="button"
onClick={(e) => {
editHandler();
}}
/>
}
</div>
{/* <HeaderComp title={bHierarchy[ind + 2]} /> */}
{parent_group?.[item]?.map((item1, idx) =>
Array.isArray(parents?.[item1]) && boundaryStatus?.[ind + 2] && (idx === 0 || idx === 1) ? (
<SubBoundaryView key={`${item1}_${idx}`} title={item1} arr={parents?.[item1]} />
) : Array.isArray(parents?.[item1]) && !boundaryStatus?.[ind + 2] ? (
<SubBoundaryView key={`${item1}_${idx}`} title={item1} arr={parents?.[item1]} />
) : null
) || null}
{boundaryStatus?.[ind + 2] && parent_group[item]?.length > 2 ? (
<div onClick={() => handleViewMore(ind + 2)} className="view-more">
{t("VIEW_MORE")}
</div>
) : !boundaryStatus?.[ind + 2] ? (
<div onClick={() => handleViewMore(ind + 2)} className="view-more">
{t("VIEW_LESS")}
<div key={`header_${ind}`}>
<Card className="middle-child">
<div className="header-container" style={{ marginBottom: "0px" }}>
<Header className="summary-sub-heading">
{bHierarchy[ind + 2]}
</Header>
{!(setupCompleted === 'true') &&
<Button
label={t("WBH_EDIT")}
variation="secondary"
icon={"Edit"}
type="button"
onClick={(e) => {
editHandler();
}}
/>
}
</div>
) : null}
</Card>
</div>
)})}
{/* <HeaderComp title={bHierarchy[ind + 2]} /> */}
{parent_group?.[item]?.map((item1, idx) =>
Array.isArray(parents?.[item1]) && boundaryStatus?.[ind + 2] && (idx === 0 || idx === 1) ? (
<SubBoundaryView style={{ gap: "1.5rem", marginBottom: "0px" }} key={`${item1}_${idx}`} title={item1} arr={parents?.[item1]} />
) : Array.isArray(parents?.[item1]) && !boundaryStatus?.[ind + 2] ? (
<SubBoundaryView style={{ gap: "1.5rem", marginBottom: "0px" }} key={`${item1}_${idx}`} title={item1} arr={parents?.[item1]} />
) : null
) || null}
{boundaryStatus?.[ind + 2] && parent_group[item]?.length > 2 ? (
<div onClick={() => handleViewMore(ind + 2)} className="view-more">
{t("VIEW_MORE")}
</div>
) : !boundaryStatus?.[ind + 2] ? (
<div onClick={() => handleViewMore(ind + 2)} className="view-more">
{t("VIEW_LESS")}
</div>
) : null}
</Card>
</div>
)
})}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export const DataMgmtComponent = ({ customProps, setupCompleted }) => {

return (
<>
<Card style={{ marginBottom: "1rem" }}>
<Card className="middle">
<div className="header-container">
<HeaderComp title="POPULATION" styles={{ color: "black" }} />
{!(setupCompleted === 'true') &&
<Button
label={t("WBH_EDIT")}
variation="secondary"
icon={"EditIcon"}
icon={"Edit"}
type="button"
onClick={(e) => {
const url = Digit.Hooks.useQueryParams();
Expand Down Expand Up @@ -75,7 +75,7 @@ export const DataMgmtComponent = ({ customProps, setupCompleted }) => {
<Button
label={t("WBH_EDIT")}
variation="secondary"
icon={"EditIcon"}
icon={"Edit"}
type="button"
onClick={(e) => {
const url = Digit.Hooks.useQueryParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const FormulaConfigScreen = ({ customProps, setupCompleted }) => {
<Button
label={t("WBH_EDIT")}
variation="secondary"
icon={"EditIcon"}
icon={"Edit"}
type="button"
onClick={(e) => {
const urlParams = Digit.Hooks.useQueryParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,11 @@ function UserAccess({ category, setData, nationalRoles }) {
name: t("ADMINISTRATIVE_BOUNDARY"),
selector: (row) => {
return (
<>
<div className="digit-tag-container userAccessCell">
{row?.jurisdiction?.length > 0 && (
<>
{row.jurisdiction.slice(0, 2).map((item, index) => (
<div className="digit-tag-container userAccessCell" key={index}>
<Chip className="" error="" extraStyles={{}} iconReq="" hideClose={true} text={t(item)} />
</div>
<Chip className="" error="" extraStyles={{}} iconReq="" hideClose={true} text={t(item)} />
))}

{row.jurisdiction.length > 2 && (
Expand Down Expand Up @@ -198,7 +196,7 @@ function UserAccess({ category, setData, nationalRoles }) {
{chipPopUp && <Wrapper setShowPopUp={setChipPopUp} alreadyQueuedSelectedState={row.jurisdiction} />}
</>
)}
</>
</div>
);
},
sortable: true,
Expand Down Expand Up @@ -238,7 +236,7 @@ function UserAccess({ category, setData, nationalRoles }) {
<p className="mp-description">{t(`${category}_DESCRIPTION`)}</p>
</Card>

<Card>
<Card style={{ maxWidth: "100%", overflow: "auto", marginBottom: "2.5rem" }}>
{planEmployee?.data?.length > 0 || searchQuery ? (
<div style={styles.container}>
<TableSearchField onSearch={handleSearch} />
Expand Down
Loading