Enable FSM
Modules are enabled by MDMS config at https://github.com/egovernments/egov-mdms-data/blob/DEV/data/pb/tenant/citymodule.json, it is done on dev via https://github.com/egovernments/egov-mdms-data/pull/1386
Create a new branch for the state if already doesn’t exist from the master of repo https://github.com/egovernments/digit-ui.
To add and enable any module in the new UI, src/App.js
needs to be changed.
We export only the init function of the module to take care of all the initialization.
import { initFSMComponents } from "@egovernments/digit-ui-module-fsm"; const enabledModules = ["FSM"]; initFSMComponents();
Adding FSM Card in Old UI
FSM Card can be added to old UI via the following change as per MDMS config https://github.com/egovernments/egov-mdms-data/pull/1563
Changing CSS
CSS classes are published over CDN and can be seen at https://unpkg.com/@egovernments/digit-ui-css/dist/index.css
Any class can be overwritten. Please make changes in the src/index.css
file.
Customizing fields in a form
First, add any new component created in the registry,
Digit.ComponentRegistryService.setupRegistry({ SelectName: SelectName });
Application config: The default config can be found at https://github.com/egovernments/digit-ui-internals/blob/development/packages/modules/fsm/src/config/NewApplication/config.js. The config has different items in the application form. The new config, if made, needs to be initialized at Digit.Customizations.FSM.applicationFormConfig
{ label: "ES_NEW_APPLICATION_PROPERTY_TYPE", isMandatory: true, type: "component", route: "property-type", key: "propertyType", component: "SelectPropertyType", texts: { headerCaption: "", header: "CS_FILE_APPLICATION_PROPERTY_LABEL", cardText: "CS_FILE_APPLICATION_PROPERTY_TEXT", submitBarLabel: "CS_COMMON_NEXT", }, nextStep: "property-subtype", }
label
: is the employee side labeltexts
: is used for citizen side step formcomponent
: the component that is to be rendered here. Any component can be created to show here, examples can be seen at pageComponents, These components are passed following paramst
: translate function to be used to convert a key to localized text. e.g.,t("CS_CREATECOMPLAINT_MOHALLA")
config
: current step config as shown aboveonSelect
: on clicking of next or input, this handled to be called to save the data in the form stateuserType
:employee
orcitizen
formData
: the current form state.
Customizing views
Use the followings to customizations are available:
Application details can be customized via defining
Digit.Customizations.FSM.getApplicationDetailsTableRows
The function will be passed following params
id
: application idservice
: application response objectrole
: currently logged in user roleCITIZEN
orEMPLOYEE
t
: function used for translation
getApplicationDetailsTableRows: ({ id, service, role, t }) => { if (role === "CITIZEN") { return { CS_FSM_APPLICATION_APPLICATION_NO: service.applicationNo, CS_FSM_APPLICATION_DETAIL_STATUS: t("CS_COMMON_" + service.applicationStatus), ... }; } return {}; }
FAQ
In addition to any FAQs of the main implementation document.