@rancher/shell 0.3.19 → 0.3.21

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 (47) hide show
  1. package/assets/translations/en-us.yaml +4 -1
  2. package/components/PromptModal.vue +4 -0
  3. package/components/Questions/Array.vue +2 -2
  4. package/components/Questions/Boolean.vue +7 -1
  5. package/components/Questions/CloudCredential.vue +1 -0
  6. package/components/Questions/Enum.vue +21 -2
  7. package/components/Questions/Float.vue +8 -3
  8. package/components/Questions/Int.vue +8 -3
  9. package/components/Questions/Question.js +72 -0
  10. package/components/Questions/QuestionMap.vue +2 -1
  11. package/components/Questions/Radio.vue +33 -0
  12. package/components/Questions/Reference.vue +2 -0
  13. package/components/Questions/String.vue +8 -3
  14. package/components/Questions/Yaml.vue +46 -0
  15. package/components/Questions/__tests__/Boolean.test.ts +123 -0
  16. package/components/Questions/__tests__/Float.test.ts +123 -0
  17. package/components/Questions/__tests__/Int.test.ts +123 -0
  18. package/components/Questions/__tests__/String.test.ts +123 -0
  19. package/components/Questions/__tests__/Yaml.test.ts +123 -0
  20. package/components/Questions/index.vue +8 -1
  21. package/components/ResourceTable.vue +10 -13
  22. package/components/SideNav.vue +634 -0
  23. package/components/__tests__/NamespaceFilter.test.ts +3 -4
  24. package/components/form/UnitInput.vue +1 -0
  25. package/components/form/__tests__/KeyValue.test.ts +2 -1
  26. package/components/form/__tests__/UnitInput.test.ts +2 -2
  27. package/components/formatter/LinkName.vue +12 -1
  28. package/components/nav/WorkspaceSwitcher.vue +4 -1
  29. package/core/plugin-helpers.js +4 -1
  30. package/core/types.ts +25 -1
  31. package/detail/node.vue +2 -2
  32. package/edit/fleet.cattle.io.gitrepo.vue +7 -0
  33. package/layouts/default.vue +11 -597
  34. package/middleware/authenticated.js +2 -14
  35. package/models/fleet.cattle.io.gitrepo.js +3 -1
  36. package/package.json +1 -1
  37. package/pages/auth/login.vue +1 -1
  38. package/pages/c/_cluster/fleet/index.vue +4 -0
  39. package/pages/c/_cluster/uiplugins/index.vue +3 -3
  40. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +8 -0
  41. package/rancher-components/components/Form/Radio/RadioButton.test.ts +7 -3
  42. package/store/auth.js +2 -0
  43. package/types/shell/index.d.ts +2 -0
  44. package/utils/auth.js +17 -0
  45. package/utils/object.js +0 -1
  46. package/utils/validators/__tests__/cidr.test.ts +33 -0
  47. package/utils/validators/cidr.js +5 -0
@@ -84,7 +84,10 @@ export default {
84
84
  </script>
85
85
 
86
86
  <template>
87
- <div class="filter">
87
+ <div
88
+ class="filter"
89
+ data-testid="workspace-switcher"
90
+ >
88
91
  <Select
89
92
  ref="select"
90
93
  v-model="value"
@@ -58,6 +58,7 @@ function checkExtensionRouteBinding($route, locationConfig, context) {
58
58
  'id',
59
59
  'mode',
60
60
  'path',
61
+ 'hash',
61
62
  // url query params
62
63
  'queryParam',
63
64
  // Custom context specific params provided by the extension, not to be confused with location params
@@ -76,8 +77,10 @@ function checkExtensionRouteBinding($route, locationConfig, context) {
76
77
  const locationConfigParam = asArray[x];
77
78
 
78
79
  if (locationConfigParam) {
80
+ if (param === 'hash') {
81
+ res = $route.hash ? $route.hash.includes(locationConfigParam) : false;
79
82
  // handle "product" in a separate way...
80
- if (param === 'product') {
83
+ } else if (param === 'product') {
81
84
  res = checkRouteProduct($route, locationConfigParam);
82
85
  // also handle "mode" in a separate way because it mainly depends on query params
83
86
  } else if (param === 'mode') {
package/core/types.ts CHANGED
@@ -139,6 +139,7 @@ export type LocationConfig = {
139
139
  cluster?: string[],
140
140
  id?: string[],
141
141
  mode?: string[],
142
+ hash?: string[],
142
143
  /**
143
144
  * path match from URL (excludes host address)
144
145
  */
@@ -364,6 +365,23 @@ export interface ConfigureTypeOptions {
364
365
  // showConfigView
365
366
  }
366
367
 
368
+ export interface ConfigureVirtualTypeOptions extends ConfigureTypeOptions {
369
+ /**
370
+ * The translation key displayed anywhere this type is referenced
371
+ */
372
+ labelKey: string;
373
+
374
+ /**
375
+ * An identifier that should be unique across all types
376
+ */
377
+ name: string;
378
+
379
+ /**
380
+ * The route that this type should correspond to {@link PluginRouteConfig} {@link RouteConfig}
381
+ */
382
+ route: PluginRouteConfig | RouteConfig;
383
+ }
384
+
367
385
  export interface DSLReturnType {
368
386
  /**
369
387
  * Register multiple types by name and place them all in a group if desired. Primarily used for grouping things in the cluster explorer navigation.
@@ -404,6 +422,13 @@ export interface DSLReturnType {
404
422
  */
405
423
  mapGroup: (groupName: string, label: string) => void;
406
424
 
425
+ /**
426
+ * Create and configure a myriad of options for a type
427
+ * @param options {@link ConfigureVirtualTypeOptions}
428
+ * @returns {@link void}
429
+ */
430
+ virtualType: (options: ConfigureVirtualTypeOptions) => void;
431
+
407
432
  /**
408
433
  * Leaving these here for completeness but I don't think these should be advertised as useable to plugin creators.
409
434
  */
@@ -417,7 +442,6 @@ export interface DSLReturnType {
417
442
  // moveType: (match, group)
418
443
  // setGroupDefaultType: (input, defaultType)
419
444
  // spoofedType: (obj)
420
- // virtualType: (obj)
421
445
  // weightGroup: (input, weight, forBasic)
422
446
  // weightType: (input, weight, forBasic)
423
447
  }
package/detail/node.vue CHANGED
@@ -82,8 +82,8 @@ export default {
82
82
  }
83
83
  ],
84
84
  imageTableHeaders: [
85
- { ...SIMPLE_NAME, width: 400 },
86
- IMAGE_SIZE
85
+ { ...SIMPLE_NAME, width: null },
86
+ { ...IMAGE_SIZE, width: 100 } // Ensure one header has a size, all other columns will scale
87
87
  ],
88
88
  taintTableHeaders: [
89
89
  KEY,
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import Vue from 'vue';
2
3
  import { exceptionToErrorsArray } from '@shell/utils/error';
3
4
  import { mapGetters } from 'vuex';
4
5
  import {
@@ -81,6 +82,10 @@ export default {
81
82
 
82
83
  this.tlsMode = tls;
83
84
 
85
+ if (this.value.spec.correctDrift === undefined) {
86
+ Vue.set(this.value.spec, 'correctDrift', { enabled: false });
87
+ }
88
+
84
89
  this.updateTargets();
85
90
  },
86
91
 
@@ -536,6 +541,7 @@ export default {
536
541
  </div>
537
542
  <div class="col span-6">
538
543
  <InputWithSelect
544
+ :data-testid="`gitrepo-${ref}`"
539
545
  :mode="mode"
540
546
  :select-label="t('fleet.gitRepo.ref.label')"
541
547
  :select-value="ref"
@@ -637,6 +643,7 @@ export default {
637
643
  <h2 v-t="'fleet.gitRepo.paths.label'" />
638
644
  <ArrayList
639
645
  v-model="value.spec.paths"
646
+ data-testid="gitRepo-paths"
640
647
  :mode="mode"
641
648
  :initial-empty-row="false"
642
649
  :value-placeholder="t('fleet.gitRepo.paths.placeholder')"