# InboxSearchComposer

## **Overview** <a href="#undefined" id="undefined"></a>

Follow the details below to customise the inbox search composer.

### **Usage Contexts**&#x20;

* Complaint Inbox
* Assignment View
* SLA Tracking

### **Component Structure**

* **Sections**:
  * `search` – Search fields.
  * `filter` – Filter fields.
  * `links` – Quick action links.
  * `searchResult` – Table view with optional column customisations.

## **Steps**

1. **Add Search Field**

   ```
   javascript{
     label: "EVENTS_DATERANGE_LABEL",
     type: "dateRange",
     populators: { name: "range" }
   }
   ```
2. **Add Filter Field**

   ```
   javascript{
     type: "radio",
     label: "",
     populators: {
       name: "assignedToMe",
       options: [
         { code: "ASSIGNED_TO_ME", name: "ASSIGNED_TO_ME" },
         { code: "ASSIGNED_TO_ALL", name: "ASSIGNED_TO_ALL" }
       ],
       optionsKey: "name"
     }
   }
   ```
3. **Add Link**

   ```
   javascript{
     text: "ES_PGR_NEW_COMPLAINT",
     url: "/employee/pgr/create-complaint",
     roles: ["SUPERUSER", "PGR-ADMIN", "HELPDESK_USER"],
     hyperlink: true
   }
   ```
4. **Add Column in Search Results**

   ```
   javascript{
     label: "WF_INBOX_HEADER_SLA_DAYS_REMAINING",
     jsonPath: "businessObject.serviceSla",
     additionalCustomization: true,
     key: "state"
   }
   ```
5. **Add Custom Component**
   * Same pattern as FormComposer:

     ```
     javascript{
       type: "component",
       key: "locality",
       component: "PGRBoundaryComponent",
       populators: { name: "locality" }
     }
     ```
6. **Backend-Driven Components**

   ```
   javascript{
     label: "ES_PGR_FILTER_STATUS",
     type: "workflowstatesfilter",
     populators: {
       name: "status",
       labelPrefix: "CS_COMMON_",
       businessService: "PGR",
       onlylabelPrefix: true
     }
   }
   ```
7. **Dynamic Config Updates**
   * Use `preProcessMDMSConfigInboxSearch` to change filter/search fields dynamically.
8. **Data Transformation**
   * Add to [`UICustomisations`](https://github.com/egovernments/Citizen-Complaint-Resolution-System/blob/SB-PGR-CITIZEN/frontend/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UICustomizations.js) to preprocess the request, postprocess the response, or change table rendering.

***

### **5. Best Practices** <a href="#undefined" id="undefined"></a>

* Keep `key` and `populators.name` same for consistency.
* Use `validation` for inputs to ensure correct data entry.
* Modularise configs so the same fields can be reused in multiple forms.
* Test dynamic updates to verify inter-field dependencies.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digit.org/complaints-management/complaints-resolution-v2.10/deploy/customise/frontend/customise-ui/inboxsearchcomposer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
