Skip to content

Commit

Permalink
Merge branch 'campaign' into bhavya-generate_api
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhavya-egov authored May 29, 2024
2 parents e3e4991 + b93fbb8 commit 5a0e91b
Show file tree
Hide file tree
Showing 17 changed files with 138 additions and 68 deletions.
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@egovernments/digit-ui-libraries": "1.8.1-beta.4",
"@egovernments/digit-ui-module-core": "1.8.1-beta.17",
"@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",
Expand Down
5 changes: 2 additions & 3 deletions micro-ui/web/micro-ui-internals/example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
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]/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]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/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
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/packages/css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.0.45-campaign",
"version": "1.0.47-campaign",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
@import url("../../index.scss");
@import "../../typography.scss";

.summary-header{
@extend .typography.text-heading-l;
font-size: 2.25rem;
}
.date-field-container {
display: grid;
grid-template-columns: 20rem 20rem;
grid-gap: 2rem;
grid-gap: 1.5rem;
width: 70%;
padding-top: 0.3rem;
margin-top: 0rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
.date-field-container {
display: grid;
grid-template-columns: 18.75rem 18.75rem;
grid-gap: 2rem;
grid-gap: 1.5rem;
width: 100%;
}
.PlusMinus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,23 @@
header {
@extend .typography.text-heading-xl;
}


.digit-popup-wrap {
background: rgba(0, 0, 0, 0.7);
@apply flex fixed w-full h-full overflow-auto top-0 left-0 min-h-screen;
z-index: 10000;
max-width: 100% !important;
max-height: 100% !important;
}

@screen dt {
.digit-popup-wrap {
background: rgba(0, 0, 0, 0.7);
@apply min-h-screen;
}
}

.digit-popup-close-icon {
@apply flex justify-end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
@import "./coreOverride.scss";
@import "../../typography.scss";

.wbh-header-container {
margin-top: 1.5rem;
}
.main.digit-home-main {
margin-left: 92px;
.employee-app-wrapper.digit-home-app-wrapper {
margin-left: 0;
.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;
.employeeCard.customEmployeeCard.card-home.home-action-cards {
margin: 0 !important;
}
}
}
}
}
}
.campaign-cycle-container {
.popup-header-fix {
margin-top: 1.5rem !important;
Expand Down Expand Up @@ -124,7 +146,6 @@
font-size: 24px;
color: #505a5f;
margin-top: 0.5rem;
font-style: italic;
}
.header-end {
margin-right: 1rem;
Expand Down Expand Up @@ -193,11 +214,21 @@ input[type="date"]::-webkit-calendar-picker-indicator {
}
}
.campaign-summary-container {
.setup-campaign-card {
.employeeCard.employeeCard-override {
padding: 1.5rem;
margin-bottom: 1.5rem !important;
}
}
.row {
justify-content: flex-start;
gap: 5rem;
h2 {
margin: 0;
width: 272px;
}
.value {
width: unset;
p {
margin: 0;
}
Expand All @@ -206,6 +237,7 @@ input[type="date"]::-webkit-calendar-picker-indicator {
}
.view-composer-header-section {
.employee-card-sub-header {
@extend .typography.text-heading-m;
margin-bottom: 1.5rem;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.23",
"@egovernments/digit-ui-components": "0.0.1-beta.28",
"@egovernments/digit-ui-components": "0.0.1-beta.30",
"@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 @@ -20,28 +20,28 @@ const CampaignCard = () => {

const { t } = useTranslation();
const tenantId = Digit.ULBService.getCurrentTenantId();
const reqCriteria = {
url: "/project-factory/v1/project-type/search",
params: {},
body: { CampaignDetails:{
tenantId,
createdBy: Digit.UserService.getUser().info.uuid,
pagination: {
"sortBy": "createdTime",
"sortOrder": "desc",
"limit": 1,
"offset": 0
}
} },
config: {
select: (data) => {
return data?.totalCount;
},
},
};
const { isLoading, data } = Digit.Hooks.useCustomAPIHook(
reqCriteria
);
// const reqCriteria = {
// url: "/project-factory/v1/project-type/search",
// params: {},
// body: { CampaignDetails:{
// tenantId,
// createdBy: Digit.UserService.getUser().info.uuid,
// pagination: {
// "sortBy": "createdTime",
// "sortOrder": "desc",
// "limit": 1,
// "offset": 0
// }
// } },
// config: {
// select: (data) => {
// return data?.totalCount;
// },
// },
// };
// const { isLoading, data } = Digit.Hooks.useCustomAPIHook(
// reqCriteria
// );
let links = [

{
Expand All @@ -53,7 +53,7 @@ const CampaignCard = () => {
label: t("ACTION_TEST_MY_CAMPAIGN"),
link: `/${window?.contextPath}/employee/campaign/my-campaign`,
roles: ROLES.CAMPAIGN_MANAGER,
count: isLoading?"-":data
// count: isLoading?"-":data
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const CampaignSummary = () => {
return (
<>
<div style={{ display: "flex", justifyContent: "space-between" }}>
<Header>{t("ES_TQM_SUMMARY_HEADING")}</Header>
<Header className="summary-header">{t("ES_TQM_SUMMARY_HEADING")}</Header>
{userCredential && (
<Button
label={t("CAMPAIGN_DOWNLOAD_USER_CRED")}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Header } from "@egovernments/digit-ui-react-components";
import { Button, Header, LoaderWithGap } from "@egovernments/digit-ui-react-components";
import React, { useRef, useState, useEffect, Fragment } from "react";
import { useTranslation } from "react-i18next";
import { DownloadIcon, Card } from "@egovernments/digit-ui-react-components";
Expand All @@ -10,6 +10,7 @@ import { schemaConfig } from "../configs/schemaConfig";
import { headerConfig } from "../configs/headerConfig";
import { PRIMARY_COLOR } from "../utils";
import { downloadExcelWithCustomName } from "../utils";

/**
* The `UploadData` function in JavaScript handles the uploading, validation, and management of files
* for different types of data in a web application.
Expand Down Expand Up @@ -796,6 +797,7 @@ const UploadData = ({ formData, onSelect, ...props }) => {

return (
<>
{isValidation && <LoaderWithGap text={"CAMPAIGN_VALIDATION_INPROGRESS"} />}
<Card>
<div className="campaign-bulk-upload">
<Header className="digit-form-composer-sub-header">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useState } from "react";
import React, { useState, Fragment } from "react";
import { Link, useHistory, useLocation } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { Banner, Card, LinkLabel, ArrowLeftWhite, ActionBar, SubmitBar } from "@egovernments/digit-ui-react-components";
import { ActionBar, SubmitBar } from "@egovernments/digit-ui-react-components";
import { PanelCard } from "@egovernments/digit-ui-components";

const Response = () => {
const { t } = useTranslation();
Expand All @@ -22,40 +23,42 @@ const Response = () => {
}
};

const children = [
<div style={{ display: "flex" }} key="response-text">
{state?.boldText ? (
<p style={{ margin: "0rem" }}>
{t(state?.preText)}
<b> {t(state?.boldText)} </b>
{t(state?.postText)}
</p>
) : (
t(state?.text, { CAMPAIGN_ID: campaignId })
)}
</div>,
];

return (
<Card>
<Banner
successful={isResponseSuccess}
<>
<PanelCard
type={isResponseSuccess ? "success" : "error"}
message={t(state?.message)}
multipleResponseIDs={[campaignId]}
response={campaignId}
info={t(state?.info)}
whichSvg={`${isResponseSuccess ? "tick" : null}`}
footerChildren={[]}
children={children}
/>
<Card style={{ border: "none", boxShadow: "none", padding: "0", paddingBottom: "1rem" }}>
<div style={{ display: "flex", marginBottom: "0.75rem" }}>
{state?.boldText ? (
<p>
{t(state?.preText)}
<b> {t(state?.boldText)} </b>
{t(state?.postText)}
</p>
) : (
t(state?.text, { CAMPAIGN_ID: campaignId })
)}
</div>
{isMobile ? (
{isMobile ? (
<Link to={state?.actionLink ? state?.actionLink : `/${window.contextPath}/employee/`}>
<SubmitBar label={state?.actionLabel ? t(state?.actionLabel) : t("ES_CAMPAIGN_RESPONSE_ACTION")} />
</Link>
) : (
<ActionBar>
<Link to={state?.actionLink ? state?.actionLink : `/${window.contextPath}/employee/`}>
<SubmitBar label={state?.actionLabel ? t(state?.actionLabel) : t("ES_CAMPAIGN_RESPONSE_ACTION")} />
</Link>
) : (
<ActionBar>
<Link to={state?.actionLink ? state?.actionLink : `/${window.contextPath}/employee/`}>
<SubmitBar label={state?.actionLabel ? t(state?.actionLabel) : t("ES_CAMPAIGN_RESPONSE_ACTION")} />
</Link>
</ActionBar>
)}
</Card>
</Card>
</ActionBar>
)}
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.1-beta.4",
"@egovernments/digit-ui-module-workbench": "1.0.1-beta.16",
"@egovernments/digit-ui-module-core": "1.8.1-beta.17",
"@egovernments/digit-ui-module-core": "1.8.1-beta.23",
"@egovernments/digit-ui-module-hrms": "1.8.0-beta.2",
"@egovernments/digit-ui-react-components": "1.8.1-beta.23",
"@egovernments/digit-ui-components": "0.0.1-beta.25",
Expand Down
4 changes: 2 additions & 2 deletions micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
rel="stylesheet" type="text/css" />
<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].15/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].21/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].45-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].47-campaign/dist/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT</title>
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"homepage": "/workbench-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.1-beta.4",
"@egovernments/digit-ui-module-core": "1.8.1-beta.17",
"@egovernments/digit-ui-module-core": "1.8.1-beta.23",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.5",
"@egovernments/digit-ui-react-components": "1.8.1-beta.23",
"@egovernments/digit-ui-components": "0.0.1-beta.25",
Expand Down
10 changes: 10 additions & 0 deletions utilities/project-factory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog
All notable changes to this module will be documented in this file.

## 0.1.0 - 2024-05-28
#### Base ProjectFactory service
1. ProjectFactory Service manages campaigns: creation, updating, searching, and data generation.
2. Project Mapping : In campaign creation full project mapping is done with staff, facility and resources along with proper target values.
3. Create Data: Validates and creates resource details of type facility,user and boundary.
4. Generate Data: Generates sheet data of type facility,user and boundary.
5. Boundary and Resource Validation: Validates boundaries and resources during campaign creation and updating.
2 changes: 1 addition & 1 deletion utilities/project-factory/src/server/utils/genericUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ async function generateFacilityAndBoundarySheet(tenantId: string, request: any,
async function generateUserAndBoundarySheet(request: any, localizationMap?: { [key: string]: string }) {
const userData: any[] = [];
const tenantId = request?.query?.tenantId;
const schema = await callMdmsSchema(request, config?.values?.moduleName, "facility", tenantId);
const schema = await callMdmsSchema(request, config?.values?.moduleName, "user", tenantId);
const headers = schema?.required;
const localizedHeaders = getLocalizedHeaders(headers, localizationMap);
const localizedUserTab = getLocalizedName(config?.user?.userTab, localizationMap);
Expand Down

0 comments on commit 5a0e91b

Please sign in to comment.