dashboard-shell-shell 1.0.113 → 1.0.115

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.
Files changed (119) hide show
  1. package/components/ActionDropdown.vue +1 -1
  2. package/components/ActionMenu.vue +2 -2
  3. package/components/ActionMenuShell.vue +0 -1
  4. package/components/AppModal.vue +6 -78
  5. package/components/AssignTo.vue +11 -25
  6. package/components/AsyncButton.vue +7 -24
  7. package/components/BannerGraphic.vue +0 -1
  8. package/components/ButtonDropdown.vue +4 -26
  9. package/components/ButtonGroup.vue +0 -4
  10. package/components/ButtonMultiAction.vue +0 -1
  11. package/components/CommunityLinks.vue +3 -3
  12. package/components/ConsumptionGauge.vue +5 -24
  13. package/components/CopyToClipboardText.vue +1 -2
  14. package/components/CruResource.vue +7 -12
  15. package/components/CruResourceFooter.vue +2 -2
  16. package/components/DashboardOptions.vue +15 -21
  17. package/components/DetailText.vue +0 -5
  18. package/components/DisableAuthProviderModal.vue +0 -1
  19. package/components/ExplorerMembers.vue +1 -1
  20. package/components/ExplorerProjectsNamespaces.vue +14 -56
  21. package/components/FixedBanner.vue +12 -19
  22. package/components/GlobalRoleBindings.vue +1 -5
  23. package/components/GrafanaDashboard.vue +4 -4
  24. package/components/GrowlManager.vue +1 -4
  25. package/components/HardwareResourceGauge.vue +3 -39
  26. package/components/InfoBox.vue +3 -3
  27. package/components/InputOrDisplay.vue +2 -28
  28. package/components/LabelValue.vue +1 -16
  29. package/components/LandingPagePreference.vue +3 -5
  30. package/components/LocaleSelector.vue +93 -39
  31. package/components/ModalWithCard.vue +0 -2
  32. package/components/MoveModal.vue +0 -1
  33. package/components/PromptChangePassword.vue +1 -1
  34. package/components/PromptModal.vue +2 -15
  35. package/components/PromptRemove.vue +8 -28
  36. package/components/PromptRestore.vue +0 -1
  37. package/components/ResourceCancelModal.vue +0 -1
  38. package/components/ResourceDetail/Masthead.vue +43 -188
  39. package/components/ResourceDetail/__tests__/Masthead.test.ts +1 -5
  40. package/components/ResourceDetail/index.vue +14 -49
  41. package/components/ResourceList/Masthead.vue +18 -80
  42. package/components/ResourceTable.vue +8 -3
  43. package/components/SideNav.vue +3 -2
  44. package/components/SortableTable/THead.vue +4 -10
  45. package/components/SortableTable/actions.js +1 -1
  46. package/components/SortableTable/index.vue +537 -637
  47. package/components/SortableTable/selection.js +11 -0
  48. package/components/Tabbed/Tab.vue +3 -3
  49. package/components/Tabbed/index.vue +26 -44
  50. package/components/Wizard.vue +2 -2
  51. package/components/__tests__/AsyncButton.test.ts +2 -2
  52. package/components/__tests__/FixedBanner.test.ts +3 -3
  53. package/components/auth/Principal.vue +3 -10
  54. package/components/auth/__tests__/RoleDetailEdit.test.ts +2 -3
  55. package/components/form/ArrayList.vue +85 -123
  56. package/components/form/ArrayListGrouped.vue +2 -10
  57. package/components/form/Command.vue +15 -6
  58. package/components/form/EnvVars.vue +8 -16
  59. package/components/form/Footer.vue +5 -8
  60. package/components/form/HealthCheck.vue +3 -3
  61. package/components/form/HookOption.vue +16 -11
  62. package/components/form/KeyValue.vue +7 -16
  63. package/components/form/LabeledSelect.vue +76 -59
  64. package/components/form/LifecycleHooks.vue +3 -3
  65. package/components/form/MatchExpressions.vue +12 -35
  66. package/components/form/NameNsDescription.vue +115 -147
  67. package/components/form/Networking.vue +12 -20
  68. package/components/form/NodeAffinity.vue +23 -31
  69. package/components/form/NodeScheduling.vue +3 -13
  70. package/components/form/Password.vue +5 -11
  71. package/components/form/PodAffinity.vue +44 -43
  72. package/components/form/Probe.vue +66 -68
  73. package/components/form/ResourceQuota/Project.vue +1 -5
  74. package/components/form/ResourceSelector.vue +9 -7
  75. package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +3 -6
  76. package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +1 -12
  77. package/components/form/SSHKnownHosts/index.vue +2 -16
  78. package/components/form/Security.vue +56 -54
  79. package/components/form/Select.vue +7 -41
  80. package/components/form/ShellInput.vue +1 -5
  81. package/components/form/Tolerations.vue +1 -5
  82. package/components/form/UnitInput.vue +2 -2
  83. package/components/form/ValueFromResource.vue +121 -134
  84. package/components/form/WorkloadPorts.vue +18 -18
  85. package/components/form/__tests__/ArrayList.test.ts +2 -5
  86. package/components/form/__tests__/MatchExpressions.test.ts +12 -12
  87. package/components/form/__tests__/NameNsDescription.test.ts +14 -115
  88. package/components/form/__tests__/Probe.test.ts +8 -12
  89. package/components/form/__tests__/SSHKnownHosts.test.ts +0 -11
  90. package/components/form/__tests__/Select.test.ts +0 -37
  91. package/components/form/__tests__/UnitInput.test.ts +5 -4
  92. package/components/formatter/BadgeStateFormatter.vue +5 -8
  93. package/components/formatter/ExtensionCache.vue +74 -0
  94. package/components/formatter/InternalExternalIP.vue +0 -2
  95. package/components/formatter/Port.vue +24 -0
  96. package/components/formatter/SecretData.vue +7 -20
  97. package/components/formatter/SecretType.vue +41 -0
  98. package/components/nav/Favorite.vue +1 -5
  99. package/components/nav/Group.vue +3 -16
  100. package/components/nav/Header.vue +13 -39
  101. package/components/nav/Jump.vue +0 -7
  102. package/components/nav/NamespaceFilter.vue +8 -14
  103. package/components/nav/Pinned.vue +1 -1
  104. package/components/nav/TopLevelMenu.vue +17 -5
  105. package/components/nav/Type.vue +1 -14
  106. package/components/nav/__tests__/TopLevelMenu.test.ts +40 -0
  107. package/components/templates/blank.vue +1 -4
  108. package/components/templates/default.vue +0 -8
  109. package/components/templates/home.vue +1 -10
  110. package/components/templates/plain.vue +1 -10
  111. package/package.json +1 -1
  112. package/public/index.html +3 -3
  113. package/components/ActionDropdownShell.vue +0 -71
  114. package/components/DotState.vue +0 -84
  115. package/components/ModalManager.vue +0 -55
  116. package/components/SlideInPanelManager.vue +0 -126
  117. package/components/StatusBadge.vue +0 -77
  118. package/components/__tests__/ModalManager.spec.ts +0 -176
  119. package/components/__tests__/SlideInPanelManager.spec.ts +0 -166
@@ -1,7 +1,5 @@
1
1
  <script>
2
- import { computed, ref, toRef, watch } from 'vue';
3
- import { mapActions, useStore } from 'vuex';
4
-
2
+ import { mapGetters, mapActions } from 'vuex';
5
3
  import { get, set } from '@shell/utils/object';
6
4
  import { sortBy } from '@shell/utils/sort';
7
5
  import { NAMESPACE } from '@shell/config/types';
@@ -10,7 +8,6 @@ import { _VIEW, _EDIT, _CREATE } from '@shell/config/query-params';
10
8
  import { LabeledInput } from '@components/Form/LabeledInput';
11
9
  import LabeledSelect from '@shell/components/form/LabeledSelect';
12
10
  import { normalizeName } from '@shell/utils/kube';
13
- import { useI18n } from '@shell/composables/useI18n';
14
11
 
15
12
  export default {
16
13
  name: 'NameNsDescription',
@@ -172,74 +169,81 @@ export default {
172
169
  },
173
170
 
174
171
  data() {
175
- return { createNamespace: false };
176
- },
172
+ const v = this.value;
173
+ const metadata = v.metadata;
174
+ let namespace, name, description;
177
175
 
178
- setup(props, { emit }) {
179
- const v = toRef(props.value);
180
- const metadata = v.value.metadata;
181
- const namespace = ref(null);
182
- const name = ref(null);
183
- const description = ref(null);
176
+ if (this.nameKey) {
177
+ name = get(v, this.nameKey);
178
+ } else {
179
+ name = metadata?.name;
180
+ }
184
181
 
185
- watch(name, (val) => {
186
- if (props.normalizeName) {
187
- val = normalizeName(val);
182
+ if (this.namespaced) {
183
+ if (this.forceNamespace) {
184
+ namespace = this.forceNamespace;
185
+ this.updateNamespace(namespace);
186
+ } else if (this.namespaceKey) {
187
+ namespace = get(v, this.namespaceKey);
188
+ } else {
189
+ namespace = metadata?.namespace;
188
190
  }
189
191
 
190
- if (props.nameKey) {
191
- set(props.value, props.nameKey, val);
192
- } else {
193
- props.value.metadata['name'] = val;
192
+ if (!namespace && !this.noDefaultNamespace) {
193
+ namespace = this.$store.getters['defaultNamespace'];
194
+ if (metadata) {
195
+ metadata.namespace = namespace;
196
+ }
194
197
  }
195
- emit('update:value', props.value);
196
- });
198
+ }
197
199
 
198
- if (props.nameKey) {
199
- name.value = get(v.value, props.nameKey);
200
+ if (this.descriptionKey) {
201
+ description = get(v, this.descriptionKey);
200
202
  } else {
201
- name.value = metadata?.name || '';
203
+ description = metadata?.annotations?.[DESCRIPTION];
202
204
  }
203
205
 
204
- const isCreate = computed(() => {
205
- return props.mode === _CREATE;
206
- });
207
-
208
- const store = useStore();
209
- const { t } = useI18n(store);
210
- const allowedNamespaces = computed(() => store.getters.allowedNamespaces());
211
- const storeNamespaces = computed(() => store.getters.namespaces());
212
- const currentCluster = computed(() => store.getters.currentCluster);
206
+ const inStore = this.$store.getters['currentStore']();
207
+ const nsSchema = this.$store.getters[`${ inStore }/schemaFor`](NAMESPACE);
213
208
 
214
- const inStore = computed(() => {
215
- return store.getters['currentStore']();
216
- });
209
+ return {
210
+ namespace,
211
+ name,
212
+ description,
213
+ createNamespace: false,
214
+ nsSchema
215
+ };
216
+ },
217
217
 
218
- const nsSchema = computed(() => {
219
- return store.getters[`${ inStore.value }/schemaFor`](NAMESPACE);
220
- });
218
+ computed: {
219
+ ...mapGetters(['currentProduct', 'currentCluster', 'namespaces', 'allowedNamespaces']),
220
+ ...mapActions('cru-resource', ['setCreateNamespace']),
221
+ namespaceReallyDisabled() {
222
+ return (
223
+ !!this.forceNamespace || this.namespaceDisabled || this.mode === _EDIT
224
+ ); // namespace is never editable
225
+ },
221
226
 
222
- const canCreateNamespace = computed(() => {
223
- // Check if user can push to namespaces... and as the ns is outside of a project restrict to admins and cluster owners
224
- return (nsSchema.value?.collectionMethods || []).includes('POST') && currentCluster.value?.canUpdate;
225
- });
227
+ nameReallyDisabled() {
228
+ return this.nameDisabled || (this.mode === _EDIT && !this.nameEditable);
229
+ },
226
230
 
227
231
  /**
228
232
  * Map namespaces from the store to options, adding divider and create button
229
233
  */
230
- const options = computed(() => {
234
+ options() {
231
235
  let namespaces;
232
236
 
233
- if (props.namespacesOverride) {
237
+ if (this.namespacesOverride) {
234
238
  // Use the resources provided
235
- namespaces = props.namespacesOverride;
239
+ namespaces = this.namespacesOverride;
236
240
  } else {
237
- if (props.namespaceOptions) {
241
+ if (this.namespaceOptions) {
238
242
  // Use the namespaces provided
239
- namespaces = (props.namespaceOptions.map((ns) => ns.name) || []).sort();
243
+ namespaces = (this.namespaceOptions.map((ns) => ns.name) || []).sort();
240
244
  } else {
241
245
  // Determine the namespaces
242
- const namespaceObjs = isCreate.value ? allowedNamespaces.value : storeNamespaces.value;
246
+ const namespaceObjs = this.isCreate ? this.allowedNamespaces() : this.namespaces();
243
247
 
244
248
  namespaces = Object.keys(namespaceObjs);
245
249
  }
@@ -247,22 +251,22 @@ export default {
247
251
 
248
252
  const options = namespaces
249
253
  .map((namespace) => ({ nameDisplay: namespace, id: namespace }))
250
- .map(props.namespaceMapper || ((obj) => ({
254
+ .map(this.namespaceMapper || ((obj) => ({
251
255
  label: obj.nameDisplay,
252
256
  value: obj.id,
253
257
  })));
254
258
 
255
259
  const sortedByLabel = sortBy(options, 'label');
256
260
 
257
- if (props.forceNamespace) {
261
+ if (this.forceNamespace) {
258
262
  sortedByLabel.unshift({
259
- label: props.forceNamespace,
260
- value: props.forceNamespace,
263
+ label: this.forceNamespace,
264
+ value: this.forceNamespace,
261
265
  });
262
266
  }
263
267
 
264
268
  const createButton = {
265
- label: t('namespace.createNamespace'),
269
+ label: this.t('namespace.createNamespace'),
266
270
  value: '',
267
271
  kind: 'highlighted'
268
272
  };
@@ -272,100 +276,59 @@ export default {
272
276
  kind: 'divider'
273
277
  };
274
278
 
275
- // const createOverhead = canCreateNamespace.value || props.createNamespaceOverride ? [createButton, divider] : [];
279
+ const createOverhead = this.canCreateNamespace || this.createNamespaceOverride ? [createButton, divider] : [];
276
280
 
277
281
  return [
278
- // ...createOverhead,
282
+ ...createOverhead,
279
283
  ...sortedByLabel
280
284
  ];
281
- });
282
-
283
- const updateNamespace = (val) => {
284
- if (props.forceNamespace) {
285
- val = props.forceNamespace;
286
- }
287
-
288
- if (props.namespaced) {
289
- emit('isNamespaceNew', !val || (options.value && !options.value.find((n) => n.value === val)));
290
- }
291
-
292
- if (props.namespaceKey) {
293
- set(props.value, props.namespaceKey, val);
294
- } else {
295
- props.value.metadata.namespace = val;
296
- }
297
- };
298
-
299
- if (props.namespaced) {
300
- if (props.forceNamespace) {
301
- namespace.value = toRef(props.forceNamespace);
302
- updateNamespace(namespace);
303
- } else if (props.namespaceKey) {
304
- namespace.value = get(v, props.namespaceKey);
305
- } else {
306
- namespace.value = metadata?.namespace;
307
- }
308
-
309
- if (!namespace.value && !props.noDefaultNamespace) {
310
- namespace.value = store.getters['defaultNamespace'];
311
- if (metadata) {
312
- metadata.namespace = namespace;
313
- }
314
- }
315
- }
316
-
317
- if (props.descriptionKey) {
318
- description.value = get(v, props.descriptionKey);
319
- } else {
320
- description.value = metadata?.annotations?.[DESCRIPTION];
321
- }
322
-
323
- return {
324
- namespace,
325
- name,
326
- description,
327
- isCreate,
328
- options,
329
- updateNamespace,
330
- };
331
- },
332
-
333
- computed: {
334
- ...mapActions('cru-resource', ['setCreateNamespace']),
335
- namespaceReallyDisabled() {
336
- return (
337
- !!this.forceNamespace || this.namespaceDisabled || this.mode === _EDIT
338
- ); // namespace is never editable
339
- },
340
-
341
- nameReallyDisabled() {
342
- return this.nameDisabled || (this.mode === _EDIT && !this.nameEditable);
343
285
  },
344
286
 
345
287
  isView() {
346
288
  return this.mode === _VIEW;
347
289
  },
348
290
 
291
+ isCreate() {
292
+ return this.mode === _CREATE;
293
+ },
294
+
349
295
  showCustomize() {
350
296
  return this.mode === _CREATE && this.name && this.name.length > 0;
351
297
  },
352
298
 
353
299
  colSpan() {
354
300
  if (!this.horizontal) {
355
- return `span-6`;
301
+ return `span-8`;
356
302
  }
357
303
  // Name and namespace take up two columns.
358
- // let cols = (this.nameNsHidden ? 0 : 2) + (this.descriptionHidden ? 0 : 1) + this.extraColumns.length;
359
- let cols = 2;
304
+ let cols = (this.nameNsHidden ? 0 : 2) + (this.descriptionHidden ? 0 : 1) + this.extraColumns.length;
360
305
 
361
306
  cols = Math.max(2, cols); // If there's only one column, make it render half-width as if there were two
362
307
  const span = 12 / cols; // If there's 5, 7, or more columns this will break; don't do that.
363
308
 
364
309
  return `span-${ span }`;
365
310
  },
311
+
312
+ canCreateNamespace() {
313
+ // Check if user can push to namespaces... and as the ns is outside of a project restrict to admins and cluster owners
314
+ return (this.nsSchema?.collectionMethods || []).includes('POST') && this.currentCluster?.canUpdate;
315
+ }
366
316
  },
367
317
 
368
318
  watch: {
319
+ name(val) {
320
+ if (this.normalizeName) {
321
+ val = normalizeName(val);
322
+ }
323
+
324
+ if (this.nameKey) {
325
+ set(this.value, this.nameKey, val);
326
+ } else {
327
+ this.value.metadata['name'] = val;
328
+ }
329
+ this.$emit('update:value', this.value);
330
+ },
331
+
369
332
  namespace(val) {
370
333
  this.updateNamespace(val);
371
334
  this.$emit('update:value', this.value);
@@ -383,13 +346,29 @@ export default {
383
346
 
384
347
  mounted() {
385
348
  this.$nextTick(() => {
386
- if (this.$refs.nameInput) {
387
- this.$refs.nameInput.focus();
349
+ if (this.$refs.name) {
350
+ this.$refs.name.focus();
388
351
  }
389
352
  });
390
353
  },
391
354
 
392
355
  methods: {
356
+ updateNamespace(val) {
357
+ if (this.forceNamespace) {
358
+ val = this.forceNamespace;
359
+ }
360
+
361
+ if (this.namespaced) {
362
+ this.$emit('isNamespaceNew', !val || (this.options && !this.options.find((n) => n.value === val)));
363
+ }
364
+
365
+ if (this.namespaceKey) {
366
+ set(this.value, this.namespaceKey, val);
367
+ } else {
368
+ this.value.metadata.namespace = val;
369
+ }
370
+ },
371
+
393
372
  changeNameAndNamespace(e) {
394
373
  this.name = (e.text || '').toLowerCase();
395
374
  this.namespace = e.selected;
@@ -410,7 +389,7 @@ export default {
410
389
  true,
411
390
  );
412
391
  this.$emit('isNamespaceNew', true);
413
- this.$nextTick(() => this.$refs.namespaceInput.focus());
392
+ this.$nextTick(() => this.$refs.namespace.focus());
414
393
  } else {
415
394
  this.createNamespace = false;
416
395
  this.$store.dispatch(
@@ -425,14 +404,14 @@ export default {
425
404
  </script>
426
405
 
427
406
  <template>
428
- <div class="row">
407
+ <div class="row mb-20">
429
408
  <div
430
409
  v-if="namespaced && !nameNsHidden && createNamespace"
431
410
  :data-testid="componentTestid + '-namespace-create'"
432
- class="col span-6"
411
+ class="col span-3"
433
412
  >
434
413
  <LabeledInput
435
- ref="namespaceInput"
414
+ ref="namespace"
436
415
  v-model:value="namespace"
437
416
  :label="t('namespace.label')"
438
417
  :placeholder="t('namespace.createNamespace')"
@@ -455,7 +434,7 @@ export default {
455
434
  <div
456
435
  v-if="namespaced && !nameNsHidden && !createNamespace"
457
436
  :data-testid="componentTestid + '-namespace'"
458
- class="col span-6"
437
+ class="col span-3"
459
438
  >
460
439
  <LabeledSelect
461
440
  v-show="!createNamespace"
@@ -477,13 +456,12 @@ export default {
477
456
  <div
478
457
  v-if="!nameNsHidden"
479
458
  :data-testid="componentTestid + '-name'"
480
- class="col span-6"
459
+ class="col span-3"
481
460
  >
482
461
  <LabeledInput
483
- ref="nameInput"
462
+ ref="name"
484
463
  key="name"
485
464
  v-model:value="name"
486
- data-testid="NameNsDescriptionNameInput"
487
465
  :label="t(nameLabel)"
488
466
  :placeholder="t(namePlaceholder)"
489
467
  :disabled="nameReallyDisabled"
@@ -495,22 +473,11 @@ export default {
495
473
  </div>
496
474
 
497
475
  <slot name="customize" />
498
- <!-- <div
499
- v-show="!descriptionHidden"
500
- :data-testid="componentTestid + '-description'"
501
- :class="['col', extraColumns.length > 0 ? 'span-3' : 'span-6']"
502
- > -->
503
- <div
504
- v-for="(slot, i) in extraColumns"
505
- :key="i"
506
- :class="{ col: true, [colSpan]: true }"
507
- >
508
- <slot :name="slot" />
509
- </div>
476
+ <!-- // TODO: here goes the custom component -->
510
477
  <div
511
478
  v-show="!descriptionHidden"
512
479
  :data-testid="componentTestid + '-description'"
513
- class="col span-6"
480
+ :class="['col', extraColumns.length > 0 ? 'span-3' : 'span-6']"
514
481
  >
515
482
  <LabeledInput
516
483
  key="description"
@@ -525,10 +492,11 @@ export default {
525
492
  </div>
526
493
 
527
494
  <div
528
- v-if="$slots.bottom"
529
- style="width: 100%;"
495
+ v-for="(slot, i) in extraColumns"
496
+ :key="i"
497
+ :class="{ col: true, [colSpan]: true }"
530
498
  >
531
- <slot name="bottom" />
499
+ <slot :name="slot" />
532
500
  </div>
533
501
  <div
534
502
  v-if="showSpacer"
@@ -29,20 +29,6 @@ export default {
29
29
 
30
30
  data() {
31
31
  const t = this.$store.getters['i18n/t'];
32
-
33
- return {
34
- dnsPolicy: this.value.dnsPolicy || 'ClusterFirst',
35
- networkMode: this.value.hostNetwork ? { label: t('workload.networking.networkMode.options.hostNetwork'), value: true } : { label: t('workload.networking.networkMode.options.normal'), value: false },
36
- hostAliases: [],
37
- nameservers: null,
38
- searches: null,
39
- hostname: null,
40
- subdomain: null,
41
- options: null,
42
- };
43
- },
44
-
45
- created() {
46
32
  const hostAliases = (this.value.hostAliases || []).map((entry) => {
47
33
  return {
48
34
  ip: entry.ip,
@@ -52,12 +38,18 @@ export default {
52
38
  const { dnsConfig = {}, hostname, subdomain } = this.value;
53
39
  const { nameservers, searches, options } = dnsConfig;
54
40
 
55
- this.hostAliases = hostAliases;
56
- this.nameservers = nameservers;
57
- this.searches = searches;
58
- this.hostname = hostname;
59
- this.subdomain = subdomain;
60
- this.options = options;
41
+ const out = {
42
+ dnsPolicy: this.value.dnsPolicy || 'ClusterFirst',
43
+ networkMode: this.value.hostNetwork ? { label: t('workload.networking.networkMode.options.hostNetwork'), value: true } : { label: t('workload.networking.networkMode.options.normal'), value: false },
44
+ hostAliases,
45
+ nameservers,
46
+ searches,
47
+ hostname,
48
+ subdomain,
49
+ options
50
+ };
51
+
52
+ return out;
61
53
  },
62
54
 
63
55
  computed: {
@@ -42,18 +42,31 @@ export default {
42
42
  data() {
43
43
  // VolumeNodeAffinity only has 'required' field
44
44
  if (this.value.required) {
45
+ return { nodeSelectorTerms: this.value.required.nodeSelectorTerms };
45
46
  } else {
46
- }
47
+ const { preferredDuringSchedulingIgnoredDuringExecution = [], requiredDuringSchedulingIgnoredDuringExecution = {} } = this.value;
48
+ const { nodeSelectorTerms = [] } = requiredDuringSchedulingIgnoredDuringExecution;
49
+ const allSelectorTerms = [...preferredDuringSchedulingIgnoredDuringExecution, ...nodeSelectorTerms].map((term) => {
50
+ const neu = clone(term);
47
51
 
48
- return {
49
- nodeSelectorTerms: null,
50
- allSelectorTerms: null,
51
- weightedNodeSelectorTerms: null,
52
- defaultWeight: 1,
53
- // rules in MatchExpressions.vue can not catch changes what happens on parent component
54
- // we need re-render it via key changing
55
- rerenderNums: randomStr(4)
56
- };
52
+ neu._id = randomStr(4);
53
+ if (term.preference) {
54
+ Object.assign(neu, term.preference);
55
+ delete neu.preference;
56
+ }
57
+
58
+ return neu;
59
+ });
60
+
61
+ return {
62
+ allSelectorTerms,
63
+ weightedNodeSelectorTerms: preferredDuringSchedulingIgnoredDuringExecution,
64
+ defaultWeight: 1,
65
+ // rules in MatchExpressions.vue can not catch changes what happens on parent component
66
+ // we need re-render it via key changing
67
+ rerenderNums: randomStr(4)
68
+ };
69
+ }
57
70
  },
58
71
 
59
72
  computed: {
@@ -75,27 +88,6 @@ export default {
75
88
  },
76
89
 
77
90
  created() {
78
- if (this.value.required) {
79
- this.nodeSelectorTerms = this.value.required.nodeSelectorTerms;
80
- } else {
81
- const { preferredDuringSchedulingIgnoredDuringExecution = [], requiredDuringSchedulingIgnoredDuringExecution = {} } = this.value;
82
- const { nodeSelectorTerms = [] } = requiredDuringSchedulingIgnoredDuringExecution;
83
- const allSelectorTerms = [...preferredDuringSchedulingIgnoredDuringExecution, ...nodeSelectorTerms].map((term) => {
84
- const neu = clone(term);
85
-
86
- neu._id = randomStr(4);
87
- if (term.preference) {
88
- Object.assign(neu, term.preference);
89
- delete neu.preference;
90
- }
91
-
92
- return neu;
93
- });
94
-
95
- this.allSelectorTerms = allSelectorTerms;
96
- this.weightedNodeSelectorTerms = preferredDuringSchedulingIgnoredDuringExecution;
97
- }
98
-
99
91
  this.queueUpdate = debounce(this.update, 500);
100
92
  },
101
93
 
@@ -40,15 +40,6 @@ export default {
40
40
  },
41
41
 
42
42
  data() {
43
- return {
44
- selectNode: null,
45
- nodeName: '',
46
- nodeAffinity: {},
47
- nodeSelector: {},
48
- };
49
- },
50
-
51
- created() {
52
43
  const isHarvester = this.$store.getters['currentProduct'].inStore === VIRTUAL;
53
44
 
54
45
  let { nodeName = '' } = this.value;
@@ -74,10 +65,9 @@ export default {
74
65
  nodeAffinity['preferredDuringSchedulingIgnoredDuringExecution'] = [];
75
66
  }
76
67
 
77
- this.selectNode = selectNode;
78
- this.nodeName = nodeName;
79
- this.nodeAffinity = nodeAffinity;
80
- this.nodeSelector = nodeSelector;
68
+ return {
69
+ selectNode, nodeName, nodeAffinity, nodeSelector
70
+ };
81
71
  },
82
72
 
83
73
  computed: {
@@ -41,10 +41,6 @@ export default {
41
41
  mode: {
42
42
  type: String,
43
43
  default: _CREATE,
44
- },
45
- placeholder: {
46
- type: String,
47
- default: '',
48
44
  }
49
45
  },
50
46
  data() {
@@ -120,7 +116,6 @@ export default {
120
116
  :disabled="isRandom"
121
117
  :ignore-password-managers="ignorePasswordManagers"
122
118
  :mode="mode"
123
- :placeholder="placeholder"
124
119
  @blur="$emit('blur', $event)"
125
120
  >
126
121
  <template #suffix>
@@ -142,7 +137,6 @@ export default {
142
137
  tabindex="0"
143
138
  class="hide-show"
144
139
  role="button"
145
- :aria-label="reveal ? t('action.ariaLabel.hidePass', { area: label }) : t('action.ariaLabel.showPass', { area: label })"
146
140
  @click.prevent.stop="hideShowFn"
147
141
  @keyup.space.prevent.stop="hideShowFn"
148
142
  >
@@ -166,20 +160,20 @@ export default {
166
160
  <style lang="scss" scoped>
167
161
  .password {
168
162
  display: flex;
169
- /* flex-direction: column; */
163
+ flex-direction: column;
170
164
 
171
165
  .labeled-input {
172
166
  .addon {
173
- /* display: flex;
167
+ display: flex;
174
168
  align-items: center;
175
169
  justify-content: center;
176
170
  padding-left: 12px;
177
- min-width: 65px; */
171
+ min-width: 65px;
178
172
 
179
- /* .hide-show:focus-visible {
173
+ .hide-show:focus-visible {
180
174
  @include focus-outline;
181
175
  outline-offset: 4px;
182
- } */
176
+ }
183
177
  }
184
178
  }
185
179
  .genPassword {