@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.
- package/assets/styles/base/_color.scss +1 -0
- package/assets/styles/base/_typography.scss +14 -5
- package/assets/styles/themes/_light.scss +1 -1
- package/assets/styles/themes/_modern.scss +1 -1
- package/assets/translations/en-us.yaml +104 -33
- package/assets/translations/zh-hans.yaml +13 -2
- package/components/ActionMenu.vue +7 -8
- package/components/ActionMenuShell.vue +23 -24
- package/components/CodeMirror.vue +4 -3
- package/components/DetailText.vue +54 -7
- package/components/Drawer/Chrome.vue +11 -4
- package/components/Drawer/DrawerCard.vue +19 -0
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +3 -11
- package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +2 -2
- package/components/Drawer/ResourceDetailDrawer/index.vue +3 -20
- package/components/Drawer/types.ts +1 -0
- package/components/DynamicContent/DynamicContentCloseButton.vue +2 -2
- package/components/LocaleSelector.vue +1 -1
- package/components/Markdown.vue +1 -1
- package/components/PopoverCard.vue +3 -3
- package/components/Resource/Detail/Card/ExtrasCard.vue +39 -0
- package/components/Resource/Detail/Card/Scaler.vue +10 -2
- package/components/Resource/Detail/Card/StateCard/__tests__/composables.test.ts +142 -0
- package/components/Resource/Detail/Card/StateCard/composables.ts +41 -11
- package/components/Resource/Detail/Card/StateCard/index.vue +3 -9
- package/components/Resource/Detail/Card/StateCard/types.ts +6 -0
- package/components/Resource/Detail/Card/{PodsCard → StatusCard}/index.vue +14 -10
- package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +24 -25
- package/components/Resource/Detail/Cards.vue +27 -0
- package/components/Resource/Detail/Masthead/__tests__/index.test.ts +70 -0
- package/components/Resource/Detail/Masthead/index.vue +5 -0
- package/components/Resource/Detail/Metadata/KeyValueRow.vue +4 -2
- package/components/Resource/Detail/ResourcePopover/ResourcePopoverCard.vue +2 -2
- package/components/Resource/Detail/ResourceRow.types.ts +14 -0
- package/components/Resource/Detail/ResourceRow.vue +23 -35
- package/components/Resource/Detail/StatusRow.vue +5 -2
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +38 -7
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +106 -2
- package/components/Resource/Detail/TitleBar/composables.ts +2 -1
- package/components/Resource/Detail/TitleBar/index.vue +41 -6
- package/components/ResourceDetail/Masthead/__tests__/index.test.ts +49 -1
- package/components/ResourceDetail/Masthead/__tests__/latest.test.ts +85 -0
- package/components/ResourceDetail/Masthead/index.vue +1 -0
- package/components/ResourceDetail/Masthead/latest.vue +8 -1
- package/components/ResourceDetail/Masthead/legacy.vue +1 -1
- package/components/ResourceTable.vue +1 -1
- package/components/Setting.vue +1 -1
- package/components/SortableTable/index.vue +25 -0
- package/components/SortableTable/selection.js +25 -12
- package/components/SortableTable/sorting.js +1 -1
- package/components/Tabbed/Tab.vue +5 -0
- package/components/Tabbed/index.vue +40 -9
- package/components/Window/ContainerShell.vue +10 -13
- package/components/__tests__/ProjectRow.test.ts +102 -15
- package/components/fleet/FleetClusterTargets/TargetsList.vue +47 -29
- package/components/fleet/FleetClusterTargets/index.vue +82 -29
- package/components/fleet/FleetClusters.vue +26 -12
- package/components/fleet/FleetGitRepoPaths.vue +2 -2
- package/components/fleet/FleetResources.vue +14 -0
- package/components/fleet/FleetValuesFrom.vue +2 -2
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +531 -0
- package/components/fleet/__tests__/FleetClusters.test.ts +576 -0
- package/components/fleet/dashboard/ResourceDetails.vue +96 -123
- package/components/form/Conditions.vue +1 -15
- package/components/form/HookOption.vue +5 -0
- package/components/form/LabeledSelect.vue +1 -1
- package/components/form/LifecycleHooks.vue +2 -6
- package/components/form/ResourceLabeledSelect.vue +12 -1
- package/components/form/ResourceQuota/Project.vue +59 -8
- package/components/form/ResourceQuota/ProjectRow.vue +116 -21
- package/components/form/ResourceQuota/shared.js +42 -18
- package/components/form/SeccompProfile.vue +113 -0
- package/components/form/Security.vue +244 -133
- package/components/form/__tests__/LabeledSelect.test.ts +1 -1
- package/components/form/__tests__/SeccompProfile.test.js +124 -0
- package/components/form/__tests__/Security.test.ts +125 -37
- package/components/formatter/Autoscaler.vue +2 -2
- package/components/formatter/FleetSummaryGraph.vue +4 -1
- package/components/formatter/LinkName.vue +3 -2
- package/components/nav/Group.vue +5 -0
- package/components/nav/Header.vue +3 -3
- package/components/nav/HeaderPageActionMenu.vue +1 -1
- package/components/nav/NamespaceFilter.vue +6 -6
- package/components/nav/NotificationCenter/index.vue +1 -1
- package/components/nav/TopLevelMenu.helper.ts +41 -16
- package/components/nav/TopLevelMenu.vue +45 -25
- package/components/nav/WorkspaceSwitcher.vue +1 -1
- package/components/nav/__tests__/TopLevelMenu.helper.test.ts +277 -0
- package/components/nav/__tests__/TopLevelMenu.test.ts +160 -4
- package/components/templates/default.vue +0 -3
- package/components/templates/home.vue +0 -3
- package/components/templates/plain.vue +0 -3
- package/composables/useClickOutside.ts +1 -1
- package/config/product/explorer.js +2 -3
- package/config/table-headers.js +9 -7
- package/config/types.js +45 -9
- package/detail/__tests__/workload.test.ts +8 -16
- package/detail/catalog.cattle.io.app.vue +5 -0
- package/detail/fleet.cattle.io.cluster.vue +6 -0
- package/detail/management.cattle.io.oidcclient.vue +15 -4
- package/detail/workload/index.vue +7 -109
- package/edit/__tests__/management.cattle.io.project.test.js +137 -0
- package/edit/__tests__/projectsecret.test.ts +42 -0
- package/edit/auth/__tests__/oidc.test.ts +50 -0
- package/edit/auth/oidc.vue +68 -44
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +140 -59
- package/edit/autoscaling.horizontalpodautoscaler/metrics-row.vue +41 -5
- package/edit/management.cattle.io.project.vue +36 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +16 -3
- package/edit/projectsecret.vue +29 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +89 -200
- package/edit/provisioning.cattle.io.cluster/__tests__/Networking.test.ts +58 -17
- package/edit/provisioning.cattle.io.cluster/rke2.vue +11 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +3 -63
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +82 -14
- package/edit/workload/__tests__/index.test.ts +3 -4
- package/edit/workload/index.vue +47 -28
- package/edit/workload/mixins/workload.js +66 -31
- package/initialize/install-plugins.js +0 -2
- package/list/catalog.cattle.io.clusterrepo.vue +1 -1
- package/list/projectsecret.vue +2 -2
- package/machine-config/__tests__/vmwarevsphere.test.ts +64 -0
- package/machine-config/amazonec2.vue +2 -2
- package/machine-config/vmwarevsphere.vue +58 -4
- package/mixins/__tests__/chart.test.ts +63 -0
- package/mixins/chart.js +56 -51
- package/models/__tests__/catalog.cattle.io.app.test.ts +33 -0
- package/models/__tests__/workload.test.ts +333 -0
- package/models/catalog.cattle.io.app.js +8 -0
- package/models/management.cattle.io.cluster.js +22 -30
- package/models/pod.js +14 -0
- package/models/provisioning.cattle.io.cluster.js +2 -2
- package/models/secret.js +1 -1
- package/models/workload.js +93 -27
- package/package.json +4 -4
- package/pages/__tests__/diagnostic.test.ts +71 -0
- package/pages/c/_cluster/apps/charts/__tests__/install.test.ts +91 -0
- package/pages/c/_cluster/apps/charts/install.vue +4 -4
- package/pages/c/_cluster/explorer/EventsTable.vue +2 -2
- package/pages/c/_cluster/explorer/tools/index.vue +23 -5
- package/pages/c/_cluster/fleet/index.vue +14 -8
- package/pages/c/_cluster/manager/hostedprovider/index.vue +1 -19
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +18 -5
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
- package/pages/c/_cluster/uiplugins/index.vue +41 -9
- package/pages/diagnostic.vue +17 -3
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +234 -0
- package/plugins/dashboard-store/actions.js +9 -8
- package/plugins/dashboard-store/resource-class.js +97 -1
- package/plugins/steve/__tests__/revision.test.ts +84 -0
- package/plugins/steve/__tests__/steve-pagination-utils.test.ts +30 -0
- package/plugins/steve/__tests__/subscribe.spec.ts +134 -0
- package/plugins/steve/revision.ts +26 -0
- package/plugins/steve/steve-pagination-utils.ts +6 -5
- package/plugins/steve/subscribe.js +188 -49
- package/plugins/subscribe-events.ts +2 -2
- package/rancher-components/Form/Checkbox/Checkbox.vue +13 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -1
- package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.vue +2 -1
- package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +3 -1
- package/rancher-components/Pill/RcStatusIndicator/RcStatusIndicator.vue +3 -1
- package/rancher-components/Pill/RcTag/RcTag.vue +1 -1
- package/rancher-components/Pill/index.ts +4 -0
- package/rancher-components/RcButton/RcButton.test.ts +53 -9
- package/rancher-components/RcButton/RcButton.vue +217 -25
- package/rancher-components/RcButton/types.ts +27 -1
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +4 -4
- package/rancher-components/RcDropdown/types.ts +3 -3
- package/rancher-components/RcIcon/RcIcon.test.ts +42 -0
- package/rancher-components/RcIcon/RcIcon.vue +9 -6
- package/rancher-components/RcIcon/types.ts +13 -9
- package/rancher-components/RcItemCard/RcItemCard.test.ts +16 -6
- package/rancher-components/RcItemCard/RcItemCard.vue +13 -23
- package/rancher-components/utils/status.test.ts +10 -15
- package/rancher-components/utils/status.ts +5 -6
- package/store/__tests__/auth.test.ts +21 -5
- package/store/auth.js +6 -3
- package/store/aws.js +18 -12
- package/store/index.js +4 -8
- package/store/type-map.utils.ts +1 -1
- package/types/kube/kube-api.ts +29 -3
- package/types/rancher/steve.api.ts +40 -0
- package/types/shell/index.d.ts +262 -156
- package/types/store/pagination.types.ts +1 -0
- package/types/store/subscribe-events.types.ts +1 -0
- package/utils/__tests__/azure.test.ts +56 -0
- package/utils/__tests__/back-off.test.ts +364 -245
- package/utils/__tests__/error.test.ts +44 -0
- package/utils/__tests__/fleet.test.ts +8 -1
- package/utils/__tests__/pagination-wrapper.test.ts +167 -0
- package/utils/__tests__/version.test.ts +55 -1
- package/utils/azure.js +12 -0
- package/utils/back-off.ts +302 -69
- package/utils/dynamic-content/__tests__/index.test.ts +1 -1
- package/utils/dynamic-content/__tests__/new-release.test.ts +48 -7
- package/utils/dynamic-content/__tests__/support-notice.test.ts +1 -4
- package/utils/dynamic-content/index.ts +1 -6
- package/utils/dynamic-content/new-release.ts +5 -3
- package/utils/dynamic-content/types.d.ts +0 -1
- package/utils/error.js +9 -0
- package/utils/fleet.ts +2 -2
- package/utils/inactivity.ts +2 -3
- package/utils/pagination-wrapper.ts +99 -15
- package/utils/validators/formRules/index.ts +3 -0
- package/utils/version.js +38 -0
- package/components/auth/AzureWarning.vue +0 -77
- /package/components/Resource/Detail/{Card/PodsCard/Bubble.vue → Bubble.vue} +0 -0
- /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
|
|
86
|
-
*
|
|
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
|
-
* @
|
|
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
|
-
* -
|
|
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
|
|
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:
|
|
175
|
-
tabIndex:
|
|
176
|
-
role:
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
21
|
+
const statuses: Status[] = [
|
|
22
22
|
'info',
|
|
23
23
|
'success',
|
|
24
24
|
'warning',
|
|
25
25
|
'error',
|
|
26
26
|
'unknown',
|
|
27
27
|
'none'
|
|
28
|
-
]
|
|
29
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
|
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(
|
|
44
|
+
export function useStatusColors(status: Ref<Status>, style: Style) {
|
|
46
45
|
const statusColors = computed(() => {
|
|
47
|
-
return StatusDefinitions[
|
|
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 (
|
|
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 = {
|
|
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 = {
|
|
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 = {
|
|
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 = {
|
|
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
|
-
|
|
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
|
-
|
|
251
|
+
try {
|
|
252
|
+
const res = await client[cmd](opt);
|
|
251
253
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
if ( !key ) {
|
|
255
|
+
key = Object.keys(res).find((x) => isArray(res[x]));
|
|
256
|
+
}
|
|
255
257
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
package/store/type-map.utils.ts
CHANGED
|
@@ -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 === '
|
|
145
|
+
if ( (col.format === '' || col.format === 'date' || col.type === 'date') && col.name.toLowerCase() === 'age' && ageColumn ) {
|
|
146
146
|
return ageColumn;
|
|
147
147
|
}
|
|
148
148
|
|
package/types/kube/kube-api.ts
CHANGED
|
@@ -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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|