Skip to content

Commit

Permalink
gate fixes (#736)
Browse files Browse the repository at this point in the history
* gate fixes validation, ui ux

* gate fix

---------

Co-authored-by: nabeelmd-eGov <nabeel.md@egovernments.com>
  • Loading branch information
nabeelmd-eGov and nabeelmd-eGov committed May 29, 2024
1 parent e192b87 commit 309d820
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 5 deletions.
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 @@ -347,3 +347,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 @@ -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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useMemo, useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { Button, Header, InboxSearchComposer, Loader } from "@egovernments/digit-ui-react-components";
import { useLocation } from "react-router-dom";
import { useHistory, useLocation } from "react-router-dom";
import { myCampaignConfig } from "../../configs/myCampaignConfig";

/**
Expand All @@ -15,6 +15,7 @@ import { myCampaignConfig } from "../../configs/myCampaignConfig";
const MyCampaign = () => {
const { t } = useTranslation();
const location = useLocation();
const history = useHistory();
const moduleName = Digit?.Utils?.getConfigModuleName() || "commonCampaignUiConfig";
const tenant = Digit.ULBService.getStateId();
const tenantId = Digit.ULBService.getCurrentTenantId();
Expand All @@ -33,11 +34,39 @@ const MyCampaign = () => {
window.Digit.SessionStorage.del("HCM_CAMPAIGN_MANAGER_UPLOAD_ID");
}, []);

const onClickRow = ({ original: row }) => {
const currentTab = tabData?.find((i) => i?.active === true)?.label;
switch (currentTab) {
case "CAMPAIGN_ONGOING":
history.push(`/${window.contextPath}/employee/campaign/setup-campaign?id=${row.id}&preview=${true}&action=${false}`);
case "CAMPAIGN_COMPLETED":
history.push(`/${window.contextPath}/employee/campaign/setup-campaign?id=${row.id}&preview=${true}&action=${false}`);
case "CAMPAIGN_UPCOMING":
history.push(`/${window.contextPath}/employee/campaign/setup-campaign?id=${row.id}&preview=${true}&action=${false}`);
case "CAMPAIGN_DRAFTS":
history.push(`/${window.contextPath}/employee/campaign/setup-campaign?id=${row.id}&draft=${true}&fetchBoundary=${true}`);
case "CAMPAIGN_FAILED":
history.push(`/${window.contextPath}/employee/campaign/setup-campaign?id=${row.id}&preview=${true}&action=${false}`);
default:
break;
}
};

return (
<React.Fragment>
<Header styles={{ fontSize: "32px" }}>{t("CAMPAIGN_SEARCH_TITLE")}</Header>
<div className="inbox-search-wrapper">
<InboxSearchComposer configs={config} showTab={true} tabData={tabData} onTabChange={onTabChange}></InboxSearchComposer>
<InboxSearchComposer
configs={config}
showTab={true}
tabData={tabData}
onTabChange={onTabChange}
additionalConfig={{
resultsTable: {
onClickRow,
},
}}
></InboxSearchComposer>
</div>
</React.Fragment>
);
Expand Down

0 comments on commit 309d820

Please sign in to comment.