Skip to content

Commit 386c1c1

Browse files
aalves08claude
andauthored
fix: scope configureType by product to prevent global route overrides (#17561)
* fix: scope configureType by product to prevent global route overrides * fix: add cluster repo button label configuration to manager product The 'Add Repository' button label was only configured in the apps product, but the cluster repository list is also accessible from the manager product context. With the product-scoped configureType changes, the configuration needs to be present in each product that displays the cluster repository list. Fixes e2e test failures for cluster repository creation. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * address PR comments * improve solution with backwards compatibility --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 1dfd288 commit 386c1c1

4 files changed

Lines changed: 571 additions & 22 deletions

File tree

shell/config/product/manager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export function init(store) {
7878
]);
7979

8080
configureType(SNAPSHOT, { depaginate: true });
81+
configureType(CATALOG.CLUSTER_REPO, { listCreateButtonLabelKey: 'catalog.repo.add' });
8182

8283
configureType(CAPI.RANCHER_CLUSTER, {
8384
showListMasthead: false, namespaced: false, alias: [HCI.CLUSTER]

shell/core/productDebugger.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ export function DSLRegistrationsPerProduct(store, prodName) {
2121
}
2222

2323
// prod configureType
24-
if (dataType === 'typeOptions' && typeMapData[dataType].filter((item) => item.customRoute && item.customRoute.name.includes(prodName))) {
25-
parsedData['configureType'] = typeMapData[dataType].filter((item) => item.customRoute && item.customRoute.name.includes(prodName));
24+
if (dataType === 'typeOptions') {
25+
const allTypeOptions = Object.values(typeMapData[dataType]).flat();
26+
const filtered = allTypeOptions.filter((item) => item.customRoute && item.customRoute.name.includes(prodName));
27+
28+
if (filtered.length > 0) {
29+
parsedData['configureType'] = filtered;
30+
}
2631
}
2732

2833
// other types which map with prodName

0 commit comments

Comments
 (0)