@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
@@ -10,7 +10,6 @@ import { allHash } from '@shell/utils/promise';
10
10
  import ResourceManager from '@shell/mixins/resource-manager';
11
11
 
12
12
  import AsyncButton from '@shell/components/AsyncButton';
13
- import AppModal from '@shell/components/AppModal';
14
13
  import LabeledSelect from '@shell/components/form/LabeledSelect';
15
14
  import Loading from '@shell/components/Loading.vue';
16
15
  import { Banner } from '@components/Banner';
@@ -98,14 +97,41 @@ const initialState = () => {
98
97
  };
99
98
 
100
99
  export default {
101
- emits: ['closed', 'refresh'],
100
+ emits: ['close'],
102
101
 
103
102
  components: {
104
- AsyncButton, Banner, LabeledInput, Loading, LabeledSelect, AppModal,
103
+ AsyncButton, Banner, LabeledInput, Loading, LabeledSelect
105
104
  },
106
105
 
107
106
  mixins: [ResourceManager],
108
107
 
108
+ props: {
109
+ /**
110
+ * Callback to trigger refresh banner on extensions screen
111
+ */
112
+ refresh: {
113
+ type: Function,
114
+ default: () => {},
115
+ required: true
116
+ },
117
+ /**
118
+ * Callback when modal is closed
119
+ */
120
+ closed: {
121
+ type: Function,
122
+ default: () => {},
123
+ required: true
124
+ },
125
+ resources: {
126
+ type: Array,
127
+ default: () => []
128
+ },
129
+ registerBackgroundClosing: {
130
+ type: Function,
131
+ default: () => {}
132
+ }
133
+ },
134
+
109
135
  async fetch() {
110
136
  const hash = {};
111
137
 
@@ -126,9 +152,7 @@ export default {
126
152
  data() {
127
153
  return {
128
154
  ...initialState(),
129
- secondaryResourceData: null,
130
- showModal: false,
131
- returnFocusSelector: '[data-testid="extensions-catalog-load-dialog"]'
155
+ secondaryResourceData: null
132
156
  };
133
157
  },
134
158
 
@@ -163,18 +187,15 @@ export default {
163
187
  };
164
188
  },
165
189
 
166
- showDialog() {
167
- this.showModal = true;
168
- },
169
-
170
190
  closeDialog(result) {
171
- this.showModal = false;
172
- this.$emit('closed', result);
191
+ this.closed(result);
173
192
 
174
193
  // Reset state
175
194
  Object.assign(this.$data, initialState());
176
195
  this.secondaryResourceData = this.secondaryResourceDataConfig();
177
196
  this.resourceManagerFetchSecondaryResources(this.secondaryResourceData);
197
+
198
+ this.$emit('close');
178
199
  },
179
200
 
180
201
  async loadImage(btnCb) {
@@ -205,7 +226,8 @@ export default {
205
226
  message: this.t('plugins.manageCatalog.imageLoad.success.message'),
206
227
  timeout: 4000,
207
228
  }, { root: true });
208
- this.$emit('refresh');
229
+
230
+ this.refresh();
209
231
  }
210
232
  } else {
211
233
  throw new Error('Unable to determine image name');
@@ -430,90 +452,80 @@ export default {
430
452
  </script>
431
453
 
432
454
  <template>
433
- <app-modal
434
- v-if="showModal"
435
- name="catalogLoadDialog"
436
- height="auto"
437
- :scrollable="true"
438
- :trigger-focus-trap="true"
439
- :return-focus-selector="returnFocusSelector"
440
- @close="closeDialog()"
455
+ <Loading
456
+ v-if="$fetchState.loading"
457
+ mode="relative"
458
+ />
459
+ <div
460
+ v-else
461
+ class="plugin-install-dialog"
441
462
  >
442
- <Loading
443
- v-if="$fetchState.loading"
444
- mode="relative"
445
- />
446
- <div
447
- v-else
448
- class="plugin-install-dialog"
449
- >
450
- <div>
451
- <h4>
452
- {{ t('plugins.manageCatalog.imageLoad.load') }}
453
- </h4>
454
- <p>
455
- {{ t('plugins.manageCatalog.imageLoad.prompt') }}
456
- </p>
457
-
458
- <div class="custom mt-10">
459
- <Banner
460
- color="info"
461
- :label="t('plugins.manageCatalog.imageLoad.banner')"
462
- class="mt-10"
463
- />
464
- </div>
463
+ <div>
464
+ <h4>
465
+ {{ t('plugins.manageCatalog.imageLoad.load') }}
466
+ </h4>
467
+ <p>
468
+ {{ t('plugins.manageCatalog.imageLoad.prompt') }}
469
+ </p>
465
470
 
466
- <div class="custom mt-10">
467
- <div class="fields">
468
- <LabeledInput
469
- v-model:value.trim="deploymentValues.spec.template.spec.containers[0].image"
470
- label-key="plugins.manageCatalog.imageLoad.fields.image.label"
471
- placeholder-key="plugins.manageCatalog.imageLoad.fields.image.placeholder"
472
- />
473
- </div>
474
- </div>
475
- <div class="custom mt-10">
476
- <div class="fields">
477
- <LabeledSelect
478
- v-model:value="imagePullSecrets"
479
- :label="t('plugins.manageCatalog.imageLoad.fields.imagePullSecrets.label')"
480
- :tooltip="t('plugins.manageCatalog.imageLoad.fields.imagePullSecrets.tooltip')"
481
- :multiple="true"
482
- :taggable="true"
483
- :options="imagePullNamespacedSecrets"
484
- option-label="metadata.name"
485
- :reduce="service => service.metadata.name"
486
- />
487
- <Banner
488
- color="warning"
489
- class="mt-10"
490
- >
491
- <span v-clean-html="t('plugins.manageCatalog.imageLoad.fields.secrets.banner', {}, true)" />
492
- </Banner>
493
- </div>
494
- </div>
471
+ <div class="custom mt-10">
472
+ <Banner
473
+ color="info"
474
+ :label="t('plugins.manageCatalog.imageLoad.banner')"
475
+ class="mt-10"
476
+ />
495
477
  </div>
496
478
 
497
479
  <div class="custom mt-10">
498
480
  <div class="fields">
499
- <div class="dialog-buttons mt-20">
500
- <button
501
- class="btn role-secondary"
502
- data-testid="image-load-ext-modal-cancel-btn"
503
- @click="closeDialog()"
504
- >
505
- {{ t('generic.cancel') }}
506
- </button>
507
- <AsyncButton
508
- mode="load"
509
- data-testid="image-load-ext-modal-install-btn"
510
- @click="loadImage"
511
- />
512
- </div>
481
+ <LabeledInput
482
+ v-model:value.trim="deploymentValues.spec.template.spec.containers[0].image"
483
+ label-key="plugins.manageCatalog.imageLoad.fields.image.label"
484
+ placeholder-key="plugins.manageCatalog.imageLoad.fields.image.placeholder"
485
+ />
486
+ </div>
487
+ </div>
488
+ <div class="custom mt-10">
489
+ <div class="fields">
490
+ <LabeledSelect
491
+ v-model:value="imagePullSecrets"
492
+ :label="t('plugins.manageCatalog.imageLoad.fields.imagePullSecrets.label')"
493
+ :tooltip="t('plugins.manageCatalog.imageLoad.fields.imagePullSecrets.tooltip')"
494
+ :multiple="true"
495
+ :taggable="true"
496
+ :options="imagePullNamespacedSecrets"
497
+ option-label="metadata.name"
498
+ :reduce="service => service.metadata.name"
499
+ />
500
+ <Banner
501
+ color="warning"
502
+ class="mt-10"
503
+ >
504
+ <span v-clean-html="t('plugins.manageCatalog.imageLoad.fields.secrets.banner', {}, true)" />
505
+ </Banner>
506
+ </div>
507
+ </div>
508
+ </div>
509
+
510
+ <div class="custom mt-10">
511
+ <div class="fields">
512
+ <div class="dialog-buttons mt-20">
513
+ <button
514
+ class="btn role-secondary"
515
+ data-testid="image-load-ext-modal-cancel-btn"
516
+ @click="closeDialog()"
517
+ >
518
+ {{ t('generic.cancel') }}
519
+ </button>
520
+ <AsyncButton
521
+ mode="load"
522
+ data-testid="image-load-ext-modal-install-btn"
523
+ @click="loadImage"
524
+ />
513
525
  </div>
514
526
  </div>
515
527
  </div>
516
- </app-modal>
528
+ </div>
517
529
  </template>
518
530
 
519
531
  <style lang="scss" scoped>
@@ -6,12 +6,46 @@ import { UI_PLUGIN_LABELS, UI_PLUGIN_NAMESPACE } from '@shell/config/uiplugins';
6
6
  import { allHash } from '@shell/utils/promise';
7
7
 
8
8
  import AsyncButton from '@shell/components/AsyncButton';
9
- import AppModal from '@shell/components/AppModal.vue';
10
9
 
11
10
  export default {
12
- emits: ['closed', 'refresh', 'update'],
13
-
14
- components: { AsyncButton, AppModal },
11
+ emits: ['close'],
12
+
13
+ components: { AsyncButton },
14
+
15
+ props: {
16
+ /**
17
+ * Catalog object
18
+ */
19
+ catalog: {
20
+ type: Object,
21
+ default: () => {},
22
+ required: true
23
+ },
24
+ /**
25
+ * Callback to trigger refresh banner on extensions screen
26
+ */
27
+ refresh: {
28
+ type: Function,
29
+ default: () => {},
30
+ required: true
31
+ },
32
+ /**
33
+ * Callback when modal is closed
34
+ */
35
+ closed: {
36
+ type: Function,
37
+ default: () => {},
38
+ required: true
39
+ },
40
+ resources: {
41
+ type: Array,
42
+ default: () => []
43
+ },
44
+ registerBackgroundClosing: {
45
+ type: Function,
46
+ default: () => {}
47
+ }
48
+ },
15
49
 
16
50
  async fetch() {
17
51
  if ( this.$store.getters['management/schemaFor'](UI_PLUGIN) ) {
@@ -23,11 +57,8 @@ export default {
23
57
 
24
58
  data() {
25
59
  return {
26
- catalog: undefined,
27
- busy: false,
28
- plugins: null,
29
- showModal: false,
30
- returnFocusSelector: '[data-testid="extensions-catalog-load-dialog"]'
60
+ busy: false,
61
+ plugins: null,
31
62
  };
32
63
  },
33
64
 
@@ -40,19 +71,14 @@ export default {
40
71
  },
41
72
 
42
73
  methods: {
43
- showDialog(catalog) {
44
- this.catalog = catalog;
45
- this.busy = false;
46
- this.showModal = true;
47
- },
48
-
49
74
  closeDialog(result) {
50
- this.showModal = false;
51
- this.$emit('closed', result);
75
+ this.closed(result);
52
76
 
53
77
  if ( result ) {
54
- this.$emit('refresh');
78
+ this.refresh();
55
79
  }
80
+
81
+ this.$emit('close');
56
82
  },
57
83
 
58
84
  async uninstall() {
@@ -76,7 +102,6 @@ export default {
76
102
  if ( pluginApps.length ) {
77
103
  try {
78
104
  pluginApps.forEach((app) => {
79
- this.$emit('update', app.name, 'uninstall');
80
105
  app.remove();
81
106
  });
82
107
  } catch (e) {
@@ -94,18 +119,24 @@ export default {
94
119
  },
95
120
 
96
121
  async removeCatalogResources(catalog) {
97
- const selector = `${ UI_PLUGIN_LABELS.CATALOG_IMAGE }=${ catalog.name }`;
98
- const namespace = UI_PLUGIN_NAMESPACE;
122
+ if ( catalog.name ) {
123
+ const namespace = UI_PLUGIN_NAMESPACE;
124
+ // of type KubeLabelSelector
125
+ const labelSelector = { matchLabels: { [UI_PLUGIN_LABELS.CATALOG_IMAGE]: catalog.name } };
99
126
 
100
- if ( selector ) {
101
127
  const hash = await allHash({
102
- deployment: this.$store.dispatch('management/findMatching', {
103
- type: WORKLOAD_TYPES.DEPLOYMENT, selector, namespace
128
+ deployment: this.$store.dispatch('management/findLabelSelector', {
129
+ type: WORKLOAD_TYPES.DEPLOYMENT,
130
+ matching: { namespace, labelSelector }
104
131
  }),
105
- service: this.$store.dispatch('management/findMatching', {
106
- type: SERVICE, selector, namespace
132
+ service: this.$store.dispatch('management/findLabelSelector', {
133
+ type: SERVICE,
134
+ matching: { namespace, labelSelector }
107
135
  }),
108
- repo: this.$store.dispatch('management/findMatching', { type: CATALOG.CLUSTER_REPO, selector })
136
+ repo: this.$store.dispatch('management/findLabelSelector', {
137
+ type: CATALOG.CLUSTER_REPO,
138
+ matching: { labelSelector }
139
+ })
109
140
  });
110
141
 
111
142
  for ( const resource of Object.keys(hash) ) {
@@ -120,46 +151,33 @@ export default {
120
151
  </script>
121
152
 
122
153
  <template>
123
- <app-modal
124
- v-if="showModal"
125
- name="uninstallCatalogDialog"
126
- height="auto"
127
- :scrollable="true"
128
- :trigger-focus-trap="true"
129
- :return-focus-selector="returnFocusSelector"
130
- @close="closeDialog(false)"
131
- >
132
- <div
133
- v-if="catalog"
134
- class="plugin-install-dialog"
135
- >
136
- <h4 class="mt-10">
137
- {{ t('plugins.uninstall.title', { name: catalog.name }) }}
138
- </h4>
139
- <div class="mt-10 dialog-panel">
140
- <div class="dialog-info">
141
- <p>
142
- {{ t('plugins.uninstall.catalog') }}
143
- </p>
144
- </div>
145
- <div class="dialog-buttons">
146
- <button
147
- :disabled="busy"
148
- class="btn role-secondary"
149
- data-testid="uninstall-ext-modal-cancel-btn"
150
- @click="closeDialog(false)"
151
- >
152
- {{ t('generic.cancel') }}
153
- </button>
154
- <AsyncButton
155
- mode="uninstall"
156
- data-testid="uninstall-ext-modal-uninstall-btn"
157
- @click="uninstall()"
158
- />
159
- </div>
154
+ <div class="plugin-install-dialog">
155
+ <h4 class="mt-10">
156
+ {{ t('plugins.uninstall.title', { name: catalog.name }) }}
157
+ </h4>
158
+ <div class="mt-10 dialog-panel">
159
+ <div class="dialog-info">
160
+ <p>
161
+ {{ t('plugins.uninstall.catalog') }}
162
+ </p>
163
+ </div>
164
+ <div class="dialog-buttons">
165
+ <button
166
+ :disabled="busy"
167
+ class="btn role-secondary"
168
+ data-testid="uninstall-ext-modal-cancel-btn"
169
+ @click="closeDialog(false)"
170
+ >
171
+ {{ t('generic.cancel') }}
172
+ </button>
173
+ <AsyncButton
174
+ mode="uninstall"
175
+ data-testid="uninstall-ext-modal-uninstall-btn"
176
+ @click="uninstall()"
177
+ />
160
178
  </div>
161
179
  </div>
162
- </app-modal>
180
+ </div>
163
181
  </template>
164
182
 
165
183
  <style lang="scss" scoped>