dashboard-shell-shell 1.0.1000000119 → 3.0.2-rc.105

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.
@@ -417,7 +417,7 @@ export default {
417
417
  const isLoading = this.loading || false;
418
418
 
419
419
  let isCreatable = false;
420
- const lastPath = this.$route?.path.split('/').pop();
420
+ const lastPath = this.$route.path.split('/').pop();
421
421
 
422
422
  if (lastPath.includes('.')) {
423
423
  isCreatable = this.$store.getters['type-map/optionsFor'](lastPath).isCreatable;
@@ -1753,11 +1753,10 @@ export default {
1753
1753
  @mouseover="setBulkActionOfInterest(act)"
1754
1754
  @mouseleave="setBulkActionOfInterest(null)"
1755
1755
  >
1756
- <!-- <i
1756
+ <i
1757
1757
  v-if="act.icon"
1758
1758
  :class="act.icon"
1759
- style="line-height: 12px;height: 12px;font-size: 12px;"
1760
- /> -->
1759
+ />
1761
1760
  <span v-clean-html="act.label" />
1762
1761
  </button>
1763
1762
  <template v-if="featureDropdownMenu">
@@ -388,6 +388,17 @@ export default {
388
388
  });
389
389
  }
390
390
 
391
+ rows = rows.map((item) => {
392
+ if (item.key && item.key.includes('harvester')) {
393
+ item.key = item.key.replace('harvester', 'cloud');
394
+ }
395
+ if (item.key && item.value.includes('harvester')) {
396
+ item.value = item.value.replace('harvester', 'cloud');
397
+ }
398
+
399
+ return item;
400
+ });
401
+
391
402
  return rows;
392
403
  },
393
404
 
@@ -398,6 +409,8 @@ export default {
398
409
  [this.valueName]: value,
399
410
  };
400
411
 
412
+ obj.key = obj.key?.replace('harvester', 'cloud');
413
+ obj.value = obj.value?.replace('harvester', 'cloud');
401
414
  obj.binary = false;
402
415
  obj.canEncode = this.handleBase64;
403
416
  obj.supported = true;
@@ -479,8 +492,8 @@ export default {
479
492
  // let value = (row[valueName] || '');
480
493
  // const key = (row[keyName] || '').trim();
481
494
 
482
- const key = (row[keyName] || '').trim();
483
- let value = (row[valueName] || '').trim();
495
+ const key = (row[keyName].replace('cloud', 'harvester') || '').trim();
496
+ let value = (row[valueName].replace('cloud', 'harvester') || '').trim();
484
497
 
485
498
  if (value && typeOf(value) === 'object') {
486
499
  out[key] = JSON.parse(JSON.stringify(value));
@@ -289,7 +289,7 @@ export default {
289
289
  :data-testid="`input-match-type-field-${index}`"
290
290
  >
291
291
  <div v-if="isView">
292
- {{ row.matching }}
292
+ {{ row.matching.replace('harvester', 'cloud') }}
293
293
  <!-- {{ row.matching }} -->
294
294
  </div>
295
295
  <LabeledSelect
@@ -305,7 +305,7 @@ export default {
305
305
  :data-testid="`input-match-expression-key-${index}`"
306
306
  >
307
307
  <div v-if="isView" class="view-item-value">
308
- {{ row.key }}
308
+ {{ row.key.replace('harvester', 'cloud') }}
309
309
  </div>
310
310
  <input
311
311
  v-else-if="!hasKeySelectOptions"
@@ -252,7 +252,7 @@ export default {
252
252
  const options = namespaces
253
253
  .map((namespace) => ({ nameDisplay: namespace, id: namespace }))
254
254
  .map(props.namespaceMapper || ((obj) => ({
255
- label: obj.nameDisplay,
255
+ label: obj.nameDisplay.replace('harvester', 'cloud'),
256
256
  value: obj.id,
257
257
  })));
258
258
 
@@ -753,7 +753,7 @@ export default {
753
753
  :data-testid="`namespaces-value-${j}`"
754
754
  class="ns-value"
755
755
  >
756
- <div>{{ ns.label }}</div>
756
+ <div>{{ ns.label.replace('harvester', 'cloud') }}</div>
757
757
  <!-- block user from removing the last selection if ns forced filtering is on -->
758
758
  <i
759
759
  v-if="!namespaceFilterMode || value.length > 1"
@@ -864,7 +864,7 @@ export default {
864
864
  v-if="opt.kind === NAMESPACE_FILTER_KINDS.NAMESPACE"
865
865
  class="icon icon-folder"
866
866
  />
867
- <div>{{ opt.label }}</div>
867
+ <div>{{ opt.label.replace('harvester', 'cloud') }}</div>
868
868
  <i
869
869
  v-if="opt.selected"
870
870
  class="icon icon-checkmark"
@@ -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
  }
@@ -162,7 +162,7 @@ export const NAMESPACE = {
162
162
  name: 'namespace',
163
163
  labelKey: 'tableHeaders.namespace',
164
164
  value: 'namespace',
165
- getValue: row => row && row.namespace && row.namespace,
165
+ getValue: row => row && row.namespace && row.namespace.replace('harvester', 'cloud'),
166
166
  sort: 'namespace',
167
167
  dashIfEmpty: true,
168
168
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashboard-shell-shell",
3
- "version": "1.0.1000000119",
3
+ "version": "3.0.2-rc.105",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
package/utils/error.js CHANGED
@@ -138,10 +138,6 @@ export const normalizeError = (err) => {
138
138
  };
139
139
  };
140
140
  export function translateError(error) {
141
- error = typeof error === 'string'
142
- ? error
143
- : error?.message || error?.toString() || '';
144
-
145
141
  const originError = error;
146
142
  error = error?.toLowerCase().replace(/admission webhook(.*?)denied the request:/g, (match, p1) => {
147
143
  return '';
package/utils/router.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { INSTALL_REDIRECT_META_KEY } from '@shell/config/router/navigation-guards/install-redirect';
2
2
 
3
3
  export function harvesterhci2cloud(str) {
4
- return str?.replace('harvesterhci.io', 'cloudhci.io')
4
+ return str?.replace('harvesterhci.io', 'cloudhci.io')
5
5
  }
6
6
 
7
7
  export function cloud2harvesterhci(str) {
@@ -14,11 +14,11 @@ export function cloud2harvesterhci(str) {
14
14
  }
15
15
 
16
16
  export function harvester2cloud(str) {
17
- return str?.replace('harvester', 'cloud')
17
+ return str?.replace(/harvester/g, 'cloud');
18
18
  }
19
19
 
20
20
  export function cloud2harvester(str) {
21
- return str?.replace('cloud', 'harvester')
21
+ return str?.replace(/cloud/g, 'harvester');
22
22
  }
23
23
 
24
24
  export function queryParamsFor(current, qp, defaults = {}) {
@@ -89,7 +89,7 @@ export const getPackageFromRoute = (route) => {
89
89
  };
90
90
 
91
91
  export const getResourceFromRoute = (to) => {
92
- let resource = to.params?.resource;
92
+ let resource = cloud2harvesterhci(to.params?.resource);
93
93
 
94
94
  if (!resource) {
95
95
  resource = findMeta(to, 'resource');