Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Enable FSM

Modules are enabled by MDMS config at https://github.com/egovernments/egov-mdms-data/blob/DEV/data/pb/tenant/citymodule.json

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 initializations.

Code Block
languagejs
import { initFSMComponents } from "@egovernments/digit-ui-module-fsm";

const enabledModules = ["FSM"];
initFSMComponents();

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

  1. 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

    Code Block
    {
      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 label

  • texts: is used for citizen side step form

  • component: 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 params

    • t: translate function to be used to convert a key to localized text. e.g., t("CS_CREATECOMPLAINT_MOHALLA")

    • config: current step config as shown above

    • onSelect: on clicking of next or input, this handled to be called to save the data in the form state

    • userType: employee or citizen

    • formData: the current form state.

Customizing views

Use the followings to customizations are available:

  1. Application details can be customized via defining Digit.Customizations.FSM.getApplicationDetailsTableRows

    The function will be passed following params

  • id: application id

  • service: application response object

  • role: currently logged in user role CITIZEN or EMPLOYEE

  • t: function used for translation

Code Block
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

  1. API calls are failing, what should I do?

Check src/setupProxy.js for proxy url in dev mode

  1. API calls are failing with no auth token

Create a .env file with following

Code Block
REACT_APP_USER_TYPE=

REACT_APP_CITIZEN_TOKEN=a3e5f0a2-4ff0-4680-855e-75051fb3e8f7

REACT_APP_EMPLOYEE_TOKEN=061bad07-c0d5-4200-a74f-ca5ed090cf30
REACT_APP_GRO_TOKEN=43af4c18-6418-4a35-8484-31f0700f465a
REACT_APP_LME_TOKEN=fa9f4184-dc64-495d-bded-31674c71b09e