Skip to content

Commit

Permalink
Fixes of admin console v0.1 (#759)
Browse files Browse the repository at this point in the history
* Merge branch 'campaign' into campaign-merged

* Merge branch 'campaign' into campaign-merged
  • Loading branch information
jagankumar-egov committed May 30, 2024
1 parent e8d6558 commit 3c88770
Show file tree
Hide file tree
Showing 34 changed files with 397 additions and 139 deletions.
7 changes: 7 additions & 0 deletions frontend/micro-ui/web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog
All notable changes to this module will be documented in this file.

## 0.1.0 - 2024-05-28
#### Base Admin console web
1. Helps in creating the Campaign and configure delivery rules
2. Create Data: Validates and creates resource details of type facility,user and boundary.
4 changes: 2 additions & 2 deletions frontend/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"@egovernments/digit-ui-libraries": "1.8.1-beta.4",
"@egovernments/digit-ui-module-core": "1.8.1-beta.23",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.2",
"@egovernments/digit-ui-components": "0.0.1-beta.28",
"@egovernments/digit-ui-react-components": "1.8.1-beta.23",
"@egovernments/digit-ui-components": "0.0.1-beta.31",
"@egovernments/digit-ui-react-components": "1.8.1-beta.24",
"@egovernments/digit-ui-module-workbench": "1.0.1-beta.16",
"@egovernments/digit-ui-module-hcmworkbench":"0.0.38",
"@egovernments/digit-ui-module-campaign-manager": "0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
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-css@1.8.1-beta.10/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-coreui.21/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.47-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-coreui.22/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.49-campaign/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->

<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.5.41/dist/index.css" /> -->
Expand All @@ -32,4 +32,4 @@
<div id="root"></div>
</body>

</html>
</html>
4 changes: 2 additions & 2 deletions frontend/micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"ajv": "^8.12.0",
"lodash": "4.17.21",
"microbundle-crl": "0.13.11",
"@egovernments/digit-ui-react-components": "1.8.1-beta.23",
"@egovernments/digit-ui-components": "0.0.1-beta.28",
"@egovernments/digit-ui-react-components": "1.8.1-beta.24",
"@egovernments/digit-ui-components": "0.0.1-beta.31",
"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.47-campaign",
"version": "1.0.49-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
@@ -1,7 +1,7 @@
@import url("../../index.scss");
@import "../../typography.scss";

.summary-header{
.summary-header {
@extend .typography.text-heading-l;
font-size: 2.25rem;
}
Expand Down Expand Up @@ -58,6 +58,9 @@
}
.selecting-boundary-div {
padding-top: 0.5rem;
.label-field-pair {
margin-bottom: 1.5rem;
}
}
.campaign-table {
border-collapse: collapse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.sub-tab-container {
margin-top: 5px;
padding: 1.5rem;
.card-text{
.card-text {
margin-bottom: 0;
}
}
Expand Down Expand Up @@ -69,6 +69,9 @@
}
}
}
.selector-button-primary {
background-color: theme(digitv2.lightTheme.primary);
}
.campaign-breadcrumb {
margin: 0;
margin-bottom: 1.5rem;
Expand Down Expand Up @@ -272,7 +275,7 @@
.options-card {
max-height: 10rem !important;
}
.card-label{
.card-label {
margin-bottom: 0.5rem;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
margin-left: 92px;
.employee-app-wrapper.digit-home-app-wrapper {
margin-left: 0;
margin-right: 2rem;
.ground-container.digit-home-ground {
padding: 0;
.employee-app-container.digit-home-employee-app {
.ground-container.moduleCardWrapper.gridModuleWrapper.digit-home-moduleCardWrapper {
gap: 2.5rem;
margin-top: 2rem;
padding: 0;
display: grid !important;
grid-template-columns: repeat(auto-fill, minmax(263px, 1fr));
.employeeCard.customEmployeeCard.card-home.home-action-cards {
margin: 0 !important;
min-width: 263px !important;
width: auto !important;
}
}
}
Expand Down Expand Up @@ -107,36 +112,63 @@
}
.campaign-attribute-table {
margin-bottom: 1rem;
border: 1px solid #d6d5d4;
overflow: hidden;
border-radius: 4px;
table {
background-color: #fafafa;
border: 1px solid #d6d5d4;
border-collapse: collapse;
border-radius: 1rem;
tbody {
tr:nth-child(odd) {
background-color: white;
}
}
th {
border: 1px solid #d6d5d4;
border-right: 1px solid #d6d5d4;
}
th:last-child {
border-right: none;
}
td {
padding: 1rem;
border: 1px solid #d6d5d4;
border-right: 1px solid #d6d5d4;
}
td:last-child {
padding: 1rem;
border-right: none;
}
}
}
.campaign-product-table {
margin-bottom: 1rem;
border: 1px solid #d6d5d4;
overflow: hidden;
border-radius: 4px;
table {
background-color: #fafafa;
border: 1px solid #d6d5d4;
border-collapse: collapse;
border-radius: 1rem;
tbody {
background-color: #fff;
tr:nth-child(odd) {
background-color: white;
}
}
th {
border: 1px solid #d6d5d4;
border-right: 1px solid #d6d5d4;
}
th:last-child {
border-right: none;
}
td {
padding: 1rem;
border: 1px solid #d6d5d4;
border-right: 1px solid #d6d5d4;
}
td:last-child {
border-right: none;
}
}
}
Expand Down Expand Up @@ -170,13 +202,20 @@ input[type="date"]::-webkit-calendar-picker-indicator {
}
}
.campaign-attribute-table {
border: 1px solid #d6d5d4;
overflow: hidden;
border-radius: 4px;
tbody {
tr:nth-child(odd) {
background-color: white;
}
}
}

tbody {
tr:nth-child(odd) {
background-color: white;
}
}
.popup-wrap.campaign-data-preview {
flex-direction: column;
}
Expand Down Expand Up @@ -212,6 +251,9 @@ input[type="date"]::-webkit-calendar-picker-indicator {
.digit-dropdown-options-card {
max-height: 10rem !important;
}
.digit-field {
margin-bottom: 0 !important;
}
}
.campaign-summary-container {
.setup-campaign-card {
Expand Down Expand Up @@ -317,9 +359,9 @@ input[type="date"]::-webkit-calendar-picker-indicator {
.popup-module-action-bar.campaign-pop-action {
.selector-button-border {
background-color: #ffffff;
border: 1px solid #f47738;
border: 1px solid #c84c0e;
h2 {
color: #f47738 !important;
color: #c84c0e !important;
}
}
}
Expand Down Expand Up @@ -347,3 +389,11 @@ input[type="date"]::-webkit-calendar-picker-indicator {
font-size: 14px;
}
}
.individualElement {
h2 {
color: theme(digitv2.lightTheme.text-primary);
}
}
.link {
color: #c84c0e !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ module.exports = {
"header-sidenav": "#0B4B66",
"input-border": "#505A5F",
"primary-bg": "#FEEFE7",
"text-primary": "#363636",
},
alert: {
error: "#b91900",
error: "#b91900",
"error-bg": "#EFC7C1",
success: "#00703C",
"success-bg": "#BAD6C9",
Expand Down Expand Up @@ -228,4 +229,4 @@ module.exports = {
},
variants: {},
plugins: [],
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"react-router-dom": "5.3.0"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.23",
"@egovernments/digit-ui-components": "0.0.1-beta.30",
"@egovernments/digit-ui-react-components": "1.8.1-beta.24",
"@egovernments/digit-ui-components": "0.0.1-beta.31",
"@rjsf/core": "5.10.0",
"@rjsf/utils": "5.10.0",
"@rjsf/validator-ajv8": "5.10.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const CampaignDates = ({ onSelect, formData, ...props }) => {
} else if (new Date(endDate).getTime() < new Date(startDate).getTime() && startValidation) {
setError({ endDate: "CAMPAIGN_END_DATE_BEFORE_ERROR" });
onSelect("campaignDates", { startDate: startDate, endDate: endDate });
} else if (startValidation && new Date(endDate).getTime() === new Date(startDate).getTime()) {
setError({ endDate: "CAMPAIGN_END_DATE_SAME_ERROR" });
onSelect("campaignDates", { startDate: startDate, endDate: endDate });
} else if (startDate || endDate) {
setError(null);
onSelect("campaignDates", { startDate: startDate, endDate: endDate });
Expand Down Expand Up @@ -89,7 +92,7 @@ const CampaignDates = ({ onSelect, formData, ...props }) => {
}}
min={Digit.Utils.date.getDate(Date.now() + ONE_DAY_IN_MS)}
onChange={(d) => {
setStartValidation(true);
// setStartValidation(true);
setStart(d);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const CampaignSelection = ({ onSelect, formData, formState, ...props }) => {
</div>
<div className="campaign-type-wrapper">
<Dropdown
style={{ width: "40rem", paddingBottom: "1rem" }}
style={!showBeneficiary ? { width: "40rem", paddingBottom: 0, marginBottom: 0 } : { width: "40rem", paddingBottom: "1rem" }}
variant={error ? "error" : ""}
t={t}
option={projectType?.["HCM-PROJECT-TYPES"]?.projectTypes}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState, Fragment ,useMemo} from "react";
import { CardText, LabelFieldPair, Card, Header, CardLabel, Modal } from "@egovernments/digit-ui-react-components";
import React, { useEffect, useState, Fragment, useMemo } from "react";
import { CardText, LabelFieldPair, Card, Header, CardLabel, Modal, LoaderWithGap } from "@egovernments/digit-ui-react-components";
import { useTranslation } from "react-i18next";
import { Dropdown, InfoCard, MultiSelectDropdown, Toast } from "@egovernments/digit-ui-components";
import { mailConfig } from "../configs/mailConfig";
Expand Down Expand Up @@ -38,6 +38,7 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {
const [showPopUp, setShowPopUp] = useState(null);
const [restrictSelection, setRestrictSelection] = useState(null);
const [updateBoundary, setUpdateBoundary] = useState(null);
const [loaderEnabled, setLoaderEnabled] = useState(false);
const { isLoading, data: hierarchyConfig } = Digit.Hooks.useCustomMDMS(tenantId, "HCM-ADMIN-CONSOLE", [{ name: "hierarchyConfig" }]);

// const lowestHierarchy = hierarchyConfig?.["HCM-ADMIN-CONSOLE"]?.hierarchyConfig?.[0]?.lowestHierarchy;
Expand Down Expand Up @@ -187,12 +188,16 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {
},
body: {},
});
setShowToast({ key: "info", label: t("HCM_PLEASE_WAIT_LOADING_BOUNDARY") });
// setShowToast({ key: "info", label: t("HCM_PLEASE_WAIT_LOADING_BOUNDARY") });
setLoaderEnabled(true);
const boundaryTypeData = await reqCriteriaBoundaryTypeSearch;
newData.push({ parentCode, boundaryTypeData });
}
setBoundaryTypeDataresult(newData);
closeToast();
setTimeout(() => {
setLoaderEnabled(false);
}, 1000);
// closeToast();
}
};

Expand Down Expand Up @@ -256,7 +261,9 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {
updatedBoundaryData[type] = [];
}
});
setSelectedData(updatedSelectedData);
if (!_.isEqual(selectedData, updatedSelectedData)) {
setSelectedData(updatedSelectedData);
}
setBoundaryData(updatedBoundaryData);
}
return;
Expand Down Expand Up @@ -317,8 +324,9 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {
}
})
.flat();

setSelectedData(updatedSelectedData);
if (!_.isEqual(selectedData, updatedSelectedData)) {
setSelectedData(updatedSelectedData);
}
} else {
// Update only the data for the new boundaryType
const mergedData = [...selectedData?.filter((item) => item?.type !== newBoundaryType), ...transformedRes];
Expand All @@ -337,8 +345,9 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {
children.forEach((child) => addChildren(child));
};
filteredData.filter((item) => item.isRoot).forEach((rootItem) => addChildren(rootItem));

setSelectedData(updatedSelectedData);
if (!_.isEqual(selectedData, updatedSelectedData)) {
setSelectedData(updatedSelectedData);
}
}
const parentBoundaryEntry = hierarchyTypeDataresult
? hierarchyTypeDataresult?.boundaryHierarchy?.find(
Expand All @@ -354,6 +363,7 @@ function SelectingBoundaries({ onSelect, formData, ...props }) {

return (
<>
{loaderEnabled && <LoaderWithGap text={"CAMPAIGN_BOUNDARY_PLEASE_WAIT"}></LoaderWithGap>}
<Card>
<div className="selecting-boundary-div">
<Header>{t(`CAMPAIGN_SELECT_BOUNDARY`)}</Header>
Expand Down
Loading

0 comments on commit 3c88770

Please sign in to comment.