@rancher/shell 0.5.0 → 0.5.2

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 (51) hide show
  1. package/components/AsyncButton.vue +5 -17
  2. package/components/Certificates.vue +4 -4
  3. package/components/DraggableZone.vue +2 -2
  4. package/components/PodSecurityAdmission.vue +2 -2
  5. package/components/form/Error.vue +3 -3
  6. package/components/form/Footer.vue +2 -2
  7. package/components/form/GitPicker.vue +38 -83
  8. package/composables/useCompactInput.ts +2 -2
  9. package/core/types-provisioning.ts +7 -0
  10. package/edit/catalog.cattle.io.clusterrepo.vue +18 -0
  11. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +2 -2
  12. package/edit/provisioning.cattle.io.cluster/index.vue +9 -3
  13. package/mixins/create-edit-view/index.js +2 -2
  14. package/models/management.cattle.io.kontainerdriver.js +2 -1
  15. package/package.json +1 -1
  16. package/rancher-components/Accordion/Accordion.vue +2 -3
  17. package/rancher-components/BadgeState/BadgeState.vue +3 -3
  18. package/rancher-components/Banner/Banner.vue +2 -2
  19. package/rancher-components/Card/Card.vue +3 -3
  20. package/rancher-components/Form/Checkbox/Checkbox.vue +3 -3
  21. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
  22. package/rancher-components/Form/LabeledInput/LabeledInput.vue +23 -53
  23. package/rancher-components/Form/Radio/RadioButton.vue +7 -13
  24. package/rancher-components/Form/Radio/RadioGroup.vue +3 -4
  25. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +4 -6
  26. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +4 -7
  27. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +4 -9
  28. package/rancher-components/StringList/StringList.vue +8 -8
  29. package/rancher-components/components/Accordion/Accordion.vue +2 -3
  30. package/rancher-components/components/BadgeState/BadgeState.vue +3 -3
  31. package/rancher-components/components/Banner/Banner.vue +2 -2
  32. package/rancher-components/components/Card/Card.vue +3 -3
  33. package/rancher-components/components/Form/Checkbox/Checkbox.vue +3 -3
  34. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +1 -1
  35. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +23 -53
  36. package/rancher-components/components/Form/Radio/RadioButton.vue +7 -13
  37. package/rancher-components/components/Form/Radio/RadioGroup.vue +3 -4
  38. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +4 -6
  39. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +4 -7
  40. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +4 -9
  41. package/rancher-components/components/StringList/StringList.vue +8 -8
  42. package/scripts/extension/parse-tag-name +3 -3
  43. package/store/plugins.js +7 -6
  44. package/tsconfig.paths.json +1 -4
  45. package/types/shell/index.d.ts +20 -82
  46. package/utils/git.ts +1 -1
  47. package/composables/useCompactInput.test.ts +0 -36
  48. package/composables/useLabeledFormElement.test.ts +0 -135
  49. package/types/vue-shim.d.ts +0 -42
  50. /package/rancher-components/BadgeState/{BadgeState.test.ts → BadgeState.spec.ts} +0 -0
  51. /package/rancher-components/components/BadgeState/{BadgeState.test.ts → BadgeState.spec.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { defineComponent, PropType, inject } from 'vue';
2
+ import Vue from 'vue';
3
3
  import typeHelper from '@shell/utils/type-helpers';
4
4
 
5
5
  export const ASYNC_BUTTON_STATES = {
@@ -14,13 +14,7 @@ const TOOLTIP = 'tooltip';
14
14
 
15
15
  export type AsyncButtonCallback = (success: boolean) => void;
16
16
 
17
- interface NonReactiveProps {
18
- timer: NodeJS.Timeout | undefined;
19
- }
20
-
21
- const provideProps: NonReactiveProps = { timer: undefined };
22
-
23
- export default defineComponent({
17
+ export default Vue.extend<{ phase: string}, any, any, any>({
24
18
  props: {
25
19
  /**
26
20
  * Mode maps to keys in asyncButton.* translations
@@ -43,7 +37,7 @@ export default defineComponent({
43
37
  default: false,
44
38
  },
45
39
  type: {
46
- type: String as PropType<'button' | 'submit' | 'reset' | undefined>,
40
+ type: String,
47
41
  default: 'button'
48
42
  },
49
43
  tabIndex: {
@@ -119,13 +113,7 @@ export default defineComponent({
119
113
 
120
114
  },
121
115
 
122
- setup() {
123
- const timer = inject('timer', provideProps.timer);
124
-
125
- return { timer };
126
- },
127
-
128
- data() {
116
+ data(): { phase: string, timer?: NodeJS.Timeout} {
129
117
  return { phase: this.currentPhase };
130
118
  },
131
119
 
@@ -257,7 +245,7 @@ export default defineComponent({
257
245
  this.phase = (success ? ASYNC_BUTTON_STATES.SUCCESS : ASYNC_BUTTON_STATES.ERROR );
258
246
  this.timer = setTimeout(() => {
259
247
  this.timerDone();
260
- }, this.delay);
248
+ }, this.delay );
261
249
  }
262
250
  },
263
251
 
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue';
2
+ import Vue from 'vue';
3
3
  import { mapGetters } from 'vuex';
4
- import ResourceTable from '@shell/components/ResourceTable.vue';
4
+ import ResourceTable from '@shell/components/ResourceTable';
5
5
  import { SECRET } from '@shell/config/types';
6
6
  import { NAME as NAME_COL, NAMESPACE as NAMESPACE_COL, AGE, STATE } from '@shell/config/table-headers';
7
7
  import Secret, { TYPES } from '@shell/models/secret';
@@ -19,7 +19,7 @@ interface Data {
19
19
  }
20
20
  }
21
21
 
22
- export default defineComponent({
22
+ export default Vue.extend<Data, any, any, any>({
23
23
  components: {
24
24
  ResourceTable, Banner, BadgeState
25
25
  },
@@ -99,7 +99,7 @@ export default defineComponent({
99
99
  computed: {
100
100
  ...mapGetters(['isAllNamespaces']),
101
101
 
102
- expiredData(): any {
102
+ expiredData() {
103
103
  let expiring = 0;
104
104
  let expired = 0;
105
105
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue';
2
+ import Vue from 'vue';
3
3
  import { mapState } from 'vuex';
4
4
  import { BOTTOM, CENTER, LEFT, RIGHT } from '@shell/utils/position';
5
5
 
@@ -14,7 +14,7 @@ interface Data {
14
14
  drag: Drag;
15
15
  }
16
16
 
17
- export default defineComponent({
17
+ export default Vue.extend({
18
18
  data(): Data {
19
19
  return {
20
20
  drag: {
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue';
2
+ import Vue from 'vue';
3
3
  import { _VIEW, _CREATE } from '@shell/config/query-params';
4
4
  import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
5
5
  import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
@@ -25,7 +25,7 @@ const getExemptionControl = (): PSAExemptionControl => ({
25
25
  value: ''
26
26
  });
27
27
 
28
- export default defineComponent({
28
+ export default Vue.extend({
29
29
  components: {
30
30
  Checkbox, LabeledSelect, LabeledInput
31
31
  },
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
- import { PropType, defineComponent } from 'vue';
2
+ import Vue, { PropType } from 'vue';
3
3
  import Banner from '@components/Banner/Banner.vue';
4
4
 
5
- type Rule = (v?: string | number | Record<string, any> | unknown[]) => undefined | string;
5
+ type Rule = (v?: string) => undefined | string;
6
6
 
7
- export default defineComponent({
7
+ export default Vue.extend<any, any, any, any>({
8
8
  components: { Banner },
9
9
  props: {
10
10
  value: {
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue';
2
+ import Vue from 'vue';
3
3
  import { _VIEW } from '@shell/config/query-params';
4
4
  import AsyncButton, { AsyncButtonCallback } from '@shell/components/AsyncButton.vue';
5
5
  import Banner from '@components/Banner/Banner.vue';
6
6
 
7
- export default defineComponent({
7
+ export default Vue.extend({
8
8
  components: { AsyncButton, Banner },
9
9
 
10
10
  props: {
@@ -1,13 +1,12 @@
1
1
  <script lang="ts">
2
- import { defineComponent, inject } from 'vue';
2
+ import Vue from 'vue';
3
3
  import SortableTable from '@shell/components/SortableTable/index.vue';
4
4
  import RadioButton from '@components/Form/Radio/RadioButton.vue';
5
5
  import debounce from 'lodash/debounce';
6
6
  import { isArray } from '@shell/utils/array';
7
7
  import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
8
8
  import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
9
- import { GitUtils, Commit } from '@shell/utils/git';
10
- import type { DebouncedFunc } from 'lodash';
9
+ import { GitUtils } from '../../utils/git';
11
10
 
12
11
  interface commit {
13
12
  [key: string]: any,
@@ -18,45 +17,21 @@ interface Data {
18
17
  repo: boolean,
19
18
  branch: boolean,
20
19
  commits: boolean,
21
- branches?: unknown,
22
20
  },
23
21
 
24
22
  repos: object[],
25
23
  branches: object[],
26
24
  commits: commit[],
27
25
 
28
- selectedAccOrOrg: string | undefined,
29
- selectedRepo: object | undefined,
30
- selectedBranch: object | undefined,
31
- selectedCommit: Commit | null,
26
+ selectedAccOrOrg: string| null,
27
+ selectedRepo: object| null,
28
+ selectedBranch: object| null,
29
+ selectedCommit: object | null,
32
30
  }
33
31
 
34
- interface CommitHeader {
35
- name: string;
36
- label: string;
37
- width?: number;
38
- formatter?: string;
39
- formatterOpts?: { [key: string]: any };
40
- value?: string | string[];
41
- sort?: string | string[];
42
- defaultSort?: boolean;
43
- }
44
-
45
- interface NonReactiveProps {
46
- onSearchRepo: DebouncedFunc<(param: any) => Promise<any>> | undefined;
47
- onSearchBranch: DebouncedFunc<(param: any) => Promise<any>> | undefined;
48
- debounceTime: number;
49
- }
50
-
51
- const debounceTime = 1_000;
32
+ const debounceTime = 1000;
52
33
 
53
- const provideProps: NonReactiveProps = {
54
- onSearchRepo: undefined,
55
- onSearchBranch: undefined,
56
- debounceTime,
57
- };
58
-
59
- export default defineComponent({
34
+ export default Vue.extend<Data, any, any, any>({
60
35
 
61
36
  components: {
62
37
  LabeledSelect,
@@ -77,20 +52,10 @@ export default defineComponent({
77
52
  }
78
53
  },
79
54
 
80
- setup() {
81
- const onSearchRepo = inject('onSearchRepo', provideProps.onSearchRepo);
82
- const onSearchBranch = inject('onSearchBranch', provideProps.onSearchBranch);
83
- const debounceTime = inject('debounceTime', provideProps.debounceTime);
84
-
55
+ data() {
85
56
  return {
86
- onSearchRepo,
87
- onSearchBranch,
88
57
  debounceTime,
89
- };
90
- },
91
58
 
92
- data(): Data {
93
- return {
94
59
  hasError: {
95
60
  repo: false,
96
61
  branch: false,
@@ -101,10 +66,10 @@ export default defineComponent({
101
66
  branches: [],
102
67
  commits: [] as commit[],
103
68
 
104
- selectedAccOrOrg: undefined,
105
- selectedRepo: undefined,
106
- selectedBranch: undefined,
107
- selectedCommit: null,
69
+ selectedAccOrOrg: null,
70
+ selectedRepo: null,
71
+ selectedBranch: null,
72
+ selectedCommit: {},
108
73
  };
109
74
  },
110
75
 
@@ -130,14 +95,13 @@ export default defineComponent({
130
95
  },
131
96
 
132
97
  computed: {
133
- commitHeaders(): CommitHeader[] {
98
+ commitHeaders() {
134
99
  return [
135
100
  {
136
101
  name: 'index',
137
102
  label: this.t(`gitPicker.${ this.type }.tableHeaders.choose.label`),
138
103
  width: 60,
139
- },
140
- {
104
+ }, {
141
105
  name: 'sha',
142
106
  label: this.t(`gitPicker.${ this.type }.tableHeaders.sha.label`),
143
107
  width: 90,
@@ -170,20 +134,17 @@ export default defineComponent({
170
134
  ];
171
135
  },
172
136
 
173
- preparedRepos(): unknown {
137
+ preparedRepos() {
174
138
  return this.normalizeArray(this.repos, (item: any) => ({ id: item.id, name: item.name }));
175
139
  },
176
140
 
177
- preparedBranches(): unknown {
141
+ preparedBranches() {
178
142
  return this.normalizeArray(this.branches, (item: any) => ({ id: item.id, name: item.name }));
179
143
  },
180
144
 
181
- preparedCommits(): Commit[] {
182
- return this.normalizeArray(this.commits, (c) => GitUtils[this.type].normalize.commit(c));
145
+ preparedCommits() {
146
+ return this.normalizeArray(this.commits, (c: any) => GitUtils[this.type].normalize.commit(c));
183
147
  },
184
- selectedCommitId(): string | undefined {
185
- return this.selectedCommit?.commitId;
186
- }
187
148
  },
188
149
 
189
150
  methods: {
@@ -203,10 +164,10 @@ export default defineComponent({
203
164
 
204
165
  reset() {
205
166
  this.repos = [];
206
- this.selectedAccOrOrg = undefined;
207
- this.selectedRepo = undefined;
208
- this.selectedBranch = undefined;
209
- this.selectedCommit = null;
167
+ this.selectedAccOrOrg = null;
168
+ this.selectedRepo = null;
169
+ this.selectedBranch = null;
170
+ this.selectedCommit = {};
210
171
 
211
172
  this.communicateReset();
212
173
  },
@@ -256,13 +217,13 @@ export default defineComponent({
256
217
 
257
218
  async fetchRepos() {
258
219
  this.repos = [];
259
- this.selectedRepo = undefined;
260
- this.selectedBranch = undefined;
261
- this.selectedCommit = null;
220
+ this.selectedRepo = null;
221
+ this.selectedBranch = null;
222
+ this.selectedCommit = {};
262
223
 
263
224
  this.communicateReset();
264
225
 
265
- if (this.selectedAccOrOrg?.length) {
226
+ if (this.selectedAccOrOrg.length) {
266
227
  try {
267
228
  const res = await this.$store.dispatch(`${ this.type }/fetchRecentRepos`, { username: this.selectedAccOrOrg });
268
229
 
@@ -276,8 +237,8 @@ export default defineComponent({
276
237
  },
277
238
 
278
239
  async fetchBranches() {
279
- this.selectedBranch = undefined;
280
- this.selectedCommit = null;
240
+ this.selectedBranch = null;
241
+ this.selectedCommit = {};
281
242
 
282
243
  this.communicateReset();
283
244
 
@@ -292,7 +253,7 @@ export default defineComponent({
292
253
  },
293
254
 
294
255
  async fetchCommits() {
295
- this.selectedCommit = null;
256
+ this.selectedCommit = {};
296
257
 
297
258
  this.communicateReset();
298
259
 
@@ -318,7 +279,7 @@ export default defineComponent({
318
279
  },
319
280
 
320
281
  final(commitId: string) {
321
- this.selectedCommit = this.preparedCommits.find((c: { commitId?: string }) => c.commitId === commitId) || null;
282
+ this.selectedCommit = this.preparedCommits.find((c: { commitId?: string }) => c.commitId === commitId);
322
283
 
323
284
  if (this.selectedAccOrOrg && this.selectedRepo && this.selectedCommit?.commitId) {
324
285
  this.$emit('change', {
@@ -376,7 +337,7 @@ export default defineComponent({
376
337
  },
377
338
 
378
339
  status(value: boolean) {
379
- return value ? 'error' : undefined;
340
+ return value ? 'error' : null;
380
341
  },
381
342
 
382
343
  reposRules() {
@@ -394,17 +355,11 @@ export default defineComponent({
394
355
  const commitId = this.$route.query?.commit;
395
356
 
396
357
  if (commitId) {
397
- const table = this.$refs.commitsTable as unknown as {
398
- getPageByRow: (id: string | (string | null)[], callback: (commit: any) => any) => any;
399
- setPage: (page: any) => void;
400
- };
401
- const page = table?.getPageByRow(commitId, ({ commitId }: commit) => commitId);
358
+ const table = this.$refs.commitsTable;
359
+ const page = table.getPageByRow(commitId, ({ commitId }: commit) => commitId);
402
360
 
403
- table?.setPage(page);
361
+ table.setPage(page);
404
362
  }
405
- },
406
- selectReduction(e: unknown) {
407
- return e;
408
363
  }
409
364
  },
410
365
  });
@@ -438,7 +393,7 @@ export default defineComponent({
438
393
  :options="preparedRepos"
439
394
  :clearable="true"
440
395
  :searchable="true"
441
- :reduce="selectReduction"
396
+ :reduce="(e) => e"
442
397
  :rules="[reposRules]"
443
398
  :status="status(hasError.repo)"
444
399
  :option-label="'name'"
@@ -457,7 +412,7 @@ export default defineComponent({
457
412
  :label="t(`gitPicker.${ type }.branch.inputLabel`)"
458
413
  :options="preparedBranches"
459
414
  :clearable="false"
460
- :reduce="selectReduction"
415
+ :reduce="(e) => e"
461
416
  :searchable="true"
462
417
  :rules="[branchesRules]"
463
418
  :status="status(hasError.branch)"
@@ -486,7 +441,7 @@ export default defineComponent({
486
441
  >
487
442
  <template #cell:index="{row}">
488
443
  <RadioButton
489
- :value="selectedCommitId"
444
+ :value="selectedCommit.commitId"
490
445
  :val="row.commitId"
491
446
  @input="final($event)"
492
447
  />
@@ -1,7 +1,7 @@
1
1
  import { computed, ComputedRef } from 'vue';
2
2
 
3
3
  interface CompactInputProps {
4
- compact?: boolean | null;
4
+ compact?: boolean;
5
5
  label?: string;
6
6
  labelKey?: string;
7
7
  }
@@ -13,7 +13,7 @@ interface UseCompactInput {
13
13
  export const useCompactInput = (props: CompactInputProps): UseCompactInput => {
14
14
  const isCompact = computed(() => {
15
15
  // Compact if explicitly set - otherwise compact if there is no label
16
- return (props.compact !== null && props.compact !== undefined) ? !!props.compact : !(props.label || props.labelKey);
16
+ return props.compact !== null ? !!props.compact : !(props.label || props.labelKey);
17
17
  });
18
18
 
19
19
  return { isCompact };
@@ -60,6 +60,7 @@ export interface IClusterProvisioner {
60
60
 
61
61
  /**
62
62
  * Unique ID of the Cluster Provisioner
63
+ * If this overlaps with the name of an existing provisioner (seen in the type query param while creating a cluster) this provisioner will overwrite the built-in ui
63
64
  */
64
65
  id: string;
65
66
 
@@ -115,6 +116,12 @@ export interface IClusterProvisioner {
115
116
  */
116
117
  tag?: string;
117
118
 
119
+ /**
120
+ * Also show the provider card in the cluster importing flow
121
+ * If not set, the card will only be shown in the cluster creation page
122
+ */
123
+ showImport?: boolean
124
+
118
125
  /* --------------------------------------------------------------------------------------
119
126
  * Custer Details View
120
127
  * --------------------------------------------------------------------------------------- */
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import Vue from 'vue';
2
3
  import CreateEditView from '@shell/mixins/create-edit-view';
3
4
  import Footer from '@shell/components/form/Footer';
4
5
  import { LabeledInput } from '@components/Form/LabeledInput';
@@ -39,6 +40,21 @@ export default {
39
40
  return this.$store.getters['cluster/all'](NAMESPACE)[0]?.id;
40
41
  }
41
42
  },
43
+
44
+ methods: {
45
+ onTargetChange(isGit) {
46
+ // reset entered value when switching options
47
+ if (isGit) {
48
+ Vue.set(this.value.spec, 'url', '');
49
+ } else {
50
+ Vue.set(this.value.spec, 'gitRepo', '');
51
+
52
+ if (!!this.value.spec.gitBranch) {
53
+ Vue.set(this.value.spec, 'gitBranch', '');
54
+ }
55
+ }
56
+ }
57
+ },
42
58
  };
43
59
  </script>
44
60
 
@@ -60,6 +76,7 @@ export default {
60
76
  :labels="[t('catalog.repo.target.http'), t('catalog.repo.target.git')]"
61
77
  :mode="mode"
62
78
  data-testid="clusterrepo-radio-input"
79
+ @input="onTargetChange"
63
80
  />
64
81
  </div>
65
82
  </div>
@@ -97,6 +114,7 @@ export default {
97
114
  :label="t('catalog.repo.url.label')"
98
115
  :placeholder="t('catalog.repo.url.placeholder', null, true)"
99
116
  :mode="mode"
117
+ data-testid="clusterrepo-helm-url-input"
100
118
  />
101
119
 
102
120
  <SelectOrCreateAuthSecret
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { PropType, defineComponent } from 'vue';
2
+ import Vue, { PropType, VueConstructor } from 'vue';
3
3
  import CreateEditView from '@shell/mixins/create-edit-view';
4
4
  import CruResource from '@shell/components/CruResource.vue';
5
5
  import PodSecurityAdmission from '@shell/components/PodSecurityAdmission.vue';
@@ -9,7 +9,7 @@ import { PSA, PSAConfig, PSADefaults, PSAExemptions } from '@shell/types/pod-sec
9
9
  import { PSADimensions } from '@shell/config/pod-security-admission';
10
10
  import { MANAGEMENT } from '@shell/config/types';
11
11
 
12
- export default defineComponent({
12
+ export default (Vue as VueConstructor<Vue & InstanceType<typeof CreateEditView>>).extend({
13
13
  mixins: [CreateEditView],
14
14
  components: {
15
15
  CruResource,
@@ -301,7 +301,7 @@ export default {
301
301
  const getters = this.$store.getters;
302
302
  const isImport = this.isImport;
303
303
  const isElementalActive = !!this.activeProducts.find((item) => item.name === ELEMENTAL_PRODUCT_NAME);
304
- const out = [];
304
+ let out = [];
305
305
 
306
306
  const templates = this.templateOptions;
307
307
  const vueKontainerTypes = getters['plugins/clusterDrivers'];
@@ -348,12 +348,18 @@ export default {
348
348
  }
349
349
 
350
350
  // Add from extensions
351
- // if th rke toggle is set to rke1, don't add extensions that specify rke2 group
352
- // default group is rke2
353
351
  this.extensions.forEach((ext) => {
352
+ // if the rke toggle is set to rke1, don't add extensions that specify rke2 group
353
+ // default group is rke2
354
354
  if (!this.isRke2 && (ext.group === _RKE2 || !ext.group)) {
355
355
  return;
356
356
  }
357
+ // Do not show the extension provisioner on the import cluster page unless its explicitly set to do so
358
+ if (isImport && !ext.showImport) {
359
+ return;
360
+ }
361
+ // Allow extensions to overwrite provisioners with the same id
362
+ out = out.filter((type) => type.id !== ext.id);
357
363
  addExtensionType(ext, getters);
358
364
  });
359
365
  }
@@ -1,9 +1,9 @@
1
1
  import { _EDIT, _YAML } from '@shell/config/query-params';
2
- import { defineComponent } from 'vue';
2
+ import Vue from 'vue';
3
3
 
4
4
  import impl from './impl';
5
5
 
6
- export default defineComponent({
6
+ export default Vue.extend({
7
7
  ...impl,
8
8
 
9
9
  props: {
@@ -1,6 +1,7 @@
1
1
  import HybridModel from '@shell/plugins/steve/hybrid-class';
2
2
 
3
- const HIDDEN = ['rke', 'rancherkubernetesengine', 'azureaks'];
3
+ const HIDDEN = ['rke', 'rancherkubernetesengine'];
4
+
4
5
  const V2 = ['amazoneks', 'googlegke', 'azureaks'];
5
6
  const IMPORTABLE = ['amazoneks', 'googlegke', 'azureaks'];
6
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rancher/shell",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -1,8 +1,7 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue';
2
+ import Vue from 'vue';
3
3
  import { mapGetters } from 'vuex';
4
-
5
- export default defineComponent({
4
+ export default Vue.extend({
6
5
  props: {
7
6
  title: {
8
7
  type: String,
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { PropType, defineComponent } from 'vue';
2
+ import Vue, { PropType } from 'vue';
3
3
 
4
4
  interface Badge {
5
5
  stateBackground: string;
@@ -11,7 +11,7 @@ interface Badge {
11
11
  * <p>Represents a badge whose label and color is either taken from the value property or
12
12
  * from the label and color properties. The state property takes precedence.</p>
13
13
  */
14
- export default defineComponent({
14
+ export default Vue.extend({
15
15
  props: {
16
16
  /**
17
17
  * A value having the properties `stateBackground` and `stateDisplay`
@@ -59,7 +59,7 @@ export default defineComponent({
59
59
  </script>
60
60
 
61
61
  <template>
62
- <span :class="['badge-state', bg]">
62
+ <span :class="{'badge-state': true, [bg]: true}">
63
63
  <i
64
64
  v-if="icon"
65
65
  class="icon"
@@ -1,9 +1,9 @@
1
1
  <script lang="ts">
2
- import { defineComponent } from 'vue';
2
+ import Vue from 'vue';
3
3
  import { nlToBr } from '@shell/utils/string';
4
4
  import { stringify } from '@shell/utils/error';
5
5
 
6
- export default defineComponent({
6
+ export default Vue.extend({
7
7
  props: {
8
8
  /**
9
9
  * A color class that represents the color of the banner.
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import { defineComponent, PropType } from 'vue';
2
+ import Vue from 'vue';
3
3
 
4
- export default defineComponent({
4
+ export default Vue.extend({
5
5
  name: 'Card',
6
6
  props: {
7
7
  /**
@@ -22,7 +22,7 @@ export default defineComponent({
22
22
  * The function to invoke when the default action button is clicked.
23
23
  */
24
24
  buttonAction: {
25
- type: Function as PropType<(event: MouseEvent) => void>,
25
+ type: Function,
26
26
  default: (): void => { }
27
27
  },
28
28
  /**
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
- import { PropType, defineComponent } from 'vue';
2
+ import Vue, { PropType } from 'vue';
3
3
  import { _EDIT, _VIEW } from '@shell/config/query-params';
4
4
  import { addObject, removeObject } from '@shell/utils/array';
5
5
  import cloneDeep from 'lodash/cloneDeep';
6
6
 
7
- export default defineComponent({
7
+ export default Vue.extend({
8
8
  name: 'Checkbox',
9
9
 
10
10
  props: {
@@ -140,7 +140,7 @@ export default defineComponent({
140
140
  /**
141
141
  * Toggles the checked state for the checkbox and emits an 'input' event.
142
142
  */
143
- clicked(event: MouseEvent | KeyboardEvent): boolean | void {
143
+ clicked(event: MouseEvent): boolean | void {
144
144
  if ((event.target as HTMLLinkElement).tagName === 'A' && (event.target as HTMLLinkElement).href) {
145
145
  // Ignore links inside the checkbox label so you can click them
146
146
  return true;
@@ -5,7 +5,7 @@ describe('component: LabeledInput', () => {
5
5
  it('should emit input only once', () => {
6
6
  const value = '2';
7
7
  const delay = 1;
8
- const wrapper = mount(LabeledInput, {
8
+ const wrapper = mount(LabeledInput as any, {
9
9
  propsData: { delay },
10
10
  mocks: { $store: { getters: { 'i18n/t': jest.fn() } } }
11
11
  });