Skip to content
Open
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 @@ -137,7 +137,7 @@ const getFieldType = (field) => {
return "text";
case "number":
return "number";
case "textarea":
case "textArea":
return "textarea";
case "time":
return "time";
Expand Down Expand Up @@ -232,14 +232,16 @@ const AppPreview = ({ data = {}, selectedField, t }) => {
placeholder={t(field?.innerLabel) || ""}
populators={{
t: field?.isMdms ? null : t,
prefix: field?.prefixText,
suffix: field?.suffixText,
title: field?.label,
fieldPairClassName: `app-preview-field-pair ${
selectedField?.jsonPath && selectedField?.jsonPath === field?.jsonPath
? `app-preview-selected`
: selectedField?.id && selectedField?.id === field?.id
? `app-preview-selected`
: ``
}`,
} ${field?.["toArray.required"] && getFieldType(field) !== "custom" ? `required` : ``}`,
mdmsConfig: field?.isMdms
? {
moduleName: field?.schemaCode?.split(".")[0],
Expand All @@ -253,7 +255,6 @@ const AppPreview = ({ data = {}, selectedField, t }) => {
? renderField(field, t)
: null,
}}
required={getFieldType(field) === "custom" ? null : field?.["toArray.required"]}
type={getFieldType(field) === "button" || getFieldType(field) === "select" ? "custom" : getFieldType(field) || "text"}
value={field?.value === true ? "" : field?.value || ""}
disabled={field?.readOnly || false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { AlertCard, LabelFieldPair, Button, CardText, Dropdown, ErrorMessage, Po

const CampaignSelection = ({ onSelect, formData, formState, ...props }) => {
const { t } = useTranslation();
const tenantId = Digit.ULBService.getStateId();
//const tenantId = Digit.ULBService.getStateId();
const tenantId=Digit.ULBService.getCurrentTenantId();
const { isLoading, data: projectType } = Digit.Hooks.useCustomMDMS(tenantId, "HCM-PROJECT-TYPES", [{ name: "projectTypes" }],{select:(MdmsRes)=>MdmsRes}, { schemaCode: `${"HCM-PROJECT-TYPES"}.projectTypes` });
const [type, setType] = useState(props?.props?.sessionData?.HCM_CAMPAIGN_TYPE?.projectType || {});
const [beneficiaryType, setBeneficiaryType] = useState(props?.props?.sessionData?.HCM_CAMPAIGN_TYPE?.projectType?.beneficiaryType || "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const HCMMyCampaignRowCard = ({ key, rowData, tabData }) => {
url: "/project-factory/v1/project-type/cancel-campaign",
body: {
CampaignDetails: {
tenantId: Digit.ULBService.getStateId(),
tenantId: Digit.ULBService.getCurrentTenantId(),
campaignId: rowData?.id,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const RenderSelectionField = ({ field, t }) => {
const isMdmsEnabled = field?.isMdms && !!field?.schemaCode;

const { isLoading, data } = Digit?.Hooks.useCustomMDMS(
Digit?.ULBService?.getStateId(),
//Digit?.ULBService?.getStateId(),
Digit.ULBService.getCurrentTenantId(),
field?.schemaCode?.split(".")[0],
[{ name: field?.schemaCode?.split(".")[1] }],
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => {
const history = useHistory();
const isDraftCampaign = location.state?.isDraftCampaign;
const queryParams = Digit.Hooks.useQueryParams();
const tenantId = Digit.ULBService.getStateId();
// const tenantId = Digit.ULBService.getStateId();
const tenantId = Digit.ULBService.getCurrentTenantId();
const searchParams = new URLSearchParams(location.search);
const hierarchyType = props?.props?.dataParams?.hierarchyType;
const campaignNumber = searchParams.get("campaignNumber");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import TagComponent from "./TagComponent";

const UpdateBoundaryWrapper = ({ onSelect, ...props }) => {
const { t } = useTranslation();
const tenantId = Digit.ULBService.getStateId();
// const tenantId = Digit.ULBService.getStateId();
const tenantId=Digit.ULBService.getCurrentTenantId();
const searchParams = new URLSearchParams(location.search);
const parentId = searchParams.get("parentId");
const id = searchParams.get("id");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ different types of campaigns - ongoing, completed, and drafts. Each campaign typ
configuration with fields like campaign name, type, start date, end date, etc. The configurations
also include API details for fetching data, UI styles, search result columns, pagination settings,
and more. The object is exported for use in other parts of the codebase. */
export const myCampaignConfig = {
tenantId: "mz",

export const myCampaignConfigs =(tenantId)=>( {
tenantId: tenantId,
moduleName: "commonCampaignUiConfig",
showTab: true,
myCampaignConfig: [
Expand Down Expand Up @@ -838,4 +839,4 @@ export const myCampaignConfig = {
showAsRemovableTagsInMobile: true,
},
],
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ different types of campaigns - ongoing, completed, and drafts. Each campaign typ
configuration with fields like campaign name, type, start date, end date, etc. The configurations
also include API details for fetching data, UI styles, search result columns, pagination settings,
and more. The object is exported for use in other parts of the codebase. */
export const myCampaignConfigNew = {
tenantId: "mz",


export const myCampaignConfigNews = (tenantId)=>( {
tenantId: tenantId,
moduleName: "commonCampaignUiConfig",
showTab: true,
myCampaignConfigNew: [
Expand Down Expand Up @@ -519,4 +521,4 @@ export const myCampaignConfigNew = {
showAsRemovableTagsInMobile: true,
},
],
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { Header, InboxSearchComposer } from "@egovernments/digit-ui-react-components";
import { useHistory } from "react-router-dom";
import { myCampaignConfig } from "../../configs/myCampaignConfig";
import { myCampaignConfigs } from "../../configs/myCampaignConfig";

/**
* The `MyCampaign` function is a React component that displays a header with a campaign search title
Expand All @@ -13,6 +13,8 @@ import { myCampaignConfig } from "../../configs/myCampaignConfig";
* component is being passed props such as `configs`, `showTab`, `tabData`, and `onTabChange
*/
const MyCampaign = () => {
const tenantId = Digit.ULBService.getCurrentTenantId();
const myCampaignConfig = myCampaignConfigs(tenantId);
const { t } = useTranslation();
const history = useHistory();
const [config, setConfig] = useState(myCampaignConfig?.myCampaignConfig?.[0]);
Expand All @@ -26,7 +28,7 @@ const MyCampaign = () => {
};

useEffect(() => {

window.Digit.SessionStorage.del("HCM_CAMPAIGN_MANAGER_FORM_DATA");
window.Digit.SessionStorage.del("HCM_CAMPAIGN_MANAGER_UPLOAD_ID");
window.Digit.SessionStorage.del("HCM_CAMPAIGN_UPDATE_FORM_DATA");
Expand Down Expand Up @@ -64,8 +66,8 @@ const MyCampaign = () => {
if (row?.parentId) {
history.push(`/${window.contextPath}/employee/campaign/update-campaign?parentId=${row.parentId}&id=${row.id}&draft=${true}&campaignName=${row.campaignName}`);
} else {
const baseUrl = `/${window.contextPath}/employee/campaign/setup-campaign?id=${row.id}&draft=true&fetchBoundary=true&draftBoundary=true`;
const hasPassedDates = row.startDate <= currentDate || row.endDate <= currentDate;
const baseUrl = `/${window.contextPath}/employee/campaign/setup-campaign?id=${row.id}&draft=true&fetchBoundary=true&draftBoundary=true`;
const hasPassedDates = row.startDate <= currentDate || row.endDate <= currentDate;
const finalUrl = hasPassedDates ? `${baseUrl}&date=true` : baseUrl;
history.push(finalUrl);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { InboxSearchComposer , Loader} from "@egovernments/digit-ui-components";
import { myCampaignConfigNew } from "../../configs/myCampaignConfigNew";
import { myCampaignConfigNews } from "../../configs/myCampaignConfigNew";

/**
* The `MyCampaignNew` function is a React component that displays a header with a campaign search title
Expand All @@ -13,6 +13,10 @@ import { myCampaignConfigNew } from "../../configs/myCampaignConfigNew";
*/

const MyCampaignNew = ({showDashboardLink}) => {

const tenantId= Digit.ULBService.getCurrentTenantId();

const myCampaignConfigNew=myCampaignConfigNews(tenantId);

const { t } = useTranslation();
const [config, setConfig] = useState(null);
Expand Down
Loading