@rancher/shell 3.0.9-rc.1 → 3.0.9-rc.3

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 (208) hide show
  1. package/assets/styles/base/_color.scss +1 -0
  2. package/assets/styles/base/_typography.scss +14 -5
  3. package/assets/styles/themes/_light.scss +1 -1
  4. package/assets/styles/themes/_modern.scss +1 -1
  5. package/assets/translations/en-us.yaml +104 -33
  6. package/assets/translations/zh-hans.yaml +13 -2
  7. package/components/ActionMenu.vue +7 -8
  8. package/components/ActionMenuShell.vue +23 -24
  9. package/components/CodeMirror.vue +4 -3
  10. package/components/DetailText.vue +54 -7
  11. package/components/Drawer/Chrome.vue +11 -4
  12. package/components/Drawer/DrawerCard.vue +19 -0
  13. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +3 -11
  14. package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +2 -2
  15. package/components/Drawer/ResourceDetailDrawer/index.vue +3 -20
  16. package/components/Drawer/types.ts +1 -0
  17. package/components/DynamicContent/DynamicContentCloseButton.vue +2 -2
  18. package/components/LocaleSelector.vue +1 -1
  19. package/components/Markdown.vue +1 -1
  20. package/components/PopoverCard.vue +3 -3
  21. package/components/Resource/Detail/Card/ExtrasCard.vue +39 -0
  22. package/components/Resource/Detail/Card/Scaler.vue +10 -2
  23. package/components/Resource/Detail/Card/StateCard/__tests__/composables.test.ts +142 -0
  24. package/components/Resource/Detail/Card/StateCard/composables.ts +41 -11
  25. package/components/Resource/Detail/Card/StateCard/index.vue +3 -9
  26. package/components/Resource/Detail/Card/StateCard/types.ts +6 -0
  27. package/components/Resource/Detail/Card/{PodsCard → StatusCard}/index.vue +14 -10
  28. package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +24 -25
  29. package/components/Resource/Detail/Cards.vue +27 -0
  30. package/components/Resource/Detail/Masthead/__tests__/index.test.ts +70 -0
  31. package/components/Resource/Detail/Masthead/index.vue +5 -0
  32. package/components/Resource/Detail/Metadata/KeyValueRow.vue +4 -2
  33. package/components/Resource/Detail/ResourcePopover/ResourcePopoverCard.vue +2 -2
  34. package/components/Resource/Detail/ResourceRow.types.ts +14 -0
  35. package/components/Resource/Detail/ResourceRow.vue +23 -35
  36. package/components/Resource/Detail/StatusRow.vue +5 -2
  37. package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +38 -7
  38. package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +106 -2
  39. package/components/Resource/Detail/TitleBar/composables.ts +2 -1
  40. package/components/Resource/Detail/TitleBar/index.vue +41 -6
  41. package/components/ResourceDetail/Masthead/__tests__/index.test.ts +49 -1
  42. package/components/ResourceDetail/Masthead/__tests__/latest.test.ts +85 -0
  43. package/components/ResourceDetail/Masthead/index.vue +1 -0
  44. package/components/ResourceDetail/Masthead/latest.vue +8 -1
  45. package/components/ResourceDetail/Masthead/legacy.vue +1 -1
  46. package/components/ResourceTable.vue +1 -1
  47. package/components/Setting.vue +1 -1
  48. package/components/SortableTable/index.vue +25 -0
  49. package/components/SortableTable/selection.js +25 -12
  50. package/components/SortableTable/sorting.js +1 -1
  51. package/components/Tabbed/Tab.vue +5 -0
  52. package/components/Tabbed/index.vue +40 -9
  53. package/components/Window/ContainerShell.vue +10 -13
  54. package/components/__tests__/ProjectRow.test.ts +102 -15
  55. package/components/fleet/FleetClusterTargets/TargetsList.vue +47 -29
  56. package/components/fleet/FleetClusterTargets/index.vue +82 -29
  57. package/components/fleet/FleetClusters.vue +26 -12
  58. package/components/fleet/FleetGitRepoPaths.vue +2 -2
  59. package/components/fleet/FleetResources.vue +14 -0
  60. package/components/fleet/FleetValuesFrom.vue +2 -2
  61. package/components/fleet/__tests__/FleetClusterTargets.test.ts +531 -0
  62. package/components/fleet/__tests__/FleetClusters.test.ts +576 -0
  63. package/components/fleet/dashboard/ResourceDetails.vue +96 -123
  64. package/components/form/Conditions.vue +1 -15
  65. package/components/form/HookOption.vue +5 -0
  66. package/components/form/LabeledSelect.vue +1 -1
  67. package/components/form/LifecycleHooks.vue +2 -6
  68. package/components/form/ResourceLabeledSelect.vue +12 -1
  69. package/components/form/ResourceQuota/Project.vue +59 -8
  70. package/components/form/ResourceQuota/ProjectRow.vue +116 -21
  71. package/components/form/ResourceQuota/shared.js +42 -18
  72. package/components/form/SeccompProfile.vue +113 -0
  73. package/components/form/Security.vue +244 -133
  74. package/components/form/__tests__/LabeledSelect.test.ts +1 -1
  75. package/components/form/__tests__/SeccompProfile.test.js +124 -0
  76. package/components/form/__tests__/Security.test.ts +125 -37
  77. package/components/formatter/Autoscaler.vue +2 -2
  78. package/components/formatter/FleetSummaryGraph.vue +4 -1
  79. package/components/formatter/LinkName.vue +3 -2
  80. package/components/nav/Group.vue +5 -0
  81. package/components/nav/Header.vue +3 -3
  82. package/components/nav/HeaderPageActionMenu.vue +1 -1
  83. package/components/nav/NamespaceFilter.vue +6 -6
  84. package/components/nav/NotificationCenter/index.vue +1 -1
  85. package/components/nav/TopLevelMenu.helper.ts +41 -16
  86. package/components/nav/TopLevelMenu.vue +45 -25
  87. package/components/nav/WorkspaceSwitcher.vue +1 -1
  88. package/components/nav/__tests__/TopLevelMenu.helper.test.ts +277 -0
  89. package/components/nav/__tests__/TopLevelMenu.test.ts +160 -4
  90. package/components/templates/default.vue +0 -3
  91. package/components/templates/home.vue +0 -3
  92. package/components/templates/plain.vue +0 -3
  93. package/composables/useClickOutside.ts +1 -1
  94. package/config/product/explorer.js +2 -3
  95. package/config/table-headers.js +9 -7
  96. package/config/types.js +45 -9
  97. package/detail/__tests__/workload.test.ts +8 -16
  98. package/detail/catalog.cattle.io.app.vue +5 -0
  99. package/detail/fleet.cattle.io.cluster.vue +6 -0
  100. package/detail/management.cattle.io.oidcclient.vue +15 -4
  101. package/detail/workload/index.vue +7 -109
  102. package/edit/__tests__/management.cattle.io.project.test.js +137 -0
  103. package/edit/__tests__/projectsecret.test.ts +42 -0
  104. package/edit/auth/__tests__/oidc.test.ts +50 -0
  105. package/edit/auth/oidc.vue +68 -44
  106. package/edit/autoscaling.horizontalpodautoscaler/index.vue +140 -59
  107. package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +41 -5
  108. package/edit/management.cattle.io.project.vue +36 -6
  109. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +16 -3
  110. package/edit/projectsecret.vue +29 -0
  111. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +89 -200
  112. package/edit/provisioning.cattle.io.cluster/__tests__/Networking.test.ts +58 -17
  113. package/edit/provisioning.cattle.io.cluster/rke2.vue +11 -0
  114. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +3 -63
  115. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +82 -14
  116. package/edit/workload/__tests__/index.test.ts +3 -4
  117. package/edit/workload/index.vue +47 -28
  118. package/edit/workload/mixins/workload.js +66 -31
  119. package/initialize/install-plugins.js +0 -2
  120. package/list/catalog.cattle.io.clusterrepo.vue +1 -1
  121. package/list/projectsecret.vue +2 -2
  122. package/machine-config/__tests__/vmwarevsphere.test.ts +64 -0
  123. package/machine-config/amazonec2.vue +2 -2
  124. package/machine-config/vmwarevsphere.vue +58 -4
  125. package/mixins/__tests__/chart.test.ts +63 -0
  126. package/mixins/chart.js +56 -51
  127. package/models/__tests__/catalog.cattle.io.app.test.ts +33 -0
  128. package/models/__tests__/workload.test.ts +333 -0
  129. package/models/catalog.cattle.io.app.js +8 -0
  130. package/models/management.cattle.io.cluster.js +22 -30
  131. package/models/pod.js +14 -0
  132. package/models/provisioning.cattle.io.cluster.js +2 -2
  133. package/models/secret.js +1 -1
  134. package/models/workload.js +93 -27
  135. package/package.json +4 -4
  136. package/pages/__tests__/diagnostic.test.ts +71 -0
  137. package/pages/c/_cluster/apps/charts/__tests__/install.test.ts +91 -0
  138. package/pages/c/_cluster/apps/charts/install.vue +4 -4
  139. package/pages/c/_cluster/explorer/EventsTable.vue +2 -2
  140. package/pages/c/_cluster/explorer/tools/index.vue +23 -5
  141. package/pages/c/_cluster/fleet/index.vue +14 -8
  142. package/pages/c/_cluster/manager/hostedprovider/index.vue +1 -19
  143. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +18 -5
  144. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
  145. package/pages/c/_cluster/uiplugins/index.vue +41 -9
  146. package/pages/diagnostic.vue +17 -3
  147. package/plugins/dashboard-store/__tests__/resource-class.test.ts +234 -0
  148. package/plugins/dashboard-store/actions.js +9 -8
  149. package/plugins/dashboard-store/resource-class.js +97 -1
  150. package/plugins/steve/__tests__/revision.test.ts +84 -0
  151. package/plugins/steve/__tests__/steve-pagination-utils.test.ts +30 -0
  152. package/plugins/steve/__tests__/subscribe.spec.ts +134 -0
  153. package/plugins/steve/revision.ts +26 -0
  154. package/plugins/steve/steve-pagination-utils.ts +6 -5
  155. package/plugins/steve/subscribe.js +188 -49
  156. package/plugins/subscribe-events.ts +2 -2
  157. package/rancher-components/Form/Checkbox/Checkbox.vue +13 -0
  158. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -1
  159. package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.vue +2 -1
  160. package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +3 -1
  161. package/rancher-components/Pill/RcStatusIndicator/RcStatusIndicator.vue +3 -1
  162. package/rancher-components/Pill/RcTag/RcTag.vue +1 -1
  163. package/rancher-components/Pill/index.ts +4 -0
  164. package/rancher-components/RcButton/RcButton.test.ts +53 -9
  165. package/rancher-components/RcButton/RcButton.vue +217 -25
  166. package/rancher-components/RcButton/types.ts +27 -1
  167. package/rancher-components/RcDropdown/RcDropdownMenu.vue +4 -4
  168. package/rancher-components/RcDropdown/types.ts +3 -3
  169. package/rancher-components/RcIcon/RcIcon.test.ts +42 -0
  170. package/rancher-components/RcIcon/RcIcon.vue +9 -6
  171. package/rancher-components/RcIcon/types.ts +13 -9
  172. package/rancher-components/RcItemCard/RcItemCard.test.ts +16 -6
  173. package/rancher-components/RcItemCard/RcItemCard.vue +13 -23
  174. package/rancher-components/utils/status.test.ts +10 -15
  175. package/rancher-components/utils/status.ts +5 -6
  176. package/store/__tests__/auth.test.ts +21 -5
  177. package/store/auth.js +6 -3
  178. package/store/aws.js +18 -12
  179. package/store/index.js +4 -8
  180. package/store/type-map.utils.ts +1 -1
  181. package/types/kube/kube-api.ts +29 -3
  182. package/types/rancher/steve.api.ts +40 -0
  183. package/types/shell/index.d.ts +262 -156
  184. package/types/store/pagination.types.ts +1 -0
  185. package/types/store/subscribe-events.types.ts +1 -0
  186. package/utils/__tests__/azure.test.ts +56 -0
  187. package/utils/__tests__/back-off.test.ts +364 -245
  188. package/utils/__tests__/error.test.ts +44 -0
  189. package/utils/__tests__/fleet.test.ts +8 -1
  190. package/utils/__tests__/pagination-wrapper.test.ts +167 -0
  191. package/utils/__tests__/version.test.ts +55 -1
  192. package/utils/azure.js +12 -0
  193. package/utils/back-off.ts +302 -69
  194. package/utils/dynamic-content/__tests__/index.test.ts +1 -1
  195. package/utils/dynamic-content/__tests__/new-release.test.ts +48 -7
  196. package/utils/dynamic-content/__tests__/support-notice.test.ts +1 -4
  197. package/utils/dynamic-content/index.ts +1 -6
  198. package/utils/dynamic-content/new-release.ts +5 -3
  199. package/utils/dynamic-content/types.d.ts +0 -1
  200. package/utils/error.js +9 -0
  201. package/utils/fleet.ts +2 -2
  202. package/utils/inactivity.ts +2 -3
  203. package/utils/pagination-wrapper.ts +99 -15
  204. package/utils/validators/formRules/index.ts +3 -0
  205. package/utils/version.js +38 -0
  206. package/components/auth/AzureWarning.vue +0 -77
  207. /package/components/Resource/Detail/{Card/PodsCard/Bubble.vue → Bubble.vue} +0 -0
  208. /package/components/Resource/Detail/Card/{PodsCard → StatusCard}/composable.ts +0 -0
@@ -82,8 +82,8 @@ interface RcItemCardProps {
82
82
 
83
83
  /** Optional actions that will be displayed inside an action-menu
84
84
  *
85
- * Each action should include an `action` name, which is emitted as a custom event when selected.
86
- * To respond to the event, you must also register a matching event listener using the `@` syntax.
85
+ * Each action should include an `action` name, which is included in the payload
86
+ * of the 'action-invoked' event when the action is selected.
87
87
  *
88
88
  * Example:
89
89
  * <rc-item-card
@@ -94,8 +94,10 @@ interface RcItemCardProps {
94
94
  * enabled: true
95
95
  * }
96
96
  * ]"
97
- * @focusSearch="focusSearch"
97
+ * @action-invoked="handleActionInvoked"
98
98
  * />
99
+ *
100
+ * The handler receives a payload with { action: string, actionData: object, event: MouseEvent, ... }
99
101
  */
100
102
  actions?: DropdownOption[];
101
103
 
@@ -117,23 +119,9 @@ const props = defineProps<RcItemCardProps>();
117
119
  /**
118
120
  * Emits:
119
121
  * - 'card-click' when card is clicked or activated via keyboard.
120
- * - custom events defined in the `actions` prop, but only if the corresponding event listener is explicitly declared on the component.
122
+ * - 'action-invoked' when an action is selected from the action menu (only when `actions` prop is used).
121
123
  */
122
- const emit = defineEmits<{(e: 'card-click', value: ItemValue): void; (e: string, payload: unknown): void;}>();
123
-
124
- const actionListeners = computed(() => {
125
- if (!props.actions) return {};
126
-
127
- const listeners: Record<string, (payload: unknown) => void> = {};
128
-
129
- for (const a of props.actions) {
130
- if (a.action) {
131
- listeners[a.action] = (payload: unknown) => emit(a.action, payload);
132
- }
133
- }
134
-
135
- return listeners;
136
- });
124
+ const emit = defineEmits<{(e: 'card-click', value?: ItemValue): void; (e: 'action-invoked', payload: unknown): void;}>();
137
125
 
138
126
  /**
139
127
  * Handles the card click while avoiding nested interactive elements
@@ -171,9 +159,10 @@ const contentText = computed(() => labelText(props.content));
171
159
  const statusTooltips = computed(() => props.header.statuses?.map((status) => labelText(status.tooltip)) || []);
172
160
 
173
161
  const cardMeta = computed(() => ({
174
- ariaLabel: props.clickable ? t('itemCard.ariaLabel.clickable', { cardTitle: labelText(props.header.title) }) : undefined,
175
- tabIndex: props.clickable ? '0' : undefined,
176
- role: props.clickable ? 'button' : undefined
162
+ ariaLabel: props.clickable ? t('itemCard.ariaLabel.clickable', { cardTitle: labelText(props.header.title) }) : undefined,
163
+ tabIndex: props.clickable ? '0' : undefined,
164
+ role: props.clickable ? 'button' : undefined,
165
+ actionMenuLabel: props.actions && t('itemCard.actionMenu.label', { cardTitle: labelText(props.header.title) })
177
166
  }));
178
167
 
179
168
  </script>
@@ -281,8 +270,9 @@ const cardMeta = computed(() => ({
281
270
  <rc-item-card-action class="item-card-header-action-menu">
282
271
  <ActionMenu
283
272
  data-testid="item-card-header-action-menu"
273
+ :button-aria-label="cardMeta.actionMenuLabel"
284
274
  :custom-actions="actions"
285
- v-on="actionListeners"
275
+ @action-invoked="(payload) => emit('action-invoked', payload)"
286
276
  />
287
277
  </rc-item-card-action>
288
278
  </template>
@@ -1,5 +1,5 @@
1
1
 
2
- import { reactive } from 'vue';
2
+ import { ref } from 'vue';
3
3
  import { wrapIfVar, useStatusColors, Status } from './status';
4
4
 
5
5
  describe('utils: status', () => {
@@ -18,20 +18,22 @@ describe('utils: status', () => {
18
18
  });
19
19
 
20
20
  describe('useStatusColors', () => {
21
- it.each([
21
+ const statuses: Status[] = [
22
22
  'info',
23
23
  'success',
24
24
  'warning',
25
25
  'error',
26
26
  'unknown',
27
27
  'none'
28
- ])('solid: should return the correct colors for status: %p', (status: Status) => {
29
- const props = reactive({ status });
28
+ ];
29
+
30
+ it.each(statuses)('solid: should return the correct colors for status: %p', (status) => {
31
+ const statusRef = ref(status as Status);
30
32
  const {
31
33
  borderColor,
32
34
  backgroundColor,
33
35
  textColor
34
- } = useStatusColors(props, 'solid');
36
+ } = useStatusColors(statusRef, 'solid');
35
37
 
36
38
  expect(borderColor.value).toBe(`var(--rc-${ status })`);
37
39
  if (status !== 'none') {
@@ -41,20 +43,13 @@ describe('utils: status', () => {
41
43
  expect(textColor.value).toBe(`var(--rc-${ status }-secondary)`);
42
44
  });
43
45
 
44
- it.each([
45
- 'info',
46
- 'success',
47
- 'warning',
48
- 'error',
49
- 'unknown',
50
- 'none'
51
- ])('outlined: should return the correct colors for status: %p', (status: Status) => {
52
- const props = reactive({ status });
46
+ it.each(statuses)('outlined: should return the correct colors for status: %p', (status) => {
47
+ const statusRef = ref(status as Status);
53
48
  const {
54
49
  borderColor,
55
50
  backgroundColor,
56
51
  textColor
57
- } = useStatusColors(props, 'outlined');
52
+ } = useStatusColors(statusRef, 'outlined');
58
53
 
59
54
  expect(borderColor.value).toBe(`var(--rc-${ status }-secondary)`);
60
55
  if (status !== 'none') {
@@ -1,4 +1,4 @@
1
- import { computed } from 'vue';
1
+ import { computed, Ref } from 'vue';
2
2
 
3
3
  export const StatusDefinitions = {
4
4
  info: {
@@ -28,7 +28,6 @@ export const StatusDefinitions = {
28
28
  };
29
29
 
30
30
  export type Status = keyof typeof StatusDefinitions;
31
- export type StatusObject = { status: Status };
32
31
  export type Style = 'solid' | 'outlined';
33
32
 
34
33
  export function wrapIfVar(colorVar: string) {
@@ -38,13 +37,13 @@ export function wrapIfVar(colorVar: string) {
38
37
  /**
39
38
  * A composable to make it easier to use status colors in multiple components
40
39
  *
41
- * @param propsWithStatus The props which contain a `status: Status` property. Ideally I'd prefer to just pass status but doing so either forces the consumer to wrap the values in a Ref or this code is no longer reactive.
40
+ * @param status A Ref containing the status value
42
41
  * @param style {@link Style} Will the block of code being using the solid or outlined styling
43
42
  * @returns An object containing the relevant style colors
44
43
  */
45
- export function useStatusColors(propsWithStatus: StatusObject, style: Style) {
44
+ export function useStatusColors(status: Ref<Status>, style: Style) {
46
45
  const statusColors = computed(() => {
47
- return StatusDefinitions[propsWithStatus.status];
46
+ return StatusDefinitions[status.value];
48
47
  });
49
48
  const isOutlined = style === 'outlined';
50
49
 
@@ -55,7 +54,7 @@ export function useStatusColors(propsWithStatus: StatusObject, style: Style) {
55
54
  });
56
55
 
57
56
  const backgroundColor = computed(() => {
58
- if (propsWithStatus.status === 'none') {
57
+ if (status.value === 'none') {
59
58
  return 'none';
60
59
  }
61
60
  const colorVar = isOutlined ? statusColors.value.secondary : statusColors.value.primary;
@@ -10,7 +10,11 @@ import { createStore } from 'vuex';
10
10
  describe('action: redirectTo', () => {
11
11
  it('should include query parameters from redirect', async() => {
12
12
  jest.spyOn(window, 'window', 'get');
13
- const store = { dispatch: jest.fn() };
13
+ const store = {
14
+ dispatch: jest.fn((x) => {
15
+ if (x === 'getAuthProvider') return { scopes: '' };
16
+ })
17
+ };
14
18
  const clientId = '123';
15
19
  const uri = 'anyURI';
16
20
  const scope = 'anything';
@@ -27,10 +31,14 @@ describe('action: redirectTo', () => {
27
31
  });
28
32
 
29
33
  it.each([
30
- ['genericoidc', '://myhost/?redirect_uri=anyURI&scope=openid%20profile%20email&state=undefined'],
34
+ ['genericoidc', '://myhost/?redirect_uri=anyURI&scope=openid%20profile%20email%20groups&state=undefined'],
31
35
  ])('given provider %p should return URL %p', async(provider, expectation) => {
32
36
  jest.spyOn(window, 'window', 'get');
33
- const store = { dispatch: jest.fn() };
37
+ const store = {
38
+ dispatch: jest.fn((x) => {
39
+ if (x === 'getAuthProvider') return { scopes: 'groups' };
40
+ })
41
+ };
34
42
  const uri = 'anyURI'; // This field is added anyway, so we set a random value
35
43
  const options = {
36
44
  provider,
@@ -61,7 +69,11 @@ describe('action: redirectTo', () => {
61
69
  test: true,
62
70
  redirect: false
63
71
  };
64
- const store = { dispatch: jest.fn() };
72
+ const store = {
73
+ dispatch: jest.fn((x) => {
74
+ if (x === 'getAuthProvider') return { scopes: '' };
75
+ })
76
+ };
65
77
 
66
78
  jest.spyOn(window, 'window', 'get');
67
79
  const url = await actions.redirectTo(store as any, options);
@@ -79,7 +91,11 @@ describe('action: redirectTo', () => {
79
91
  test: true,
80
92
  redirect: false
81
93
  };
82
- const store = { dispatch: jest.fn() };
94
+ const store = {
95
+ dispatch: jest.fn((x) => {
96
+ if (x === 'getAuthProvider') return { scopes: 'openid' };
97
+ })
98
+ };
83
99
 
84
100
  jest.spyOn(window, 'window', 'get');
85
101
  const url = await actions.redirectTo(store as any, options);
package/store/auth.js CHANGED
@@ -228,12 +228,11 @@ export const actions = {
228
228
 
229
229
  async redirectTo({ state, commit, dispatch }, opt = {}) {
230
230
  const provider = opt.provider;
231
+ const driver = await dispatch('getAuthProvider', provider);
231
232
  let redirectUrl = opt.redirectUrl;
232
233
 
233
234
  if ( !redirectUrl ) {
234
- const driver = await dispatch('getAuthProvider', provider);
235
-
236
- redirectUrl = driver.redirectUrl;
235
+ redirectUrl = driver?.redirectUrl;
237
236
  }
238
237
  let returnToUrl = `${ window.location.origin }/verify-auth`;
239
238
 
@@ -266,6 +265,10 @@ export const actions = {
266
265
  scopes = [joinStringList(scopes[0], opt.scopes)];
267
266
  }
268
267
 
268
+ if (driver?.scopes) {
269
+ scopes = [joinStringList(scopes[0], driver.scopes)];
270
+ }
271
+
269
272
  let url = removeParam(redirectUrl, GITHUB_SCOPE);
270
273
 
271
274
  // TODO: #13457 - Verify use case of scopesJoinChar anywhere outside this repository
package/store/aws.js CHANGED
@@ -2,6 +2,7 @@ import { sortBy } from '@shell/utils/sort';
2
2
  import { randomStr } from '@shell/utils/string';
3
3
  import { FetchHttpHandler } from '@smithy/fetch-http-handler';
4
4
  import { isArray, addObjects } from '@shell/utils/array';
5
+ import { formatAWSError } from '@shell/utils/error';
5
6
 
6
7
  export const state = () => {
7
8
  return {
@@ -247,21 +248,26 @@ export const actions = {
247
248
  opt = opt || {};
248
249
 
249
250
  while ( hasNext ) {
250
- const res = await client[cmd](opt);
251
+ try {
252
+ const res = await client[cmd](opt);
251
253
 
252
- if ( !key ) {
253
- key = Object.keys(res).find((x) => isArray(res[x]));
254
- }
254
+ if ( !key ) {
255
+ key = Object.keys(res).find((x) => isArray(res[x]));
256
+ }
255
257
 
256
- addObjects(out, res[key]);
257
- if (res.NextToken) {
258
- opt.NextToken = res.NextToken;
259
- hasNext = true;
260
- } else if (res.Marker) {
261
- opt.Marker = res.Marker;
262
- hasNext = true;
263
- } else {
258
+ addObjects(out, res[key]);
259
+ if (res.NextToken) {
260
+ opt.NextToken = res.NextToken;
261
+ hasNext = true;
262
+ } else if (res.Marker) {
263
+ opt.Marker = res.Marker;
264
+ hasNext = true;
265
+ } else {
266
+ hasNext = false;
267
+ }
268
+ } catch (err) {
264
269
  hasNext = false;
270
+ throw formatAWSError(err);
265
271
  }
266
272
  }
267
273
 
package/store/index.js CHANGED
@@ -36,7 +36,8 @@ import { sortBy } from '@shell/utils/sort';
36
36
  import { addParam } from '@shell/utils/url';
37
37
  import semver from 'semver';
38
38
  import { STORE, BLANK_CLUSTER } from '@shell/store/store-types';
39
- import { isDevBuild } from '@shell/utils/version';
39
+ import { getReleaseNotesURL } from '@shell/utils/version';
40
+ import { getVersionData } from '@shell/config/version';
40
41
  import { markRaw } from 'vue';
41
42
  import paginationUtils from '@shell/utils/pagination-utils';
42
43
  import { addReleaseNotesNotification } from '@shell/utils/release-notes';
@@ -628,14 +629,9 @@ export const getters = {
628
629
 
629
630
  releaseNotesUrl(state, getters) {
630
631
  const version = getters['management/byId'](MANAGEMENT.SETTING, SETTING.VERSION_RANCHER)?.value;
632
+ const isPrime = getVersionData().RancherPrime === 'true';
631
633
 
632
- const base = 'https://github.com/rancher/rancher/releases';
633
-
634
- if (version && !isDevBuild(version)) {
635
- return `${ base }/tag/${ version }`;
636
- }
637
-
638
- return `${ base }/latest`;
634
+ return getReleaseNotesURL(isPrime, version);
639
635
  },
640
636
 
641
637
  ...gcGetters
@@ -142,7 +142,7 @@ export function headerFromSchemaColString(colName: string, schema: Schema, rootG
142
142
  export function headerFromSchemaCol(col: SchemaAttributeColumn, rootGetters: VuexStoreGetters, pagination: boolean, ageColumn: TableColumn): TableColumn {
143
143
  let formatter, width, formatterOpts;
144
144
 
145
- if ( (col.format === '' || col.format === 'date') && col.name === 'Age' && ageColumn ) {
145
+ if ( (col.format === '' || col.format === 'date' || col.type === 'date') && col.name.toLowerCase() === 'age' && ageColumn ) {
146
146
  return ageColumn;
147
147
  }
148
148
 
@@ -25,11 +25,37 @@ export interface KubeLabelSelector {
25
25
  * https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#objectmeta-v1-meta
26
26
  */
27
27
  export interface KubeMetadata {
28
+ namespace?: string,
29
+ name: string
30
+
28
31
  labels?: { [key: string]: string },
29
32
  annotations?: { [key: string]: string },
30
33
  }
31
34
 
32
- export interface RancherKubeMetadata extends KubeMetadata {
33
- namespace?: string,
34
- name: string
35
+ /**
36
+ * Kube API JSON response for LIST requests
37
+ */
38
+ export interface KubeListResponse<T = any> {
39
+ kind: string,
40
+ apiVersion: string,
41
+
42
+ items: T[],
43
+
44
+ // Bucket for everything else (hopefully to remove once above populated)
45
+ [key: string]: any
46
+ }
47
+
48
+ /**
49
+ * Kube API JSON response for GET requests
50
+ */
51
+ export interface KubeGetResponse {
52
+ kind: string,
53
+ apiVersion: string,
54
+
55
+ metadata: KubeMetadata,
56
+ spec: any,
57
+ status: any,
58
+
59
+ // Bucket for everything else (hopefully to remove once above populated)
60
+ [key: string]: any
35
61
  }
@@ -0,0 +1,40 @@
1
+ import { KubeGetResponse, KubeMetadata } from '@shell/types/kube/kube-api';
2
+
3
+ /**
4
+ * Collection of string based values used by the Steve API response's `code` field
5
+ */
6
+ export const STEVE_RESPONSE_CODE = {
7
+ /**
8
+ * When the query param `revision` is sent and it's not in the vai cache then return this error
9
+ */
10
+ UNKNOWN_REVISION: 'unknown revision'
11
+ };
12
+
13
+ /**
14
+ * Steve API JSON response for LIST requests
15
+ */
16
+ export interface SteveListResponse<T = any> {
17
+ actions: any,
18
+ count: number,
19
+ data: T[],
20
+ links: any,
21
+ resourceType: string,
22
+ revision: string,
23
+ type: string,
24
+
25
+ // Bucket for everything else (hopefully to remove once above populated)
26
+ [key: string]: any
27
+ }
28
+
29
+ /**
30
+ * Steve API JSON response for GET requests
31
+ */
32
+ export interface SteveGetResponse extends KubeGetResponse {
33
+ // Rancher specific properties (there are more)
34
+ id: string,
35
+
36
+ // Bucket for everything else (hopefully to remove once above populated)
37
+ [key: string]: any
38
+ }
39
+
40
+ export type RancherKubeMetadata = KubeMetadata