...
Code Block |
---|
{ title: "WS_CONN_HOLDER_OWN_DETAIL_RELATION_LABEL", value: wsDataDetails?.connectionHolders?.[0]?.relationship, privacy: { uuid: uuid, fieldName: ["relationship"], model: "WnSConnection",showValue: false, loadData: { serviceName: serviceType === "WATER" ? "/ws-services/wc/_search" : "/sw-services/swc/_search", requestBody: {}, requestParam: { tenantId, applicationNumber }, jsonPath: serviceType === "WATER" ? "WaterConnection[0].connectionHolders[0].relationship" : "SewerageConnections[0].connectionHolders[0].relationship", isArray: false, }, }, }, |
here uuid is the record id which we have to send for particular model, fieldName is the name defined in mdms as well as the exact param which we recieve in the response object and , model is the model from SecurityPolicy MDMS, showValue is sent as true when if we want to append any data with the newly unmasked data, ususally this is used for property address and loadData is an object in which we sent the body and params for API call which we have to make in order to get the unmasked data. refer code DIGIT-Dev/Search.js at 090ef18028a50f38222e426ec59ab9f123833af0 ยท egovernments/DIGIT-Dev (github.com)
...
For enabling eyeicon in text field similar steps has to be followed :
The search API Hook used to prefill the data in edit screen should have privacy object being sent in it.
Unmask component has to be defined with the corresponding component
Code Block |
---|
let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType,{privacy : Digit.Utils.getPrivacyObject() }); |
...