Repository navigation
Description
Affected module
UI
Describe the bug
On the Classification page (Govern › Classifications › ), the Domains panel does not work:
- When you add a domain (Domains + › select a domain › Apply), the toast "An unexpected error occurred." shows. The UI sends no request to the server.
- When a classification already has a domain (set through the REST API), the Domains panel shows nothing, but the API response that the page loads contains the domain.
The browser console shows:
TypeError: Le(...) is not a function
at ot (/assets/DomainSelect-oio4LLJb.js:1:1023)
at /assets/DomainLabel.component-CTfaXhGD.js:1:1142
at /assets/DomainSelect-oio4LLJb.js:1:4329
at /assets/vendor-untitled-B_OciFo4.js:2:556225
at /assets/vendor-aria-BOnwjigg.js:8:68053
at /assets/vendor-aria-BOnwjigg.js:1:24903
at onClick (...)
To Reproduce
- Log in as
admin. - Create a classification (UI or API), for example
domain-test. Do not add tags. - Make sure at least one domain exists.
- Open Govern › Classifications › domain-test.
- In the right panel, click Domains +.
- Select a domain (tick its checkbox) and click Apply.
- See the toast "An unexpected error occurred." The server access log has no
PATCH /api/v1/classifications/{id}.
To see the second symptom:
- Set a domain on the classification through the API:
The response is 200. The new version has
PATCH /api/v1/classifications/{id} Content-Type: application/json-patch+json [{"op": "add", "path": "/domains", "value": [{"id": "<domain id>", "type": "domain"}]}]fieldsAdded: domains. GET /api/v1/classifications/name/domain-test?fields=owners,usageCount,termCount,domainsreturns the domain indomains. This is the same request that the page makes.- Reload the classification page. The Domains panel is still empty, and the domain picker does not show the domain as selected.
Expected behavior
- Apply saves the domain on the classification (
PATCH /api/v1/classifications/{id}with/domains). - The Domains panel shows the domains of the classification, the same as on a glossary or a data asset.
OS
No response
Python version
No response
OpenMetadata version
2.1.0
OpenMetadata Ingestion package version
No response
Additional context
Analysis
In DomainSelect-*.js, the save handler is:
ot = async (t, e, r, s, i, f) => {
const o = await Le(e)(r, { fields: "domains" }); // Le = entity-type -> "get by name" API map (AssetsUtils)
...
const p = await we(e)(s, h); // we = entity-type -> "patch" API map
...
}I paused on the exception and read the arguments in the ot frame: e (entity type) is undefined, and r and s (entity FQN and id) are "". With e === undefined, Le(e) returns undefined, and the call throws.
The API maps in AssetsUtils-*.js do contain classification ([EntityType.CLASSIFICATION] maps to the tagAPI get and patch functions). So it looks like the Classification page renders the domain component without the entity type, FQN and id. This probably also explains why the panel shows no existing domains.
The REST API works: PATCH /domains on a classification succeeds and GET ...?fields=domains returns the domain.
Pre-submission checklist
- I searched for duplicate issues.
- I removed credentials, hostnames, emails, and other sensitive data from logs and config.
Update: related issue fixed in the same PR (#38641)
Flash when creating a classification: after Add Classification › Save, the page briefly showed the previously selected classification with an empty, loading tags table before switching to the new classification's "Add the first tag" state. Expected: the new classification opens straight on its empty state.
#38641 fixes both this and the Domains panel issue above. It also makes sure that a failed domain save leaves the panel showing the previously saved domains.
Activity