@rancher/shell 3.0.5-rc.8 → 3.0.5

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 (199) hide show
  1. package/assets/styles/base/_color.scss +4 -1
  2. package/assets/styles/global/_tooltip.scss +7 -4
  3. package/assets/styles/themes/_dark.scss +11 -0
  4. package/assets/styles/themes/_light.scss +13 -1
  5. package/assets/styles/themes/_modern.scss +22 -0
  6. package/assets/translations/en-us.yaml +147 -19
  7. package/assets/translations/zh-hans.yaml +0 -1
  8. package/chart/monitoring/grafana/index.vue +8 -2
  9. package/components/ActionMenuShell.vue +3 -1
  10. package/components/Cron/CronExpressionEditor.vue +299 -0
  11. package/components/Cron/CronExpressionEditorModal.vue +247 -0
  12. package/components/Cron/CronTooltip.vue +87 -0
  13. package/components/Cron/types.ts +13 -0
  14. package/components/ForceDirectedTreeChart/composable.ts +11 -0
  15. package/components/PodSecurityAdmission.vue +2 -0
  16. package/components/PromptModal.vue +1 -1
  17. package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +1 -0
  18. package/components/Resource/Detail/CopyToClipboard.vue +78 -0
  19. package/components/Resource/Detail/FetchLoader/__tests__/composables.test.ts +69 -0
  20. package/components/Resource/Detail/FetchLoader/composables.ts +27 -0
  21. package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +1 -1
  22. package/components/Resource/Detail/Metadata/Annotations/index.vue +1 -1
  23. package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +13 -61
  24. package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +33 -6
  25. package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +24 -38
  26. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +25 -5
  27. package/components/Resource/Detail/Metadata/KeyValue.vue +12 -23
  28. package/components/Resource/Detail/Metadata/KeyValueRow.vue +144 -0
  29. package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +1 -0
  30. package/components/Resource/Detail/Metadata/Labels/index.vue +1 -0
  31. package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +30 -32
  32. package/components/Resource/Detail/Metadata/__tests__/KeyValueRow.test.ts +108 -0
  33. package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +0 -3
  34. package/components/Resource/Detail/Metadata/__tests__/index.test.ts +12 -5
  35. package/components/Resource/Detail/Metadata/composables.ts +1 -4
  36. package/components/Resource/Detail/Metadata/index.vue +1 -0
  37. package/components/Resource/Detail/Preview/Content.vue +63 -0
  38. package/components/Resource/Detail/Preview/Preview.vue +128 -0
  39. package/components/Resource/Detail/Preview/__tests__/Content.spec.ts +71 -0
  40. package/components/Resource/Detail/Preview/__tests__/Preview.spec.ts +121 -0
  41. package/components/Resource/Detail/ResourcePopover/ResourcePopoverCard.vue +141 -0
  42. package/components/Resource/Detail/ResourcePopover/__tests__/ResourcePopoverCard.test.ts +136 -0
  43. package/components/Resource/Detail/ResourcePopover/__tests__/index.test.ts +245 -0
  44. package/components/Resource/Detail/ResourcePopover/index.vue +226 -0
  45. package/components/Resource/Detail/SpacedRow.vue +1 -0
  46. package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +0 -5
  47. package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +1 -1
  48. package/components/Resource/Detail/TitleBar/composables.ts +1 -3
  49. package/components/Resource/Detail/TitleBar/index.vue +2 -29
  50. package/components/Resource/Detail/ViewOptions/composable.ts +9 -0
  51. package/components/Resource/Detail/ViewOptions/index.vue +41 -0
  52. package/components/Resource/Detail/__tests__/CopyToClipboard.spec.ts +82 -0
  53. package/components/ResourceDetail/Masthead/legacy.vue +0 -19
  54. package/components/ResourceDetail/index.vue +1 -26
  55. package/components/ResourceTable.vue +24 -0
  56. package/components/SortableTable/index.vue +7 -1
  57. package/components/SortableTable/paging.js +3 -0
  58. package/components/Tabbed/Tab.vue +43 -1
  59. package/components/Tabbed/index.vue +3 -1
  60. package/components/__tests__/Cron/CronExpressionEditor.test.ts +151 -0
  61. package/components/__tests__/Cron/CronExpressionEditorModal.test.ts +81 -0
  62. package/components/auth/login/saml.vue +86 -0
  63. package/components/form/LabeledSelect.vue +8 -8
  64. package/components/form/ProjectMemberEditor.vue +2 -0
  65. package/components/form/ResourceTabs/composable.ts +54 -0
  66. package/components/form/ResourceTabs/index.vue +10 -7
  67. package/components/form/Select.vue +13 -10
  68. package/components/form/__tests__/LabeledSelect.test.ts +133 -0
  69. package/components/form/__tests__/Select.test.ts +134 -0
  70. package/components/nav/Header.vue +6 -5
  71. package/composables/useExtensionManager.ts +17 -0
  72. package/config/home-links.js +12 -0
  73. package/config/labels-annotations.js +0 -1
  74. package/config/page-actions.js +0 -1
  75. package/config/product/explorer.js +3 -1
  76. package/config/product/fleet.js +2 -7
  77. package/config/product/manager.js +0 -5
  78. package/config/query-params.js +1 -0
  79. package/config/router/navigation-guards/clusters.js +2 -1
  80. package/config/router/navigation-guards/products.js +1 -1
  81. package/config/store.js +2 -0
  82. package/core/extension-manager-impl.js +518 -0
  83. package/core/plugins.js +35 -468
  84. package/core/types.ts +8 -2
  85. package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +1 -0
  86. package/detail/catalog.cattle.io.app.vue +7 -4
  87. package/detail/fleet.cattle.io.bundle.vue +1 -5
  88. package/detail/fleet.cattle.io.cluster.vue +3 -2
  89. package/detail/fleet.cattle.io.gitrepo.vue +76 -49
  90. package/detail/fleet.cattle.io.helmop.vue +78 -49
  91. package/dialog/AddonConfigConfirmationDialog.vue +1 -1
  92. package/dialog/GenericPrompt.vue +1 -1
  93. package/dialog/ImportDialog.vue +9 -2
  94. package/dialog/InstallExtensionDialog.vue +18 -10
  95. package/dialog/SloDialog.vue +1 -1
  96. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +2 -1
  97. package/edit/__tests__/resources.cattle.io.restore.test.ts +106 -0
  98. package/edit/auth/oidc.vue +106 -6
  99. package/edit/auth/saml.vue +5 -5
  100. package/edit/cloudcredential.vue +31 -17
  101. package/edit/constraints.gatekeeper.sh.constraint/index.vue +10 -2
  102. package/edit/fleet.cattle.io.cluster.vue +19 -0
  103. package/edit/fleet.cattle.io.gitrepo.vue +23 -16
  104. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +12 -11
  105. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +11 -1
  106. package/edit/provisioning.cattle.io.cluster/index.vue +14 -19
  107. package/edit/provisioning.cattle.io.cluster/rke2.vue +11 -3
  108. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +1 -0
  109. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +1 -0
  110. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -0
  111. package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +1 -0
  112. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +2 -0
  113. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +6 -0
  114. package/edit/resources.cattle.io.restore.vue +5 -8
  115. package/initialize/install-plugins.js +1 -3
  116. package/list/__tests__/workload.test.ts +1 -0
  117. package/list/workload.vue +8 -1
  118. package/machine-config/components/GCEImage.vue +6 -5
  119. package/machine-config/google.vue +11 -6
  120. package/mixins/__tests__/auth-config.test.ts +4 -6
  121. package/mixins/__tests__/chart.test.ts +139 -1
  122. package/mixins/auth-config.js +33 -10
  123. package/mixins/chart.js +58 -18
  124. package/models/__tests__/namespace.test.ts +69 -0
  125. package/models/apps.statefulset.js +8 -10
  126. package/models/chart.js +5 -1
  127. package/models/fleet-application.js +16 -46
  128. package/models/fleet.cattle.io.bundle.js +1 -38
  129. package/models/fleet.cattle.io.gitrepo.js +4 -0
  130. package/models/fleet.cattle.io.helmop.js +4 -0
  131. package/models/management.cattle.io.cluster.js +1 -1
  132. package/models/management.cattle.io.project.js +12 -0
  133. package/models/namespace.js +30 -0
  134. package/models/workload.js +4 -1
  135. package/package.json +10 -10
  136. package/pages/auth/login.vue +8 -3
  137. package/pages/auth/logout.vue +6 -5
  138. package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +26 -11
  139. package/pages/c/_cluster/apps/charts/chart.vue +29 -20
  140. package/pages/c/_cluster/apps/charts/index.vue +1 -0
  141. package/pages/c/_cluster/apps/charts/install.vue +6 -5
  142. package/pages/c/_cluster/explorer/tools/__tests__/index.test.ts +102 -12
  143. package/pages/c/_cluster/explorer/tools/index.vue +145 -254
  144. package/pages/c/_cluster/manager/cloudCredential/index.vue +18 -1
  145. package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +12 -2
  146. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
  147. package/pages/c/_cluster/uiplugins/__tests__/index.spec.ts +318 -0
  148. package/pages/c/_cluster/uiplugins/index.vue +221 -363
  149. package/pages/home.vue +1 -9
  150. package/plugins/axios.js +3 -2
  151. package/plugins/dashboard-store/resource-class.js +49 -0
  152. package/plugins/ember-cookie.js +7 -3
  153. package/plugins/steve/subscribe.js +4 -2
  154. package/public/index.html +2 -1
  155. package/rancher-components/Card/Card.vue +1 -1
  156. package/rancher-components/Form/Checkbox/Checkbox.vue +1 -1
  157. package/rancher-components/Form/Radio/RadioButton.vue +1 -1
  158. package/rancher-components/Form/Radio/RadioGroup.vue +1 -1
  159. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -11
  160. package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.test.ts +53 -0
  161. package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.vue +65 -0
  162. package/rancher-components/Pill/RcCounterBadge/index.ts +1 -0
  163. package/rancher-components/Pill/RcCounterBadge/types.ts +7 -0
  164. package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +1 -1
  165. package/rancher-components/Pill/RcStatusBadge/index.ts +1 -1
  166. package/rancher-components/Pill/RcStatusIndicator/RcStatusIndicator.vue +3 -3
  167. package/rancher-components/Pill/RcStatusIndicator/types.ts +1 -1
  168. package/rancher-components/Pill/RcTag/RcTag.test.ts +64 -0
  169. package/rancher-components/Pill/RcTag/RcTag.vue +94 -0
  170. package/rancher-components/Pill/RcTag/index.ts +1 -0
  171. package/rancher-components/Pill/RcTag/types.ts +9 -0
  172. package/rancher-components/Pill/types.ts +1 -0
  173. package/rancher-components/RcItemCard/RcItemCard.vue +1 -0
  174. package/rancher-components/RcItemCard/RcItemCardAction.vue +12 -0
  175. package/scripts/test-plugins-build.sh +0 -1
  176. package/store/__tests__/catalog.test.ts +63 -0
  177. package/store/__tests__/cookies.test.ts +72 -0
  178. package/store/auth.js +33 -10
  179. package/store/catalog.js +2 -2
  180. package/store/cookies.ts +30 -0
  181. package/store/prefs.js +10 -5
  182. package/store/type-map.js +3 -15
  183. package/types/extension-manager.ts +26 -0
  184. package/types/shell/index.d.ts +123 -27
  185. package/utils/__tests__/product.test.ts +129 -0
  186. package/utils/__tests__/resource.test.ts +87 -0
  187. package/utils/alertmanagerconfig.js +2 -2
  188. package/utils/auth.js +4 -77
  189. package/utils/product.ts +39 -0
  190. package/utils/resource.ts +35 -0
  191. package/utils/select.js +0 -24
  192. package/utils/validators/formRules/__tests__/index.test.ts +3 -0
  193. package/utils/validators/formRules/index.ts +2 -1
  194. package/vue.config.js +1 -1
  195. package/components/Resource/Detail/Metadata/Rectangle.vue +0 -34
  196. package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +0 -24
  197. package/components/ResourceDetail/Masthead/__tests__/legacy.test.ts +0 -65
  198. package/utils/cookie-universal.js +0 -10
  199. /package/components/{ForceDirectedTreeChart.vue → ForceDirectedTreeChart/index.vue} +0 -0
@@ -296,4 +296,67 @@ describe('catalog', () => {
296
296
  expect(result).toHaveLength(0);
297
297
  });
298
298
  });
299
+
300
+ describe('getters', () => {
301
+ describe('version', () => {
302
+ it('should find a version from a chart, respecting the showDeprecated flag for charts', () => {
303
+ // A regular chart with some versions
304
+ const regularChart = {
305
+ repoType: 'cluster',
306
+ repoName: 'rancher-charts',
307
+ chartName: 'regular-chart',
308
+ deprecated: false,
309
+ versions: [{ version: '1.2.3' }, { version: '1.2.4' }]
310
+ };
311
+ // A deprecated chart with some versions
312
+ const deprecatedChart = {
313
+ repoType: 'cluster',
314
+ repoName: 'rancher-charts',
315
+ chartName: 'deprecated-chart',
316
+ deprecated: true,
317
+ versions: [{ version: '2.0.0' }, { version: '2.1.0' }]
318
+ };
319
+
320
+ const allCharts = [regularChart, deprecatedChart];
321
+ const state = {};
322
+ const localGetters = {
323
+ charts: allCharts,
324
+ chart: (args: any) => getters.chart(state, { charts: allCharts })(args)
325
+ };
326
+
327
+ // Scenario 1: Get a version from a regular chart
328
+ const result1 = getters.version(state, localGetters)({
329
+ repoType: 'cluster',
330
+ repoName: 'rancher-charts',
331
+ chartName: 'regular-chart',
332
+ versionName: '1.2.3',
333
+ showDeprecated: false
334
+ });
335
+
336
+ expect(result1).toStrictEqual({ version: '1.2.3' });
337
+
338
+ // Scenario 2: Get a version from a deprecated chart
339
+ const result2 = getters.version(state, localGetters)({
340
+ repoType: 'cluster',
341
+ repoName: 'rancher-charts',
342
+ chartName: 'deprecated-chart',
343
+ versionName: '2.0.0',
344
+ showDeprecated: true
345
+ });
346
+
347
+ expect(result2).toStrictEqual({ version: '2.0.0' });
348
+
349
+ // Scenario 3: Try to get a version from a deprecated chart without the flag should fail
350
+ const result3 = getters.version(state, localGetters)({
351
+ repoType: 'cluster',
352
+ repoName: 'rancher-charts',
353
+ chartName: 'deprecated-chart',
354
+ versionName: '2.0.0',
355
+ showDeprecated: false
356
+ });
357
+
358
+ expect(result3).toBeNull();
359
+ });
360
+ });
361
+ });
299
362
  });
@@ -0,0 +1,72 @@
1
+ import cookieStore from '../cookies';
2
+
3
+ // Mock cookie-universal
4
+ const mockCookie = {
5
+ get: jest.fn(),
6
+ set: jest.fn(),
7
+ remove: jest.fn(),
8
+ getAll: jest.fn(),
9
+ addChangeListener: jest.fn(),
10
+ removeChangeListener: jest.fn()
11
+ };
12
+
13
+ jest.mock('cookie-universal', () => {
14
+ return jest.fn(() => mockCookie);
15
+ });
16
+
17
+ describe('store: cookies', () => {
18
+ let state: any;
19
+
20
+ beforeEach(() => {
21
+ state = cookieStore.state();
22
+ // Reset mocks before each test
23
+ mockCookie.get.mockClear();
24
+ mockCookie.set.mockClear();
25
+ mockCookie.remove.mockClear();
26
+ });
27
+
28
+ describe('getters', () => {
29
+ it('get should call cookies.get with the correct parameters', () => {
30
+ const { getters } = cookieStore;
31
+ const key = 'test-key';
32
+ const options = { from: 'server' };
33
+
34
+ getters.get(state, {}, {}, {})({ key, options });
35
+ expect(mockCookie.get).toHaveBeenCalledWith(key, options);
36
+ });
37
+ });
38
+
39
+ describe('mutations', () => {
40
+ it('set should call cookies.set with the correct parameters', () => {
41
+ const { mutations } = cookieStore;
42
+ const key = 'test-key';
43
+ const value = { data: 'test-value' };
44
+ const options = { path: '/' };
45
+
46
+ mutations.set(state, {
47
+ key, value, options
48
+ });
49
+ expect(mockCookie.set).toHaveBeenCalledWith(key, value, options);
50
+ });
51
+
52
+ it('remove should call cookies.remove with the correct key', () => {
53
+ const { mutations } = cookieStore;
54
+ const key = 'test-key';
55
+
56
+ mutations.remove(state, { key });
57
+ expect(mockCookie.remove).toHaveBeenCalledWith(key);
58
+ });
59
+ });
60
+
61
+ describe('state', () => {
62
+ it('should return a cookies object', () => {
63
+ expect(state.cookies).toBeDefined();
64
+ });
65
+ });
66
+
67
+ describe('namespaced', () => {
68
+ it('should be namespaced', () => {
69
+ expect(cookieStore.namespaced).toBe(true);
70
+ });
71
+ });
72
+ });
package/store/auth.js CHANGED
@@ -8,6 +8,13 @@ import { removeEmberPage } from '@shell/utils/ember-page';
8
8
  import { randomStr } from '@shell/utils/string';
9
9
  import { addParams, parse as parseUrl, removeParam } from '@shell/utils/url';
10
10
 
11
+ // configuration for Single Logout/SLO
12
+ // admissable auth providers compatible with SLO, based on shell/models/management.cattle.io.authconfig "configType"
13
+ export const SLO_AUTH_PROVIDERS = ['oidc', 'saml'];
14
+
15
+ // this is connected to the redirect url, for which the logic can be found in "shell/store/auth"
16
+ const SLO_TOKENS_ENDPOINT_LOGOUT_RES_BASETYPE = ['authConfigLogoutOutput'];
17
+
11
18
  export const BASE_SCOPES = {
12
19
  github: ['read:org'],
13
20
  googleoauth: ['openid profile email'],
@@ -85,8 +92,6 @@ export const mutations = {
85
92
  loggedInAs(state, principalId) {
86
93
  state.loggedIn = true;
87
94
  state.principalId = principalId;
88
-
89
- this.$cookies.remove(KEY);
90
95
  },
91
96
 
92
97
  loggedOut(state) {
@@ -136,10 +141,18 @@ export const actions = {
136
141
  commit('initialPass', pass);
137
142
  },
138
143
 
139
- getAuthProviders({ dispatch }) {
144
+ getAuthProviders({ dispatch }, opt) {
145
+ let force = false;
146
+
147
+ if (opt?.force) {
148
+ force = true;
149
+ }
150
+
140
151
  return dispatch('rancher/findAll', {
141
152
  type: 'authProvider',
142
- opt: { url: `/v3-public/authProviders`, watch: false }
153
+ opt: {
154
+ url: `/v3-public/authProviders`, watch: false, force
155
+ }
143
156
  }, { root: true });
144
157
  },
145
158
 
@@ -183,13 +196,17 @@ export const actions = {
183
196
  * Save nonce details. Information it contains will be used to validate auth requests/responses
184
197
  * Note - this may be structurally different than the nonce we encode and send
185
198
  */
186
- saveNonce(ctx, opt) {
199
+ saveNonce({ commit }, opt) {
187
200
  const strung = JSON.stringify(opt);
188
201
 
189
- this.$cookies.set(KEY, strung, {
202
+ const options = {
190
203
  path: '/',
191
204
  sameSite: true,
192
205
  secure: true,
206
+ };
207
+
208
+ commit('cookies/set', {
209
+ key: KEY, value: strung, options
193
210
  });
194
211
 
195
212
  return strung;
@@ -265,8 +282,8 @@ export const actions = {
265
282
  }
266
283
  },
267
284
 
268
- verifyOAuth({ dispatch }, { nonce, code, provider }) {
269
- const expectJSON = this.$cookies.get(KEY, { parseJSON: false });
285
+ verifyOAuth({ dispatch, rootGetters }, { nonce, code, provider }) {
286
+ const expectJSON = rootGetters['cookies/get']({ key: KEY, options: { parseJSON: false } });
270
287
  let parsed;
271
288
 
272
289
  try {
@@ -351,6 +368,12 @@ export const actions = {
351
368
  }
352
369
  },
353
370
 
371
+ loggedInAs({ commit }, principalId) {
372
+ commit('loggedInAs', principalId);
373
+
374
+ commit('cookies/remove', { key: KEY });
375
+ },
376
+
354
377
  uiLogout({ commit, dispatch }) {
355
378
  removeEmberPage();
356
379
 
@@ -398,8 +421,8 @@ export const actions = {
398
421
  redirectUnauthorized: false,
399
422
  }, { root: true });
400
423
 
401
- // Single-sign logout for SAML providers that allow for it
402
- if (res.baseType === 'samlConfigLogoutOutput' && res.idpRedirectUrl) {
424
+ // Single-sign logout redirect for SLO compatible auth providers
425
+ if (SLO_TOKENS_ENDPOINT_LOGOUT_RES_BASETYPE.includes(res.baseType) && res.idpRedirectUrl) {
403
426
  window.location.href = res.idpRedirectUrl;
404
427
 
405
428
  return;
package/store/catalog.js CHANGED
@@ -237,10 +237,10 @@ export const getters = {
237
237
 
238
238
  version(state, getters) {
239
239
  return ({
240
- repoType, repoName, chartName, versionName
240
+ repoType, repoName, chartName, versionName, showDeprecated
241
241
  }) => {
242
242
  const chart = getters['chart']({
243
- repoType, repoName, chartName
243
+ repoType, repoName, chartName, showDeprecated
244
244
  });
245
245
 
246
246
  if ( !chart ) {
@@ -0,0 +1,30 @@
1
+ import { MutationTree, GetterTree, ActionTree } from 'vuex';
2
+ import Cookie, { ICookie, ICookieGetOpts } from 'cookie-universal';
3
+
4
+ type State = { cookies: ICookie };
5
+ const options = { parseJSON: true };
6
+ const state = (): State => ({ cookies: Cookie(undefined, undefined, options.parseJSON) });
7
+
8
+ const getters: GetterTree<State, any> = {
9
+ get(state) {
10
+ return ({ key, options }: {key: string, options?: ICookieGetOpts}) => state.cookies.get(key, options);
11
+ }
12
+ };
13
+ const mutations: MutationTree<State> = {
14
+ set(state, { key, value, options }) {
15
+ return state.cookies.set(key, value, options);
16
+ },
17
+
18
+ remove(state, { key }) {
19
+ return state.cookies.remove(key);
20
+ },
21
+ };
22
+ const actions: ActionTree<State, any> = {};
23
+
24
+ export default {
25
+ namespaced: true,
26
+ state,
27
+ getters,
28
+ mutations,
29
+ actions
30
+ };
package/store/prefs.js CHANGED
@@ -289,12 +289,16 @@ export const actions = {
289
289
  commit('load', { key, value });
290
290
 
291
291
  if ( definition.asCookie ) {
292
- const opt = {
292
+ const options = {
293
293
  ...cookieOptions,
294
294
  parseJSON: definition.parseJSON === true
295
295
  };
296
296
 
297
- this.$cookies.set(`${ cookiePrefix }${ key }`.toUpperCase(), value, opt);
297
+ const computedKey = `${ cookiePrefix }${ key }`.toUpperCase();
298
+
299
+ commit('cookies/set', {
300
+ key: computedKey, value, options
301
+ }, { root: true });
298
302
  }
299
303
 
300
304
  if ( definition.asUserPreference ) {
@@ -336,7 +340,7 @@ export const actions = {
336
340
  await dispatch('set', { key: THEME, value: val });
337
341
  },
338
342
 
339
- loadCookies({ state, commit }) {
343
+ loadCookies({ state, commit, rootGetters }) {
340
344
  if ( state.cookiesLoaded ) {
341
345
  return;
342
346
  }
@@ -348,8 +352,9 @@ export const actions = {
348
352
  continue;
349
353
  }
350
354
 
351
- const opt = { parseJSON: definition.parseJSON === true };
352
- const value = this.$cookies.get(`${ cookiePrefix }${ key }`.toUpperCase(), opt);
355
+ const options = { parseJSON: definition.parseJSON === true };
356
+ const computedKey = `${ cookiePrefix }${ key }`.toUpperCase();
357
+ const value = rootGetters['cookies/get']({ key: computedKey, options });
353
358
 
354
359
  if (value !== undefined) {
355
360
  commit('load', { key, value });
package/store/type-map.js CHANGED
@@ -103,8 +103,6 @@
103
103
  // depaginate: undefined -- Use this to depaginate requests for this type
104
104
  // resourceEditMasthead: true -- Show the Masthead in the edit resource component
105
105
  // customRoute: undefined,
106
- // hasGraph: undefined -- If true, render ForceDirectedTreeChart graph (ATTENTION: option graphConfig is needed also!!!)
107
- // graphConfig: undefined -- Use this to pass along the graph configuration
108
106
  // notFilterNamespace: undefined -- Define namespaces that do not need to be filtered
109
107
  // localOnly: False -- Hide this type from the nav/search bar on downstream clusters
110
108
  // custom: any - Custom options for a given type
@@ -208,7 +206,6 @@ export const SPOOFED_PREFIX = '__[[spoofed]]__';
208
206
  export const SPOOFED_API_PREFIX = '__[[spoofedapi]]__';
209
207
 
210
208
  const instanceMethods = {};
211
- const graphConfigMap = {};
212
209
 
213
210
  export const IF_HAVE = {
214
211
  V2_MONITORING: 'v2-monitoring',
@@ -291,10 +288,6 @@ export function DSL(store, product, module = 'type-map') {
291
288
  },
292
289
 
293
290
  configureType(match, options) {
294
- if (options.graphConfig) {
295
- graphConfigMap[match] = options.graphConfig;
296
- delete options.graphConfig;
297
- }
298
291
  store.commit(`${ module }/configureType`, { ...options, match });
299
292
  },
300
293
 
@@ -1178,14 +1171,9 @@ export const getters = {
1178
1171
  };
1179
1172
  },
1180
1173
 
1181
- hasGraph(state, getters) {
1182
- return (resource) => {
1183
- const typeOptions = getters['optionsFor'](resource);
1184
-
1185
- if (typeOptions && typeOptions.hasGraph) {
1186
- return graphConfigMap[resource];
1187
- }
1188
-
1174
+ // This has to be left in to support extensions which use shell version 3.0.5-rc.8 or earlier, this extensions have a version of ResourceDetail/index.vue which still invokes this method.
1175
+ hasGraph() {
1176
+ return () => {
1189
1177
  return null;
1190
1178
  };
1191
1179
  },
@@ -0,0 +1,26 @@
1
+ import { ClusterProvisionerContext } from '@shell/core/types';
2
+ export type ExtensionManager = {
3
+ internal(): any;
4
+ loadPluginAsync(plugin: any): Promise<void>;
5
+ loadAsync(id: string, mainFile: string): Promise<void>;
6
+ loadBuiltinExtensions(): void;
7
+ registerBuiltinExtension(id: string, module: any): void;
8
+ initBuiltinExtension(id: string, module: any): void;
9
+ logout(): Promise<void>;
10
+ removePlugin(name: string): Promise<void>;
11
+ removeTypeFromStore(store: any, storeName: string, types: string[]): any[];
12
+ applyPlugin(plugin: any): void;
13
+ register(type: string, name: string, fn: Function): void;
14
+ unregister(type: string, name: string, fn: Function): void;
15
+ getAll(): any;
16
+ getPlugins(): any;
17
+ getDynamic(typeName: string, name: string): any;
18
+ getValidator(name: string): any;
19
+ getUIConfig(type: string, uiArea: string): any[];
20
+ getAllUIConfig(): any;
21
+ getProviders(context: ClusterProvisionerContext): any[];
22
+ lastLoad: number;
23
+ listDynamic(typeName: string): string[];
24
+ products: any[];
25
+ loadProducts(loadPlugins: any[]): void;
26
+ }
@@ -121,7 +121,6 @@ export namespace FLEET {
121
121
  export { CLUSTER_NAMESPACE_1 as CLUSTER_NAMESPACE };
122
122
  export let CLUSTER: string;
123
123
  export let CREATED_BY_USER_ID: string;
124
- export let CREATED_BY_USER_NAME: string;
125
124
  export let OCI_STORAGE_SECRET_DEFAULT: string;
126
125
  export let OCI_STORAGE_SECRET_GENERATED: string;
127
126
  }
@@ -199,6 +198,7 @@ export const _STAGE: "stage";
199
198
  export const _IMPORT: "import";
200
199
  export const LEGACY: "legacy";
201
200
  export const AS: "as";
201
+ export const VIEW: "view";
202
202
  export const _DETAIL: "detail";
203
203
  export const _CONFIG: "config";
204
204
  export const _YAML: "yaml";
@@ -2613,6 +2613,20 @@ export default class Namespace {
2613
2613
  cleanForNew(): void;
2614
2614
  metadata: any;
2615
2615
  get hideDetailLocation(): boolean;
2616
+ get glance(): any[];
2617
+ get projectGlance(): {
2618
+ name: string;
2619
+ label: any;
2620
+ formatter: string;
2621
+ formatterOpts: {
2622
+ to: any;
2623
+ row: {};
2624
+ options: {
2625
+ internal: boolean;
2626
+ };
2627
+ };
2628
+ content: any;
2629
+ };
2616
2630
  }
2617
2631
  }
2618
2632
 
@@ -3275,6 +3289,112 @@ export default class Resource {
3275
3289
  };
3276
3290
  content: any;
3277
3291
  })[];
3292
+ get glance(): ({
3293
+ name: string;
3294
+ label: any;
3295
+ formatter: string;
3296
+ formatterOpts: {
3297
+ row: this;
3298
+ to?: undefined;
3299
+ options?: undefined;
3300
+ };
3301
+ content: any;
3302
+ } | {
3303
+ name: string;
3304
+ label: any;
3305
+ formatter: string;
3306
+ formatterOpts: {
3307
+ to: {
3308
+ name: string;
3309
+ params: {
3310
+ product: any;
3311
+ cluster: any;
3312
+ resource: any;
3313
+ };
3314
+ };
3315
+ row: {};
3316
+ options: {
3317
+ internal: boolean;
3318
+ };
3319
+ };
3320
+ content: any;
3321
+ } | {
3322
+ name: string;
3323
+ label: any;
3324
+ formatter: string;
3325
+ formatterOpts: {
3326
+ to: {
3327
+ name: string;
3328
+ product: any;
3329
+ cluster: any;
3330
+ resource: any;
3331
+ };
3332
+ row: {};
3333
+ options: {
3334
+ internal: boolean;
3335
+ };
3336
+ };
3337
+ content: any;
3338
+ } | {
3339
+ name: string;
3340
+ label: any;
3341
+ formatter: string;
3342
+ content: any;
3343
+ formatterOpts?: undefined;
3344
+ })[];
3345
+ get _glance(): ({
3346
+ name: string;
3347
+ label: any;
3348
+ formatter: string;
3349
+ formatterOpts: {
3350
+ row: this;
3351
+ to?: undefined;
3352
+ options?: undefined;
3353
+ };
3354
+ content: any;
3355
+ } | {
3356
+ name: string;
3357
+ label: any;
3358
+ formatter: string;
3359
+ formatterOpts: {
3360
+ to: {
3361
+ name: string;
3362
+ params: {
3363
+ product: any;
3364
+ cluster: any;
3365
+ resource: any;
3366
+ };
3367
+ };
3368
+ row: {};
3369
+ options: {
3370
+ internal: boolean;
3371
+ };
3372
+ };
3373
+ content: any;
3374
+ } | {
3375
+ name: string;
3376
+ label: any;
3377
+ formatter: string;
3378
+ formatterOpts: {
3379
+ to: {
3380
+ name: string;
3381
+ product: any;
3382
+ cluster: any;
3383
+ resource: any;
3384
+ };
3385
+ row: {};
3386
+ options: {
3387
+ internal: boolean;
3388
+ };
3389
+ };
3390
+ content: any;
3391
+ } | {
3392
+ name: string;
3393
+ label: any;
3394
+ formatter: string;
3395
+ content: any;
3396
+ formatterOpts?: undefined;
3397
+ })[];
3278
3398
  get t(): any;
3279
3399
  findOwners(): any[];
3280
3400
  getOwners(): any[];
@@ -3481,9 +3601,10 @@ export namespace actions {
3481
3601
  function setTheme({ dispatch }: {
3482
3602
  dispatch: any;
3483
3603
  }, val: any): Promise<void>;
3484
- function loadCookies({ state, commit }: {
3604
+ function loadCookies({ state, commit, rootGetters }: {
3485
3605
  state: any;
3486
3606
  commit: any;
3607
+ rootGetters: any;
3487
3608
  }): void;
3488
3609
  function loadTheme({ dispatch }: {
3489
3610
  dispatch: any;
@@ -3556,20 +3677,6 @@ export function parseAuthProvidersInfo(rows: any): {
3556
3677
  };
3557
3678
  enabled: any;
3558
3679
  };
3559
- /**
3560
- * Attempt to set the product in our datastore if the route matches a known product. Otherwise show an error page instead.
3561
- */
3562
- export function setProduct(store: any, to: any): any;
3563
- /**
3564
- * Check that the resource is valid, if not redirect to fail whale
3565
- *
3566
- * This requires that
3567
- * - product is set
3568
- * - product's store is set and setup (so we can check schema's within it)
3569
- * - product's store has the schemaFor getter (extension stores might not have it)
3570
- * - there's a resource associated with route (meta or param)
3571
- */
3572
- export function validateResource(store: any, to: any): boolean;
3573
3680
  /**
3574
3681
  * Attempt to load the current user's principal
3575
3682
  */
@@ -3744,16 +3851,6 @@ declare function _default(context: any, inject: any): void;
3744
3851
  export default _default;
3745
3852
  }
3746
3853
 
3747
- // @shell/utils/cookie-universal
3748
-
3749
- declare module '@shell/utils/cookie-universal' {
3750
- declare function _default({ req, res }: {
3751
- req: any;
3752
- res: any;
3753
- }, inject: any): void;
3754
- export default _default;
3755
- }
3756
-
3757
3854
  // @shell/utils/create-yaml
3758
3855
 
3759
3856
  declare module '@shell/utils/create-yaml' {
@@ -4389,7 +4486,6 @@ export function routeRequiresInstallRedirect(to: any): boolean;
4389
4486
  // @shell/utils/select
4390
4487
 
4391
4488
  declare module '@shell/utils/select' {
4392
- export function onClickOption(option: any, e: any): void;
4393
4489
  export function calculatePosition(dropdownList: any, component: any, width: any, placement: any): void;
4394
4490
  }
4395
4491