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.
@@ -416,7 +416,6 @@ export default {
416
416
  </script>
417
417
 
418
418
  <template>
419
- 测试111111111111111111111111
420
419
  <div class="project-namespaces outlet">
421
420
  <Masthead
422
421
  :schema="projectSchema"
@@ -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.path.split('/'.pop());
421
+ const lastPath = this.$route?.path?.split('/').pop();
422
+
423
+ console.log(lastPath, ' lastPath-----------------------');
420
424
 
421
- if (lastPath.includes('.')) {
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
@@ -737,7 +737,7 @@ export default {
737
737
  <Tab
738
738
  v-if="isRancherRoleTemplate"
739
739
  name="inherit-from"
740
- label="Inherit From"
740
+ label="继承表单"
741
741
  :weight="0"
742
742
  >
743
743
  <ArrayList
@@ -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.product?.includes('cloud')) {
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.cluster?.includes('cloud')) {
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.resource?.includes('cloud')) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashboard-shell-shell",
3
- "version": "1.0.1000000113",
3
+ "version": "1.0.1000000116",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
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 = cloud2harvesterhci(to.params?.resource);
92
+ let resource = to.params?.resource;
93
93
 
94
94
  if (!resource) {
95
95
  resource = findMeta(to, 'resource');