-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34c2409
commit c075921
Showing
8 changed files
with
249 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
...web/micro-ui-internals/packages/modules/campaign-manager/src/configs/myMicroplanConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
|
||
|
||
const tenantId = Digit.ULBService.getCurrentTenantId(); | ||
const mdms_context_path = window?.globalConfigs?.getConfig("MDMS_V2_CONTEXT_PATH") || "mdms-v2"; | ||
export const MicroplanCampaignSearchConfig = [ | ||
{ | ||
label: "MICROPLAN_SEARCH", | ||
type: "search", | ||
apiDetails: { | ||
serviceName: "/plan-service/config/_search", | ||
requestParam: { | ||
}, | ||
requestBody: { | ||
"PlanConfigurationSearchCriteria": { | ||
"limit": 10, | ||
"offset": 0, | ||
"tenantId": "mz", | ||
"userUuid": "ff4ca65b-de7a-48de-ab9d-23c7728dc1aa" | ||
}, | ||
}, | ||
masterName: "commonUiConfig", | ||
moduleName: "MicroplanCampaignSearchConfig", | ||
minParametersForSearchForm: 0, | ||
tableFormJsonPath: "requestBody.PlanConfigurationSearchCriteria.pagination", | ||
// filterFormJsonPath: "requestBody.MdmsCriteria.customs", | ||
searchFormJsonPath: "requestBody.PlanConfigurationSearchCriteria", | ||
}, | ||
sections: { | ||
search: { | ||
uiConfig: { | ||
formClassName: "custom-both-clear-search", | ||
primaryLabel: "ES_COMMON_SEARCH", | ||
secondaryLabel: "ES_COMMON_CLEAR_SEARCH", | ||
minReqFields: 0, | ||
defaultValues:{ | ||
microplanName: "", | ||
campaignType: "", | ||
}, | ||
fields: [ | ||
{ | ||
label: "Name of the microplan", | ||
isMandatory: false, | ||
key: "microplanName", | ||
type: "text", | ||
populators: { | ||
name: "microplanName" | ||
}, | ||
}, | ||
{ | ||
label: "CAMPAIGN_SEARCH_TYPE", | ||
type: "apidropdown", | ||
isMandatory: false, | ||
disable: false, | ||
populators: { | ||
optionsCustomStyle: { | ||
top: "2.3rem", | ||
}, | ||
name: "campaignType", | ||
optionsKey: "code", | ||
allowMultiSelect: false, | ||
masterName: "commonUiConfig", | ||
moduleName: "MyCampaignConfigDrafts", | ||
customfn: "populateCampaignTypeReqCriteria", | ||
}, | ||
}, | ||
], | ||
}, | ||
|
||
show: true, | ||
}, | ||
searchResult: { | ||
uiConfig: { | ||
columns: [ | ||
{ | ||
label: "NAME_OF_MICROPLAN", | ||
jsonPath: "name", | ||
additionalCustomization:true | ||
}, | ||
{ | ||
label:"CAMPAIGN_TYPE", | ||
jsonPath:"campaignDetails.projectType", | ||
additionalCustomization:true | ||
}, | ||
{ | ||
label:"LAST_MODIFIED_TIME", | ||
jsonPath:"auditDetails.lastModifiedTime", | ||
additionalCustomization:true | ||
}, | ||
], | ||
resultsJsonPath: "PlanConfiguration", | ||
|
||
enableColumnSort: true, | ||
// resultsJsonPath: "mdms", | ||
}, | ||
show: true, | ||
}, | ||
// customHookName: "microplanv1.useSavedMicroplans", | ||
|
||
}, | ||
customHookName:"microplanv1.useSavedMicroplans" | ||
}, | ||
]; | ||
|
||
|
52 changes: 52 additions & 0 deletions
52
...b/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyMicroplans.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Header, InboxSearchComposer } from "@egovernments/digit-ui-react-components"; | ||
import React, { useState, useEffect } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { useHistory } from "react-router-dom"; | ||
import { MicroplanCampaignSearchConfig } from "../../configs/myMicroplanConfig"; | ||
|
||
|
||
|
||
const defaultSearchValues = { | ||
|
||
}; | ||
|
||
const MyMicroplans = () => { | ||
const { t } = useTranslation(); | ||
const [defaultValues, setDefaultValues] = useState(defaultSearchValues); // State to hold default values for search fields | ||
const history = useHistory(); | ||
useEffect(() => { | ||
// Set default values when component mounts | ||
setDefaultValues(defaultSearchValues); | ||
}, []); | ||
|
||
const onTabChange = (n) => { | ||
|
||
setTabData((prev) => prev.map((i, c) => ({ ...i, active: c === n ? true : false }))); //setting tab enable which is being clicked | ||
// setConfig(TabSearchconfig?.TabSearchconfig?.[n]);// as per tab number filtering the config | ||
const url = new URL(window.location.href); | ||
url.searchParams.set("tabId", `${n}`); | ||
window.history.replaceState({}, "", url); | ||
|
||
}; | ||
const onClickRow = ({ original: row }) => { | ||
history.push(`/${window.contextPath}/employee/campaign/setup-campaign?id=${row.campaignId}&draft=true&fetchBoundary=true&draftBoundary=true&type=microplan`); | ||
}; | ||
return ( | ||
<React.Fragment> | ||
|
||
<Header styles={{ fontSize: "32px" }}>{t("MY_MICROPLANS_HEADING")}</Header> | ||
<div className="inbox-search-wrapper"> | ||
{/* Pass defaultValues as props to InboxSearchComposer */} | ||
<InboxSearchComposer | ||
configs={MicroplanCampaignSearchConfig?.[0]} | ||
additionalConfig={{ | ||
resultsTable: { | ||
onClickRow, | ||
}, | ||
}} | ||
></InboxSearchComposer> | ||
</div> | ||
</React.Fragment> | ||
); | ||
}; | ||
export default MyMicroplans; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters