dashboard-shell-shell 1.0.1000000113 → 1.0.1000000116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -415,16 +415,33 @@ export default {
|
|
|
415
415
|
|
|
416
416
|
const isLoading = this.loading || false;
|
|
417
417
|
|
|
418
|
+
console.log(this.$route.path, ' this.$route?.path');
|
|
419
|
+
|
|
418
420
|
let isCreatable = false;
|
|
419
|
-
const lastPath = this.$route
|
|
421
|
+
const lastPath = this.$route?.path?.split('/').pop();
|
|
422
|
+
|
|
423
|
+
console.log(lastPath, ' lastPath-----------------------');
|
|
420
424
|
|
|
421
|
-
if (lastPath
|
|
425
|
+
if (lastPath?.includes('.')) {
|
|
422
426
|
isCreatable = this.$store.getters['type-map/optionsFor'](lastPath).isCreatable;
|
|
423
427
|
} else if (lastPath === 'namespace') {
|
|
424
428
|
isCreatable = this.$store.getters['type-map/optionsFor'](this.$route.name).isCreatable;
|
|
425
429
|
}
|
|
426
430
|
|
|
431
|
+
const resource = this.$route.params.resource;
|
|
432
|
+
|
|
433
|
+
let hasEditComponent = false
|
|
434
|
+
|
|
435
|
+
if (lastPath?.includes('.')) {
|
|
436
|
+
hasEditComponent = this.$store.getters['type-map/hasCustomEdit'](lastPath);
|
|
437
|
+
} else if (lastPath === 'namespace') {
|
|
438
|
+
hasEditComponent = this.$store.getters['type-map/hasCustomEdit'](this.$route.name);
|
|
439
|
+
} else {
|
|
440
|
+
hasEditComponent = this.$store.getters['type-map/hasCustomEdit'](resource);
|
|
441
|
+
}
|
|
442
|
+
|
|
427
443
|
return {
|
|
444
|
+
hasEditComponent,
|
|
428
445
|
refreshButtonPhase: isLoading ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION,
|
|
429
446
|
expanded: {},
|
|
430
447
|
searchQuery,
|
|
@@ -1227,7 +1244,7 @@ export default {
|
|
|
1227
1244
|
<div
|
|
1228
1245
|
:class="{'titled': $slots.title && $slots.title.length, 'mb-40': isFilterLabel, 'mb-20': search || isCreatable}"
|
|
1229
1246
|
class="sortable-table-header "
|
|
1230
|
-
:style="{marginTop: search&& !isBanner ? marginTopValue + 'px' : '0px',marginLeft: isCreatable ? '100px' : '-10px',maxHeight: '32px'}"
|
|
1247
|
+
:style="{marginTop: search&& !isBanner ? marginTopValue + 'px' : '0px',marginLeft: isCreatable && hasEditComponent ? '100px' : '-10px',maxHeight: '32px'}"
|
|
1231
1248
|
>
|
|
1232
1249
|
<slot name="title" />
|
|
1233
1250
|
<div
|
|
@@ -22,17 +22,17 @@ export function installNavigationGuards(router, context) {
|
|
|
22
22
|
let changed = false;
|
|
23
23
|
const params = { ...to.params };
|
|
24
24
|
|
|
25
|
-
if (params
|
|
25
|
+
if (params?.product?.includes('cloud')) {
|
|
26
26
|
params.product = params.product.replace(/cloud/g, 'harvester');
|
|
27
27
|
changed = true;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
if (params
|
|
30
|
+
if (params?.cluster?.includes('cloud')) {
|
|
31
31
|
params.cluster = params.cluster.replace(/cloud/g, 'harvester');
|
|
32
32
|
changed = true;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
if (params
|
|
35
|
+
if (params?.resource?.includes('cloud')) {
|
|
36
36
|
params.resource = params.resource.replace(/cloud/g, 'harvester');
|
|
37
37
|
changed = true;
|
|
38
38
|
}
|
package/package.json
CHANGED
package/utils/router.js
CHANGED
|
@@ -89,7 +89,7 @@ export const getPackageFromRoute = (route) => {
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
export const getResourceFromRoute = (to) => {
|
|
92
|
-
let resource =
|
|
92
|
+
let resource = to.params?.resource;
|
|
93
93
|
|
|
94
94
|
if (!resource) {
|
|
95
95
|
resource = findMeta(to, 'resource');
|