@rancher/shell 2.0.0 → 2.0.2-rc.1

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 (154) hide show
  1. package/assets/translations/en-us.yaml +69 -29
  2. package/assets/translations/zh-hans.yaml +1 -0
  3. package/components/AlertTable.vue +17 -7
  4. package/components/AssignTo.vue +2 -0
  5. package/components/GrafanaDashboard.vue +6 -4
  6. package/components/PromptRemove.vue +1 -0
  7. package/components/Questions/index.vue +2 -2
  8. package/components/auth/RoleDetailEdit.vue +5 -4
  9. package/components/form/KeyValue.vue +1 -0
  10. package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
  11. package/components/form/ProjectMemberEditor.vue +1 -1
  12. package/components/form/ResourceLabeledSelect.vue +11 -3
  13. package/components/form/Taints.vue +13 -7
  14. package/components/form/__tests__/Taints.test.ts +70 -0
  15. package/components/form/labeled-select-utils/labeled-select.utils.ts +1 -1
  16. package/components/nav/Header.vue +1 -1
  17. package/components/nav/TopLevelMenu.vue +1 -4
  18. package/config/pagination-table-headers.js +5 -4
  19. package/config/product/auth.js +1 -1
  20. package/config/roles.ts +34 -19
  21. package/config/router/navigation-guards/attempt-first-login.js +1 -1
  22. package/config/router/navigation-guards/authentication.js +1 -1
  23. package/config/router/navigation-guards/i18n.js +13 -0
  24. package/config/router/navigation-guards/index.js +3 -1
  25. package/config/router/navigation-guards/load-initial-settings.js +1 -1
  26. package/config/router/navigation-guards/runtime-extension-route.js +31 -0
  27. package/config/router/routes.js +10 -1
  28. package/config/uiplugins.js +130 -61
  29. package/core/plugin.ts +5 -0
  30. package/core/plugins.js +7 -1
  31. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +42 -0
  32. package/detail/provisioning.cattle.io.cluster.vue +4 -4
  33. package/dialog/DeactivateDriverDialog.vue +30 -11
  34. package/edit/auth/__tests__/oidc.test.ts +2 -2
  35. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +86 -13
  36. package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +3 -134
  37. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +209 -0
  38. package/edit/provisioning.cattle.io.cluster/index.vue +8 -4
  39. package/edit/provisioning.cattle.io.cluster/rke2.vue +115 -17
  40. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +50 -0
  41. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +29 -64
  42. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +42 -3
  43. package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +22 -86
  44. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +8 -2
  45. package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +61 -0
  46. package/edit/token.vue +2 -1
  47. package/initialize/entry-helpers.js +4 -24
  48. package/list/management.cattle.io.feature.vue +4 -2
  49. package/middleware/authenticated.js +0 -19
  50. package/mixins/__tests__/chart.test.ts +4 -1
  51. package/mixins/auth-config.js +1 -1
  52. package/mixins/chart.js +30 -14
  53. package/models/__tests__/apps.deployment.test.ts +93 -0
  54. package/models/apps.deployment.js +18 -4
  55. package/models/driver.js +3 -2
  56. package/models/kontainerdriver.js +30 -13
  57. package/models/management.cattle.io.authconfig.js +2 -2
  58. package/models/management.cattle.io.cluster.js +2 -2
  59. package/models/management.cattle.io.user.js +3 -3
  60. package/models/nodedriver.js +35 -13
  61. package/models/provisioning.cattle.io.cluster.js +4 -0
  62. package/package.json +3 -2
  63. package/pages/404.vue +15 -0
  64. package/pages/auth/login.vue +4 -1
  65. package/pages/auth/setup.vue +4 -1
  66. package/pages/c/_cluster/apps/charts/install.vue +3 -2
  67. package/pages/c/_cluster/explorer/index.vue +5 -0
  68. package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +0 -3
  69. package/pages/c/_cluster/manager/drivers/nodeDriver/index.vue +1 -4
  70. package/pages/c/_cluster/manager/jwt.authentication/index.vue +10 -4
  71. package/pages/c/_cluster/settings/performance.vue +2 -2
  72. package/pages/c/_cluster/uiplugins/InstallDialog.vue +2 -1
  73. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +7 -10
  74. package/pages/c/_cluster/uiplugins/index.vue +24 -16
  75. package/pages/home.vue +1 -13
  76. package/plugins/dashboard-store/actions.js +1 -1
  77. package/plugins/dashboard-store/getters.js +1 -1
  78. package/plugins/steve/__tests__/getters.test.ts +5 -5
  79. package/plugins/steve/getters.js +6 -4
  80. package/plugins/steve/hybrid-class.js +1 -5
  81. package/promptRemove/pod.vue +15 -7
  82. package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +1 -1
  83. package/scripts/publish-shell.sh +54 -55
  84. package/scripts/test-plugins-build.sh +45 -39
  85. package/shell/types/shell/index.d.ts +2 -0
  86. package/store/auth.js +1 -1
  87. package/store/index.js +1 -1
  88. package/store/type-map.js +4 -2
  89. package/types/store/pagination.types.ts +1 -1
  90. package/utils/__tests__/kontainer.test.ts +89 -1
  91. package/utils/auth.js +1 -1
  92. package/utils/cluster.js +9 -0
  93. package/utils/kontainer.ts +5 -1
  94. package/utils/settings.ts +3 -1
  95. package/utils/version.js +2 -1
  96. package/creators/app/app.package.json +0 -13
  97. package/creators/app/files/.eslintignore +0 -16
  98. package/creators/app/files/.eslintrc.js +0 -173
  99. package/creators/app/files/.gitignore +0 -70
  100. package/creators/app/files/.gitlab-ci.yml +0 -14
  101. package/creators/app/files/.vscode/settings.json +0 -21
  102. package/creators/app/files/babel.config.js +0 -1
  103. package/creators/app/files/tsconfig.json +0 -42
  104. package/creators/app/files/vue.config.js +0 -6
  105. package/creators/app/init +0 -120
  106. package/creators/app/package.json +0 -25
  107. package/creators/pkg/files/.github/workflows/build-extension-catalog.yml +0 -24
  108. package/creators/pkg/files/.github/workflows/build-extension-charts.yml +0 -22
  109. package/creators/pkg/files/babel.config.js +0 -1
  110. package/creators/pkg/files/index.ts +0 -14
  111. package/creators/pkg/files/tsconfig.json +0 -53
  112. package/creators/pkg/files/vue.config.js +0 -1
  113. package/creators/pkg/init +0 -286
  114. package/creators/pkg/package.json +0 -19
  115. package/creators/pkg/pkg.package.json +0 -21
  116. package/creators/pkg/vue-shim.ts +0 -4
  117. package/creators/update/init +0 -56
  118. package/creators/update/package.json +0 -20
  119. package/creators/update/upgrade +0 -56
  120. package/rancher-components/components/Accordion/Accordion.test.ts +0 -45
  121. package/rancher-components/components/Accordion/Accordion.vue +0 -86
  122. package/rancher-components/components/Accordion/index.ts +0 -1
  123. package/rancher-components/components/BadgeState/BadgeState.test.ts +0 -12
  124. package/rancher-components/components/BadgeState/BadgeState.vue +0 -111
  125. package/rancher-components/components/BadgeState/index.ts +0 -1
  126. package/rancher-components/components/Banner/Banner.test.ts +0 -59
  127. package/rancher-components/components/Banner/Banner.vue +0 -244
  128. package/rancher-components/components/Banner/index.ts +0 -1
  129. package/rancher-components/components/Card/Card.test.ts +0 -37
  130. package/rancher-components/components/Card/Card.vue +0 -167
  131. package/rancher-components/components/Card/index.ts +0 -1
  132. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +0 -68
  133. package/rancher-components/components/Form/Checkbox/Checkbox.vue +0 -421
  134. package/rancher-components/components/Form/Checkbox/index.ts +0 -1
  135. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +0 -40
  136. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +0 -402
  137. package/rancher-components/components/Form/LabeledInput/index.ts +0 -1
  138. package/rancher-components/components/Form/Radio/RadioButton.test.ts +0 -33
  139. package/rancher-components/components/Form/Radio/RadioButton.vue +0 -293
  140. package/rancher-components/components/Form/Radio/RadioGroup.test.ts +0 -30
  141. package/rancher-components/components/Form/Radio/RadioGroup.vue +0 -259
  142. package/rancher-components/components/Form/Radio/index.ts +0 -2
  143. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +0 -172
  144. package/rancher-components/components/Form/TextArea/index.ts +0 -1
  145. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +0 -94
  146. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +0 -152
  147. package/rancher-components/components/Form/ToggleSwitch/index.ts +0 -1
  148. package/rancher-components/components/Form/index.ts +0 -5
  149. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +0 -156
  150. package/rancher-components/components/LabeledTooltip/index.ts +0 -1
  151. package/rancher-components/components/StringList/StringList.test.ts +0 -754
  152. package/rancher-components/components/StringList/StringList.vue +0 -650
  153. package/rancher-components/components/StringList/index.ts +0 -1
  154. package/types/shell/index.d.ts +0 -4585
@@ -1,421 +0,0 @@
1
- <script lang="ts">
2
- import { PropType, defineComponent } from 'vue';
3
- import { _EDIT, _VIEW } from '@shell/config/query-params';
4
- import { addObject, removeObject } from '@shell/utils/array';
5
- import cloneDeep from 'lodash/cloneDeep';
6
-
7
- export default defineComponent({
8
- name: 'Checkbox',
9
-
10
- props: {
11
- /**
12
- * The checkbox value.
13
- */
14
- value: {
15
- type: [Boolean, Array, String] as PropType<boolean | boolean[] | string>,
16
- default: false
17
- },
18
-
19
- /**
20
- * The checkbox label.
21
- */
22
- label: {
23
- type: String,
24
- default: null
25
- },
26
-
27
- /**
28
- * The i18n key to use for the checkbox label.
29
- */
30
- labelKey: {
31
- type: String,
32
- default: null
33
- },
34
-
35
- /**
36
- * Random ID generated for binding label to input.
37
- */
38
- id: {
39
- type: String,
40
- default: String(Math.random() * 1000)
41
- },
42
-
43
- /**
44
- * Disable the checkbox.
45
- */
46
- disabled: {
47
- type: Boolean,
48
- default: false
49
- },
50
-
51
- /**
52
- * Display an indeterminate state. Useful for cases where a checkbox might
53
- * be the parent to child checkboxes, and we need to show that a subset of
54
- * children are checked.
55
- */
56
- indeterminate: {
57
- type: Boolean,
58
- default: false
59
- },
60
-
61
- /**
62
- * The checkbox editing mode.
63
- * @values _EDIT, _VIEW
64
- */
65
- mode: {
66
- type: String,
67
- default: _EDIT
68
- },
69
-
70
- /**
71
- * The contents of the checkbox tooltip.
72
- */
73
- tooltip: {
74
- type: [String, Object],
75
- default: null
76
- },
77
-
78
- /**
79
- * The i18n key to use for the checkbox tooltip.
80
- */
81
- tooltipKey: {
82
- type: String,
83
- default: null
84
- },
85
-
86
- /**
87
- * A custom value to use when the checkbox is checked.
88
- */
89
- valueWhenTrue: {
90
- type: [Boolean, String, Number],
91
- default: true
92
- },
93
-
94
- /**
95
- * The i18n key to use for the checkbox description.
96
- */
97
- descriptionKey: {
98
- type: String,
99
- default: null
100
- },
101
-
102
- /**
103
- * The checkbox description.
104
- */
105
- description: {
106
- type: String,
107
- default: null
108
- },
109
-
110
- /**
111
- * Primary checkbox displays label so that it stands out more
112
- */
113
- primary: {
114
- type: Boolean,
115
- default: false
116
- },
117
- },
118
-
119
- computed: {
120
- /**
121
- * Determines if the checkbox is disabled.
122
- * @returns boolean: True when the disabled prop is true or when mode is
123
- * View.
124
- */
125
- isDisabled(): boolean {
126
- return (this.disabled || this.mode === _VIEW);
127
- },
128
- /**
129
- * Determines if the checkbox is checked when using custom values or
130
- * multiple values.
131
- * @returns boolean: True when at least one value is true in a collection or
132
- * when value matches `this.valueWhenTrue`.
133
- */
134
- isChecked(): boolean {
135
- return this.isMulti(this.value) ? this.findTrueValues(this.value) : this.value === this.valueWhenTrue;
136
- }
137
- },
138
-
139
- methods: {
140
- /**
141
- * Toggles the checked state for the checkbox and emits an 'input' event.
142
- */
143
- clicked(event: MouseEvent | KeyboardEvent): boolean | void {
144
- if ((event.target as HTMLLinkElement).tagName === 'A' && (event.target as HTMLLinkElement).href) {
145
- // Ignore links inside the checkbox label so you can click them
146
- return true;
147
- }
148
-
149
- event.stopPropagation();
150
- event.preventDefault();
151
-
152
- if (this.isDisabled) {
153
- return;
154
- }
155
-
156
- const customEvent = {
157
- bubbles: true,
158
- cancelable: false,
159
- shiftKey: event.shiftKey,
160
- altKey: event.altKey,
161
- ctrlKey: event.ctrlKey,
162
- metaKey: event.metaKey
163
- };
164
-
165
- const click = new CustomEvent('click', customEvent);
166
-
167
- // Flip the value
168
- const value = cloneDeep(this.value);
169
-
170
- if (this.isMulti(value)) {
171
- if (this.isChecked) {
172
- removeObject(value, this.valueWhenTrue);
173
- } else {
174
- addObject(value, this.valueWhenTrue);
175
- }
176
- this.$emit('input', value);
177
- } else if (this.isString(this.valueWhenTrue)) {
178
- if (this.isChecked) {
179
- this.$emit('input', null);
180
- } else {
181
- this.$emit('input', this.valueWhenTrue);
182
- }
183
- } else {
184
- this.$emit('input', !value);
185
- this.$el.dispatchEvent(click);
186
- }
187
- },
188
-
189
- /**
190
- * Determines if there are multiple values for the checkbox.
191
- */
192
- isMulti(value: boolean | boolean[] | string): value is boolean[] {
193
- return Array.isArray(value);
194
- },
195
-
196
- isString(value: boolean | number | string): value is boolean {
197
- return typeof value === 'string';
198
- },
199
-
200
- /**
201
- * Finds the first true value for multiple checkboxes.
202
- * @param value A collection of values for the checkbox.
203
- */
204
- findTrueValues(value: boolean[]): boolean {
205
- return value.find((v) => v === this.valueWhenTrue) || false;
206
- }
207
- }
208
- });
209
- </script>
210
-
211
- <template>
212
- <div
213
- class="checkbox-outer-container"
214
- data-checkbox-ctrl
215
- >
216
- <label
217
- class="checkbox-container"
218
- :class="{ 'disabled': isDisabled}"
219
- :for="id"
220
- @keydown.enter.prevent="clicked($event)"
221
- @keydown.space.prevent="clicked($event)"
222
- @click="clicked($event)"
223
- >
224
- <input
225
- :checked="isChecked"
226
- :value="valueWhenTrue"
227
- type="checkbox"
228
- :tabindex="-1"
229
- :name="id"
230
- @click.stop.prevent
231
- >
232
- <span
233
- class="checkbox-custom"
234
- :class="{indeterminate: indeterminate}"
235
- :tabindex="isDisabled ? -1 : 0"
236
- :aria-label="label"
237
- :aria-checked="!!value"
238
- role="checkbox"
239
- />
240
- <span
241
- v-if="$slots.label || label || labelKey || tooltipKey || tooltip"
242
- class="checkbox-label"
243
- :class="{ 'checkbox-primary': primary }"
244
- >
245
- <slot name="label">
246
- <t
247
- v-if="labelKey"
248
- :k="labelKey"
249
- :raw="true"
250
- />
251
- <template v-else-if="label">{{ label }}</template>
252
- <i
253
- v-if="tooltipKey"
254
- v-clean-tooltip="t(tooltipKey)"
255
- class="checkbox-info icon icon-info icon-lg"
256
- />
257
- <i
258
- v-else-if="tooltip"
259
- v-clean-tooltip="tooltip"
260
- class="checkbox-info icon icon-info icon-lg"
261
- />
262
- </slot>
263
- </span>
264
- </label>
265
- <div
266
- v-if="descriptionKey || description"
267
- class="checkbox-outer-container-description"
268
- >
269
- <t
270
- v-if="descriptionKey"
271
- :k="descriptionKey"
272
- />
273
- <template v-else-if="description">
274
- {{ description }}
275
- </template>
276
- </div>
277
- </div>
278
- </template>
279
-
280
- <style lang='scss'>
281
- $fontColor: var(--input-label);
282
-
283
- .checkbox-outer-container {
284
- display: inline-flex;
285
- flex-direction: column;
286
- &-description {
287
- color: $fontColor;
288
- font-size: 14px;
289
- margin-left: 19px;
290
- margin-top: 5px;
291
- opacity: 0.8;
292
- }
293
- }
294
-
295
- // NOTE: SortableTable depends on the names of this class, do not arbitrarily change.
296
- .checkbox-container {
297
- position: relative;
298
- display: inline-flex;
299
- align-items: center;
300
- margin: 0;
301
- cursor: pointer;
302
- user-select: none;
303
- border-radius: var(--border-radius);
304
-
305
- .checkbox-label {
306
- color: var(--input-label);
307
- display: inline-flex;
308
- margin: 0px 10px 0px 5px;
309
-
310
- &.checkbox-primary {
311
- color: inherit;
312
- font-weight: 600;
313
- }
314
- }
315
-
316
- .checkbox-info {
317
- line-height: normal;
318
- margin-left: 2px;
319
- }
320
-
321
- .checkbox-custom {
322
- height: 14px;
323
- width: 14px;
324
- background-color: var(--body-bg);
325
- border-radius: var(--border-radius);
326
- transition: all 0.3s ease-out;
327
- border: 1px solid var(--border);
328
- flex-shrink: 0;
329
- }
330
-
331
- input {
332
- // display: none;
333
- opacity: 0;
334
- position: absolute;
335
- z-index: -1;
336
- }
337
-
338
- input:checked ~ .checkbox-custom {
339
- background-color:var(--primary);
340
- -webkit-transform: rotate(0deg) scale(1);
341
- -ms-transform: rotate(0deg) scale(1);
342
- transform: rotate(0deg) scale(1);
343
- opacity:1;
344
- border: 1px solid var(--primary);
345
- }
346
-
347
- // Custom Checkbox tick
348
- .checkbox-custom::after {
349
- position: absolute;
350
- content: "";
351
- left: 0px;
352
- top: 0px;
353
- height: 0px;
354
- width: 0px;
355
- border-radius: var(--border-radius);
356
- border: solid;
357
- border-color: var(--input-text);
358
- border-width: 0 3px 3px 0;
359
- -webkit-transform: rotate(0deg) scale(0);
360
- -ms-transform: rotate(0deg) scale(0);
361
- transform: rotate(0deg) scale(0);
362
- opacity:1;
363
- }
364
-
365
- input:checked ~ .checkbox-custom::after {
366
- -webkit-transform: rotate(45deg) scale(1);
367
- -ms-transform: rotate(45deg) scale(1);
368
- transform: rotate(45deg) scale(1);
369
- opacity:1;
370
- left: 4px;
371
- width: 4px;
372
- height: 10px;
373
- border: solid;
374
- border-color: var(--checkbox-tick);
375
- border-width: 0 2px 2px 0;
376
- background-color: transparent;
377
- }
378
-
379
- input:checked ~ .checkbox-custom.indeterminate::after {
380
- -webkit-transform: scale(1);
381
- -ms-transform: scale(1);
382
- transform: scale(1);
383
- opacity:1;
384
- left: 3px;
385
- top:2px;
386
- width: 6px;
387
- height: 5px;
388
- border: solid;
389
- border-color: var(--checkbox-tick);
390
- border-width: 0 0 2px 0;
391
- background-color: transparent;
392
- }
393
-
394
- // Disabled styles
395
- &.disabled {
396
- .checkbox-custom {
397
- background-color: var(--checkbox-disabled-bg);
398
- border-color: var(--checkbox-disabled-bg);
399
- }
400
- input:checked ~ .checkbox-custom {
401
- background-color: var(--checkbox-disabled-bg);
402
- border-color: var(--checkbox-disabled-bg);
403
- &::after {
404
- border-color: var(--checkbox-tick-disabled);
405
- }
406
- }
407
- }
408
-
409
- &.disabled {
410
- cursor: not-allowed;
411
- }
412
-
413
- .checkbox-view {
414
- display: flex;
415
- flex-direction: column;
416
- LABEL {
417
- color: $fontColor;
418
- }
419
- }
420
- }
421
- </style>
@@ -1 +0,0 @@
1
- export { default as Checkbox } from './Checkbox.vue';
@@ -1,40 +0,0 @@
1
- import { mount } from '@vue/test-utils';
2
- import { LabeledInput } from './index';
3
-
4
- describe('component: LabeledInput', () => {
5
- it('should emit input only once', () => {
6
- const value = '2';
7
- const delay = 1;
8
- const wrapper = mount(LabeledInput, {
9
- propsData: { delay },
10
- mocks: { $store: { getters: { 'i18n/t': jest.fn() } } }
11
- });
12
-
13
- jest.useFakeTimers();
14
- wrapper.find('input').setValue('1');
15
- wrapper.find('input').setValue(value);
16
- jest.advanceTimersByTime(delay);
17
- jest.useRealTimers();
18
-
19
- expect(wrapper.emitted('input')).toHaveLength(1);
20
- expect(wrapper.emitted('input')![0][0]).toBe(value);
21
- });
22
-
23
- it('using mode "multiline" should emit input value correctly', () => {
24
- const value = 'any-string';
25
- const delay = 1;
26
- const wrapper = mount(LabeledInput as any, {
27
- propsData: { delay, multiline: true },
28
- mocks: { $store: { getters: { 'i18n/t': jest.fn() } } }
29
- });
30
-
31
- jest.useFakeTimers();
32
- wrapper.find('input').setValue('1');
33
- wrapper.find('input').setValue(value);
34
- jest.advanceTimersByTime(delay);
35
- jest.useRealTimers();
36
-
37
- expect(wrapper.emitted('input')).toHaveLength(1);
38
- expect(wrapper.emitted('input')![0][0]).toBe(value);
39
- });
40
- });