Skip to content

Commit

Permalink
Boundary feature + checklist fixes (#1518)
Browse files Browse the repository at this point in the history
* Feature/boundary ss (#1490)

* boundary-hierarchy

* boundary-hierarchy

* localization changes

* ui changes

* Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignCard.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pr review changes

* removed all logs

---------

Co-authored-by: suryansh-egov <suryansh.singh.egovernments.org>
Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* checklist-bugs-fixes (#1513)

* checklist-bugs-fixes

* cahgnes

---------

Co-authored-by: suryansh-egov <suryansh.singh.egovernments.org>

* changesnew

---------

Co-authored-by: suryansh-egov <suryansh.singh@egovernments.org>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: suryansh-egov <suryansh.singh.egovernments.org>
  • Loading branch information
3 people authored Oct 15, 2024
1 parent 7382ef1 commit 842be89
Show file tree
Hide file tree
Showing 23 changed files with 1,555 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.0-alpha.6/dist/index.css" />

<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.36/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.78-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.79-campaign/dist/index.css" />


<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.50-microplan/dist/index.css" />

Expand Down
4 changes: 2 additions & 2 deletions health/micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
"*.{js,css,md}": "prettier --write"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.2-beta.40",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"ajv": "8.12.0",
"lodash": "4.17.21",
"microbundle-crl": "0.13.11",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-components": "0.0.2-beta.40",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "6.15.8",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.0.78-campaign",
"version": "1.0.79-campaign",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <jagan.kumar@egov.org.in>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,4 +953,23 @@ tbody {
}
}
}
}.custom-popup-boundary{
max-width: 100%;
height: 11rem;
}




.dustbin-icon{
margin-bottom: 1rem;
margin-top: 0.7rem;
}

.custom-action-bar .digit-action-bar-fields{
display: contents;
}

.digit-action-bar-wrap div {
width: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ import CampaignUpdateSummary from "./components/CampaignUpdateSummary";
import XlsPreview from "./components/XlsPreview";
import BulkUpload from "./components/BulkUpload";
import BoundarySummary from "./components/BoundarySummary";
import Boundary from "./pages/employee/Boundary";
import GeoPode from "./pages/employee/GeoPode";
import ViewBoundary from "./pages/employee/ViewBoundary";
import ViewHierarchy from "./pages/employee/ViewHierarchy";

import MultiSelectDropdown from "./components/MultiSelectDropdown";
/**
Expand Down Expand Up @@ -137,6 +141,10 @@ const componentsToRegister = {
CampaignUpdateSummary,
XlsPreview,
MultiSelectDropdownBoundary:MultiSelectDropdown,
Boundary,
GeoPode,
ViewBoundary,
ViewHierarchy,
// SelectingBoundaryComponent
BoundarySummary
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from "react";
import { PopUp, Button } from "@egovernments/digit-ui-components";
import { useTranslation } from "react-i18next";

const BoundaryPopup = ({ showPopUp, setShowPopUp, callGeoPode, geoPodeData })=> {
const { t } = useTranslation();
return (
showPopUp && (
<PopUp
className={"custom-popup-boundary"}
type={"default"}
heading={t("CHOOSE_MEANS_TO_CREATE_BOUNDARY")}
children={[
]}
onClose={()=>{
setShowPopUp(false);
}}
style={{
height:"11rem",
width: "48rem"
}}
footerChildren={[
]}
sortFooterChildren={true}
>
<div style={{display:"flex", gap:"1rem", justifyContent:"space-around"}}>
<Button
type={"button"}
size={"large"}
isDisabled={!geoPodeData}
variation={"secondary"}
label={t("GET_BOUNDARY_DATA_FROM_GEOPODE")}
onClick={() => {
callGeoPode(false);
}}
style={{height:"4rem"}}
/>
<Button
type={"button"}
size={"large"}
variation={"secondary"}
label={t("CREATE_MY_OWN_BOUNDARY_DATA")}
onClick={() => {
callGeoPode(true);
}}
style={{height:"4rem"}}
/>
</div>
</PopUp>

)
);
};

export default BoundaryPopup;
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ const CampaignCard = () => {
link: "/digit-ui/employee/dss/landing/national-health-dashboard",
roles: ROLES.NATIONAL_SUPERVISOR,
// count: isLoading?"-":data
},
{
label: t("BOUNDARY_MANAGEMENT"),
link: `/${window?.contextPath}/employee/campaign/boundary-management?defaultHierarchyType=HIERARCHYTEST&hierarchyType=DEMOTEST6`,
roles: ROLES.CAMPAIGN_MANAGER,
// count: isLoading?"-":data
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const CreateQuestionContext = ({ onSelect, ...props }) => {
}
};
// const [initialState, setInitialState] = useState([{ id: crypto.randomUUID(), parentId: null, level: 1, key: 1, title: null, type: { "code": "SingleValueList" }, value: null, isRequired: false }])

const [initialState, setInitialState] = useState(()=>{
const savedQuestions = localStorage.getItem("questions");
return savedQuestions ? JSON.parse(savedQuestions) : [{ id: crypto.randomUUID(), parentId: null, level: 1, key: 1, title: null, type: { "code": "SingleValueList" }, value: null, isRequired: false }]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from "react";
import { PopUp, Button } from "@egovernments/digit-ui-components";
import { useTranslation } from "react-i18next";

const FinalPopup = ({ showFinalPopUp, setShowFinalPopup, addParents, createNewHierarchy })=> {
const { t } = useTranslation();
return (
showFinalPopUp && (
<PopUp
className={"custom-popup"}
type={"default"}
heading={t("CREATE_BOUNDARY_HIERARCHY")}
children={[
]}
onClose={()=>{
setShowFinalPopup(false);
}}
onOverlayClick={()=>{
setShowFinalPopup(false);
}}
style={{
// height:"11rem"
width: "50rem"
}}
footerChildren={[
<Button
type={"button"}
size={"large"}
variation={"secondary"}
label={t("CANCEL")}
onClick={() => {
setShowFinalPopup(false);
}}
/>,
<Button
type={"button"}
size={"large"}
variation={"primary"}
label={t("CREATE")}
onClick={() => {
addParents();
createNewHierarchy();
setShowFinalPopup(false);
}}
/>
]}
sortFooterChildren={true}
>
<div>
{<div>{t("YOU_WON'T_BE_ABLE_TO_UNDO_THIS_STEP_OF_CREATING_HIERARCHY")}</div>}
</div>
</PopUp>

)
);
};

export default FinalPopup;
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { PopUp, SVG, DownloadIcon, Button } from "@egovernments/digit-ui-react-components";
import React from "react";
import DocViewer, { DocViewerRenderers } from "@cyntler/react-doc-viewer";
import { useTranslation } from "react-i18next";
import { PRIMARY_COLOR } from "../utils";

const ArrowBack = ({ className = "", height = "15", width = "15", styles = {} }) => {
return (
<svg className={className} style={styles} width={width} height={height} viewBox="0 0 15 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M14.1663 6.16658H4.02467L8.68301 1.50825L7.49967 0.333252L0.833008 6.99992L7.49967 13.6666L8.67467 12.4916L4.02467 7.83325H14.1663V6.16658Z"
fill={PRIMARY_COLOR}
/>
</svg>
);
};
function XlsPreviewNew({ file, ...props }) {
const { t } = useTranslation();
const documents = file
? [
{
fileType: "xlsx",
fileName: file?.filename,
uri: file?.url,
},
]
: null;

return (
<div>
<div style={{ display: "flex", justifyContent: "space-between", marginLeft: "2.5rem", marginRight: "2.5rem", marginTop: "2.5rem" }}>
{/* <Button
label={t("BACK")}
variation="secondary"
icon={<ArrowBack styles={{ height: "1.25rem", width: "1.25rem" }} fill={PRIMARY_COLOR} />}
type="button"
className="workbench-download-template-btn"
onButtonClick={() => props?.onBack()}
/>
<Button
label={t("WBH_DOWNLOAD")}
variation="secondary"
icon={<DownloadIcon styles={{ height: "1.25rem", width: "1.25rem" }} fill={PRIMARY_COLOR} />}
type="button"
className="workbench-download-template-btn"
onButtonClick={() => props?.onDownload()}
/> */}
</div>
<div className="campaign-popup-module" style={{ marginTop: "1.5rem" }}>
<DocViewer
style={{ height: "80vh", overflowY: "hidden" }}
theme={{
primary: PRIMARY_COLOR,
secondary: "#feefe7",
tertiary: "#feefe7",
textPrimary: "#0B0C0C",
textSecondary: "#505A5F",
textTertiary: "#00000099",
disableThemeScrollbar: true,
}}
documents={documents}
pluginRenderers={DocViewerRenderers}
/>
</div>
</div>
);
}

export default XlsPreviewNew;
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React from "react";

export const ShpFileIcon = () => (
<svg width="96" height="120" viewBox="0 0 96 120" fill="none" xmlns="http://www.w3.org/2000/svg">
{/* File outline */}
<rect
x="5"
y="5"
width="86"
height="110"
rx="10"
ry="10"
fill="url(#gradient)" // Gradient fill
stroke="#DAA520" // Golden outline
strokeWidth="2"
/>

{/* File fold at the top-right corner */}
<path
d="M64 0V24H88"
fill="url(#foldGradient)"
stroke="#DAA520"
strokeWidth="1"
/>

{/* Shadow under the fold */}
<path
d="M64 24L88 24"
stroke="#FFD700"
strokeOpacity="0.5"
strokeWidth="1.5"
/>

{/* Add subtle shadow for depth */}
<rect
x="5"
y="5"
width="86"
height="110"
rx="10"
ry="10"
fill="none"
stroke="rgba(0,0,0,0.2)" // Shadow
strokeWidth="4"
strokeLinecap="round"
/>

{/* Add .SHP text below the file */}
<text x="28" y="115" fill="#DAA520" fontSize="22" fontWeight="bold">.SHP</text>

{/* Define gradient for file */}
<defs>
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style={{ stopColor: "#FFD700", stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: "#FFEA00", stopOpacity: 1 }} />
</linearGradient>

{/* Gradient for the folded corner */}
<linearGradient id="foldGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style={{ stopColor: "#FFDE5A", stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: "#FFD700", stopOpacity: 0.8 }} />
</linearGradient>
</defs>
</svg>
);
Loading

0 comments on commit 842be89

Please sign in to comment.