@rancher/shell 0.3.20 → 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 (43) hide show
  1. package/assets/translations/en-us.yaml +4 -2
  2. package/components/Questions/Array.vue +2 -2
  3. package/components/Questions/Boolean.vue +7 -1
  4. package/components/Questions/CloudCredential.vue +1 -0
  5. package/components/Questions/Enum.vue +21 -2
  6. package/components/Questions/Float.vue +8 -3
  7. package/components/Questions/Int.vue +8 -3
  8. package/components/Questions/Question.js +72 -0
  9. package/components/Questions/QuestionMap.vue +2 -1
  10. package/components/Questions/Radio.vue +33 -0
  11. package/components/Questions/Reference.vue +2 -0
  12. package/components/Questions/String.vue +8 -3
  13. package/components/Questions/Yaml.vue +46 -0
  14. package/components/Questions/__tests__/Boolean.test.ts +123 -0
  15. package/components/Questions/__tests__/Float.test.ts +123 -0
  16. package/components/Questions/__tests__/Int.test.ts +123 -0
  17. package/components/Questions/__tests__/String.test.ts +123 -0
  18. package/components/Questions/__tests__/Yaml.test.ts +123 -0
  19. package/components/Questions/index.vue +8 -1
  20. package/components/ResourceTable.vue +6 -12
  21. package/components/SideNav.vue +634 -0
  22. package/components/__tests__/NamespaceFilter.test.ts +3 -4
  23. package/components/form/UnitInput.vue +1 -0
  24. package/components/form/__tests__/KeyValue.test.ts +2 -1
  25. package/components/form/__tests__/UnitInput.test.ts +2 -2
  26. package/components/formatter/LinkName.vue +12 -1
  27. package/components/nav/WorkspaceSwitcher.vue +4 -1
  28. package/core/plugin-helpers.js +4 -1
  29. package/core/types.ts +1 -0
  30. package/edit/fleet.cattle.io.gitrepo.vue +7 -0
  31. package/layouts/default.vue +11 -597
  32. package/middleware/authenticated.js +2 -14
  33. package/models/fleet.cattle.io.gitrepo.js +3 -1
  34. package/package.json +1 -1
  35. package/pages/c/_cluster/fleet/index.vue +4 -0
  36. package/pages/c/_cluster/uiplugins/index.vue +3 -3
  37. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +8 -0
  38. package/rancher-components/components/Form/Radio/RadioButton.test.ts +7 -3
  39. package/types/shell/index.d.ts +2 -0
  40. package/utils/auth.js +17 -0
  41. package/utils/object.js +0 -1
  42. package/utils/validators/__tests__/cidr.test.ts +33 -0
  43. 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
  */
@@ -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')"