@rancher/shell 3.0.5-rc.1 → 3.0.5-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 (280) hide show
  1. package/assets/data/aws-regions.json +2 -0
  2. package/assets/images/providers/sks.svg +1 -0
  3. package/assets/styles/base/_helpers.scss +4 -0
  4. package/assets/styles/base/_variables.scss +1 -0
  5. package/assets/styles/global/_layout.scss +0 -1
  6. package/assets/translations/en-us.yaml +92 -34
  7. package/assets/translations/zh-hans.yaml +4 -13
  8. package/chart/monitoring/index.vue +4 -2
  9. package/components/ActionDropdownShell.vue +71 -0
  10. package/components/AppModal.vue +18 -4
  11. package/components/AsyncButton.vue +2 -0
  12. package/components/CodeMirror.vue +3 -3
  13. package/components/CommunityLinks.vue +3 -58
  14. package/components/CruResource.vue +109 -16
  15. package/components/ExplorerProjectsNamespaces.vue +19 -6
  16. package/components/FixedBanner.vue +19 -5
  17. package/components/GlobalRoleBindings.vue +5 -1
  18. package/components/GrowlManager.vue +1 -0
  19. package/components/LandingPagePreference.vue +2 -0
  20. package/components/LocaleSelector.vue +1 -1
  21. package/components/ModalManager.vue +55 -0
  22. package/components/PaginatedResourceTable.vue +7 -0
  23. package/components/PromptModal.vue +47 -8
  24. package/components/ResourceDetail/Masthead.vue +38 -13
  25. package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
  26. package/components/ResourceDetail/index.vue +47 -12
  27. package/components/ResourceList/index.vue +2 -1
  28. package/components/ResourceTable.vue +54 -19
  29. package/components/SideNav.vue +5 -1
  30. package/components/SlideInPanelManager.vue +125 -0
  31. package/components/SortableTable/THead.vue +5 -2
  32. package/components/SortableTable/actions.js +1 -1
  33. package/components/SortableTable/index.vue +54 -40
  34. package/components/SortableTable/paging.js +16 -19
  35. package/components/SortableTable/selection.js +1 -12
  36. package/components/Tabbed/index.vue +6 -0
  37. package/components/Wizard.vue +2 -2
  38. package/components/__tests__/AsyncButton.test.ts +39 -0
  39. package/components/__tests__/CruResource.test.ts +63 -0
  40. package/components/__tests__/ModalManager.spec.ts +176 -0
  41. package/components/__tests__/PromptModal.test.ts +146 -0
  42. package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
  43. package/components/auth/AuthBanner.vue +13 -11
  44. package/components/auth/Principal.vue +1 -0
  45. package/components/auth/login/ldap.vue +1 -1
  46. package/components/fleet/FleetResources.vue +21 -6
  47. package/components/form/ArrayList.vue +138 -118
  48. package/components/form/BannerSettings.vue +149 -85
  49. package/components/form/ColorInput.vue +35 -6
  50. package/components/form/EnvVars.vue +1 -0
  51. package/components/form/KeyValue.vue +10 -7
  52. package/components/form/LabeledSelect.vue +25 -23
  53. package/components/form/MatchExpressions.vue +9 -2
  54. package/components/form/NameNsDescription.vue +6 -2
  55. package/components/form/NotificationSettings.vue +15 -1
  56. package/components/form/Password.vue +1 -0
  57. package/components/form/Probe.vue +1 -0
  58. package/components/form/ResourceSelector.vue +26 -23
  59. package/components/form/ResourceTabs/index.vue +2 -1
  60. package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +15 -34
  61. package/components/form/SSHKnownHosts/index.vue +14 -11
  62. package/components/form/Select.vue +8 -15
  63. package/components/form/UnitInput.vue +13 -0
  64. package/components/form/ValueFromResource.vue +12 -12
  65. package/components/form/__tests__/ArrayList.test.ts +34 -2
  66. package/components/form/__tests__/ColorInput.test.ts +35 -0
  67. package/components/form/__tests__/KeyValue.test.ts +36 -0
  68. package/components/form/__tests__/LabeledSelect.test.ts +73 -0
  69. package/components/form/__tests__/SSHKnownHosts.test.ts +11 -2
  70. package/components/form/__tests__/Select.test.ts +34 -1
  71. package/components/form/__tests__/UnitInput.test.ts +23 -1
  72. package/components/formatter/ClusterLink.vue +5 -8
  73. package/components/formatter/Description.vue +30 -0
  74. package/components/formatter/__tests__/ClusterLink.test.ts +2 -32
  75. package/components/nav/Group.vue +12 -4
  76. package/components/nav/Header.vue +16 -43
  77. package/components/nav/NamespaceFilter.vue +134 -86
  78. package/components/nav/TopLevelMenu.vue +4 -5
  79. package/components/nav/WindowManager/ContainerLogs.vue +87 -61
  80. package/components/nav/WindowManager/ContainerLogsActions.vue +76 -0
  81. package/components/nav/WindowManager/index.vue +1 -0
  82. package/components/templates/default.vue +6 -3
  83. package/components/templates/home.vue +6 -0
  84. package/components/templates/plain.vue +6 -3
  85. package/composables/focusTrap.ts +12 -4
  86. package/config/product/explorer.js +16 -13
  87. package/config/product/manager.js +1 -28
  88. package/config/settings.ts +11 -13
  89. package/config/store.js +4 -0
  90. package/config/table-headers.js +7 -5
  91. package/config/uiplugins.js +5 -1
  92. package/core/types.ts +7 -6
  93. package/detail/catalog.cattle.io.app.vue +5 -1
  94. package/detail/fleet.cattle.io.bundle.vue +70 -6
  95. package/detail/fleet.cattle.io.gitrepo.vue +1 -1
  96. package/detail/namespace.vue +0 -3
  97. package/detail/node.vue +17 -13
  98. package/detail/provisioning.cattle.io.cluster.vue +85 -9
  99. package/detail/service.vue +0 -1
  100. package/detail/workload/index.vue +21 -34
  101. package/dialog/AddCustomBadgeDialog.vue +0 -1
  102. package/{pages/c/_cluster/uiplugins/AddExtensionRepos.vue → dialog/AddExtensionReposDialog.vue} +72 -42
  103. package/dialog/AssignToDialog.vue +176 -0
  104. package/dialog/ChangePasswordDialog.vue +106 -0
  105. package/{pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue → dialog/DeveloperLoadExtensionDialog.vue} +74 -71
  106. package/dialog/DisableAuthProviderDialog.vue +101 -0
  107. package/dialog/DrainNode.vue +1 -1
  108. package/{pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue → dialog/ExtensionCatalogInstallDialog.vue} +100 -88
  109. package/{pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue → dialog/ExtensionCatalogUninstallDialog.vue} +83 -65
  110. package/dialog/FeatureFlagListDialog.vue +288 -0
  111. package/dialog/ForceMachineRemoveDialog.vue +1 -1
  112. package/{components/Import.vue → dialog/ImportDialog.vue} +0 -5
  113. package/{pages/c/_cluster/uiplugins/InstallDialog.vue → dialog/InstallExtensionDialog.vue} +124 -106
  114. package/{components/form/SSHKnownHosts → dialog}/KnownHostsEditDialog.vue +52 -62
  115. package/dialog/MoveNamespaceDialog.vue +157 -0
  116. package/dialog/ScalePoolDownDialog.vue +1 -1
  117. package/{components/nav/Jump.vue → dialog/SearchDialog.vue} +34 -14
  118. package/{pages/c/_cluster/uiplugins/UninstallDialog.vue → dialog/UninstallExtensionDialog.vue} +67 -58
  119. package/dialog/WechatDialog.vue +57 -0
  120. package/edit/__tests__/service.test.ts +2 -1
  121. package/edit/auth/azuread.vue +1 -1
  122. package/edit/auth/github.vue +1 -1
  123. package/edit/auth/googleoauth.vue +1 -1
  124. package/edit/auth/ldap/index.vue +1 -1
  125. package/edit/auth/oidc.vue +1 -1
  126. package/edit/auth/saml.vue +1 -1
  127. package/edit/cloudcredential.vue +24 -10
  128. package/edit/management.cattle.io.user.vue +28 -3
  129. package/edit/namespace.vue +1 -4
  130. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +3 -14
  131. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +57 -62
  132. package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +3 -14
  133. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.test.ts +72 -41
  134. package/edit/networking.k8s.io.networkpolicy/__tests__/utils/mock.json +17 -1
  135. package/edit/networking.k8s.io.networkpolicy/index.vue +18 -30
  136. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +4 -1
  137. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +26 -10
  138. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +8 -8
  139. package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +26 -12
  140. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +66 -0
  141. package/edit/provisioning.cattle.io.cluster/__tests__/utils/rke2-test-data.ts +58 -0
  142. package/edit/provisioning.cattle.io.cluster/index.vue +21 -73
  143. package/edit/provisioning.cattle.io.cluster/rke2.vue +24 -7
  144. package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +5 -3
  145. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +4 -1
  146. package/edit/service.vue +13 -28
  147. package/initialize/install-plugins.js +2 -1
  148. package/list/harvesterhci.io.management.cluster.vue +4 -1
  149. package/list/management.cattle.io.feature.vue +4 -288
  150. package/list/workload.vue +6 -1
  151. package/machine-config/azure.vue +16 -4
  152. package/mixins/resource-fetch-api-pagination.js +55 -43
  153. package/mixins/resource-fetch.js +14 -5
  154. package/mixins/vue-select-overrides.js +0 -4
  155. package/models/__tests__/workload.test.ts +1 -0
  156. package/models/cluster/node.js +1 -0
  157. package/models/cluster.js +32 -2
  158. package/models/fleet.cattle.io.cluster.js +8 -2
  159. package/models/fleet.cattle.io.gitrepo.js +8 -34
  160. package/models/management.cattle.io.cluster.js +0 -20
  161. package/models/management.cattle.io.feature.js +7 -1
  162. package/models/management.cattle.io.node.js +7 -22
  163. package/models/management.cattle.io.nodepool.js +12 -0
  164. package/models/namespace.js +12 -1
  165. package/models/provisioning.cattle.io.cluster.js +18 -64
  166. package/models/service.js +24 -9
  167. package/models/workload.js +70 -31
  168. package/package.json +1 -1
  169. package/pages/about.vue +13 -3
  170. package/pages/account/index.vue +12 -5
  171. package/pages/auth/login.vue +7 -4
  172. package/pages/auth/setup.vue +1 -0
  173. package/pages/auth/verify.vue +9 -7
  174. package/pages/c/_cluster/apps/charts/install.vue +25 -26
  175. package/pages/c/_cluster/auth/config/index.vue +10 -12
  176. package/pages/c/_cluster/explorer/EventsTable.vue +38 -33
  177. package/pages/c/_cluster/explorer/index.vue +28 -15
  178. package/pages/c/_cluster/istio/index.vue +2 -2
  179. package/pages/c/_cluster/longhorn/index.vue +3 -3
  180. package/pages/c/_cluster/monitoring/index.vue +1 -1
  181. package/pages/c/_cluster/monitoring/monitor/_namespace/_id.vue +4 -2
  182. package/pages/c/_cluster/monitoring/monitor/create.vue +4 -2
  183. package/pages/c/_cluster/monitoring/route-receiver/_id.vue +4 -2
  184. package/pages/c/_cluster/monitoring/route-receiver/create.vue +5 -2
  185. package/pages/c/_cluster/neuvector/index.vue +1 -1
  186. package/pages/c/_cluster/settings/banners.vue +60 -5
  187. package/pages/c/_cluster/settings/performance.vue +7 -26
  188. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +8 -10
  189. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +4 -7
  190. package/pages/c/_cluster/uiplugins/index.vue +98 -55
  191. package/pages/diagnostic.vue +12 -9
  192. package/pages/fail-whale.vue +8 -5
  193. package/pages/home.vue +11 -52
  194. package/pages/prefs.vue +7 -6
  195. package/plugins/clean-html.js +2 -0
  196. package/plugins/dashboard-store/__tests__/actions.test.ts +4 -1
  197. package/plugins/dashboard-store/actions.js +122 -21
  198. package/plugins/dashboard-store/getters.js +74 -3
  199. package/plugins/dashboard-store/mutations.js +10 -5
  200. package/plugins/dashboard-store/resource-class.js +23 -3
  201. package/plugins/internal-api/index.ts +37 -0
  202. package/plugins/internal-api/shared/base-api.ts +13 -0
  203. package/plugins/internal-api/shell/shell.api.ts +108 -0
  204. package/plugins/steve/__tests__/getters.test.ts +18 -11
  205. package/plugins/steve/__tests__/steve-class.test.ts +1 -0
  206. package/plugins/steve/actions.js +34 -24
  207. package/plugins/steve/getters.js +39 -10
  208. package/plugins/steve/steve-class.js +5 -0
  209. package/plugins/steve/steve-pagination-utils.ts +199 -37
  210. package/plugins/steve/worker/web-worker.advanced.js +3 -1
  211. package/public/index.html +1 -0
  212. package/rancher-components/Banner/Banner.test.ts +51 -3
  213. package/rancher-components/Banner/Banner.vue +28 -6
  214. package/rancher-components/Card/Card.vue +1 -1
  215. package/rancher-components/Form/Checkbox/Checkbox.test.ts +59 -1
  216. package/rancher-components/Form/Checkbox/Checkbox.vue +27 -3
  217. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +51 -0
  218. package/rancher-components/Form/LabeledInput/LabeledInput.vue +20 -2
  219. package/rancher-components/Form/Radio/RadioButton.test.ts +36 -1
  220. package/rancher-components/Form/Radio/RadioButton.vue +20 -4
  221. package/rancher-components/Form/Radio/RadioGroup.test.ts +60 -0
  222. package/rancher-components/Form/Radio/RadioGroup.vue +75 -35
  223. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +17 -0
  224. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +26 -1
  225. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +10 -1
  226. package/rancher-components/RcButton/RcButton.vue +2 -1
  227. package/rancher-components/RcButton/types.ts +1 -0
  228. package/rancher-components/RcDropdown/RcDropdown.vue +17 -6
  229. package/rancher-components/RcDropdown/RcDropdownItem.vue +3 -56
  230. package/rancher-components/RcDropdown/RcDropdownItemCheckbox.vue +68 -0
  231. package/rancher-components/RcDropdown/RcDropdownItemSelect.vue +92 -0
  232. package/rancher-components/RcDropdown/index.ts +2 -0
  233. package/rancher-components/RcDropdown/useDropdownItem.ts +63 -0
  234. package/scripts/extension/bundle +20 -0
  235. package/scripts/extension/helm/charts/ui-plugin-server/templates/cr.yaml +2 -1
  236. package/scripts/extension/helm/charts/ui-plugin-server/values.yaml +2 -0
  237. package/scripts/extension/helmpatch +44 -31
  238. package/scripts/extension/publish +12 -13
  239. package/scripts/typegen.sh +2 -4
  240. package/store/action-menu.js +26 -56
  241. package/store/features.js +0 -1
  242. package/store/index.js +5 -0
  243. package/store/modal.ts +71 -0
  244. package/store/slideInPanel.ts +47 -0
  245. package/store/type-map.js +8 -1
  246. package/store/type-map.utils.ts +49 -6
  247. package/types/fleet.d.ts +1 -1
  248. package/types/global-vue.d.ts +5 -0
  249. package/types/internal-api/shell/growl.d.ts +25 -0
  250. package/types/internal-api/shell/modal.d.ts +77 -0
  251. package/types/internal-api/shell/slideIn.d.ts +15 -0
  252. package/types/kube/kube-api.ts +22 -0
  253. package/types/resources/fleet.d.ts +0 -14
  254. package/types/resources/settings.d.ts +0 -4
  255. package/types/shell/index.d.ts +375 -306
  256. package/types/store/dashboard-store.types.ts +24 -1
  257. package/types/store/pagination.types.ts +19 -2
  258. package/types/vue-shim.d.ts +4 -1
  259. package/utils/__mocks__/tabbable.js +13 -0
  260. package/utils/__tests__/object.test.ts +38 -4
  261. package/utils/cluster.js +24 -20
  262. package/utils/fleet.ts +15 -73
  263. package/utils/grafana.js +1 -0
  264. package/utils/object.js +36 -5
  265. package/utils/pagination-utils.ts +6 -2
  266. package/utils/perf-setting.utils.ts +28 -0
  267. package/utils/selector-typed.ts +205 -0
  268. package/utils/selector.js +29 -6
  269. package/utils/uiplugins.ts +10 -6
  270. package/utils/v-sphere.ts +5 -1
  271. package/utils/validators/formRules/__tests__/index.test.ts +10 -1
  272. package/utils/validators/formRules/index.ts +27 -3
  273. package/components/AssignTo.vue +0 -199
  274. package/components/DisableAuthProviderModal.vue +0 -115
  275. package/components/MoveModal.vue +0 -167
  276. package/components/PromptChangePassword.vue +0 -123
  277. package/components/fleet/FleetBundleResources.vue +0 -86
  278. package/components/formatter/RKETemplateName.vue +0 -37
  279. package/dialog/SaveAsRKETemplateDialog.vue +0 -139
  280. package/types/vue-shim.d +0 -20
@@ -1,4 +1,4 @@
1
- import { shallowMount } from '@vue/test-utils';
1
+ import { shallowMount, mount } from '@vue/test-utils';
2
2
  import { defineComponent } from 'vue';
3
3
  import Select from '@shell/components/form/Select.vue';
4
4
 
@@ -64,4 +64,37 @@ describe('select.vue', () => {
64
64
  // from the library
65
65
  expect(vSelectInput.attributes('aria-label')).toBe('-');
66
66
  });
67
+
68
+ it('pressing space key while focused on search should not prevent event propagation', async() => {
69
+ const value = 'value-1';
70
+ const options = [
71
+ { label: 'label-1', value: 'value-1' },
72
+ { label: 'label-2', value: 'value-2' },
73
+ ];
74
+
75
+ const wrapper = mount(SelectComponent, {
76
+ props: {
77
+ value,
78
+ label: 'some-label',
79
+ options,
80
+ searchable: true
81
+ }
82
+ });
83
+
84
+ const mockEvent = { preventDefault: jest.fn() };
85
+ const spyFocus = jest.spyOn(wrapper.vm, 'focusSearch');
86
+ const spyPreventDefault = jest.spyOn(mockEvent, 'preventDefault');
87
+
88
+ const input = wrapper.find('.unlabeled-select');
89
+
90
+ // open unlabeled-select first
91
+ await input.trigger('keydown.enter');
92
+
93
+ // mimic pressing space on search box inside v-select
94
+ await input.trigger('keydown.space', mockEvent);
95
+
96
+ // eslint-disable-next-line
97
+ expect(spyFocus).toHaveBeenCalled();
98
+ expect(spyPreventDefault).not.toHaveBeenCalled();
99
+ });
67
100
  });
@@ -5,12 +5,34 @@ import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
5
5
  import { defineComponent } from 'vue';
6
6
 
7
7
  describe('component: UnitInput', () => {
8
- it('should renders', () => {
8
+ it('should render the UnitInput component with basic config', () => {
9
9
  const wrapper = mount(UnitInput, { props: { value: 1 } });
10
10
 
11
11
  expect(wrapper.isVisible()).toBe(true);
12
12
  });
13
13
 
14
+ it('a11y: adding ARIA props should correctly fill out the appropriate fields on the component', () => {
15
+ const baseUnit = 'B';
16
+ const wrapper = mount(UnitInput,
17
+ {
18
+ props: {
19
+ value: 1,
20
+ baseUnit,
21
+ disabled: true
22
+ }
23
+ }
24
+ );
25
+
26
+ const inputElement = wrapper.find('input');
27
+ const unitDisplay = wrapper.find('.addon');
28
+
29
+ expect(wrapper.findComponent(LabeledInput as any).exists()).toBe(true);
30
+ expect(inputElement.attributes('aria-describedby')).toBe(wrapper.vm.describedById);
31
+ expect(unitDisplay.attributes('id')).toBe(wrapper.vm.describedById);
32
+ expect(inputElement.attributes('aria-disabled')).toBe('true');
33
+ expect(inputElement.attributes('disabled')).toBeDefined();
34
+ });
35
+
14
36
  it.each(['blur', 'update:value'])('should emit input event when "%p" is fired', async(event) => {
15
37
  const wrapper = mount(UnitInput, { props: { value: 1, delay: 0 } });
16
38
  const input = wrapper.find('input');
@@ -70,10 +70,10 @@ export default {
70
70
  data-testid="unavailable-machines-alert-icon"
71
71
  />
72
72
  <i
73
- v-if="row.rkeTemplateUpgrade"
74
- v-clean-tooltip="t('cluster.rkeTemplateUpgrade', { name: row.rkeTemplateUpgrade })"
75
- class="template-upgrade-icon icon-alert icon"
76
- data-testid="rke-template-upgrade-alert-icon"
73
+ v-if="row.isRke1"
74
+ v-clean-tooltip="t('cluster.rke1Unsupported')"
75
+ class="rke1-unsupported-icon icon-warning icon"
76
+ data-testid="rke1-unsupported-icon"
77
77
  />
78
78
  <i
79
79
  v-if="row.hasError && statusErrorConditions.length > 0"
@@ -106,12 +106,9 @@ export default {
106
106
  .mytooltip ul {
107
107
  outline: 1px dashed red;
108
108
  }
109
- .template-upgrade-icon {
110
- border: 1px solid var(--warning);
111
- border-radius: 50%;
109
+ .rke1-unsupported-icon {
112
110
  color: var(--warning);
113
111
  margin-left: 4px;
114
112
  font-size: 14px;
115
- padding: 2px;
116
113
  }
117
114
  </style>
@@ -0,0 +1,30 @@
1
+ <script>
2
+ export default {
3
+ props: {
4
+ value: {
5
+ type: String,
6
+ required: true,
7
+ }
8
+ },
9
+ };
10
+ </script>
11
+ <template>
12
+ <span
13
+ v-clean-tooltip="{content: value, placement: 'auto', popperClass: ['description-tooltip']}"
14
+ class="description-text"
15
+ >
16
+ {{ value }}
17
+ </span>
18
+ </template>
19
+ <style lang="scss">
20
+ .description-text {
21
+ display: block;
22
+ width: inherit;
23
+ overflow: hidden;
24
+ white-space: nowrap;
25
+ text-overflow: ellipsis;
26
+ }
27
+ .description-tooltip {
28
+ overflow-wrap: break-word;
29
+ }
30
+ </style>
@@ -3,7 +3,6 @@ import ClusterLink from '@shell/components/formatter/ClusterLink.vue';
3
3
 
4
4
  describe('component: ClusterLink', () => {
5
5
  const UNAVAILABLE_MACHINES_ICON_SELECTOR = '[data-testid="unavailable-machines-alert-icon"]';
6
- const TEMPLATE_UPGRADE_ICON_SELECTOR = '[data-testid="rke-template-upgrade-alert-icon"]';
7
6
  const CONDITION_HAS_ERROR_ICON_SELECTOR = '[data-testid="conditions-has-error-icon"]';
8
7
 
9
8
  describe('unavailable machines alert icon', () => {
@@ -20,10 +19,9 @@ describe('component: ClusterLink', () => {
20
19
  const wrapper = mount(ClusterLink, {
21
20
  props: {
22
21
  row: {
23
- hasError: false,
24
- status: {},
22
+ hasError: false,
23
+ status: {},
25
24
  unavailableMachines,
26
- rkeTemplateUpgrade: undefined
27
25
  },
28
26
  reference: 'any',
29
27
  value: 'any'
@@ -36,34 +34,6 @@ describe('component: ClusterLink', () => {
36
34
  );
37
35
  });
38
36
 
39
- describe('template upgrade alert icon', () => {
40
- const testCases = [
41
- [undefined, false],
42
- ['any', true],
43
- ];
44
-
45
- it.each(testCases)(
46
- 'should show/hide properly based on rkeTemplateUpgrade',
47
- (rkeTemplateUpgrade, expected) => {
48
- const wrapper = mount(ClusterLink, {
49
- props: {
50
- row: {
51
- hasError: false,
52
- status: {},
53
- unavailableMachines: 0,
54
- rkeTemplateUpgrade
55
- },
56
- reference: 'any',
57
- value: 'any'
58
- }
59
- });
60
- const el = wrapper.find(TEMPLATE_UPGRADE_ICON_SELECTOR);
61
-
62
- expect(el.exists()).toBe(expected);
63
- }
64
- );
65
- });
66
-
67
37
  describe('conditions has error icon', () => {
68
38
  const MOCKED_CONDITIONS_1 = [{
69
39
  status: '', type: 'Ready', reason: 'Waiting', error: true // When the only existing error has a type "Ready" and reason "Waiting"
@@ -99,6 +99,11 @@ export default {
99
99
  },
100
100
 
101
101
  groupSelected() {
102
+ // Can not click on groups that are fixed open
103
+ if (this.fixedOpen) {
104
+ return;
105
+ }
106
+
102
107
  // Don't auto-select first group entry if we're already expanded and contain the currently-selected nav item
103
108
  if (this.hasActiveRoute() && this.isExpanded) {
104
109
  return;
@@ -219,14 +224,14 @@ export default {
219
224
  <template>
220
225
  <div
221
226
  class="accordion"
222
- :class="{[`depth-${depth}`]: true, 'expanded': isExpanded, 'has-children': hasChildren, 'group-highlight': isGroupActive}"
227
+ :class="{[`depth-${depth}`]: true, 'expanded': isExpanded, 'has-children': hasChildren, 'group-highlight': isGroupActive }"
223
228
  >
224
229
  <div
225
230
  v-if="showHeader"
226
231
  class="header"
227
- :class="{'active': isOverview, 'noHover': !canCollapse}"
232
+ :class="{'active': isOverview, 'noHover': !canCollapse || fixedOpen}"
228
233
  role="button"
229
- tabindex="0"
234
+ :tabindex="fixedOpen ? -1 : 0"
230
235
  :aria-label="group.labelDisplay || group.label || ''"
231
236
  @click="groupSelected()"
232
237
  @keyup.enter="groupSelected()"
@@ -274,7 +279,7 @@ export default {
274
279
  v-if="child.divider"
275
280
  :key="idx"
276
281
  >
277
- <hr>
282
+ <hr role="none">
278
283
  </li>
279
284
  <!-- <div v-else-if="child[childrenKey] && hideGroup(child[childrenKey])" :key="child.name">
280
285
  HIDDEN
@@ -372,6 +377,9 @@ export default {
372
377
  &:hover:not(.active) {
373
378
  background-color: var(--nav-hover);
374
379
  }
380
+ &:hover:not(.active).noHover {
381
+ background-color: inherit;
382
+ }
375
383
  }
376
384
  }
377
385
 
@@ -5,7 +5,6 @@ import { MANAGEMENT, NORMAN, STEVE } from '@shell/config/types';
5
5
  import { HARVESTER_NAME as HARVESTER } from '@shell/config/features';
6
6
  import { ucFirst } from '@shell/utils/string';
7
7
  import { isAlternate, isMac } from '@shell/utils/platform';
8
- import Import from '@shell/components/Import';
9
8
  import BrandImage from '@shell/components/BrandImage';
10
9
  import { getProduct, getVendor } from '@shell/config/private-label';
11
10
  import ClusterProviderIcon from '@shell/components/ClusterProviderIcon';
@@ -16,7 +15,6 @@ import NamespaceFilter from './NamespaceFilter';
16
15
  import WorkspaceSwitcher from './WorkspaceSwitcher';
17
16
  import TopLevelMenu from './TopLevelMenu';
18
17
 
19
- import Jump from './Jump';
20
18
  import { allHash } from '@shell/utils/promise';
21
19
  import { ActionLocation, ExtensionPoint } from '@shell/core/types';
22
20
  import { getApplicableExtensionEnhancements } from '@shell/core/plugin-helpers';
@@ -36,9 +34,7 @@ export default {
36
34
  components: {
37
35
  NamespaceFilter,
38
36
  WorkspaceSwitcher,
39
- Import,
40
37
  TopLevelMenu,
41
- Jump,
42
38
  BrandImage,
43
39
  ClusterBadge,
44
40
  ClusterProviderIcon,
@@ -79,9 +75,7 @@ export default {
79
75
  LOGGED_OUT,
80
76
  navHeaderRight: null,
81
77
  extensionHeaderActions: getApplicableExtensionEnhancements(this, ExtensionPoint.ACTION, ActionLocation.HEADER, this.$route),
82
- ctx: this,
83
- showImportModal: false,
84
- showSearchModal: false
78
+ ctx: this
85
79
  };
86
80
  },
87
81
 
@@ -316,19 +310,24 @@ export default {
316
310
  },
317
311
 
318
312
  openImport() {
319
- this.showImportModal = true;
320
- },
321
-
322
- closeImport() {
323
- this.showImportModal = false;
313
+ this.$store.dispatch('cluster/promptModal', {
314
+ component: 'ImportDialog',
315
+ modalWidth: '75%',
316
+ height: 'auto',
317
+ styles: 'max-height: 90vh;',
318
+ componentProps: { cluster: this.currentCluster }
319
+ });
324
320
  },
325
321
 
326
322
  openSearch() {
327
- this.showSearchModal = true;
328
- },
329
-
330
- hideSearch() {
331
- this.showSearchModal = false;
323
+ this.$store.dispatch('cluster/promptModal', {
324
+ component: 'SearchDialog',
325
+ testId: 'search-modal',
326
+ modalWidth: '50%',
327
+ height: 'auto',
328
+ styles: 'max-height: 90vh;',
329
+ returnFocusSelector: '#header-btn-search'
330
+ });
332
331
  },
333
332
 
334
333
  checkClusterName() {
@@ -555,20 +554,6 @@ export default {
555
554
  >
556
555
  <i class="icon icon-upload icon-lg" />
557
556
  </button>
558
- <app-modal
559
- v-if="showImportModal"
560
- class="import-modal"
561
- name="importModal"
562
- width="75%"
563
- height="auto"
564
- styles="max-height: 90vh;"
565
- @close="closeImport"
566
- >
567
- <Import
568
- :cluster="currentCluster"
569
- @close="closeImport"
570
- />
571
- </app-modal>
572
557
 
573
558
  <button
574
559
  v-if="showKubeShell"
@@ -641,18 +626,6 @@ export default {
641
626
  >
642
627
  <i class="icon icon-search icon-lg" />
643
628
  </button>
644
- <app-modal
645
- v-if="showSearch && showSearchModal"
646
- class="search-modal"
647
- name="searchModal"
648
- width="50%"
649
- height="auto"
650
- :trigger-focus-trap="true"
651
- return-focus-selector="#header-btn-search"
652
- @close="hideSearch()"
653
- >
654
- <Jump @closeSearch="hideSearch()" />
655
- </app-modal>
656
629
  </div>
657
630
 
658
631
  <!-- Extension header actions -->