gaohong opened a new pull request, #12046:
URL: https://github.com/apache/gravitino/pull/12046
### What changes were proposed in this pull request?
This PR adds a shared `normalizeServiceAdmins` utility and uses it in the
Metalake list page and user settings component.
The utility normalizes `serviceAdmins` into an array and supports both
formats returned by the configuration API:
- An array of user names
- A comma-separated string of user names
Unsupported values are normalized to an empty array.
### Why are the changes needed?
`serviceAdmins` can be returned as either an array or a comma-separated
string. The previous duplicated page-level logic could call `.split(',')` on a
non-string value, causing a frontend runtime error.
This change centralizes the normalization logic and prevents the UI from
failing when the configuration value has an unexpected type.
Fix: N/A
### Does this PR introduce _any_ user-facing change?
Yes. The UI now handles both supported `serviceAdmins` formats consistently
and no longer fails for unsupported values.
No user-facing API or configuration property is added or changed.
### How was this patch tested?
- Ran `git diff --check upstream/main...HEAD`.
- Verified that both existing `serviceAdmins` consumers use the shared
utility:
- `web-v2/web/src/app/rootLayout/UserSetting.js`
- `web-v2/web/src/app/metalakes/page.js`
No automated frontend tests were run.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]