@rancher/shell 0.3.13 → 0.3.15

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 (396) hide show
  1. package/assets/images/providers/nutanix.svg +1 -0
  2. package/assets/translations/en-us.yaml +89 -2
  3. package/chart/gatekeeper.vue +2 -2
  4. package/chart/monitoring/alerting/index.vue +3 -3
  5. package/chart/monitoring/index.vue +2 -2
  6. package/chart/monitoring/prometheus/index.vue +1 -1
  7. package/chart/rancher-backup/index.vue +2 -2
  8. package/cloud-credential/harvester.vue +2 -2
  9. package/components/AssignTo.vue +1 -1
  10. package/components/AwsComplianceBanner.vue +1 -1
  11. package/components/BackLink.vue +7 -0
  12. package/components/BrandImage.vue +3 -3
  13. package/components/ClusterProviderIcon.vue +1 -1
  14. package/components/CommunityLinks.vue +2 -2
  15. package/components/ConsumptionGauge.vue +17 -2
  16. package/components/CruResource.vue +2 -1
  17. package/components/DashboardMetrics.vue +8 -0
  18. package/components/DetailTop.vue +1 -1
  19. package/components/ExplorerMembers.vue +8 -8
  20. package/components/ExplorerProjectsNamespaces.vue +9 -9
  21. package/components/FixedBanner.vue +1 -1
  22. package/components/GlobalRoleBindings.vue +11 -11
  23. package/components/GrafanaDashboard.vue +7 -1
  24. package/components/GrowlManager.vue +1 -1
  25. package/components/HarvesterServiceAddOnConfig.vue +117 -2
  26. package/components/IconOrSvg.vue +10 -3
  27. package/components/LandingPagePreference.vue +2 -2
  28. package/components/MoveModal.vue +1 -1
  29. package/components/PodSecurityAdmission.vue +3 -3
  30. package/components/ProgressBarMulti.vue +2 -2
  31. package/components/PromptRemove.vue +52 -28
  32. package/components/PromptRestore.vue +3 -3
  33. package/components/Questions/index.vue +5 -5
  34. package/components/RelatedWorkloadsTable.vue +1 -1
  35. package/components/ResourceList/Masthead.vue +1 -1
  36. package/components/ResourceTable.vue +3 -3
  37. package/components/ResourceYaml.vue +1 -1
  38. package/components/RoleBindings.vue +2 -2
  39. package/components/SingleClusterInfo.vue +1 -1
  40. package/components/SortableTable/actions.js +3 -3
  41. package/components/SortableTable/advanced-filtering.js +7 -7
  42. package/components/SortableTable/filtering.js +1 -1
  43. package/components/SortableTable/index.vue +9 -9
  44. package/components/SortableTable/selection.js +5 -5
  45. package/components/SortableTable/sorting.js +5 -5
  46. package/components/Tabbed/index.vue +7 -7
  47. package/components/TableSparkLine.vue +1 -1
  48. package/components/Wizard.vue +11 -23
  49. package/components/__tests__/Collapse.spec.ts +1 -1
  50. package/components/__tests__/CruResource.test.ts +74 -0
  51. package/components/__tests__/SimpleBox.spec.ts +1 -1
  52. package/components/auth/RoleDetailEdit.vue +7 -3
  53. package/components/auth/SelectPrincipal.vue +3 -3
  54. package/components/fleet/FleetResources.vue +1 -1
  55. package/components/fleet/FleetStatus.vue +4 -4
  56. package/components/fleet/FleetSummary.vue +1 -1
  57. package/components/fleet/ForceDirectedTreeChart/chartIcons.js +1 -1
  58. package/components/fleet/ForceDirectedTreeChart/index.vue +1 -1
  59. package/components/form/ArrayList.vue +11 -3
  60. package/components/form/ArrayListSelect.vue +2 -2
  61. package/components/form/FileSelector.vue +6 -0
  62. package/components/form/GitPicker.vue +528 -0
  63. package/components/form/KeyValue.vue +82 -41
  64. package/components/form/LabeledSelect.vue +2 -2
  65. package/components/form/MatchExpressions.vue +2 -2
  66. package/components/form/Members/ClusterMembershipEditor.vue +1 -2
  67. package/components/form/Members/ClusterPermissionsEditor.vue +6 -5
  68. package/components/form/Members/MembershipEditor.vue +4 -4
  69. package/components/form/Members/ProjectMembershipEditor.vue +1 -2
  70. package/components/form/NameNsDescription.vue +13 -6
  71. package/components/form/Networking.vue +2 -2
  72. package/components/form/NodeScheduling.vue +1 -1
  73. package/components/form/PodAffinity.vue +1 -1
  74. package/components/form/ProjectMemberEditor.vue +4 -4
  75. package/components/form/ResourceQuota/Namespace.vue +2 -2
  76. package/components/form/ResourceQuota/NamespaceRow.vue +2 -2
  77. package/components/form/ResourceQuota/Project.vue +1 -1
  78. package/components/form/ResourceQuota/shared.js +2 -2
  79. package/components/form/ResourceSelector.vue +1 -1
  80. package/components/form/ResourceTabs/index.vue +1 -1
  81. package/components/form/RuleSelector.vue +1 -1
  82. package/components/form/SecretSelector.vue +4 -4
  83. package/components/form/Select.vue +2 -2
  84. package/components/form/SelectOrCreateAuthSecret.vue +3 -3
  85. package/components/form/ServiceNameSelect.vue +1 -1
  86. package/components/form/ServicePorts.vue +1 -1
  87. package/components/form/ShellInput.vue +1 -1
  88. package/components/form/SimpleSecretSelector.vue +4 -4
  89. package/components/form/Taints.vue +1 -1
  90. package/components/form/ValueFromResource.vue +3 -3
  91. package/components/form/WorkloadPorts.vue +8 -7
  92. package/components/form/__tests__/Error.test.ts +1 -1
  93. package/components/form/__tests__/KeyValue.test.ts +21 -0
  94. package/components/formatter/ClusterLink.vue +1 -1
  95. package/components/formatter/ClusterProvider.vue +13 -2
  96. package/components/formatter/Endpoints.vue +1 -1
  97. package/components/formatter/FleetSummaryGraph.vue +2 -2
  98. package/components/formatter/IngressTarget.vue +2 -2
  99. package/components/formatter/PodImages.vue +1 -1
  100. package/components/formatter/PrincipalGroupBindings.vue +1 -1
  101. package/components/formatter/ReceiverIcons.vue +3 -3
  102. package/components/formatter/ServiceType.vue +1 -1
  103. package/components/formatter/WorkloadDetailEndpoints.vue +1 -1
  104. package/components/formatter/WorkloadHealthScale.vue +1 -1
  105. package/components/formatter/__tests__/LiveDate.test.ts +1 -1
  106. package/components/graph/Bar.vue +1 -1
  107. package/components/graph/LinePlot.vue +3 -3
  108. package/components/nav/Group.vue +2 -2
  109. package/components/nav/Header.vue +5 -5
  110. package/components/nav/NamespaceFilter.vue +14 -14
  111. package/components/nav/TopLevelMenu.vue +76 -11
  112. package/components/nav/WindowManager/ContainerLogs.vue +2 -2
  113. package/components/nav/WindowManager/ContainerShell.vue +1 -1
  114. package/components/nav/WorkspaceSwitcher.vue +1 -1
  115. package/config/home-links.js +4 -4
  116. package/config/labels-annotations.js +8 -8
  117. package/config/pod-security-admission.ts +1 -1
  118. package/config/product/auth.js +4 -4
  119. package/config/product/explorer.js +14 -0
  120. package/config/router.js +5 -0
  121. package/config/store.js +2 -0
  122. package/config/table-headers.js +13 -13
  123. package/config/uiplugins.js +8 -1
  124. package/core/plugin-routes.ts +3 -2
  125. package/core/plugin.ts +3 -3
  126. package/core/plugins.js +7 -7
  127. package/creators/app/files/.gitignore +0 -3
  128. package/creators/pkg/files/index.ts +1 -1
  129. package/detail/cis.cattle.io.clusterscan.vue +3 -3
  130. package/detail/fleet.cattle.io.bundle.vue +1 -1
  131. package/detail/helm.cattle.io.projecthelmchart.vue +16 -29
  132. package/detail/management.cattle.io.user.vue +12 -12
  133. package/detail/namespace.vue +4 -4
  134. package/detail/networking.k8s.io.ingress.vue +3 -3
  135. package/detail/node.vue +2 -2
  136. package/detail/provisioning.cattle.io.cluster.vue +9 -10
  137. package/detail/service.vue +1 -1
  138. package/detail/workload/index.vue +3 -3
  139. package/dialog/AddProjectMemberDialog.vue +2 -2
  140. package/dialog/DrainNode.vue +1 -1
  141. package/dialog/GenericPrompt.vue +9 -5
  142. package/dialog/RotateEncryptionKeyDialog.vue +2 -2
  143. package/dialog/ScaleMachineDownDialog.vue +2 -2
  144. package/edit/auth/azuread.vue +3 -3
  145. package/edit/autoscaling.horizontalpodautoscaler/index.vue +5 -5
  146. package/edit/cis.cattle.io.clusterscan.vue +5 -5
  147. package/edit/cloudcredential.vue +4 -4
  148. package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +1 -1
  149. package/edit/constraints.gatekeeper.sh.constraint/index.vue +4 -4
  150. package/edit/fleet.cattle.io.gitrepo.vue +6 -6
  151. package/edit/helm.cattle.io.projecthelmchart.vue +3 -3
  152. package/edit/logging-flow/index.vue +4 -4
  153. package/edit/logging.banzaicloud.io.output/index.vue +3 -3
  154. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +1 -1
  155. package/edit/logging.banzaicloud.io.output/providers/forward.vue +1 -1
  156. package/edit/logging.banzaicloud.io.output/providers/logz.vue +1 -1
  157. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +1 -1
  158. package/edit/logging.banzaicloud.io.output/providers/redis.vue +1 -1
  159. package/edit/logging.banzaicloud.io.output/providers/splunkHec.vue +1 -1
  160. package/edit/management.cattle.io.clusterroletemplatebinding.vue +1 -1
  161. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +1 -1
  162. package/edit/management.cattle.io.project.vue +3 -3
  163. package/edit/management.cattle.io.projectroletemplatebinding.vue +2 -2
  164. package/edit/management.cattle.io.setting.vue +1 -1
  165. package/edit/management.cattle.io.user.vue +2 -2
  166. package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +2 -2
  167. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
  168. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +1 -1
  169. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +3 -3
  170. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +5 -5
  171. package/edit/monitoring.coreos.com.prometheusrule/duration.js +1 -1
  172. package/edit/monitoring.coreos.com.receiver/auth.vue +2 -2
  173. package/edit/monitoring.coreos.com.receiver/tls.vue +3 -4
  174. package/edit/monitoring.coreos.com.receiver/types/__tests__/email.test.ts +53 -0
  175. package/edit/monitoring.coreos.com.receiver/types/email.vue +2 -0
  176. package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +3 -3
  177. package/edit/monitoring.coreos.com.receiver/types/webhook.add.vue +1 -1
  178. package/edit/monitoring.coreos.com.route.vue +2 -2
  179. package/edit/namespace.vue +21 -13
  180. package/edit/networking.k8s.io.ingress/Certificate.vue +2 -2
  181. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -2
  182. package/edit/networking.k8s.io.ingress/RulePath.vue +2 -2
  183. package/edit/networking.k8s.io.ingress/Rules.vue +2 -2
  184. package/edit/networking.k8s.io.ingress/index.vue +4 -4
  185. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +3 -3
  186. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  187. package/edit/persistentvolume/index.vue +4 -4
  188. package/edit/persistentvolumeclaim.vue +3 -3
  189. package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +1 -1
  190. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +2 -2
  191. package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
  192. package/edit/provisioning.cattle.io.cluster/index.vue +7 -7
  193. package/edit/provisioning.cattle.io.cluster/rke2.vue +28 -29
  194. package/edit/resources.cattle.io.backup.vue +2 -2
  195. package/edit/resources.cattle.io.restore.vue +3 -3
  196. package/edit/secret/generic.vue +1 -1
  197. package/edit/secret/index.vue +3 -3
  198. package/edit/service.vue +3 -21
  199. package/edit/serviceaccount.vue +2 -2
  200. package/edit/storage.k8s.io.storageclass/index.vue +4 -4
  201. package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +1 -1
  202. package/edit/token.vue +5 -5
  203. package/edit/workload/index.vue +1 -1
  204. package/edit/workload/mixins/workload.js +8 -8
  205. package/edit/workload/storage/ContainerMountPaths.vue +9 -9
  206. package/edit/workload/storage/Mount.vue +2 -2
  207. package/edit/workload/storage/csi/index.vue +1 -1
  208. package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
  209. package/edit/workload/storage/index.vue +6 -6
  210. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +2 -2
  211. package/initialize/client.js +8 -8
  212. package/initialize/index.js +1 -4
  213. package/layouts/default.vue +38 -11
  214. package/list/catalog.cattle.io.clusterrepo.vue +9 -1
  215. package/list/cis.cattle.io.clusterscan.vue +1 -1
  216. package/list/fleet.cattle.io.cluster.vue +2 -2
  217. package/list/group.principal.vue +1 -1
  218. package/list/helm.cattle.io.projecthelmchart.vue +2 -2
  219. package/list/management.cattle.io.cluster.vue +1 -1
  220. package/list/management.cattle.io.feature.vue +1 -1
  221. package/list/management.cattle.io.user.vue +2 -2
  222. package/list/node.vue +5 -5
  223. package/list/provisioning.cattle.io.cluster.vue +4 -5
  224. package/machine-config/amazonec2.vue +2 -2
  225. package/machine-config/digitalocean.vue +4 -4
  226. package/machine-config/linode.vue +4 -4
  227. package/machine-config/vmwarevsphere.vue +12 -12
  228. package/middleware/authenticated.js +7 -6
  229. package/mixins/brand.js +1 -1
  230. package/mixins/chart.js +6 -6
  231. package/mixins/fetch.client.js +2 -2
  232. package/mixins/form-validation.js +7 -7
  233. package/mixins/resource-fetch-namespaced.js +1 -1
  234. package/mixins/resource-fetch.js +2 -2
  235. package/models/apps.statefulset.js +2 -2
  236. package/models/batch.cronjob.js +1 -1
  237. package/models/catalog.cattle.io.app.js +4 -4
  238. package/models/cis.cattle.io.clusterscan.js +1 -1
  239. package/models/cis.cattle.io.clusterscanbenchmark.js +1 -1
  240. package/models/cis.cattle.io.clusterscanreport.js +1 -1
  241. package/models/cloudcredential.js +1 -1
  242. package/models/cluster/node.js +5 -5
  243. package/models/cluster.x-k8s.io.machinedeployment.js +2 -2
  244. package/models/fleet.cattle.io.gitrepo.js +3 -3
  245. package/models/group.principal.js +4 -4
  246. package/models/helm.cattle.io.projecthelmchart.js +2 -2
  247. package/models/logging.banzaicloud.io.clusterflow.js +2 -2
  248. package/models/logging.banzaicloud.io.flow.js +5 -5
  249. package/models/logging.banzaicloud.io.output.js +2 -2
  250. package/models/management.cattle.io.cluster.js +10 -14
  251. package/models/management.cattle.io.globalrole.js +4 -4
  252. package/models/management.cattle.io.node.js +2 -2
  253. package/models/management.cattle.io.nodepool.js +3 -3
  254. package/models/management.cattle.io.nodetemplate.js +4 -4
  255. package/models/management.cattle.io.project.js +2 -2
  256. package/models/management.cattle.io.roletemplate.js +1 -1
  257. package/models/management.cattle.io.setting.js +1 -1
  258. package/models/management.cattle.io.user.js +5 -5
  259. package/models/monitoring.coreos.com.receiver.js +9 -9
  260. package/models/namespace.js +1 -1
  261. package/models/networking.k8s.io.ingress.js +5 -5
  262. package/models/persistentvolume.js +3 -3
  263. package/models/pod.js +3 -3
  264. package/models/provisioning.cattle.io.cluster.js +39 -27
  265. package/models/rbac.authorization.k8s.io.clusterrole.js +2 -2
  266. package/models/rbac.authorization.k8s.io.role.js +3 -3
  267. package/models/secret.js +1 -1
  268. package/models/service.js +2 -2
  269. package/models/storage.k8s.io.storageclass.js +2 -2
  270. package/models/token.js +1 -1
  271. package/models/workload.js +6 -6
  272. package/models/workload.service.js +5 -21
  273. package/package.json +2 -1
  274. package/pages/about.vue +9 -9
  275. package/pages/account/index.vue +2 -2
  276. package/pages/auth/login.vue +15 -12
  277. package/pages/auth/verify.vue +6 -0
  278. package/pages/c/_cluster/apps/charts/index.vue +4 -4
  279. package/pages/c/_cluster/apps/charts/install.vue +28 -20
  280. package/pages/c/_cluster/auth/roles/index.vue +9 -9
  281. package/pages/c/_cluster/explorer/index.vue +41 -16
  282. package/pages/c/_cluster/explorer/tools/index.vue +8 -8
  283. package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +1 -1
  284. package/pages/c/_cluster/fleet/index.vue +11 -11
  285. package/pages/c/_cluster/monitoring/index.vue +1 -1
  286. package/pages/c/_cluster/settings/links.vue +3 -3
  287. package/pages/c/_cluster/settings/performance.vue +1 -1
  288. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +6 -6
  289. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +3 -3
  290. package/pages/c/_cluster/uiplugins/InstallDialog.vue +3 -3
  291. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
  292. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +3 -3
  293. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +6 -6
  294. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +4 -4
  295. package/pages/c/_cluster/uiplugins/index.vue +22 -19
  296. package/pages/diagnostic.vue +6 -6
  297. package/pages/home.vue +3 -3
  298. package/pages/prefs.vue +2 -2
  299. package/pages/rio/mesh.vue +3 -3
  300. package/pages/support/index.vue +10 -1
  301. package/pkg/auto-import.js +1 -1
  302. package/pkg/tsconfig.json +1 -0
  303. package/pkg/vue.config.js +1 -1
  304. package/plugins/axios.js +1 -1
  305. package/plugins/clean-html-directive.js +1 -1
  306. package/plugins/dashboard-store/__tests__/mutations.spec.js +4 -4
  307. package/plugins/dashboard-store/actions.js +4 -4
  308. package/plugins/dashboard-store/getters.js +1 -1
  309. package/plugins/dashboard-store/index.js +1 -1
  310. package/plugins/dashboard-store/mutations.js +2 -2
  311. package/plugins/dashboard-store/resource-class.js +8 -8
  312. package/plugins/i18n.js +1 -1
  313. package/plugins/plugin.js +5 -1
  314. package/plugins/steve/actions.js +3 -3
  315. package/plugins/steve/getters.js +3 -3
  316. package/plugins/steve/hybrid-class.js +1 -1
  317. package/plugins/steve/mutations.js +1 -1
  318. package/plugins/steve/performanceTesting.js +1 -1
  319. package/plugins/steve/resourceWatcher.js +1 -1
  320. package/plugins/steve/subscribe.js +6 -6
  321. package/plugins/steve/worker/web-worker.basic.js +1 -1
  322. package/promptRemove/management.cattle.io.project.vue +3 -3
  323. package/promptRemove/mixin/roleDeletionCheck.js +4 -4
  324. package/promptRemove/pod.vue +1 -1
  325. package/rancher-components/StringList/StringList.test.ts +80 -0
  326. package/rancher-components/StringList/StringList.vue +577 -0
  327. package/rancher-components/StringList/index.ts +1 -0
  328. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +2 -2
  329. package/rancher-components/components/Form/Checkbox/Checkbox.vue +1 -1
  330. package/rancher-components/components/Form/Radio/RadioButton.test.ts +1 -1
  331. package/rancher-components/components/Form/Radio/RadioButton.vue +2 -2
  332. package/rancher-components/components/Form/Radio/RadioGroup.vue +2 -2
  333. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
  334. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +1 -1
  335. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +7 -7
  336. package/rancher-components/components/StringList/StringList.test.ts +10 -9
  337. package/rancher-components/components/StringList/StringList.vue +5 -5
  338. package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +1 -1
  339. package/store/action-menu.js +4 -4
  340. package/store/auth.js +40 -7
  341. package/store/aws.js +1 -1
  342. package/store/catalog.js +12 -11
  343. package/store/digitalocean.js +4 -4
  344. package/store/features.js +1 -0
  345. package/store/github.js +70 -213
  346. package/store/gitlab.js +159 -0
  347. package/store/growl.js +1 -1
  348. package/store/i18n.js +7 -7
  349. package/store/index.js +63 -22
  350. package/store/linode.js +1 -1
  351. package/store/plugins.js +5 -5
  352. package/store/pnap.js +1 -1
  353. package/store/prefs.js +6 -6
  354. package/store/resource-fetch.js +3 -3
  355. package/store/type-map.js +61 -42
  356. package/store/uiplugins.ts +2 -1
  357. package/store/wm.js +5 -4
  358. package/tsconfig.default.json +10 -0
  359. package/tsconfig.json +2 -9
  360. package/types/shell/index.d.ts +12 -4
  361. package/utils/__tests__/version.test.ts +28 -0
  362. package/utils/alertmanagerconfig.js +4 -4
  363. package/utils/array.ts +4 -4
  364. package/utils/async.ts +1 -1
  365. package/utils/auth.js +3 -3
  366. package/utils/axios.js +5 -5
  367. package/utils/cluster.js +4 -3
  368. package/utils/color.js +10 -0
  369. package/utils/create-yaml.js +4 -4
  370. package/utils/crypto/browserHashUtils.js +1 -1
  371. package/utils/crypto/browserMd5.js +1 -1
  372. package/utils/crypto/browserSha1.js +1 -1
  373. package/utils/crypto/browserSha256.js +1 -1
  374. package/utils/crypto/index.js +3 -3
  375. package/utils/favicon.js +2 -3
  376. package/utils/gatekeeper/util.js +3 -3
  377. package/utils/gc/gc.ts +2 -2
  378. package/utils/git.ts +92 -0
  379. package/utils/grafana.js +4 -4
  380. package/utils/monitoring.js +2 -2
  381. package/utils/nuxt.js +2 -2
  382. package/utils/object.js +5 -5
  383. package/utils/pod-security-admission.ts +1 -1
  384. package/utils/projectAndNamespaceFiltering.utils.ts +1 -1
  385. package/utils/select.js +2 -2
  386. package/utils/selector.js +2 -2
  387. package/utils/settings.ts +17 -2
  388. package/utils/socket.js +30 -6
  389. package/utils/sort.js +1 -1
  390. package/utils/string.js +1 -1
  391. package/utils/url.ts +1 -1
  392. package/utils/validators/formRules/index.ts +3 -3
  393. package/utils/validators/role-template.js +4 -4
  394. package/utils/version.js +14 -1
  395. package/vue.config.js +19 -13
  396. package/components/form/GithubPicker.vue +0 -390
@@ -0,0 +1,577 @@
1
+ <script lang="ts">
2
+ import Vue, { PropType } from 'vue';
3
+
4
+ import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
5
+ import { findStringIndex, hasDuplicatedStrings } from '@shell/utils/array';
6
+
7
+ type Error = 'duplicate';
8
+ type ErrorMessages = Record<Error, string>;
9
+
10
+ type Arrow = 'up' | 'down';
11
+
12
+ const DIRECTION: Record<Arrow, number> = {
13
+ up: -1,
14
+ down: 1,
15
+ };
16
+
17
+ const INPUT = {
18
+ create: 'item-create',
19
+ edit: 'item-edit',
20
+ };
21
+
22
+ const BOX = 'box';
23
+
24
+ const CLASS = {
25
+ item: 'item',
26
+ error: 'error',
27
+ };
28
+
29
+ /**
30
+ * Manage a list of strings
31
+ */
32
+ export default Vue.extend({
33
+ components: { LabeledInput },
34
+
35
+ name: 'StringList',
36
+
37
+ props: {
38
+ /**
39
+ * The items source
40
+ */
41
+ items: {
42
+ type: Array as PropType<string[]>,
43
+ default() {
44
+ return [];
45
+ },
46
+ },
47
+ /**
48
+ * Determines if items with same text will be treated differently, depending on the letters case
49
+ * It is used to compare items during create/edit actions and detect duplicates.
50
+ */
51
+ caseSensitive: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ /**
56
+ * Determines if the list of items is editable or view-only
57
+ */
58
+ readonly: {
59
+ type: Boolean,
60
+ default: false,
61
+ },
62
+ /**
63
+ * The placeholder to show in input field when create or edit items
64
+ */
65
+ placeholder: {
66
+ type: String,
67
+ default: null,
68
+ },
69
+ /**
70
+ * Determines the action buttons position at the bottom of the main box
71
+ */
72
+ actionsPosition: {
73
+ type: String,
74
+ default: 'right',
75
+ },
76
+ /**
77
+ * Custom Error messages
78
+ */
79
+ errorMessages: {
80
+ type: Object as PropType<ErrorMessages>,
81
+ default() {
82
+ return {} as ErrorMessages;
83
+ },
84
+ },
85
+ },
86
+ data() {
87
+ return {
88
+ value: null as string | null,
89
+ selected: null as string | null,
90
+ isEditItem: null as string | null,
91
+ isCreateItem: false,
92
+ errors: { duplicate: false } as Record<Error, boolean>
93
+ };
94
+ },
95
+
96
+ computed: {
97
+
98
+ /**
99
+ * Create an array of error messages, one for each current error
100
+ */
101
+ errorMessagesArray(): string[] {
102
+ return (Object.keys(this.errors) as Error[])
103
+ .filter(f => !!(this.errors)[f])
104
+ .map(k => this.errorMessages[k]);
105
+ },
106
+ },
107
+
108
+ watch: {
109
+ /**
110
+ * Shutdown any user actions on the component when it becomes readonly
111
+ */
112
+ readonly() {
113
+ this.toggleEditMode(false);
114
+ this.toggleCreateMode(false);
115
+ },
116
+ },
117
+
118
+ methods: {
119
+ onChange(value: string) {
120
+ this.value = value;
121
+ /**
122
+ * Remove duplicate error when a new value is typed
123
+ */
124
+ this.toggleError(
125
+ 'duplicate',
126
+ false,
127
+ this.isCreateItem ? INPUT.create : INPUT.edit,
128
+ );
129
+ },
130
+
131
+ onSelect(item: string) {
132
+ if (this.isCreateItem || this.isEditItem === item) {
133
+ return;
134
+ }
135
+ this.selected = item;
136
+ },
137
+
138
+ onSelectNext(arrow: Arrow) {
139
+ const index = findStringIndex(
140
+ this.items,
141
+ this.selected as string,
142
+ );
143
+
144
+ if (index !== -1) {
145
+ /**
146
+ * Select next item in the arrow's direction if it exists,
147
+ * else select again this.selected (do nothing)
148
+ */
149
+ const item = (this.items[index + DIRECTION[arrow]] || this.selected) as string;
150
+
151
+ this.onSelect(item);
152
+ this.moveScrollbar(arrow);
153
+ }
154
+ },
155
+
156
+ onSelectLeave(item?: string) {
157
+ if (item === this.selected) {
158
+ this.selected = null;
159
+ }
160
+ },
161
+
162
+ onClickEmptyBody() {
163
+ if (!this.isCreateItem && !this.isEditItem) {
164
+ this.toggleCreateMode(true);
165
+ }
166
+ },
167
+
168
+ onClickPlusButton() {
169
+ this.onSelectLeave();
170
+ this.toggleCreateMode(true);
171
+ },
172
+
173
+ onClickMinusButton() {
174
+ if (this.isCreateItem) {
175
+ this.toggleCreateMode(false);
176
+
177
+ return;
178
+ }
179
+ if (this.isEditItem) {
180
+ this.toggleEditMode(false);
181
+
182
+ return;
183
+ }
184
+ if (this.selected) {
185
+ const index = findStringIndex(this.items, this.selected, false);
186
+
187
+ if (index !== -1) {
188
+ /**
189
+ * Select the next item in the list when an item is to be deleted.
190
+ */
191
+ const item = (this.items[index + 1] || this.items[index - 1]);
192
+
193
+ this.onSelect(item);
194
+ this.setFocus(item);
195
+
196
+ this.deleteItem(this.items[index]);
197
+ }
198
+ }
199
+ },
200
+
201
+ setFocus(refId: string) {
202
+ this.$nextTick(() => this.getElemByRef(refId)?.focus());
203
+ },
204
+
205
+ /**
206
+ * Move scrollbar when the selected item is over the top or bottom side of the box
207
+ */
208
+ moveScrollbar(arrow: Arrow, value?: number) {
209
+ const box = this.getElemByRef(BOX);
210
+ const item = this.getElemByRef(this.selected || '');
211
+
212
+ if (box && item && item.className.includes(CLASS.item)) {
213
+ const boxRect = box.getClientRects()[0];
214
+ const itemRect = item.getClientRects()[0];
215
+
216
+ if (
217
+ (arrow === 'down' && itemRect.bottom > boxRect.bottom) ||
218
+ (arrow === 'up' && itemRect.top < boxRect.top)
219
+ ) {
220
+ const top = (value ?? itemRect.height) * DIRECTION[arrow];
221
+
222
+ box.scrollBy({ top });
223
+ }
224
+ }
225
+ },
226
+
227
+ /**
228
+ * Set an error and eventually assign an error class to the element
229
+ */
230
+ toggleError(type: Error, val: boolean, refId?: string) {
231
+ this.errors[type] = val;
232
+ if (refId) {
233
+ this.toggleErrorClass(refId, val);
234
+ }
235
+ },
236
+
237
+ toggleErrorClass(refId: string, val: boolean) {
238
+ const input = this.getElemByRef(refId)?.$el;
239
+
240
+ if (input) {
241
+ if (val) {
242
+ input.classList.add(CLASS.error);
243
+ } else {
244
+ input.classList.remove(CLASS.error);
245
+ }
246
+ }
247
+ },
248
+
249
+ /**
250
+ * Show/Hide the input line to create new item
251
+ */
252
+ toggleCreateMode(show: boolean) {
253
+ if (show) {
254
+ this.value = '';
255
+
256
+ this.isCreateItem = true;
257
+ this.setFocus(INPUT.create);
258
+ } else {
259
+ this.value = null;
260
+ this.toggleError('duplicate', false);
261
+ this.onSelectLeave();
262
+
263
+ this.isCreateItem = false;
264
+ }
265
+ },
266
+
267
+ /**
268
+ * Show/Hide the in-line editing to edit an existing item
269
+ */
270
+ toggleEditMode(show: boolean, item?: string) {
271
+ if (show) {
272
+ this.toggleCreateMode(false);
273
+ this.value = this.isEditItem;
274
+
275
+ this.isEditItem = item || '';
276
+ this.setFocus(INPUT.edit);
277
+ } else {
278
+ this.value = null;
279
+ this.toggleError('duplicate', false);
280
+ this.onSelectLeave();
281
+
282
+ this.isEditItem = null;
283
+ }
284
+ },
285
+
286
+ getElemByRef(id: string) {
287
+ const ref = this.$refs[id];
288
+
289
+ return (Array.isArray(ref) ? ref[0] : ref) as any;
290
+ },
291
+
292
+ /**
293
+ * Create a new item and insert in the items list
294
+ */
295
+ saveItem() {
296
+ const value = this.value?.trim();
297
+
298
+ if (value) {
299
+ const items = [
300
+ ...this.items,
301
+ value,
302
+ ];
303
+
304
+ if (hasDuplicatedStrings(items, this.caseSensitive)) {
305
+ this.toggleError('duplicate', true, INPUT.create);
306
+
307
+ return;
308
+ }
309
+
310
+ this.updateItems(items);
311
+ }
312
+ this.toggleCreateMode(false);
313
+ },
314
+
315
+ /**
316
+ * Update an existing item in the items list
317
+ */
318
+ updateItem(item: string) {
319
+ const value = this.value?.trim();
320
+
321
+ if (value) {
322
+ const items = [...this.items];
323
+ const index = findStringIndex(items, item, false);
324
+
325
+ if (index !== -1) {
326
+ items[index] = value;
327
+ }
328
+
329
+ if (hasDuplicatedStrings(items, this.caseSensitive)) {
330
+ this.toggleError('duplicate', true, INPUT.edit);
331
+
332
+ return;
333
+ }
334
+
335
+ this.updateItems(items);
336
+ }
337
+ this.toggleEditMode(false);
338
+ },
339
+
340
+ /**
341
+ * Remove an item from items list
342
+ */
343
+ deleteItem(item?: string) {
344
+ const items = this.items.filter(f => f !== item);
345
+
346
+ this.updateItems(items);
347
+ },
348
+
349
+ /**
350
+ * Update items list and emit to parent component
351
+ */
352
+ updateItems(items: string[]) {
353
+ this.$emit('change', items);
354
+ },
355
+ },
356
+
357
+ });
358
+ </script>
359
+
360
+ <template>
361
+ <div
362
+ class="string-list"
363
+ :class="{ readonly }"
364
+ >
365
+ <div
366
+ ref="box"
367
+ data-testid="div-string-list-box"
368
+ class="string-list-box"
369
+ tabindex="0"
370
+ @dblclick="onClickEmptyBody()"
371
+ >
372
+ <div
373
+ v-for="item in items"
374
+ :key="item"
375
+ :ref="item"
376
+ :class="{
377
+ selected: selected === item,
378
+ readonly
379
+ }"
380
+ :data-testid="`div-item-${item}`"
381
+ class="item static"
382
+ tabindex="0"
383
+ @mousedown="onSelect(item)"
384
+ @dblclick.stop="toggleEditMode(true, item)"
385
+ @keydown.down.prevent="onSelectNext('down')"
386
+ @keydown.up.prevent="onSelectNext('up')"
387
+ @blur="onSelectLeave(item)"
388
+ >
389
+ <span
390
+ v-if="!isEditItem || isEditItem !== item"
391
+ class="label static"
392
+ >
393
+ {{ item }}
394
+ </span>
395
+ <LabeledInput
396
+ v-if="isEditItem && isEditItem === item"
397
+ ref="item-edit"
398
+ class="edit-input static"
399
+ :value="value != null ? value : item"
400
+ @input="onChange($event)"
401
+ @blur.prevent="toggleEditMode(false)"
402
+ @keydown.native.enter="updateItem(item)"
403
+ />
404
+ </div>
405
+ <div
406
+ v-if="isCreateItem"
407
+ class="create-field static"
408
+ >
409
+ <LabeledInput
410
+ ref="item-create"
411
+ class="create-input static"
412
+ type="text"
413
+ :value="value"
414
+ :placeholder="placeholder"
415
+ @input="onChange($event)"
416
+ @keydown.native.enter="saveItem"
417
+ />
418
+ </div>
419
+ </div>
420
+ <div
421
+ v-if="!readonly"
422
+ class="string-list-footer"
423
+ :class="{[actionsPosition]: true }"
424
+ >
425
+ <div
426
+ data-testid="div-action-buttons"
427
+ class="action-buttons"
428
+ >
429
+ <button
430
+ class="btn btn-sm role-tertiary remove-button"
431
+ :disabled="!selected && !isCreateItem && !isEditItem"
432
+ @mousedown.prevent="onClickMinusButton"
433
+ >
434
+ <span class="icon icon-minus icon-sm" />
435
+ </button>
436
+ <button
437
+ class="btn btn-sm role-tertiary add-button"
438
+ :disabled="isCreateItem"
439
+ @click.prevent="onClickPlusButton"
440
+ >
441
+ <span class="icon icon-plus icon-sm" />
442
+ </button>
443
+ </div>
444
+ <div class="messages">
445
+ <i v-if="errorMessagesArray.length > 0" class="icon icon-warning icon-lg" />
446
+ <span
447
+ v-for="(msg, idx) in errorMessagesArray"
448
+ :key="idx"
449
+ class="error"
450
+ >
451
+ {{ idx > 0 ? '; ' : '' }}
452
+ {{ msg }}
453
+ </span>
454
+ </div>
455
+ </div>
456
+ </div>
457
+ </template>
458
+
459
+ <style lang="scss" scoped>
460
+
461
+ .string-list {
462
+ display: flex;
463
+ flex-direction: column;
464
+ width: auto;
465
+
466
+ &.readonly {
467
+ cursor: default;
468
+ opacity: 0.4;
469
+ }
470
+
471
+ .string-list-box {
472
+ min-height: 200px;
473
+ height: 100%;
474
+ outline: none;
475
+ overflow-y: auto;
476
+ overflow-x: hidden;
477
+ border: solid var(--border-width) var(--input-border);
478
+ padding-top: 3px;
479
+
480
+ .static {
481
+ height: 25px;
482
+ padding: 3px;
483
+ }
484
+
485
+ .item {
486
+ outline: none;
487
+
488
+ &.selected {
489
+ background: var(--primary);
490
+ color: var(--primary-hover-text);
491
+ }
492
+
493
+ &.readonly {
494
+ pointer-events: none;
495
+ }
496
+
497
+ .label {
498
+ display: block;
499
+ width: auto;
500
+ user-select: none;
501
+ overflow: hidden;
502
+ text-overflow: ellipsis;
503
+ padding-top: 1px;
504
+ }
505
+ }
506
+
507
+ .create-field {
508
+ padding-top: 1px;
509
+ margin-bottom: 7px;
510
+ }
511
+
512
+ .labeled-input {
513
+ padding-top: 0;
514
+ padding-bottom: 0;
515
+ border-radius: 0;
516
+ &.error {
517
+ border: none;
518
+ box-shadow: 0 0 0 var(--outline-width) var(--error);
519
+ }
520
+ }
521
+ }
522
+
523
+ .string-list-footer {
524
+ --footer-height: 28px;
525
+ height: var(--footer-height);
526
+ margin-top: 5px;
527
+ display: flex;
528
+ justify-content: space-between;
529
+ gap: 0.5rem;
530
+
531
+ &.left {
532
+ flex-direction: row;
533
+ }
534
+
535
+ &.right {
536
+ flex-direction: row-reverse;
537
+ }
538
+
539
+ .action-buttons {
540
+ display: flex;
541
+ flex-direction: row-reverse;
542
+ gap: 0.5rem;
543
+
544
+ .btn {
545
+ min-height: var(--footer-height);
546
+ line-height: 0;
547
+ border-radius: 2px;
548
+
549
+ &:disabled {
550
+ cursor: default;
551
+ pointer-events: none;
552
+ }
553
+ }
554
+ }
555
+
556
+ .messages {
557
+ line-height: var(--footer-height);
558
+
559
+ .error, .icon-warning {
560
+ color: var(--error);
561
+ line-height: inherit;
562
+ }
563
+ }
564
+ }
565
+ }
566
+
567
+ ::v-deep {
568
+ .labeled-input INPUT.no-label,
569
+ .labeled-input INPUT:hover.no-label,
570
+ .labeled-input INPUT:focus.no-label {
571
+ padding: 1px 0px 0px 0px;
572
+ }
573
+ .labeled-input.compact-input {
574
+ min-height: 0;
575
+ }
576
+ }
577
+ </style>
@@ -0,0 +1 @@
1
+ export { default as StringList } from './StringList.vue';
@@ -1,7 +1,7 @@
1
1
  import { shallowMount, Wrapper } from '@vue/test-utils';
2
2
  import { Checkbox } from './index';
3
3
 
4
- describe('Checkbox.vue', () => {
4
+ describe('checkbox.vue', () => {
5
5
  const event = {
6
6
  target: { tagName: 'input', href: null },
7
7
  stopPropagation: () => { },
@@ -63,6 +63,6 @@ describe('Checkbox.vue', () => {
63
63
  wrapper.vm.clicked(event);
64
64
  await wrapper.vm.$nextTick();
65
65
 
66
- expect(wrapper.emitted().input?.[0][0]).toBe(null);
66
+ expect(wrapper.emitted().input?.[0][0]).toBeNull();
67
67
  });
68
68
  });
@@ -202,7 +202,7 @@ export default Vue.extend({
202
202
  * @param value A collection of values for the checkbox.
203
203
  */
204
204
  findTrueValues(value: boolean[]): boolean {
205
- return value.find(v => v === this.valueWhenTrue) || false;
205
+ return value.find((v) => v === this.valueWhenTrue) || false;
206
206
  }
207
207
  }
208
208
  });
@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
2
2
  import { RadioButton } from './index';
3
3
  import { cleanHtmlDirective } from '@shell/plugins/clean-html-directive';
4
4
 
5
- describe('RadioButton.vue', () => {
5
+ describe('radioButton.vue', () => {
6
6
  it('renders label slot contents', () => {
7
7
  const wrapper = shallowMount(RadioButton, { slots: { label: 'Test Label' } });
8
8
 
@@ -17,7 +17,7 @@ export default Vue.extend({
17
17
  */
18
18
  val: {
19
19
  required: true,
20
- validator: x => true
20
+ validator: () => true
21
21
  },
22
22
 
23
23
  /**
@@ -25,7 +25,7 @@ export default Vue.extend({
25
25
  */
26
26
  value: {
27
27
  required: true,
28
- validator: x => true
28
+ validator: () => true
29
29
  },
30
30
 
31
31
  /**
@@ -152,7 +152,7 @@ export default Vue.extend({
152
152
  */
153
153
  clickNext(direction: number): void {
154
154
  const opts = this.normalizedOptions;
155
- const selected = opts.find(x => x.value === this.value);
155
+ const selected = opts.find((x) => x.value === this.value);
156
156
  let newIndex = (selected ? opts.indexOf(selected) : -1) + direction;
157
157
 
158
158
  if (newIndex >= opts.length) {
@@ -209,7 +209,7 @@ export default Vue.extend({
209
209
  <slot
210
210
  :listeners="$listeners"
211
211
  :option="option"
212
- :isDisabled="isDisabled"
212
+ :is-disabled="isDisabled"
213
213
  :name="i"
214
214
  >
215
215
  <RadioButton
@@ -155,6 +155,7 @@ export default Vue.extend({
155
155
  <template>
156
156
  <textarea
157
157
  ref="ta"
158
+ data-testid="text-area-auto-grow"
158
159
  :disabled="isDisabled"
159
160
  :style="style"
160
161
  :placeholder="placeholder"
@@ -1,7 +1,7 @@
1
1
  import { shallowMount, Wrapper } from '@vue/test-utils';
2
2
  import { ToggleSwitch } from './index';
3
3
 
4
- describe('ToggleSwitch.vue', () => {
4
+ describe('toggleSwitch.vue', () => {
5
5
  it('renders falsy by default', () => {
6
6
  const wrapper = shallowMount(ToggleSwitch);
7
7
 
@@ -31,13 +31,6 @@ export default Vue.extend({
31
31
  return { state: false as boolean | string | number };
32
32
  },
33
33
 
34
- methods: {
35
- toggle(neu: boolean | string | number) {
36
- this.state = neu === null ? !this.state : neu;
37
- this.$emit('input', this.state ? this.onValue : this.offValue);
38
- }
39
- },
40
-
41
34
  watch: {
42
35
  value: {
43
36
  handler() {
@@ -45,6 +38,13 @@ export default Vue.extend({
45
38
  },
46
39
  immediate: true
47
40
  }
41
+ },
42
+
43
+ methods: {
44
+ toggle(neu: boolean | string | number) {
45
+ this.state = neu === null ? !this.state : neu;
46
+ this.$emit('input', this.state ? this.onValue : this.offValue);
47
+ }
48
48
  }
49
49
  });
50
50
  </script>