@rancher/shell 3.0.7 → 3.0.8-rc.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 (123) hide show
  1. package/assets/images/vendor/githubapp.svg +13 -0
  2. package/assets/styles/base/_typography.scss +1 -1
  3. package/assets/styles/global/_layout.scss +21 -35
  4. package/assets/styles/themes/_modern.scss +5 -5
  5. package/assets/translations/en-us.yaml +102 -17
  6. package/assets/translations/zh-hans.yaml +0 -4
  7. package/components/EmberPage.vue +1 -1
  8. package/components/Inactivity.vue +222 -106
  9. package/components/InstallHelmCharts.vue +2 -2
  10. package/components/Resource/Detail/CopyToClipboard.vue +1 -1
  11. package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +0 -2
  12. package/components/Resource/Detail/TitleBar/index.vue +10 -6
  13. package/components/ResourceDetail/index.vue +4 -1
  14. package/components/SortableTable/index.vue +18 -2
  15. package/components/{nav/WindowManager → Window}/ContainerLogs.vue +1 -1
  16. package/components/{nav/WindowManager → Window}/ContainerLogsActions.vue +1 -0
  17. package/components/{nav/WindowManager → Window}/__tests__/ContainerLogs.test.ts +1 -1
  18. package/components/{nav/WindowManager → Window}/__tests__/ContainerShell.test.ts +2 -2
  19. package/components/fleet/FleetConfigMapSelector.vue +117 -0
  20. package/components/fleet/FleetSecretSelector.vue +127 -0
  21. package/components/fleet/__tests__/FleetConfigMapSelector.test.ts +125 -0
  22. package/components/fleet/__tests__/FleetSecretSelector.test.ts +82 -0
  23. package/components/form/FileImageSelector.vue +13 -4
  24. package/components/form/FileSelector.vue +11 -2
  25. package/components/form/ResourceLabeledSelect.vue +1 -0
  26. package/components/form/__tests__/ResourceLabeledSelect.test.ts +90 -0
  27. package/components/nav/Header.vue +34 -13
  28. package/components/{DraggableZone.vue → nav/WindowManager/PinArea.vue} +47 -80
  29. package/components/nav/WindowManager/composables/useComponentsMount.ts +70 -0
  30. package/components/nav/WindowManager/composables/useDimensionsHandler.ts +105 -0
  31. package/components/nav/WindowManager/composables/useDragHandler.ts +99 -0
  32. package/components/nav/WindowManager/composables/usePanelHandler.ts +72 -0
  33. package/components/nav/WindowManager/composables/usePanelsHandler.ts +14 -0
  34. package/components/nav/WindowManager/composables/useResizeHandler.ts +167 -0
  35. package/components/nav/WindowManager/composables/useTabsHandler.ts +51 -0
  36. package/components/nav/WindowManager/constants.ts +23 -0
  37. package/components/nav/WindowManager/index.vue +61 -575
  38. package/components/nav/WindowManager/panels/HorizontalPanel.vue +265 -0
  39. package/components/nav/WindowManager/panels/TabBodyContainer.vue +39 -0
  40. package/components/nav/WindowManager/panels/VerticalPanel.vue +308 -0
  41. package/components/templates/default.vue +4 -40
  42. package/components/templates/home.vue +31 -5
  43. package/config/product/auth.js +1 -0
  44. package/config/query-params.js +1 -0
  45. package/config/settings.ts +8 -1
  46. package/config/store.js +4 -2
  47. package/config/types.js +2 -0
  48. package/detail/pod.vue +1 -0
  49. package/dialog/AddonConfigConfirmationDialog.vue +45 -1
  50. package/directives/ui-context.ts +97 -0
  51. package/edit/__tests__/fleet.cattle.io.helmop.test.ts +52 -11
  52. package/edit/auth/AuthProviderWarningBanners.vue +14 -1
  53. package/edit/auth/github-app-steps.vue +97 -0
  54. package/edit/auth/github-steps.vue +75 -0
  55. package/edit/auth/github.vue +94 -65
  56. package/edit/fleet.cattle.io.helmop.vue +51 -2
  57. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +15 -5
  58. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +11 -9
  59. package/edit/provisioning.cattle.io.cluster/rke2.vue +56 -9
  60. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +28 -2
  61. package/initialize/install-directives.js +2 -0
  62. package/list/projectsecret.vue +1 -1
  63. package/machine-config/azure.vue +1 -1
  64. package/mixins/chart.js +1 -1
  65. package/models/__tests__/chart.test.ts +17 -9
  66. package/models/__tests__/compliance.cattle.io.clusterscanprofile.spec.js +30 -0
  67. package/models/catalog.cattle.io.app.js +1 -1
  68. package/models/chart.js +3 -1
  69. package/models/compliance.cattle.io.clusterscanprofile.js +1 -1
  70. package/models/management.cattle.io.authconfig.js +1 -0
  71. package/package.json +2 -2
  72. package/pages/auth/login.vue +5 -2
  73. package/pages/auth/verify.vue +1 -1
  74. package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +3 -2
  75. package/pages/c/_cluster/apps/charts/chart.vue +2 -2
  76. package/pages/c/_cluster/explorer/EventsTable.vue +89 -3
  77. package/pages/c/_cluster/explorer/tools/index.vue +3 -3
  78. package/pages/c/_cluster/settings/performance.vue +12 -25
  79. package/pages/home.vue +313 -12
  80. package/plugins/axios.js +2 -1
  81. package/plugins/dashboard-store/actions.js +1 -1
  82. package/plugins/dashboard-store/resource-class.js +17 -2
  83. package/plugins/steve/steve-pagination-utils.ts +2 -2
  84. package/rancher-components/RcDropdown/RcDropdownItemSelect.vue +5 -1
  85. package/scripts/extension/publish +1 -1
  86. package/store/auth.js +8 -3
  87. package/store/aws.js +8 -6
  88. package/store/features.js +1 -0
  89. package/store/index.js +9 -3
  90. package/store/prefs.js +6 -0
  91. package/store/ui-context.ts +86 -0
  92. package/store/wm.ts +244 -0
  93. package/types/kube/kube-api.ts +2 -1
  94. package/types/rancher/index.d.ts +1 -0
  95. package/types/resources/settings.d.ts +29 -7
  96. package/types/shell/index.d.ts +59 -0
  97. package/types/window-manager.ts +22 -0
  98. package/utils/__tests__/cluster.test.ts +379 -1
  99. package/utils/cluster.js +157 -3
  100. package/utils/dynamic-content/__tests__/config.test.ts +187 -0
  101. package/utils/dynamic-content/__tests__/index.test.ts +390 -0
  102. package/utils/dynamic-content/__tests__/info.test.ts +263 -0
  103. package/utils/dynamic-content/__tests__/new-release.test.ts +216 -0
  104. package/utils/dynamic-content/__tests__/support-notice.test.ts +262 -0
  105. package/utils/dynamic-content/__tests__/util.test.ts +235 -0
  106. package/utils/dynamic-content/config.ts +55 -0
  107. package/utils/dynamic-content/index.ts +273 -0
  108. package/utils/dynamic-content/info.ts +219 -0
  109. package/utils/dynamic-content/new-release.ts +126 -0
  110. package/utils/dynamic-content/support-notice.ts +169 -0
  111. package/utils/dynamic-content/types.d.ts +101 -0
  112. package/utils/dynamic-content/util.ts +122 -0
  113. package/utils/dynamic-importer.js +2 -2
  114. package/utils/inactivity.ts +104 -0
  115. package/utils/pagination-utils.ts +19 -4
  116. package/utils/release-notes.ts +1 -1
  117. package/assets/images/icons/document.svg +0 -3
  118. package/store/wm.js +0 -95
  119. /package/components/{nav/WindowManager → Window}/ChartReadme.vue +0 -0
  120. /package/components/{nav/WindowManager → Window}/ContainerShell.vue +0 -0
  121. /package/components/{nav/WindowManager → Window}/KubectlShell.vue +0 -0
  122. /package/components/{nav/WindowManager → Window}/MachineSsh.vue +0 -0
  123. /package/components/{nav/WindowManager → Window}/Window.vue +0 -0
@@ -0,0 +1,86 @@
1
+ interface Context {
2
+ tag: string;
3
+ value: any;
4
+ hookId?: string;
5
+ description?: string;
6
+ icon?: string;
7
+ }
8
+
9
+ interface Element {
10
+ id: number;
11
+ context: Context
12
+ }
13
+
14
+ interface State {
15
+ idCounter: number;
16
+ elements: Record<string, Element>;
17
+ }
18
+
19
+ export const state = function(): State {
20
+ return {
21
+ idCounter: 0,
22
+ elements: {}
23
+ };
24
+ };
25
+
26
+ export const getters = {
27
+ all: (state: State) => {
28
+ return Object.values(state.elements)
29
+ .map((e) => e.context)
30
+ .sort((a, b) => (a.tag || '').localeCompare(b.tag || '') || 0);
31
+ },
32
+ };
33
+
34
+ export const mutations = {
35
+ add(state: State, element: Element) {
36
+ state.elements[element.id] = element;
37
+ },
38
+
39
+ update(state: State, element: Element) {
40
+ const existingElement = state.elements[element.id];
41
+
42
+ if (existingElement) {
43
+ existingElement.context = element.context;
44
+ }
45
+ },
46
+
47
+ remove(state: State, element: Element) {
48
+ delete state.elements[element.id];
49
+ }
50
+ };
51
+
52
+ let id = null;
53
+
54
+ export const actions = {
55
+ add({ commit, state }: { commit: Function, state: State }, context: Context) {
56
+ if (context?.value === undefined || !context?.tag) {
57
+ throw new Error(`[ui-context] context {{${ JSON.stringify(context) }}} is not valid`);
58
+ }
59
+
60
+ id = `ctx-${ state.idCounter++ }`;
61
+
62
+ commit('add', { id, context });
63
+
64
+ return id;
65
+ },
66
+
67
+ update({ commit, state }: { commit: Function, state: State }, element: Element) {
68
+ const old = state.elements[element.id];
69
+
70
+ if (!old) {
71
+ throw new Error(`[ui-context] element with id {{${ element.id }}} not found`);
72
+ }
73
+
74
+ commit('update', element);
75
+ },
76
+
77
+ remove({ commit, state }: { commit: Function, state: State }, id: number) {
78
+ const element = state.elements[id];
79
+
80
+ if (!element) {
81
+ throw new Error(`[ui-context] element with id {{${ id }}} not found`);
82
+ }
83
+
84
+ commit('remove', element);
85
+ }
86
+ };
package/store/wm.ts ADDED
@@ -0,0 +1,244 @@
1
+ import { STORAGE_KEY } from '@shell/components/nav/WindowManager/constants';
2
+ import { Layout, Position, Tab } from '@shell/types/window-manager';
3
+ import { addObject, removeObject } from '@shell/utils/array';
4
+ import { BOTTOM, LEFT, RIGHT } from '@shell/utils/position';
5
+
6
+ /**
7
+ * This module defines the Vuex store for the window manager, managing tabs, their positions,
8
+ * active states, panel dimensions, and user preferences.
9
+ *
10
+ * The store can be used to add, switch, and close tabs, as well as manage panel dimensions and locked positions.
11
+ * The store can be accessed also by Rancher extensions to integrate to handle the window manager.
12
+ */
13
+ export interface State {
14
+ tabs: Array<Tab>;
15
+ active: Record<Position | string, string>;
16
+ open: Record<Position | string, boolean>;
17
+ panelHeight: Record<Position | string, number | null>;
18
+ panelWidth: Record<Position | string, number | null>;
19
+ userPin: Position | string | null;
20
+ lockedPositions: Position[];
21
+ }
22
+
23
+ function moveTabByReference(tabs: Tab[], fromPosition: Position | undefined, toPosition: Position, tabId: string) {
24
+ const idx = tabs.findIndex((t) => t.id === tabId && t.position === fromPosition);
25
+
26
+ if (idx === -1) return;
27
+ const [tab] = tabs.splice(idx, 1);
28
+
29
+ tab.position = toPosition;
30
+
31
+ tabs.push(tab);
32
+ }
33
+
34
+ export const state = function() {
35
+ return {
36
+ tabs: [],
37
+ active: {},
38
+ open: {},
39
+ panelHeight: { [BOTTOM]: window.localStorage.getItem(STORAGE_KEY[BOTTOM]) },
40
+ panelWidth: {
41
+ [LEFT]: window.localStorage.getItem(STORAGE_KEY[LEFT]),
42
+ [RIGHT]: window.localStorage.getItem(STORAGE_KEY[RIGHT]),
43
+ },
44
+ userPin: null,
45
+ lockedPositions: [],
46
+ };
47
+ };
48
+
49
+ export const getters = {
50
+ byId: (state: State) => (id: string) => state.tabs.find((x) => x.id === id),
51
+ tabs: (state: State) => state.tabs,
52
+ isOpen: (state: State) => (position: string) => state.open[position],
53
+ panelWidth: (state: State) => state.panelWidth,
54
+ panelHeight: (state: State) => state.panelHeight,
55
+ userPin: (state: State) => state.userPin,
56
+ lockedPositions: (state: State) => state.lockedPositions,
57
+ };
58
+
59
+ export const mutations = {
60
+ /**
61
+ * Adds a new tab to the window manager.
62
+ *
63
+ * Usage:
64
+ *
65
+ * store.dispatch('wm/open', {
66
+ * id: PRODUCT_NAME,
67
+ * extensionId: PRODUCT_NAME,
68
+ * label: 'Label',
69
+ * component: 'LabelComponent',
70
+ * position: 'bottom',
71
+ * layouts: [
72
+ * Layout.default,
73
+ * Layout.home
74
+ * ],
75
+ * showHeader: false,
76
+ * }, { root: true });
77
+ *
78
+ * This will add a new tab with the specified properties to the window manager and set it as active.
79
+ */
80
+ addTab(state: State, tab: Tab) {
81
+ const existing = state.tabs.find((x) => x.id === tab.id);
82
+
83
+ if (!existing) {
84
+ if (tab.position === undefined) {
85
+ tab.position = (window.localStorage.getItem(STORAGE_KEY['pin']) || BOTTOM) as Position;
86
+ }
87
+
88
+ if (state.lockedPositions.includes(BOTTOM)) {
89
+ tab.position = BOTTOM;
90
+ }
91
+
92
+ if (tab.layouts === undefined) {
93
+ tab.layouts = [Layout.default];
94
+ }
95
+
96
+ if (tab.showHeader === undefined) {
97
+ tab.showHeader = true;
98
+ }
99
+
100
+ addObject(state.tabs, tab);
101
+ }
102
+
103
+ state.active[tab.position] = tab.id;
104
+ state.open = { ...state.open, [tab.position]: true };
105
+
106
+ state.userPin = tab.position;
107
+ window.localStorage.setItem(STORAGE_KEY['pin'], tab.position);
108
+ },
109
+
110
+ /**
111
+ * Switches a tab to a different position within the window manager.
112
+ *
113
+ * Usage:
114
+ * store.commit('wm/switchTab', { tabId: 'tab1', targetPosition: LEFT });
115
+ *
116
+ * This will move the tab with ID 'tab1' to the LEFT position and update the active tab accordingly.
117
+ */
118
+ switchTab(state: State, { tabId, targetPosition }: { tabId: string, targetPosition: Position }) {
119
+ const current = { ...(state.tabs.find((x) => x.id === tabId) || {}) };
120
+
121
+ if (current) {
122
+ moveTabByReference(state.tabs, current.position, targetPosition, tabId);
123
+
124
+ state.active[targetPosition] = tabId;
125
+ state.open = { ...state.open, [targetPosition]: true };
126
+
127
+ if (current.position !== targetPosition) {
128
+ const oldPositionTabs = state.tabs.filter((t) => t.position === current.position);
129
+
130
+ if (current.position) {
131
+ state.active[current.position] = oldPositionTabs[0]?.id || '';
132
+ state.open[current.position] = oldPositionTabs.length > 0;
133
+ }
134
+ }
135
+ }
136
+
137
+ state.userPin = targetPosition;
138
+ window.localStorage.setItem(STORAGE_KEY['pin'], targetPosition);
139
+ },
140
+
141
+ closeTab(state: State, { id }: { id: string }) {
142
+ const tab = state.tabs.find((x) => x.id === id);
143
+
144
+ if ( !tab ) {
145
+ return;
146
+ }
147
+
148
+ let idx = state.tabs.indexOf(tab);
149
+
150
+ removeObject(state.tabs, tab);
151
+ if ( idx >= state.tabs.length ) {
152
+ idx = state.tabs.length - 1;
153
+ }
154
+
155
+ if ( idx >= 0 ) {
156
+ state.active[tab.position] = state.tabs[idx].id;
157
+ } else {
158
+ state.open[tab.position] = false;
159
+ }
160
+
161
+ const oldPositionTabs = state.tabs.filter((t) => t.position === tab.position);
162
+
163
+ if (tab.position) {
164
+ state.active[tab.position] = oldPositionTabs[0]?.id || '';
165
+ state.open[tab.position] = oldPositionTabs.length > 0;
166
+ }
167
+ },
168
+
169
+ removeTab(state: State, tab: Tab) {
170
+ removeObject(state.tabs, tab);
171
+ },
172
+
173
+ setOpen(state: State, { position, open }: { position: string, open: boolean }) {
174
+ state.open = { ...state.open, [position]: open };
175
+ },
176
+
177
+ setActive(state: State, { position, id }: { position: string, id: string }) {
178
+ state.active[position] = id;
179
+ },
180
+
181
+ setPanelHeight(state: State, { position, height }: { position: string, height: number | null }) {
182
+ state.panelHeight[position] = height;
183
+ window.localStorage.setItem(STORAGE_KEY[BOTTOM], `${ height }`);
184
+
185
+ for (const tab of state.tabs) {
186
+ if (tab.position === position) {
187
+ tab.containerHeight = height;
188
+ }
189
+ }
190
+ },
191
+
192
+ setPanelWidth(state: State, { position, width }: { position: Position, width: number | null }) {
193
+ state.panelWidth[position] = width;
194
+ window.localStorage.setItem(STORAGE_KEY[position as keyof typeof STORAGE_KEY], `${ width }`);
195
+
196
+ for (const tab of state.tabs) {
197
+ if (tab.position === position) {
198
+ tab.containerWidth = width;
199
+ }
200
+ }
201
+ },
202
+
203
+ /**
204
+ * Sets the user's preferred pin position for tabs in the window manager.
205
+ *
206
+ * Usage:
207
+ * store.commit('wm/setUserPin', LEFT);
208
+ *
209
+ * This will set the user's preferred pin position to LEFT and store it in local storage.
210
+ */
211
+ setUserPin(state: State, pin: string) {
212
+ state.userPin = pin;
213
+ window.localStorage.setItem(STORAGE_KEY['pin'], pin);
214
+ },
215
+
216
+ /**
217
+ * Sets the locked positions for tabs in the window manager.
218
+ *
219
+ * Usage:
220
+ * store.commit('wm/setLockedPositions', [LEFT, RIGHT]);
221
+ *
222
+ * This will lock tabs to the specified positions, preventing them from being moved elsewhere.
223
+ */
224
+ setLockedPositions(state: State, positions: Position[]) {
225
+ state.lockedPositions = positions;
226
+ }
227
+ };
228
+
229
+ export const actions = {
230
+ close({ commit }: { state: State, getters: any, commit: any }, id: string) {
231
+ if ( !id ) {
232
+ throw new Error('[wm] id is not provided');
233
+ }
234
+ commit('closeTab', { id });
235
+ },
236
+
237
+ open({ commit }: { commit: any }, tab: Tab) {
238
+ if ( !tab.id ) {
239
+ throw new Error('[wm] id is not provided');
240
+ }
241
+
242
+ commit('addTab', tab);
243
+ }
244
+ };
@@ -30,5 +30,6 @@ export interface KubeMetadata {
30
30
  }
31
31
 
32
32
  export interface RancherKubeMetadata extends KubeMetadata {
33
- namespace: string,
33
+ namespace?: string,
34
+ name: string
34
35
  }
@@ -4,6 +4,7 @@ declare module '@rancher/auto-import' {
4
4
 
5
5
  declare module '@shell/store/type-map' {
6
6
  export function DSL(store: any, name: string): any;
7
+ export function isAdminUser(getters: any): boolean;
7
8
  }
8
9
 
9
10
  declare module '@shell/plugins/dashboard-store';
@@ -20,14 +20,39 @@ export interface PaginationSettingsStore {
20
20
  }
21
21
  }
22
22
 
23
- /**
23
+ /*
24
24
  * Determine which resources can utilise server-side pagination
25
25
  */
26
26
  export interface PaginationSettingsStores {
27
27
  [store: string]: PaginationSettingsStore
28
28
  }
29
29
 
30
- export type PaginationFeature = 'listAutoRefreshToggle' | 'listManualRefresh'
30
+ /**
31
+ * Names of pagination features used in pagination settings (not featureflags)
32
+ */
33
+ export type PaginationFeatureName = 'listAutoRefreshToggle' | 'listManualRefresh' | 'homePageCluster'
34
+
35
+ export type PaginationFeatureHomePageClusterConfig = {
36
+ threshold: number,
37
+ results: number,
38
+ pagesPerRow: number
39
+ }
40
+
41
+ /**
42
+ * Details of a specific pagination feature
43
+ */
44
+ export type PaginationFeature<Config = any> = {
45
+ version: number,
46
+ enabled: boolean,
47
+ configuration?: Config,
48
+ }
49
+
50
+ /**
51
+ * List of specific features that can be enabled / disabled
52
+ */
53
+ export type PaginationSettingsFeatures = {
54
+ [key in PaginationFeatureName]?: PaginationFeature
55
+ }
31
56
 
32
57
  /**
33
58
  * Settings to handle server side pagination
@@ -45,11 +70,7 @@ export interface PaginationSettings {
45
70
  /**
46
71
  * List of specific features that can be enabled / disabled
47
72
  */
48
- features?: {
49
- [key in PaginationFeature]: {
50
- enabled: boolean,
51
- }
52
- },
73
+ features?: PaginationSettingsFeatures,
53
74
 
54
75
  /**
55
76
  * Debounce the amount of time between a resource changing and the backend sending a resource.changes message
@@ -82,6 +103,7 @@ type ManagedFields = {
82
103
  time: string;
83
104
  };
84
105
 
106
+ // Note - this should now be @RancherKubeMetadata
85
107
  type Metadata = {
86
108
  creationTimestamp: string;
87
109
  fields: string[];
@@ -174,6 +174,7 @@ export const STEP: "step";
174
174
  export const LOGGED_OUT: "logged-out";
175
175
  export const IS_SSO: "is-sso";
176
176
  export const IS_SLO: "is-slo";
177
+ export const IS_SESSION_IDLE: "is-session-idle";
177
178
  export const UPGRADED: "upgraded";
178
179
  export const TIMED_OUT: "timed-out";
179
180
  export const AUTH_TEST: "test";
@@ -2190,6 +2191,9 @@ export namespace MANAGEMENT {
2190
2191
  export let CLUSTER_PROXY_CONFIG: string;
2191
2192
  export let OIDC_CLIENT: string;
2192
2193
  }
2194
+ export namespace EXT {
2195
+ let USER_ACTIVITY: string;
2196
+ }
2193
2197
  export namespace CAPI {
2194
2198
  let CAPI_CLUSTER: string;
2195
2199
  let MACHINE_DEPLOYMENT: string;
@@ -3671,6 +3675,7 @@ export const STEVE_CACHE: any;
3671
3675
  export const UIEXTENSION: any;
3672
3676
  export const PROVISIONING_PRE_BOOTSTRAP: any;
3673
3677
  export const SCHEDULING_CUSTOMIZATION: any;
3678
+ export const SCC: any;
3674
3679
  export namespace getters {
3675
3680
  function get(state: any, getters: any, rootState: any, rootGetters: any): (name: any) => any;
3676
3681
  }
@@ -3754,6 +3759,9 @@ export const _RKE2: "rke2";
3754
3759
  export const PROVISIONER: any;
3755
3760
  export const MENU_MAX_CLUSTERS: 10;
3756
3761
  export const SCALE_POOL_PROMPT: any;
3762
+ export const READ_NEW_RELEASE: any;
3763
+ export const READ_SUPPORT_NOTICE: any;
3764
+ export const READ_UPCOMING_SUPPORT_NOTICE: any;
3757
3765
  export function state(): {
3758
3766
  cookiesLoaded: boolean;
3759
3767
  data: {};
@@ -3980,6 +3988,57 @@ export function initSchedulingCustomization(value: any, features: any, store: an
3980
3988
  schedulingCustomizationOriginallyEnabled: boolean;
3981
3989
  errors: any[];
3982
3990
  }>;
3991
+ /**
3992
+ * Recursively filters a `diffs` object to only include differences that are relevant to the user.
3993
+ * A difference is considered relevant if the user has provided a custom value for that specific field.
3994
+ *
3995
+ * @param {object} diffs - The object representing the differences between two chart versions' default values.
3996
+ * @param {object} userVals - The object containing the user's custom values.
3997
+ * @returns {object} A new object containing only the relevant differences.
3998
+ */
3999
+ export function _addonConfigPreserveFilter(diffs: object, userVals: object): object;
4000
+ /**
4001
+ * @typedef {object} AddonPreserveContext
4002
+ * @property {object} addonConfigDiffs - An object that stores the diffs.
4003
+ * @property {string[]} addonNames - An array of addon names to check.
4004
+ * @property {object} $store - The Vuex store.
4005
+ * @property {object} userChartValues - The user's customized chart values.
4006
+ *
4007
+ * When the Kubernetes version is changed, this method is called to handle the add-on configurations
4008
+ * for all enabled addons. It checks if an addon's version has changed and, if so, determines if the
4009
+ * user's custom configurations should be preserved for the new version.
4010
+ *
4011
+ * The goal is to avoid showing a confirmation dialog for changes in default values that the user has not customized.
4012
+ *
4013
+ * @param {AddonPreserveContext} context The context object from the component.
4014
+ * @param {object} oldCharts The charts object from the K8s release object being changed from.
4015
+ * @param {object} newCharts The charts object from the K8s release object being changed to.
4016
+ */
4017
+ export function addonConfigPreserve(context: AddonPreserveContext, oldCharts: object, newCharts: object): Promise<void>;
4018
+ export type AddonPreserveContext = {
4019
+ /**
4020
+ * - An object that stores the diffs.
4021
+ */
4022
+ addonConfigDiffs: object;
4023
+ /**
4024
+ * - An array of addon names to check.
4025
+ */
4026
+ addonNames: string[];
4027
+ /**
4028
+ * - The Vuex store.
4029
+ */
4030
+ $store: object;
4031
+ /**
4032
+ * - The user's customized chart values.
4033
+ *
4034
+ * When the Kubernetes version is changed, this method is called to handle the add-on configurations
4035
+ * for all enabled addons. It checks if an addon's version has changed and, if so, determines if the
4036
+ * user's custom configurations should be preserved for the new version.
4037
+ *
4038
+ * The goal is to avoid showing a confirmation dialog for changes in default values that the user has not customized.
4039
+ */
4040
+ userChartValues: object;
4041
+ };
3983
4042
  }
3984
4043
 
3985
4044
  // @shell/utils/color
@@ -0,0 +1,22 @@
1
+ import { BOTTOM, CENTER, LEFT, RIGHT } from '@shell/utils/position';
2
+
3
+ export const enum Layout {
4
+ default = 'default', // eslint-disable-line no-unused-vars
5
+ home = 'home', // eslint-disable-line no-unused-vars
6
+ }
7
+
8
+ export type Position = typeof BOTTOM | typeof LEFT | typeof RIGHT | typeof CENTER;
9
+
10
+ export interface Tab {
11
+ id: string,
12
+ icon: string,
13
+ label: string,
14
+ component?: string,
15
+ extensionId?: string,
16
+ position: Position,
17
+ layouts: Layout[],
18
+ showHeader: boolean,
19
+ containerHeight: number | null,
20
+ containerWidth: number | null,
21
+ attrs?: Record<string, any>,
22
+ }