Search: present users as a username rather than a URI
- Dominant language
- Scala
- Stars
- 301
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Currently, our users (Created By, Last Modified By) are shown as URIs which is not practical for users. We need to present them as just the username, which is the suffix of the URI. The Side panel is already doing so.
## Strategy
We can add configuration to Search to give a hint to the UI to strip the URI and only present the suffix both in the table and in the filter menu.
These columns are currently configured with `"format" : "uri"`.
It should be noted that other columns also have "uri" and need to be presented in full (e.g. file paths)
This configuration is captured in an attribute `display` and that specific behaviour is captured in the `onlyShowRegexCapturingGroups`. When configuring, we have to specify a REGEX with a [capturing group](https://www.regular-expressions.info/refcapture.html). If multiple capturing groups are present, show them all concatenated.
Error cases
- if the REGEX does not contain a capturing group or is invalid, the UI should print a console message (ONCE only) mentioning the name of the column and the specific REGEX found in the configuration. This should allow easier debugging.
## Proposed Configuration
```
{
"array": false,
"label": "Created By",
"name": "createdBy",
"format": [
"uri"
],
"display": [
"onlyShowRegexCapturingGroups": ".*\/(.*)"
]
"filterable": true,
"optional": false,
"sortable": true
}
```
[REGEX playgroup](https://regex101.com/r/iV3iM1/1)
Contributor guide
Research direction
Start by locating Search's column configuration and the table and filter-menu rendering paths; the issue identifies the display attribute and onlyShowRegexCapturingGroups setting as the entry point. Verify URI columns can opt into captured-group display while other URI columns remain unchanged, and confirm invalid or group-less regular expressions produce one console message per column.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend, search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100