Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Figma screens for the UI are available here. Refer to them to understand the Workbench UI.
Flow for adding master data from UI
An action button is available on the search master data screen to add master data.
Clicking on the action button redirects users to the add master data screen.
The Add Master Data screen renders a form through which the user can enter master data.
Once the form is submitted, the validations are run as specified in the schema. If the validations are passed, the Create API is called and the respective toast message is shown as relevant to the response received from the Create API.
As of now, role actions have to be defined for every schema. Let us take an example of a schema code "Trade.Details"
The Create API URL for the above schema will look like this "/mdms-v2/v2/_create/Trade.Details"
Hence for this URL, the role action mapping has to be added to the MDMS_ADMIN role.
Similarly, for other masters, add role action mapping to the same role "MDMS_ADMIN".
Refer to the curl below:
Sample request body:
From the Search screen itself user can update localization messages
Only message text can be edited, we are not allowed to change locale, module and code of the message.
There is a fixed action column in the results table.
Upon clicking the edit icon a modal is opened from where user can add the updated message
User can click on the submit button, a respective toast is shown and the search results are refetched and rendered with the updated message.
API used here is same as add localization.
Select the edit icon in the action column, update the text as needed, and then click submit to save your changes.
Flow for updating master data from UI
The users have two options on the View Master Data screen -
Disable/Enable Master Data
Edit Master Data
This option is dynamic, if the master data is currently disabled(computed through the "isActive" flag present in every master data) Enable option is shown and vice-versa.
Update Master data API is called with the updated value of "isActive" flag and a respective toast message is shown to the user
As soon as the API responds, this option is updated according to the new value of "isActive" flag.
Pls refer to the end of this page for updated API details
When the user clicks on this option, the screen redirects to the Edit master data screen.
This screen is similar to the add master data screen, but all the fields are pre-populated with previous data.
Users can make changes to the master data.
Once the user clicks on the Submit button, validations are run in UI (specified in schema). If the validations are passed update master data API is called and a toast message is shown. After 5 seconds the user is automatically redirected to the view screen, where the updated data is reflected.
If the validations fail, the respective error message is shown below the target field for which validations failed.
The same role action mapping rules apply here as mentioned in the Add Master data page.
Refer to the curl below to update the master data API. It is very similar to the Create Master Data. (Notice the URL is unique to the schema for which the master data belongs, similar to add).
Sample request body for update:
This page provides details about the Workbench UI configuration required to enable it in any environment.
In the DevOps repository of your organization, locate the following "deploy-as-code/helm/environments/unified-dev.yaml"
. Inside the environment YAML file used to deploy the Core platform, please add the following block of code:
A dev environment sample file is linked here. Note that you will have to modify this for your deployment.
This section contains a config that applies globally to all UI modules. These need to be configured before configuring the service-specific UI.
Create a config file (globalconfigs.js) with the below-mentioned configurations (refer code below).
Configure all the images/logos required in the S3 and add links as footerBWLogoURL, footerLogoURL.
Mention the state tenant ID as stateTenantId.
If any user roles have to be made invalid add as invalidEmployeeRoles.
Then push this global config file into your S3 bucket as globalconfigs.js.
Mention the globalConfigs file URL in your Environment config
.
All strings localised per module are provided in this sheet linked here. To translate the UI into other languages, please follow this sheet and provide appropriate translations in your language.
Figma screens for the UI are here. Refer to them to understand the Workbench UI.
How to search master data
Users can click on the specific master name from the dropdown on the Manage Master Data screen to select the master data.
Users are redirected to the Search Master Data screen (of the selected master) screen as soon as a master is selected.
By default, the data present in that master is shown in the Results table.
Users can search master data using the following input parameters -
Field
Value
is Active
Note -> Search with field and value is considered as one parameter. Make sure to enter both in order to search master data.
'isActive' is a Boolean parameter which results in either active or inactive master data. All master data contain this field by default.
For the time being, master data search is allowed with string fields and the isActive flag.
Search results are filtered by string type and isActive before getting rendered in the table.
The master and module dropdowns on the manage master screen are populated on the basis of the responses from the schema search. Refer to the below curl for details:
Use the below parameters to search for the schemas -
tenantId
limit
offset
codes -> list of schema codes
Users are redirected to the search master data screen once a specific master is selected from the manage master data screen.
Refer to the below API curl to search for the master data -
The parameters here are used to search for the master data. Refer to the request body object below.
The "data" object holds the field-value pairs used to search for master data within a specific master. The "uniqueIdentifier" is a backend-generated ID for each master data.
Steps to follow to create a new Master -
Create a schema using Postman (API) - Schema( JSON draft-07 ) can be constructed by inputting the required JSON Object here Below is the sample cURL to create a schema.
Add actions-test and roleactions for search, create, and update. Below is the sample code for the actions-test for the schema mentioned above::
Here is the sample code for the roleactions::
Push the localization messages using the rainmaker-schema module to the schema's name(on the Add Master Data page and sidebar), tooltips, and all the fields on the UI. Example::
Flow for viewing master data
From the search master data screen users can click on any of the rows in the results table, this will redirect the UI to the View master data screen.
Before loading the View screen, we fetch the schema and the data using the schema code and unique Identifier respectively. Curls for search schema and search data can be referred from the Add Master Data page.
Schema response is used to render the form, similar to add form, and the data response is used to prefill the values in the form. The only difference here is that all the fields are disabled, unlike the add screen.
The same role action mapping rules apply here as defined in the Add Master Data page.
In the View screen, we have an action button with two options
Edit Master Data
Disable Master Data
The above actions are covered in the Update Master Data page.
This page provides the steps to search localisation data.
Navigate to the Manage Localisation screen from the home screen card. This opens the search localisation screen.
locale -> this field is mandatory. This dropdown is populated based on this mdms https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-UAT/data/pg/common-masters/StateInfo.json
module -> list of modules present in this mdms https://github.com/egovernments/egov-mdms-data/blob/UNIFIED-DEV/data/pg/common-masters/StateInfo.json
keycode -> code of a specific message. It is a string-type parameter
We have the following columns for localisation search results:
Module name
Key code
Default value -> message stored in default locale
Text -> message stored
Action -> Edit action to update message in that particular localisation
While adding localisations, by default all the messages will be updated in the locale mentioned by the user as well as in the "default" locale. The message updated in this locale is considered the default message. While updating the message default locale message remains unchanged.
Localisation search API is an open API. Refer to the curl given below:
Search for the desired language and module using the provided search functionality. The language and module are derived from MDMSv2.
For example, if you are searching for the language ‘English’ and the module ‘rainmaker-common’, Once you perform the search, all relevant results will be displayed below.
Refer to the screenshot below:
Bulk Upload
If you are visiting the screen and it is not localized, the screen will appear as in the screenshot below.
You can localize it with these simple steps:
We have an option to upload Excel sheets (XLSX, XLS) and upsert bulk messages.
From the "Add Localization" screen, there is an option to Bulk upload. See the image below.
Upon clicking the bulk upload option, the user can select an Excel file from the file system.
Copy all the locale code and give the corresponding message to display, module, and locale.
Paste this data into an Excel spreadsheet and save it as an XLSX file.
See the screenshot provided for reference for excel file.
Conditions for valid excel file
Excel file can contain multiple sheets, every sheet must have these four columns:
code
message
locale
module
Upload this XLSX file to the project UI.
After uploading, log out and log back in to see the UI localized.
Now see the UI, it will be as given below:
Add localization flow
From the search screen user can navigate to add localization screen by clicking the action button
In this screen user can specify the locale(language) and module in which messages have to be upserted
Once the language and module is selected a table is rendered in which user can add the keycode and the respective message. In one go, we can upsert upto 50 messages in this table.
These messages will be upserted into the default locale as well.
After adding the messages user can click on the "Save" action button. Upon success, a relevant toast message is shown and the table is cleared.
In case of failure, an error toast message is shown listing the list of errors due to which the messages could not be upserted.
Same API is utilized for edit and bulk upload as well.
Refer the below curl:
State level users can upsert localizations to all modules
City level users can only upsert to module specific to the tenantId (eg -> pg.citya)
Some examples of city module localizations