Required documents dialog implementation
Objective:-
while creating a new property or on click of Add New Property button required document popup is opening this is implemented in each module. To avoid this duplication we created common DialogContainer in the UI framework for reusability purposes.
example for this feature URl:https://egov-micro-qa.egovernments.org/employee/fire-noc/search
Step 1:- Create mdms data for required documents in every module
Step 2:- Import getRequiredDocData
method from UI framework commons file and pass required arguments to this method like the below example.
Url Links :- https://github.com/egovernments/frontend/blob/master/web/rainmaker/dev-packages/egov-ui-framework-core/src/ui-utils/commons.js
Note:- moduleDetails contain the details that need to pass to fetch data form mdms database. The getRequiredDocData is the promise method its returning payload and required documents objects for further use in case if you want to set any redirection Url or any callback event you can attach to this flow.
Step 3:- After you call the above method, you need to pass the callback method to apply flow on the footer. The below example gives the idea of how to add the call back to the footer apply flow call back based on the module name.
In the footerCallBackForRequiredDataModal method declare your callback event and then pass by mentioning the module name so that call back is assigned to footer buttons.
Step 4:- Creation of documents logic is implemented in RequiredDocuments->reqDocs file for further in the information please refer to this file.
Required Documents popup implementation from Menu tree.
Usually the Required Documents popup will come before creating an application ie. from search screen new application button.
if the popup is required from the menu tree then , we need to add the following piece of code and use dialog container from the common framework.
reRouteURL is used to navigate to search screen on click of back button.
adhocDialog: {
uiFramework: 'custom-containers',
componentPath: 'DialogContainer',
props: {
open: getQueryArg(window.location.href, "action")==='showRequiredDocuments'?true:false,
maxWidth: false,
screenKey: 'search',
reRouteURL:'/tradelicence/search'
},
children: {
popup: {}
}
}
}