@rancher/shell 3.0.0-rc.3 → 3.0.0-rc.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 (295) hide show
  1. package/assets/styles/base/_variables.scss +12 -4
  2. package/assets/styles/global/_layout.scss +1 -1
  3. package/assets/styles/global/_tooltip.scss +1 -1
  4. package/assets/translations/en-us.yaml +61 -26
  5. package/assets/translations/zh-hans.yaml +6 -5
  6. package/chart/istio.vue +2 -0
  7. package/chart/monitoring/ClusterSelector.vue +2 -0
  8. package/chart/monitoring/StorageClassSelector.vue +4 -1
  9. package/chart/monitoring/index.vue +2 -0
  10. package/chart/rancher-backup/S3.vue +2 -0
  11. package/chart/rancher-backup/index.vue +2 -0
  12. package/cloud-credential/aws.vue +2 -0
  13. package/cloud-credential/azure.vue +2 -0
  14. package/cloud-credential/digitalocean.vue +2 -0
  15. package/cloud-credential/gcp.vue +2 -0
  16. package/cloud-credential/generic.vue +2 -0
  17. package/cloud-credential/harvester.vue +2 -0
  18. package/cloud-credential/linode.vue +2 -0
  19. package/cloud-credential/pnap.vue +2 -0
  20. package/cloud-credential/s3.vue +2 -0
  21. package/cloud-credential/vmwarevsphere.vue +2 -0
  22. package/components/ActionMenu.vue +4 -1
  23. package/components/AppModal.vue +4 -1
  24. package/components/ButtonDropdown.vue +3 -0
  25. package/components/ButtonGroup.vue +2 -0
  26. package/components/ButtonMultiAction.vue +41 -0
  27. package/components/Carousel.vue +3 -0
  28. package/components/CodeMirror.vue +6 -4
  29. package/components/Collapse.vue +4 -1
  30. package/components/CollapsibleCard.vue +4 -1
  31. package/components/ContainerResourceLimit.vue +2 -0
  32. package/components/CopyCode.vue +8 -4
  33. package/components/CopyToClipboardText.vue +2 -0
  34. package/components/CruResource.vue +2 -0
  35. package/components/CruResourceFooter.vue +2 -0
  36. package/components/Dialog.vue +2 -0
  37. package/components/DisableAuthProviderModal.vue +4 -1
  38. package/components/EmberPage.vue +2 -0
  39. package/components/ExplorerProjectsNamespaces.vue +11 -8
  40. package/components/GlobalRoleBindings.vue +2 -0
  41. package/components/Import.vue +2 -0
  42. package/components/InputOrDisplay.vue +23 -18
  43. package/components/Loading.vue +4 -1
  44. package/components/Markdown.vue +2 -0
  45. package/components/ModalWithCard.vue +2 -0
  46. package/components/MoveModal.vue +2 -0
  47. package/components/PodSecurityAdmission.vue +2 -0
  48. package/components/Questions/Array.vue +2 -0
  49. package/components/Questions/Boolean.vue +2 -0
  50. package/components/Questions/CloudCredential.vue +2 -0
  51. package/components/Questions/Enum.vue +2 -0
  52. package/components/Questions/Float.vue +2 -0
  53. package/components/Questions/Int.vue +2 -0
  54. package/components/Questions/QuestionMap.vue +4 -1
  55. package/components/Questions/Radio.vue +2 -0
  56. package/components/Questions/Reference.vue +2 -0
  57. package/components/Questions/String.vue +2 -0
  58. package/components/Questions/Yaml.vue +2 -0
  59. package/components/Questions/index.vue +2 -0
  60. package/components/ResourceCancelModal.vue +2 -0
  61. package/components/ResourceDetail/Masthead.vue +4 -3
  62. package/components/ResourceDetail/index.vue +17 -15
  63. package/components/ResourceTable.vue +2 -0
  64. package/components/ResourceYaml.vue +2 -0
  65. package/components/SelectIconGrid.vue +2 -0
  66. package/components/SimpleBox.vue +2 -0
  67. package/components/SortableTable/THead.vue +2 -0
  68. package/components/SortableTable/index.vue +15 -19
  69. package/components/StatusTable.vue +2 -0
  70. package/components/Tabbed/Tab.vue +2 -0
  71. package/components/Tabbed/index.vue +2 -0
  72. package/components/Wizard.vue +2 -0
  73. package/components/YamlEditor.vue +2 -0
  74. package/components/__tests__/ButtonMultiAction.test.ts +31 -0
  75. package/components/auth/RoleDetailEdit.vue +2 -0
  76. package/components/auth/SelectPrincipal.vue +2 -0
  77. package/components/auth/login/ldap.vue +2 -0
  78. package/components/fleet/FleetStatus.vue +3 -2
  79. package/components/form/ArrayList.vue +16 -1
  80. package/components/form/ArrayListSelect.vue +2 -0
  81. package/components/form/ChangePassword.vue +2 -0
  82. package/components/form/ColorInput.vue +2 -0
  83. package/components/form/Command.vue +2 -0
  84. package/components/form/FileImageSelector.vue +2 -0
  85. package/components/form/FileSelector.vue +2 -0
  86. package/components/form/Footer.vue +2 -0
  87. package/components/form/GitPicker.vue +1 -0
  88. package/components/form/HealthCheck.vue +5 -3
  89. package/components/form/HookOption.vue +22 -18
  90. package/components/form/InputWithSelect.vue +3 -1
  91. package/components/form/KeyValue.vue +2 -0
  92. package/components/form/LabeledSelect.vue +13 -3
  93. package/components/form/LifecycleHooks.vue +2 -0
  94. package/components/form/MatchExpressions.vue +2 -0
  95. package/components/form/Members/ClusterPermissionsEditor.vue +2 -0
  96. package/components/form/Members/MembershipEditor.vue +2 -0
  97. package/components/form/NameNsDescription.vue +4 -1
  98. package/components/form/Networking.vue +2 -0
  99. package/components/form/NodeAffinity.vue +4 -1
  100. package/components/form/Password.vue +2 -0
  101. package/components/form/PlusMinus.vue +2 -0
  102. package/components/form/PodAffinity.vue +4 -1
  103. package/components/form/Ports.vue +2 -0
  104. package/components/form/Probe.vue +8 -4
  105. package/components/form/ResourceQuota/NamespaceRow.vue +2 -0
  106. package/components/form/ResourceQuota/Project.vue +2 -0
  107. package/components/form/ResourceQuota/ProjectRow.vue +2 -0
  108. package/components/form/RuleSelector.vue +2 -0
  109. package/components/form/SecretSelector.vue +1 -0
  110. package/components/form/Security.vue +5 -2
  111. package/components/form/Select.vue +2 -1
  112. package/components/form/SelectOrCreateAuthSecret.vue +2 -0
  113. package/components/form/ServiceNameSelect.vue +2 -0
  114. package/components/form/ServicePorts.vue +2 -0
  115. package/components/form/ShellInput.vue +2 -0
  116. package/components/form/SimpleSecretSelector.vue +2 -0
  117. package/components/form/Taints.vue +2 -0
  118. package/components/form/Tolerations.vue +2 -0
  119. package/components/form/ValueFromResource.vue +2 -0
  120. package/components/form/WorkloadPorts.vue +5 -3
  121. package/components/form/__tests__/HookOption.test.ts +28 -0
  122. package/components/form/__tests__/LabeledSelect.test.ts +42 -0
  123. package/components/form/__tests__/Probe.test.ts +12 -0
  124. package/components/nav/Header.vue +26 -128
  125. package/components/nav/HeaderPageActionMenu.vue +151 -0
  126. package/components/nav/Jump.vue +2 -0
  127. package/components/nav/NamespaceFilter.vue +5 -1
  128. package/components/nav/Type.vue +28 -2
  129. package/components/nav/WindowManager/ContainerShell.vue +6 -12
  130. package/components/nav/WindowManager/index.vue +2 -0
  131. package/components/nav/__tests__/Type.test.ts +68 -24
  132. package/composables/useClickOutside.ts +81 -0
  133. package/config/product/cis.js +4 -3
  134. package/config/product/manager.js +1 -0
  135. package/config/router/routes.js +1 -1
  136. package/config/table-headers.js +0 -10
  137. package/config/uiplugins.js +186 -143
  138. package/config/version.js +10 -0
  139. package/detail/autoscaling.horizontalpodautoscaler/index.vue +2 -0
  140. package/detail/configmap.vue +2 -0
  141. package/detail/fleet.cattle.io.cluster.vue +2 -0
  142. package/detail/fleet.cattle.io.clustergroup.vue +2 -0
  143. package/detail/fleet.cattle.io.gitrepo.vue +2 -0
  144. package/detail/harvesterhci.io.management.cluster.vue +2 -0
  145. package/detail/management.cattle.io.roletemplate.vue +4 -4
  146. package/detail/management.cattle.io.user.vue +2 -0
  147. package/detail/namespace.vue +2 -0
  148. package/detail/networking.k8s.io.ingress.vue +1 -0
  149. package/detail/node.vue +2 -0
  150. package/detail/provisioning.cattle.io.cluster.vue +2 -0
  151. package/detail/secret.vue +2 -0
  152. package/detail/service.vue +2 -0
  153. package/detail/workload/index.vue +1 -1
  154. package/dialog/AddClusterMemberDialog.vue +2 -0
  155. package/dialog/AddCustomBadgeDialog.vue +3 -1
  156. package/dialog/AddProjectMemberDialog.vue +2 -0
  157. package/dialog/AddonConfigConfirmationDialog.vue +2 -0
  158. package/dialog/DeactivateDriverDialog.vue +2 -0
  159. package/dialog/DiagnosticTimingsDialog.vue +2 -0
  160. package/dialog/DrainNode.vue +2 -0
  161. package/dialog/ForceMachineRemoveDialog.vue +2 -0
  162. package/dialog/GenericPrompt.vue +2 -0
  163. package/dialog/RollbackWorkloadDialog.vue +2 -0
  164. package/dialog/RotateCertificatesDialog.vue +2 -0
  165. package/dialog/RotateEncryptionKeyDialog.vue +2 -0
  166. package/dialog/SaveAsRKETemplateDialog.vue +2 -0
  167. package/dialog/ScaleMachineDownDialog.vue +2 -0
  168. package/dialog/ScalePoolDownDialog.vue +2 -0
  169. package/dialog/SloDialog.vue +2 -0
  170. package/edit/auth/ldap/config.vue +2 -0
  171. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +3 -3
  172. package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -2
  173. package/edit/catalog.cattle.io.clusterrepo.vue +2 -0
  174. package/edit/cis.cattle.io.clusterscan.vue +38 -18
  175. package/edit/cloudcredential.vue +2 -0
  176. package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +2 -0
  177. package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +2 -0
  178. package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +2 -0
  179. package/edit/constraints.gatekeeper.sh.constraint/index.vue +2 -0
  180. package/edit/fleet.cattle.io.cluster.vue +2 -0
  181. package/edit/fleet.cattle.io.clustergroup.vue +4 -1
  182. package/edit/fleet.cattle.io.gitrepo.vue +2 -0
  183. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +2 -0
  184. package/edit/logging-flow/Match.vue +2 -0
  185. package/edit/logging-flow/index.vue +10 -8
  186. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +1 -1
  187. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +1 -1
  188. package/edit/logging.banzaicloud.io.output/providers/redis.vue +3 -3
  189. package/edit/management.cattle.io.fleetworkspace.vue +4 -1
  190. package/edit/management.cattle.io.project.vue +2 -0
  191. package/edit/management.cattle.io.roletemplate.vue +1 -1
  192. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -0
  193. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +2 -0
  194. package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -0
  195. package/edit/namespace.vue +1 -0
  196. package/edit/networking.k8s.io.ingress/Certificate.vue +2 -0
  197. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -1
  198. package/edit/networking.k8s.io.ingress/Rule.vue +1 -0
  199. package/edit/networking.k8s.io.ingress/RulePath.vue +20 -23
  200. package/edit/networking.k8s.io.ingress/index.vue +1 -0
  201. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +1 -1
  202. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -0
  203. package/edit/node.vue +2 -0
  204. package/edit/persistentvolumeclaim.vue +1 -0
  205. package/edit/policy.poddisruptionbudget.vue +3 -1
  206. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +2 -0
  207. package/edit/provisioning.cattle.io.cluster/Labels.vue +2 -0
  208. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +2 -0
  209. package/edit/provisioning.cattle.io.cluster/import.vue +2 -0
  210. package/edit/provisioning.cattle.io.cluster/index.vue +2 -2
  211. package/edit/provisioning.cattle.io.cluster/rke2.vue +38 -13
  212. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +49 -0
  213. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +32 -65
  214. package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +2 -0
  215. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +2 -0
  216. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +2 -0
  217. package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +2 -0
  218. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +2 -0
  219. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +2 -0
  220. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +2 -0
  221. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +1 -0
  222. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +2 -0
  223. package/edit/resources.cattle.io.backup.vue +2 -2
  224. package/edit/secret/index.vue +2 -0
  225. package/edit/service.vue +2 -1
  226. package/edit/ui.cattle.io.navlink.vue +1 -0
  227. package/edit/workload/Job.vue +3 -2
  228. package/edit/workload/Upgrading.vue +1 -0
  229. package/edit/workload/index.vue +18 -7
  230. package/edit/workload/storage/ContainerMountPaths.vue +37 -97
  231. package/edit/workload/storage/awsElasticBlockStore.vue +1 -1
  232. package/edit/workload/storage/azureDisk.vue +1 -1
  233. package/edit/workload/storage/csi/driver.longhorn.io.vue +2 -0
  234. package/edit/workload/storage/ephemeralVolume/index.vue +2 -0
  235. package/edit/workload/storage/gcePersistentDisk.vue +1 -1
  236. package/edit/workload/storage/index.vue +38 -22
  237. package/edit/workload/storage/persistentVolumeClaim/index.vue +2 -0
  238. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +1 -0
  239. package/edit/workload/storage/vsphereVolume.vue +1 -1
  240. package/initialize/install-components.js +0 -12
  241. package/initialize/install-plugins.js +4 -5
  242. package/machine-config/azure.vue +2 -0
  243. package/machine-config/generic.vue +2 -0
  244. package/machine-config/vmwarevsphere.vue +2 -0
  245. package/mixins/resource-manager.js +1 -1
  246. package/models/cis.cattle.io.clusterscan.js +17 -16
  247. package/models/cis.cattle.io.clusterscanprofile.js +17 -0
  248. package/models/management.cattle.io.cluster.js +1 -1
  249. package/models/management.cattle.io.user.js +3 -3
  250. package/models/provisioning.cattle.io.cluster.js +2 -1
  251. package/models/steve-schema.ts +1 -1
  252. package/models/workload.js +2 -1
  253. package/package.json +5 -7
  254. package/pages/c/_cluster/apps/charts/chart.vue +3 -1
  255. package/pages/c/_cluster/apps/charts/install.vue +5 -56
  256. package/pages/c/_cluster/fleet/index.vue +0 -1
  257. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +1 -0
  258. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +2 -0
  259. package/pages/c/_cluster/settings/performance.vue +2 -2
  260. package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +11 -16
  261. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +2 -0
  262. package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +2 -0
  263. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +2 -0
  264. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +6 -3
  265. package/pages/c/_cluster/uiplugins/InstallDialog.vue +2 -0
  266. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +7 -17
  267. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +2 -0
  268. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +3 -6
  269. package/pages/c/_cluster/uiplugins/index.vue +93 -92
  270. package/pkg/vue.config.js +2 -0
  271. package/plugins/plugin.js +27 -19
  272. package/plugins/version.js +3 -13
  273. package/promptRemove/pod.vue +2 -0
  274. package/rancher-components/Form/LabeledInput/LabeledInput.vue +14 -8
  275. package/rancher-components/Form/Radio/RadioButton.vue +0 -1
  276. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +17 -9
  277. package/rancher-components/StringList/StringList.vue +6 -15
  278. package/scripts/extension/bundle +1 -1
  279. package/scripts/extension/publish +174 -99
  280. package/scripts/publish-shell.sh +3 -4
  281. package/scripts/typegen.sh +1 -1
  282. package/store/catalog.js +0 -26
  283. package/store/growl.js +8 -5
  284. package/types/shell/index.d.ts +22 -0
  285. package/utils/cluster.js +9 -0
  286. package/utils/versions.ts +39 -0
  287. package/vue.config.js +5 -0
  288. package/components/form/PodSecurity.vue +0 -168
  289. package/components/formatter/Weight.vue +0 -147
  290. package/components/nuxt/nuxt-build-indicator.vue +0 -170
  291. package/components/nuxt/nuxt-child.js +0 -52
  292. package/components/nuxt/nuxt-error.vue +0 -128
  293. package/components/nuxt/nuxt-link.client.js +0 -17
  294. package/components/nuxt/nuxt-loading.vue +0 -165
  295. package/shell/types/shell/index.d.ts +0 -2
@@ -16,6 +16,8 @@ const KINDS = [
16
16
  ];
17
17
 
18
18
  export default {
19
+ emits: ['update:value'],
20
+
19
21
  components: {
20
22
  LabeledInput, LabeledSelect, UnitInput, ShellInput, KeyValue,
21
23
  },
@@ -179,7 +181,7 @@ export default {
179
181
  data-testid="input-probe-port"
180
182
  >
181
183
  <LabeledInput
182
- v-model.number="httpGet.port"
184
+ v-model:value.number="httpGet.port"
183
185
  type="number"
184
186
  min="1"
185
187
  max="65535"
@@ -208,7 +210,7 @@ export default {
208
210
  data-testid="input-probe-socket"
209
211
  >
210
212
  <LabeledInput
211
- v-model.number="tcpSocket.port"
213
+ v-model:value.number="tcpSocket.port"
212
214
  type="number"
213
215
  min="1"
214
216
  max="65535"
@@ -303,7 +305,7 @@ export default {
303
305
  class="col span-6"
304
306
  >
305
307
  <LabeledInput
306
- v-model.number="probe.successThreshold"
308
+ v-model:value.number="probe.successThreshold"
307
309
  type="number"
308
310
  min="1"
309
311
  :mode="mode"
@@ -317,7 +319,7 @@ export default {
317
319
  class="col span-6"
318
320
  >
319
321
  <LabeledInput
320
- v-model.number="probe.failureThreshold"
322
+ v-model:value.number="probe.failureThreshold"
321
323
  type="number"
322
324
  min="1"
323
325
  :mode="mode"
@@ -335,6 +337,7 @@ export default {
335
337
  <div class="col span-12">
336
338
  <KeyValue
337
339
  v-model:value="httpGet.httpHeaders"
340
+ data-testid="input-probe-http-headers"
338
341
  key-name="name"
339
342
  :mode="mode"
340
343
  :as-map="false"
@@ -343,6 +346,7 @@ export default {
343
346
  :key-label="t('generic.name')"
344
347
  :value-label="t('generic.value')"
345
348
  :add-label="t('generic.add')"
349
+ @update:value="update"
346
350
  >
347
351
  <template #title>
348
352
  <h3>
@@ -6,6 +6,8 @@ import { formatSi, parseSi } from '@shell/utils/units';
6
6
  import { ROW_COMPUTED } from './shared';
7
7
 
8
8
  export default {
9
+ emits: ['update:value'],
10
+
9
11
  components: {
10
12
  Select, PercentageBar, UnitInput
11
13
  },
@@ -4,6 +4,8 @@ import Row from './ProjectRow';
4
4
  import { QUOTA_COMPUTED } from './shared';
5
5
 
6
6
  export default {
7
+ emits: ['remove', 'input'],
8
+
7
9
  components: { ArrayList, Row },
8
10
 
9
11
  props: {
@@ -4,6 +4,8 @@ import UnitInput from '@shell/components/form/UnitInput';
4
4
  import { ROW_COMPUTED } from './shared';
5
5
 
6
6
  export default {
7
+ emits: ['type-change'],
8
+
7
9
  components: { Select, UnitInput },
8
10
 
9
11
  props: {
@@ -12,6 +12,8 @@ const OPERATOR_VALUES = {
12
12
  };
13
13
 
14
14
  export default {
15
+ emits: ['update:value', 'input'],
16
+
15
17
  components: {
16
18
  ArrayList,
17
19
  LabeledInput,
@@ -10,6 +10,7 @@ import { LABEL_SELECT_KINDS } from '@shell/types/components/labeledSelect';
10
10
  const NONE = '__[[NONE]]__';
11
11
 
12
12
  export default {
13
+ emits: ['update:value'],
13
14
  components: { LabeledSelect, ResourceLabeledSelect },
14
15
 
15
16
  props: {
@@ -6,6 +6,8 @@ import { mapGetters } from 'vuex';
6
6
  import LabeledSelect from '@shell/components/form/LabeledSelect';
7
7
 
8
8
  export default {
9
+ emits: ['update:value'],
10
+
9
11
  components: {
10
12
  RadioGroup,
11
13
  LabeledInput,
@@ -48,7 +50,8 @@ export default {
48
50
  'SETGID',
49
51
  'SETPCAP',
50
52
  'SETUID',
51
- 'SYSLOGSYS_ADMIN',
53
+ 'SYSLOG',
54
+ 'SYS_ADMIN',
52
55
  'SYS_BOOT',
53
56
  'SYS_CHROOT',
54
57
  'SYS_MODULE',
@@ -198,7 +201,7 @@ export default {
198
201
  >
199
202
  <div class="col span-6">
200
203
  <LabeledInput
201
- v-model.number="runAsUser"
204
+ v-model:value.number="runAsUser"
202
205
  :label="t('workload.container.security.runAsUser')"
203
206
  :mode="mode"
204
207
  @update:value="update"
@@ -6,12 +6,13 @@ import { LabeledTooltip } from '@components/LabeledTooltip';
6
6
  import { onClickOption, calculatePosition } from '@shell/utils/select';
7
7
 
8
8
  export default {
9
+ emits: ['update:value', 'createdListItem'],
10
+
9
11
  components: { LabeledTooltip },
10
12
  mixins: [
11
13
  LabeledFormElement,
12
14
  VueSelectOverrides,
13
15
  ],
14
- emits: ['createdListItem', 'on-focus', 'on-blur'],
15
16
  props: {
16
17
  appendToBody: {
17
18
  default: true,
@@ -16,6 +16,8 @@ import {
16
16
  export default {
17
17
  name: 'SelectOrCreateAuthSecret',
18
18
 
19
+ emits: ['inputauthval', 'update:value'],
20
+
19
21
  components: {
20
22
  LabeledInput,
21
23
  LabeledSelect,
@@ -5,6 +5,8 @@ import { Banner } from '@components/Banner';
5
5
  import { _VIEW } from '@shell/config/query-params';
6
6
 
7
7
  export default {
8
+ emits: ['update:value'],
9
+
8
10
  components: { LabeledSelect, Banner },
9
11
 
10
12
  mixins: [labeledFormElement],
@@ -7,6 +7,8 @@ import Select from '@shell/components/form/Select';
7
7
  import Error from '@shell/components/form/Error';
8
8
 
9
9
  export default {
10
+ emits: ['update:value'],
11
+
10
12
  components: { Select, Error },
11
13
  props: {
12
14
  value: {
@@ -2,6 +2,8 @@
2
2
  import { LabeledInput } from '@components/Form/LabeledInput';
3
3
 
4
4
  export default {
5
+ emits: ['update:value'],
6
+
5
7
  components: { LabeledInput },
6
8
 
7
9
  props: {
@@ -28,6 +28,8 @@ import { PaginationParamFilter } from '@shell/types/store/pagination.types';
28
28
  const NONE = '__[[NONE]]__';
29
29
 
30
30
  export default {
31
+ emits: ['updateSecretName', 'updateSecretKey'],
32
+
31
33
  components: { LabeledSelect, ResourceLabeledSelect },
32
34
 
33
35
  props: {
@@ -10,6 +10,8 @@ const DEFAULT_EFFECT_VALUES = {
10
10
  };
11
11
 
12
12
  export default {
13
+ emits: ['update:value', 'input'],
14
+
13
15
  components: { KeyValue, Select },
14
16
 
15
17
  props: {
@@ -7,6 +7,8 @@ import { _VIEW } from '@shell/config/query-params';
7
7
  import { random32 } from '@shell/utils/string';
8
8
 
9
9
  export default {
10
+ emits: ['update:value'],
11
+
10
12
  components: {
11
13
  LabeledInput,
12
14
  Select,
@@ -6,6 +6,8 @@ import LabeledSelect from '@shell/components/form/LabeledSelect';
6
6
  import { LabeledInput } from '@components/Form/LabeledInput';
7
7
 
8
8
  export default {
9
+ emits: ['update:value', 'remove'],
10
+
9
11
  components: {
10
12
  LabeledSelect,
11
13
  LabeledInput
@@ -12,6 +12,8 @@ import { HARVESTER_NAME as HARVESTER } from '@shell/config/features';
12
12
  import { CAPI, SERVICE } from '@shell/config/types';
13
13
 
14
14
  export default {
15
+ emits: ['update:value'],
16
+
15
17
  components: {
16
18
  LabeledInput,
17
19
  LabeledSelect,
@@ -302,7 +304,7 @@ export default {
302
304
 
303
305
  <div class="port">
304
306
  <LabeledInput
305
- v-model.number="row.containerPort"
307
+ v-model:value.number="row.containerPort"
306
308
  :mode="mode"
307
309
  type="number"
308
310
  min="1"
@@ -331,7 +333,7 @@ export default {
331
333
  >
332
334
  <LabeledInput
333
335
  ref="port"
334
- v-model.number="row.hostPort"
336
+ v-model:value.number="row.hostPort"
335
337
  :mode="mode"
336
338
  type="number"
337
339
  min="1"
@@ -373,7 +375,7 @@ export default {
373
375
  <div v-if="row._serviceType === 'LoadBalancer' || row._serviceType === 'NodePort'">
374
376
  <LabeledInput
375
377
  ref="port"
376
- v-model.number="row._listeningPort"
378
+ v-model:value.number="row._listeningPort"
377
379
  type="number"
378
380
  :mode="mode"
379
381
  :label="t('workload.container.ports.listeningPort')"
@@ -0,0 +1,28 @@
1
+ import HookOption from '@shell/components/form/HookOption.vue';
2
+ import { _EDIT } from '@shell/config/query-params';
3
+ import { shallowMount } from '@vue/test-utils';
4
+ import { nextTick } from 'vue';
5
+
6
+ describe('component: HookOption', () => {
7
+ it('should render a row of inputs per http header', async() => {
8
+ const wrapper = shallowMount(HookOption, { props: { value: { httpGet: {} }, mode: _EDIT } });
9
+
10
+ const addButton = wrapper.get('[data-testid="hookoption-add-header-button"]');
11
+
12
+ addButton.trigger('click');
13
+
14
+ await nextTick();
15
+
16
+ let headerRows = wrapper.findAll('[data-testid="hookoption-header-row"]');
17
+
18
+ expect(headerRows).toHaveLength(1);
19
+
20
+ addButton.trigger('click');
21
+
22
+ await nextTick();
23
+
24
+ headerRows = wrapper.findAll('[data-testid="hookoption-header-row"]');
25
+
26
+ expect(headerRows).toHaveLength(2);
27
+ });
28
+ });
@@ -1,5 +1,6 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
3
+ import { defineComponent } from 'vue';
3
4
 
4
5
  describe('component: LabeledSelect', () => {
5
6
  describe('should display correct label', () => {
@@ -135,4 +136,45 @@ describe('component: LabeledSelect', () => {
135
136
  });
136
137
  });
137
138
  });
139
+
140
+ describe('given attributes from parent element', () => {
141
+ it('should not pass classes to the select element', () => {
142
+ const customClass = 'bananas';
143
+ const ParentComponent = defineComponent({
144
+ components: { LabeledSelect },
145
+ template: `<LabeledSelect class="${ customClass }" />`,
146
+ });
147
+ const wrapper = mount(ParentComponent);
148
+ const input = wrapper.find('.v-select');
149
+
150
+ expect(input.classes).not.toContain(customClass);
151
+ });
152
+
153
+ it.each([
154
+ [true, ['bananas']],
155
+ [false, 'bananas'],
156
+ ])('given multiple as %p, should emit %p', async(multiple, expectation) => {
157
+ const ParentComponent = defineComponent({
158
+ components: { LabeledSelect },
159
+ template: `
160
+ <LabeledSelect
161
+ v-model:value="myValue"
162
+ :multiple="${ multiple }"
163
+ :options="options"
164
+ :appendToBody="false"
165
+ />`,
166
+ data: () => ({
167
+ myValue: [],
168
+ options: ['bananas']
169
+ })
170
+ });
171
+ const wrapper = mount(ParentComponent);
172
+
173
+ // https://test-utils.vuejs.org/guide/essentials/event-handling#Asserting-the-arguments-of-the-event
174
+ await wrapper.find('input').trigger('focus');
175
+ await wrapper.find('.vs__dropdown-option').trigger('click');
176
+
177
+ expect(wrapper.vm.$data.myValue).toStrictEqual(expectation);
178
+ });
179
+ });
138
180
  });
@@ -59,4 +59,16 @@ describe('component: Probe', () => {
59
59
 
60
60
  expect(wrapper.emitted('update:value')).toHaveLength(2);
61
61
  });
62
+
63
+ it('should emit an update when http headers are modified', () => {
64
+ const wrapper = mount(Probe as unknown as ExtendedVue<Vue, {}, {}, {}, DefaultProps>, { props: { mode: _EDIT, value: { httpGet: { scheme: 'https' } } } });
65
+
66
+ const httpHeaders = wrapper.getComponent('[data-testid="input-probe-http-headers"]');
67
+
68
+ httpHeaders.vm.$emit('update:value', [{ name: 'abc', value: 'def' }]);
69
+
70
+ expect(wrapper.emitted()?.['update:value']?.[0]?.[0]).toStrictEqual({
71
+ exec: null, httpGet: { httpHeaders: [{ name: 'abc', value: 'def' }], scheme: 'HTTPS' }, tcpSocket: null
72
+ });
73
+ });
62
74
  });
@@ -21,6 +21,7 @@ import { getApplicableExtensionEnhancements } from '@shell/core/plugin-helpers';
21
21
  import IconOrSvg from '@shell/components/IconOrSvg';
22
22
  import { wait } from '@shell/utils/async';
23
23
  import { authProvidersInfo, parseAuthProvidersInfo } from '@shell/utils/auth';
24
+ import HeaderPageActionMenu from './HeaderPageActionMenu.vue';
24
25
 
25
26
  export default {
26
27
 
@@ -35,6 +36,7 @@ export default {
35
36
  ClusterProviderIcon,
36
37
  IconOrSvg,
37
38
  AppModal,
39
+ HeaderPageActionMenu,
38
40
  },
39
41
 
40
42
  props: {
@@ -72,8 +74,20 @@ export default {
72
74
  },
73
75
 
74
76
  computed: {
75
- ...mapGetters(['clusterReady', 'isExplorer', 'isRancher', 'currentCluster',
76
- 'currentProduct', 'rootProduct', 'backToRancherLink', 'backToRancherGlobalLink', 'pageActions', 'isSingleProduct', 'isRancherInHarvester', 'showTopLevelMenu']),
77
+ ...mapGetters([
78
+ 'clusterReady',
79
+ 'isExplorer',
80
+ 'isRancher',
81
+ 'currentCluster',
82
+ 'currentProduct',
83
+ 'rootProduct',
84
+ 'backToRancherLink',
85
+ 'backToRancherGlobalLink',
86
+ 'pageActions',
87
+ 'isSingleProduct',
88
+ 'isRancherInHarvester',
89
+ 'showTopLevelMenu'
90
+ ]),
77
91
 
78
92
  authProviderEnabled() {
79
93
  const authProviders = this.$store.getters['management/all'](MANAGEMENT.AUTH_CONFIG);
@@ -294,14 +308,6 @@ export default {
294
308
  this.showSearchModal = false;
295
309
  },
296
310
 
297
- showPageActionsMenu(show) {
298
- this.isPageActionMenuOpen = show;
299
- },
300
-
301
- pageAction(action) {
302
- this.$store.dispatch('handlePageAction', action);
303
- },
304
-
305
311
  checkClusterName() {
306
312
  this.$nextTick(() => {
307
313
  const el = this.$refs.clusterName;
@@ -610,57 +616,7 @@ export default {
610
616
  </button>
611
617
  </div>
612
618
 
613
- <div
614
- v-if="showPageActions"
615
- id="page-actions"
616
- class="actions"
617
- >
618
- <i
619
- data-testid="page-actions-menu"
620
- class="icon icon-actions"
621
- tabindex="0"
622
- @blur="showPageActionsMenu(false)"
623
- @click="showPageActionsMenu(true)"
624
- @focus.capture="showPageActionsMenu(true)"
625
- />
626
- <v-dropdown
627
- :triggers="[]"
628
- :shown="isPageActionMenuOpen"
629
- :autoHide="false"
630
- :flip="false"
631
- :content="false"
632
- :placement="'bottom-end'"
633
- :distance="14"
634
- :container="'#page-actions'"
635
- >
636
- <template #popper>
637
- <div class="user-menu">
638
- <ul
639
- data-testid="page-actions-dropdown"
640
- class="list-unstyled dropdown"
641
- @click.stop="showPageActionsMenu(false)"
642
- >
643
- <li
644
- v-for="(a, i) in pageActions"
645
- :key="i"
646
- class="user-menu-item"
647
- >
648
- <a
649
- v-if="!a.separator"
650
- @click="pageAction(a)"
651
- >{{ a.labelKey ? t(a.labelKey) : a.label }}</a>
652
- <div
653
- v-else
654
- class="menu-separator"
655
- >
656
- <div class="menu-separator-line" />
657
- </div>
658
- </li>
659
- </ul>
660
- </div>
661
- </template>
662
- </v-dropdown>
663
- </div>
619
+ <header-page-action-menu v-if="showPageActions" />
664
620
 
665
621
  <div class="header-spacer" />
666
622
  <div
@@ -1002,7 +958,7 @@ export default {
1002
958
  }
1003
959
  }
1004
960
 
1005
- .actions {
961
+ :deep(.actions) {
1006
962
  align-items: center;
1007
963
  cursor: pointer;
1008
964
  display: flex;
@@ -1014,6 +970,14 @@ export default {
1014
970
  color: var(--link);
1015
971
  }
1016
972
  }
973
+
974
+ :deep(.v-popper:focus) {
975
+ outline: 0;
976
+ }
977
+
978
+ .dropdown {
979
+ margin: 0 -10px;
980
+ }
1017
981
  }
1018
982
 
1019
983
  .header-spacer {
@@ -1113,70 +1077,4 @@ export default {
1113
1077
  color: var(--secondary);
1114
1078
  }
1115
1079
 
1116
- #page-actions {
1117
- :deep() .v-popper__arrow-container {
1118
- display: none;
1119
- }
1120
- }
1121
-
1122
- .user-menu {
1123
- :deep() .v-popper__arrow-container {
1124
- display: none;
1125
- }
1126
- // Remove the default padding on the popup so that the hover on menu items goes full width of the menu
1127
- :deep() .v-popper__inner {
1128
- padding: 0 0 10px 0;
1129
- }
1130
-
1131
- :deep() .v-popper {
1132
- display: flex;
1133
- }
1134
- }
1135
-
1136
- .actions {
1137
- :deep() .v-popper:focus {
1138
- outline: 0;
1139
- }
1140
-
1141
- .dropdown {
1142
- margin: 0 -10px;
1143
- }
1144
- }
1145
-
1146
- .user-menu-item {
1147
- a, &.no-link > span {
1148
- cursor: pointer;
1149
- padding: 0px 10px;
1150
-
1151
- &:hover {
1152
- background-color: var(--dropdown-hover-bg);
1153
- color: var(--dropdown-hover-text);
1154
- text-decoration: none;
1155
- }
1156
-
1157
- // When the menu item is focused, pop the margin and compensate the padding, so that
1158
- // the focus border appears within the menu
1159
- &:focus {
1160
- margin: 0 2px;
1161
- padding: 10px 8px;
1162
- }
1163
- }
1164
-
1165
- &.no-link > span {
1166
- display: flex;
1167
- justify-content: space-between;
1168
- padding: 10px;
1169
- color: var(--link);
1170
- }
1171
-
1172
- div.menu-separator {
1173
- cursor: default;
1174
- padding: 4px 0;
1175
-
1176
- .menu-separator-line {
1177
- background-color: var(--border);
1178
- height: 1px;
1179
- }
1180
- }
1181
- }
1182
1080
  </style>