Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added IRS changes in console #1305

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -5,6 +5,7 @@ import { Button, EditIcon, Header, Loader, ViewComposer } from "@egovernments/di
import { InfoBannerIcon, Toast } from "@egovernments/digit-ui-components";
import { DownloadIcon } from "@egovernments/digit-ui-react-components";
import { PRIMARY_COLOR, downloadExcelWithCustomName } from "../utils";
import getProjectServiceUrl from "../utils/getProjectServiceUrl";

function mergeObjects(item) {
const arr = item;
Expand Down Expand Up @@ -134,26 +135,31 @@ const fetchResourceFile = async (tenantId, resourceIdArr) => {
return res?.ResourceDetails;
};
const fetchcd = async (tenantId, projectId) => {
const reqCriteriaResource = {
url: `/health-project/v1/_search?limit=1000&offset=0&tenantId=mz`,
body: {
Projects: [
{
tenantId: tenantId, // Ensure tenantId is defined and in scope
id: projectId
}
]
}
};
try{
const res = await Digit.CustomService.getResponse(reqCriteriaResource);
return res?.Project?.[0];
}
catch(e) {
console.log("error", e);
}
const url = getProjectServiceUrl();
const reqCriteriaResource = {
url: `${url}/v1/_search`,
params: {
tenantId: tenantId,
limit: 10,
offset: 0,
},
body: {
Projects: [
{
tenantId: tenantId,
id: projectId
}
]
}
};
try{
const res = await Digit.CustomService.getResponse(reqCriteriaResource);
return res?.Project?.[0];
}
catch(e) {
console.log("error", e);
}
};

const CampaignSummary = (props) => {
const { t } = useTranslation();
const history = useHistory();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import getProjectServiceUrl from "../utils/getProjectServiceUrl";

const useProjectSearchWithBoundary = async ({ name, tenantId, boundaries }) => {
const url = getProjectServiceUrl();
const requests = boundaries.map(({ code }) => {
return Digit.CustomService.getResponse({
url: "/health-project/v1/_search",
url: `${url}/v1/_search`,
params: {
tenantId: tenantId,
limit: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";
import { LabelFieldPair, Header } from "@egovernments/digit-ui-react-components";
import { Card, FieldV1 } from "@egovernments/digit-ui-components";
import getProjectServiceUrl from "../../utils/getProjectServiceUrl";

const initialState = (projectData) => {
return projectData;
Expand Down Expand Up @@ -80,9 +81,9 @@ const DateAndCycleUpdate = ({ onSelect, formData, ...props }) => {
const tenantId = Digit.ULBService.getCurrentTenantId();
const { state } = useLocation();
const historyState = window.history.state;

const url = getProjectServiceUrl();
const reqCriteria = {
url: "/health-project/v1/_search",
url: `${url}/v1/_search`,
Bhavya-egov marked this conversation as resolved.
Show resolved Hide resolved
params: {
tenantId: tenantId,
limit: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,16 +566,17 @@ const AddAttributeWrapper = ({ targetedData, deliveryRuleIndex, delivery, delive
},
});

const { isLoading: structureConfigLoading, data: structureConfig } = Digit.Hooks.useCustomMDMS(
const { data: structureConfig } = Digit.Hooks.useCustomMDMS(
tenantId,
"HCM-ADMIN-CONSOLE",
[{ name: "structureType" }],
"HCM",
[{ name: "HOUSE_STRUCTURE_TYPES" }],
{
select: (data) => {
Bhavya-egov marked this conversation as resolved.
Show resolved Hide resolved
return data?.["HCM-ADMIN-CONSOLE"]?.structureType;
return data?.["HCM"]?.["HOUSE_STRUCTURE_TYPES"];
},
}
);

const [attributes, setAttributes] = useState([{ key: 1, deliveryRuleIndex, attribute: "", operator: "", value: "" }]);
const reviseIndexKeys = () => {
setAttributes((prev) => prev.map((unit, index) => ({ ...unit, key: index + 1 })));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const getProjectServiceUrl = () => {
// Access the globalConfigs object and retrieve the PROJECT_SERVICE_PATH configuration.
// If not defined, fallback to default URL `/health-project`.
const url = window.globalConfigs?.getConfig("PROJECT_SEERVICE_PATH") || `/health-project`;
return url;
};

export default getProjectServiceUrl;