Repository navigation
[2.0] fix(data-products): port pickers hide assets that can't be ports and show why a port is rejected (#36729) - #36984
Conversation
…show why a port is rejected (#36729) * fix(data-products): keep port pickers to assets that can be ports and show why a port is rejected - Output port picker hides the data product's input ports, input port picker hides its output ports (ES `ids` exclusion; `id` is text-mapped). - Asset selection shows the per-asset reasons of an all-failed bulk add (400 BulkOperationResult) instead of the generic "Error while adding assets!" toast. - Clearer backend message: "Asset 'X' is already an input port of this data product; an asset cannot be both an input and an output port". * fix(data-products): keep each port picker's exclusions separate A late port fetch for one picker could overwrite the other picker's exclusion list when both Add Port buttons were clicked before the first fetch returned. * chore(ui): organize imports in InputOutputPortsTab test 2.0 backport notes: - Includes the column exclusion (PORT_ASSETS_FILTER) from #35740, which 2.0 lacks. - Adds ids to QueryFieldInterface, as on main, so the ids exclusion type-checks. - Drops the held-port-change test edit (WorkflowDefinitionResourceIT); 2.0 has no port approvals. - InputOutputPortsTab test keeps only the port picker suite. (cherry picked from commit 97af5ab)
Code Review ✅ Approved🟡 Medium risk · Port pickers exclude opposite-kind ports and columns, but the 1,000-port cap may still expose conflicting assets that the backend rejects. Backport of the port picker fix to 2.0: Add Port now excludes assets already on the other port kind via an ES VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Backport of #36729 to
2.0.Describe your changes:
When a backend rejected a data product port, the UI showed a generic "Error while adding assets!" toast. Two cases:
tableColumn, which can never be a port.Changes (same as #36729)
InputOutputPortsTab.component.tsx,DataProductPureUtils.ts). Opening Add Port fetches the other kind's ports (up to the API max of 1000) and excludes them with an ESidsquery.useAssetSelectionState.ts). An all-failed 400 carryingfailedRequestsets the failed status, so each card shows its backend reason instead of a toast.DataProductRepository):Asset 'X' is already an input port of this data product; an asset cannot be both an input and an output port. No API, status-code or schema change.Differences from the
mainPR, because of what 2.0 lacksPORT_ASSETS_FILTERinuseAssetSelectionState.ts, passed to the quick filters throughAssetSelectionContentBody/Drawer/Modal). It is not on 2.0, and fix(data-products): port pickers hide assets that can't be ports and show why a port is rejected #36729 relies on it for case 2. Only the picker hunk of fix(governance): hold data product port changes for approval, keep approvals off their requester, fix the port picker and status rule display #35740 is included, not its port approval work.QueryFieldInterfacegainsids?: { values: string[] }, as on main. Without it theidsexclusion failstscon 2.0.PortRules.alreadyOpposite, which 2.0 does not have.WorkflowDefinitionResourceITedit is dropped. It asserts on held port changes, which 2.0 does not have.InputOutputPortsTab.component.test.tsxis new on 2.0 and keeps only this PR's port pickers suite. Main's permissions suite tests acanEditAllrefactor that is not on 2.0.Type of change:
Tests:
yarn install):AssetsSelectionModal/*+InputOutputPortsTab: 6 suites, 97/97 passed.tsc --noEmit: no errors in any touched file (app andplaywright/tsconfig.json). Prettier clean.InputOutputPortsTab.component.tsx,DataProductPureUtils.ts,InputOutputPorts.spec.tsandDataProductResourceIT.javaare identical to main. Every added line ofuseAssetSelectionState.test.tsis present.createAssetRef,addInputPorts,navigateToPortsTab, 5tables) all exist on 2.0. Not run locally. CI runs it, along with ESLint and the Java ITs.Checklist: