@rancher/shell 3.0.5-rc.3 → 3.0.5-rc.6

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 (424) hide show
  1. package/assets/data/aws-regions.json +1 -0
  2. package/assets/images/icons/document.svg +3 -0
  3. package/assets/images/key.svg +17 -0
  4. package/assets/images/vendor/cognito.svg +1 -0
  5. package/assets/styles/app.scss +1 -0
  6. package/assets/styles/base/_basic.scss +10 -0
  7. package/assets/styles/base/_spacing.scss +29 -0
  8. package/assets/styles/global/_form.scss +1 -1
  9. package/assets/styles/global/_labeled-input.scss +1 -1
  10. package/assets/styles/global/_layout.scss +1 -1
  11. package/assets/styles/themes/_dark.scss +28 -0
  12. package/assets/styles/themes/_light.scss +68 -0
  13. package/assets/styles/vendor/vue-select.scss +1 -1
  14. package/assets/translations/en-us.yaml +721 -83
  15. package/assets/translations/zh-hans.yaml +11 -9
  16. package/cloud-credential/gcp.vue +9 -1
  17. package/components/AppModal.vue +2 -0
  18. package/components/Certificates.vue +5 -0
  19. package/components/CodeMirror.vue +1 -1
  20. package/components/ConfigMapSettings/Settings.vue +377 -0
  21. package/components/ConfigMapSettings/index.vue +354 -0
  22. package/components/CruResource.vue +1 -2
  23. package/components/DetailText.vue +61 -11
  24. package/components/Drawer/Chrome.vue +116 -0
  25. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +61 -0
  26. package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +48 -0
  27. package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +54 -0
  28. package/components/Drawer/ResourceDetailDrawer/__tests__/YamlTab.test.ts +80 -0
  29. package/components/Drawer/ResourceDetailDrawer/__tests__/composables.test.ts +82 -0
  30. package/components/Drawer/ResourceDetailDrawer/__tests__/helpers.test.ts +42 -0
  31. package/components/Drawer/ResourceDetailDrawer/composables.ts +50 -0
  32. package/components/Drawer/ResourceDetailDrawer/helpers.ts +10 -0
  33. package/components/Drawer/ResourceDetailDrawer/index.vue +110 -0
  34. package/components/FilterPanel.vue +156 -0
  35. package/components/{fleet/ForceDirectedTreeChart/index.vue → ForceDirectedTreeChart.vue} +47 -41
  36. package/components/GrowlManager.vue +16 -15
  37. package/components/IconOrSvg.vue +19 -35
  38. package/components/KeyValueView.vue +1 -1
  39. package/components/LocaleSelector.vue +9 -1
  40. package/components/ProgressBarMulti.vue +1 -0
  41. package/components/PromptModal.vue +6 -1
  42. package/components/PromptRemove.vue +5 -1
  43. package/components/RelatedResources.vue +4 -12
  44. package/components/Resource/Detail/Additional.vue +46 -0
  45. package/components/Resource/Detail/Card/PodsCard/Bubble.vue +13 -0
  46. package/components/Resource/Detail/Card/PodsCard/composable.ts +30 -0
  47. package/components/Resource/Detail/Card/PodsCard/index.vue +118 -0
  48. package/components/Resource/Detail/Card/ResourceUsageCard/composable.ts +51 -0
  49. package/components/Resource/Detail/Card/ResourceUsageCard/index.vue +79 -0
  50. package/components/Resource/Detail/Card/Scaler.vue +89 -0
  51. package/components/Resource/Detail/Card/StateCard/composables.ts +112 -0
  52. package/components/Resource/Detail/Card/StateCard/index.vue +39 -0
  53. package/components/Resource/Detail/Card/VerticalGap.vue +11 -0
  54. package/components/Resource/Detail/Card/__tests__/Card.test.ts +36 -0
  55. package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +84 -0
  56. package/components/Resource/Detail/Card/__tests__/ResourceUsageCard.test.ts +72 -0
  57. package/components/Resource/Detail/Card/__tests__/Scaler.test.ts +87 -0
  58. package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +53 -0
  59. package/components/Resource/Detail/Card/__tests__/VerticalGap.test.ts +14 -0
  60. package/components/Resource/Detail/Card/__tests__/index.test.ts +36 -0
  61. package/components/Resource/Detail/Card/index.vue +56 -0
  62. package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +19 -0
  63. package/components/Resource/Detail/Metadata/Annotations/composable.ts +12 -0
  64. package/components/Resource/Detail/Metadata/Annotations/index.vue +31 -0
  65. package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +223 -0
  66. package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +103 -0
  67. package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +64 -0
  68. package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +298 -0
  69. package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +133 -0
  70. package/components/Resource/Detail/Metadata/KeyValue.vue +138 -0
  71. package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +18 -0
  72. package/components/Resource/Detail/Metadata/Labels/composable.ts +12 -0
  73. package/components/Resource/Detail/Metadata/Labels/index.vue +31 -0
  74. package/components/Resource/Detail/Metadata/Rectangle.vue +32 -0
  75. package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +107 -0
  76. package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +24 -0
  77. package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +75 -0
  78. package/components/Resource/Detail/Metadata/__tests__/index.test.ts +91 -0
  79. package/components/Resource/Detail/Metadata/composables.ts +78 -0
  80. package/components/Resource/Detail/Metadata/index.vue +73 -0
  81. package/components/Resource/Detail/Page.vue +37 -0
  82. package/components/Resource/Detail/PercentageBar.vue +40 -0
  83. package/components/Resource/Detail/ResourceRow.vue +138 -0
  84. package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/composables.test.ts +29 -0
  85. package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/index.test.ts +48 -0
  86. package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/composables.ts +31 -0
  87. package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/index.vue +50 -0
  88. package/components/Resource/Detail/ResourceTabs/KnownHostsTab/__tests__/composables.test.ts +66 -0
  89. package/components/Resource/Detail/ResourceTabs/KnownHostsTab/composables.ts +21 -0
  90. package/components/Resource/Detail/ResourceTabs/KnownHostsTab/index.vue +31 -0
  91. package/components/Resource/Detail/ResourceTabs/SecretDataTab/Basic.vue +45 -0
  92. package/components/Resource/Detail/ResourceTabs/SecretDataTab/BasicAuth.vue +31 -0
  93. package/components/Resource/Detail/ResourceTabs/SecretDataTab/Certificate.vue +31 -0
  94. package/components/Resource/Detail/ResourceTabs/SecretDataTab/Registry.vue +22 -0
  95. package/components/Resource/Detail/ResourceTabs/SecretDataTab/ServiceAccountToken.vue +31 -0
  96. package/components/Resource/Detail/ResourceTabs/SecretDataTab/Ssh.vue +32 -0
  97. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Basic.test.ts +40 -0
  98. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/BasicAuth.test.ts +33 -0
  99. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Certificate.test.ts +33 -0
  100. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Registry.test.ts +27 -0
  101. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/ServiceAccountToken.test.ts +33 -0
  102. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Ssh.test.ts +33 -0
  103. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/auth-types.test.ts +186 -0
  104. package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/composables.test.ts +102 -0
  105. package/components/Resource/Detail/ResourceTabs/SecretDataTab/auth-types.ts +109 -0
  106. package/components/Resource/Detail/ResourceTabs/SecretDataTab/composeables.ts +52 -0
  107. package/components/Resource/Detail/ResourceTabs/SecretDataTab/index.vue +71 -0
  108. package/components/Resource/Detail/SpacedRow.vue +14 -0
  109. package/components/Resource/Detail/StatusBar.vue +59 -0
  110. package/components/Resource/Detail/StatusRow.vue +61 -0
  111. package/components/Resource/Detail/TitleBar/Title.vue +14 -0
  112. package/components/Resource/Detail/TitleBar/Top.vue +14 -0
  113. package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +17 -0
  114. package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +17 -0
  115. package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +63 -0
  116. package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +142 -0
  117. package/components/Resource/Detail/TitleBar/composables.ts +44 -0
  118. package/components/Resource/Detail/TitleBar/index.vue +196 -0
  119. package/components/Resource/Detail/Top/index.vue +34 -0
  120. package/components/Resource/Detail/__tests__/Page.test.ts +32 -0
  121. package/components/Resource/Detail/composables.ts +45 -0
  122. package/components/ResourceDetail/Masthead/__tests__/index.test.ts +70 -0
  123. package/components/ResourceDetail/{__tests__/Masthead.test.ts → Masthead/__tests__/legacy.test.ts} +3 -3
  124. package/components/ResourceDetail/Masthead/index.vue +65 -0
  125. package/components/ResourceDetail/Masthead/latest.vue +44 -0
  126. package/components/ResourceDetail/__tests__/index.test.ts +135 -0
  127. package/components/ResourceDetail/index.vue +73 -557
  128. package/components/ResourceDetail/legacy.vue +562 -0
  129. package/components/ResourceList/Masthead.vue +6 -0
  130. package/components/ResourceTable.vue +41 -7
  131. package/components/ResourceYaml.vue +14 -1
  132. package/components/SlideInPanelManager.vue +117 -10
  133. package/components/SortableTable/index.vue +13 -2
  134. package/components/SortableTable/selection.js +21 -8
  135. package/components/StateDot/index.vue +28 -0
  136. package/components/StatusBadge.vue +6 -4
  137. package/components/SubtleLink.vue +25 -0
  138. package/components/Tabbed/index.vue +11 -15
  139. package/components/Wizard.vue +16 -3
  140. package/components/YamlEditor.vue +1 -1
  141. package/components/__tests__/ConfigMapSettings.test.ts +376 -0
  142. package/components/__tests__/FilterPanel.test.ts +81 -0
  143. package/components/__tests__/GrowlManager.test.ts +0 -25
  144. package/components/auth/AuthBanner.vue +2 -3
  145. package/components/auth/RoleDetailEdit.vue +45 -3
  146. package/components/auth/login/ldap.vue +1 -1
  147. package/components/auth/login/oidc.vue +6 -1
  148. package/components/fleet/FleetApplications.vue +174 -0
  149. package/components/fleet/FleetClusterTargets/TargetsList.vue +66 -0
  150. package/components/fleet/FleetClusterTargets/index.vue +455 -0
  151. package/components/fleet/FleetClusters.vue +25 -6
  152. package/components/fleet/FleetGitRepoPaths.vue +476 -0
  153. package/components/fleet/FleetHelmOps.vue +123 -0
  154. package/components/fleet/FleetIntro.vue +58 -28
  155. package/components/fleet/FleetNoWorkspaces.vue +5 -1
  156. package/components/fleet/FleetOCIStorageSecret.vue +171 -0
  157. package/components/fleet/FleetRepos.vue +37 -80
  158. package/components/fleet/FleetResources.vue +53 -26
  159. package/components/fleet/FleetSummary.vue +26 -51
  160. package/components/fleet/FleetValuesFrom.vue +295 -0
  161. package/components/fleet/__tests__/FleetClusterTargets.test.ts +1224 -0
  162. package/components/fleet/__tests__/FleetGitRepoPaths.test.ts +265 -0
  163. package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +213 -0
  164. package/components/fleet/__tests__/FleetSummary.test.ts +39 -39
  165. package/components/fleet/__tests__/FleetValuesFrom.test.ts +300 -0
  166. package/components/fleet/dashboard/Empty.vue +73 -0
  167. package/components/fleet/dashboard/ResourceCard.vue +184 -0
  168. package/components/fleet/dashboard/ResourceCardSummary.vue +195 -0
  169. package/components/fleet/dashboard/ResourceDetails.vue +194 -0
  170. package/components/fleet/dashboard/ResourcePanel.vue +383 -0
  171. package/components/form/ArrayList.vue +19 -2
  172. package/components/form/ChangePassword.vue +3 -1
  173. package/components/form/Footer.vue +10 -4
  174. package/components/form/KeyValue.vue +81 -43
  175. package/components/form/LabeledSelect.vue +56 -16
  176. package/components/form/Labels.vue +90 -17
  177. package/components/form/MatchExpressions.vue +46 -5
  178. package/components/form/NameNsDescription.vue +1 -1
  179. package/components/form/ResourceSelector.vue +1 -0
  180. package/components/form/ResourceTabs/index.vue +5 -0
  181. package/components/form/SecretSelector.vue +9 -2
  182. package/components/form/Select.vue +57 -19
  183. package/components/form/SimpleSecretSelector.vue +17 -4
  184. package/components/form/Taints.vue +21 -2
  185. package/components/form/UnitInput.vue +8 -0
  186. package/components/form/ValueFromResource.vue +31 -19
  187. package/components/form/__tests__/LabeledSelect.test.ts +8 -4
  188. package/components/form/__tests__/Labels.test.ts +360 -0
  189. package/components/form/__tests__/MatchExpressions.test.ts +16 -13
  190. package/components/form/__tests__/Select.test.ts +5 -2
  191. package/components/formatter/FleetApplicationClustersReady.vue +77 -0
  192. package/components/formatter/FleetApplicationSource.vue +71 -0
  193. package/components/formatter/FleetSummaryGraph.vue +7 -0
  194. package/components/formatter/WorkloadHealthScale.vue +1 -1
  195. package/components/google/AccountAccess.vue +211 -0
  196. package/components/google/types/gcp.d.ts +136 -0
  197. package/components/google/types/index.d.ts +101 -0
  198. package/components/google/util/__mocks__/gcp.ts +465 -0
  199. package/components/google/util/formatter.ts +82 -0
  200. package/components/google/util/gcp.ts +134 -0
  201. package/components/google/util/index.d.ts +11 -0
  202. package/components/nav/Favorite.vue +1 -1
  203. package/components/nav/Group.vue +70 -47
  204. package/components/nav/Header.vue +13 -8
  205. package/components/nav/NamespaceFilter.vue +13 -1
  206. package/components/nav/NotificationCenter/Notification.vue +510 -0
  207. package/components/nav/NotificationCenter/NotificationHeader.vue +112 -0
  208. package/components/nav/NotificationCenter/index.vue +148 -0
  209. package/components/nav/TopLevelMenu.helper.ts +55 -34
  210. package/components/nav/TopLevelMenu.vue +11 -0
  211. package/components/nav/Type.vue +4 -1
  212. package/composables/drawer.ts +26 -0
  213. package/composables/resources.test.ts +63 -0
  214. package/composables/resources.ts +38 -0
  215. package/composables/useI18n.ts +12 -11
  216. package/composables/useIsNewDetailPageEnabled.ts +17 -0
  217. package/config/labels-annotations.js +20 -11
  218. package/config/product/auth.js +17 -1
  219. package/config/product/{cis.js → compliance.js} +23 -26
  220. package/config/product/explorer.js +5 -1
  221. package/config/product/fleet.js +77 -17
  222. package/config/product/settings.js +22 -11
  223. package/config/query-params.js +6 -1
  224. package/config/roles.ts +2 -1
  225. package/config/router/navigation-guards/authentication.js +51 -2
  226. package/config/router/routes.js +45 -31
  227. package/config/secret.ts +15 -0
  228. package/config/settings.ts +24 -5
  229. package/config/store.js +2 -0
  230. package/config/system-namespaces.js +1 -1
  231. package/config/table-headers.js +53 -23
  232. package/config/types.js +17 -6
  233. package/core/plugin-helpers.ts +3 -2
  234. package/core/plugin.ts +32 -7
  235. package/core/types.ts +18 -1
  236. package/detail/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +22 -18
  237. package/detail/fleet.cattle.io.cluster.vue +28 -15
  238. package/detail/fleet.cattle.io.gitrepo.vue +10 -1
  239. package/detail/fleet.cattle.io.helmop.vue +157 -0
  240. package/detail/management.cattle.io.fleetworkspace.vue +18 -27
  241. package/detail/management.cattle.io.oidcclient.vue +369 -0
  242. package/detail/node.vue +2 -2
  243. package/detail/pod.vue +2 -2
  244. package/detail/service.vue +10 -1
  245. package/detail/workload/index.vue +8 -2
  246. package/dialog/ExtensionCatalogUninstallDialog.vue +7 -4
  247. package/dialog/GenericPrompt.vue +1 -1
  248. package/dialog/HelmOpForceUpdateDialog.vue +132 -0
  249. package/dialog/ImportDialog.vue +8 -8
  250. package/dialog/OidcClientSecretDialog.vue +117 -0
  251. package/dialog/RedeployWorkloadDialog.vue +164 -0
  252. package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +3 -3
  253. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +60 -68
  254. package/edit/auth/oidc.vue +159 -93
  255. package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -1
  256. package/edit/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +30 -31
  257. package/edit/{cis.cattle.io.clusterscanbenchmark.vue → compliance.cattle.io.clusterscanbenchmark.vue} +4 -4
  258. package/edit/{cis.cattle.io.clusterscanprofile.vue → compliance.cattle.io.clusterscanprofile.vue} +5 -5
  259. package/edit/configmap.vue +4 -1
  260. package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -0
  261. package/edit/fleet.cattle.io.gitrepo.vue +70 -255
  262. package/edit/fleet.cattle.io.helmop.vue +772 -0
  263. package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
  264. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +1 -0
  265. package/edit/logging-flow/index.vue +1 -0
  266. package/edit/logging.banzaicloud.io.output/index.vue +1 -0
  267. package/edit/management.cattle.io.fleetworkspace.vue +44 -10
  268. package/edit/management.cattle.io.oidcclient.vue +162 -0
  269. package/edit/management.cattle.io.project.vue +4 -1
  270. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
  271. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +5 -0
  272. package/edit/monitoring.coreos.com.prometheusrule/index.vue +1 -0
  273. package/edit/monitoring.coreos.com.receiver/auth.vue +30 -30
  274. package/edit/monitoring.coreos.com.receiver/index.vue +1 -0
  275. package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -1
  276. package/edit/monitoring.coreos.com.route.vue +1 -0
  277. package/edit/namespace.vue +1 -0
  278. package/edit/networking.istio.io.destinationrule/index.vue +4 -1
  279. package/edit/networking.k8s.io.ingress/index.vue +4 -1
  280. package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +7 -2
  281. package/edit/networking.k8s.io.networkpolicy/index.vue +6 -2
  282. package/edit/node.vue +1 -0
  283. package/edit/persistentvolume/index.vue +4 -1
  284. package/edit/provisioning.cattle.io.cluster/rke2.vue +418 -382
  285. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +27 -27
  286. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +5 -0
  287. package/edit/resources.cattle.io.restore.vue +1 -1
  288. package/edit/secret/index.vue +1 -0
  289. package/edit/service.vue +4 -1
  290. package/edit/serviceaccount.vue +4 -1
  291. package/edit/storage.k8s.io.storageclass/index.vue +4 -1
  292. package/edit/workload/index.vue +5 -0
  293. package/list/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +2 -2
  294. package/list/fleet.cattle.io.gitrepo.vue +1 -1
  295. package/list/fleet.cattle.io.helmop.vue +108 -0
  296. package/list/management.cattle.io.oidcclient.vue +108 -0
  297. package/list/namespace.vue +5 -2
  298. package/list/node.vue +2 -0
  299. package/machine-config/amazonec2.vue +3 -24
  300. package/machine-config/components/GCEImage.vue +374 -0
  301. package/machine-config/google.vue +617 -0
  302. package/mixins/__tests__/brand.spec.ts +170 -0
  303. package/mixins/auth-config.js +8 -1
  304. package/mixins/brand.js +16 -17
  305. package/mixins/create-edit-view/index.js +5 -0
  306. package/mixins/preset.js +100 -0
  307. package/mixins/resource-fetch-api-pagination.js +18 -0
  308. package/mixins/resource-fetch.js +1 -1
  309. package/mixins/resource-table-watch.js +45 -0
  310. package/mixins/vue-select-overrides.js +1 -0
  311. package/models/__tests__/chart.test.ts +273 -0
  312. package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
  313. package/models/chart.js +144 -2
  314. package/models/{cis.cattle.io.clusterscan.js → compliance.cattle.io.clusterscan.js} +8 -8
  315. package/models/{cis.cattle.io.clusterscanbenchmark.js → compliance.cattle.io.clusterscanbenchmark.js} +1 -1
  316. package/models/{cis.cattle.io.clusterscanprofile.js → compliance.cattle.io.clusterscanprofile.js} +5 -5
  317. package/models/{cis.cattle.io.clusterscanreport.js → compliance.cattle.io.clusterscanreport.js} +1 -1
  318. package/models/fleet-application.js +314 -0
  319. package/models/fleet.cattle.io.bundle.js +9 -8
  320. package/models/fleet.cattle.io.cluster.js +11 -0
  321. package/models/fleet.cattle.io.gitrepo.js +41 -365
  322. package/models/fleet.cattle.io.helmop.js +198 -0
  323. package/models/management.cattle.io.authconfig.js +1 -0
  324. package/models/management.cattle.io.fleetworkspace.js +14 -1
  325. package/models/management.cattle.io.oidcclient.js +18 -0
  326. package/models/management.cattle.io.registration.js +3 -0
  327. package/models/provisioning.cattle.io.cluster.js +5 -5
  328. package/models/service.js +4 -0
  329. package/models/workload.js +19 -18
  330. package/package.json +2 -1
  331. package/pages/about.vue +4 -58
  332. package/pages/auth/login.vue +1 -1
  333. package/pages/auth/verify.vue +13 -1
  334. package/pages/c/_cluster/apps/charts/AddRepoLink.vue +36 -0
  335. package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +80 -0
  336. package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +54 -0
  337. package/pages/c/_cluster/apps/charts/StatusLabel.vue +33 -0
  338. package/pages/c/_cluster/apps/charts/index.vue +487 -465
  339. package/pages/c/_cluster/auth/user.retention/index.vue +87 -78
  340. package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
  341. package/pages/c/_cluster/explorer/index.vue +3 -3
  342. package/pages/c/_cluster/explorer/tools/pages/_page.vue +0 -1
  343. package/pages/c/_cluster/fleet/__tests__/index.test.ts +426 -0
  344. package/pages/c/_cluster/fleet/application/_resource/_id.vue +14 -0
  345. package/pages/c/_cluster/fleet/application/_resource/create.vue +14 -0
  346. package/pages/c/_cluster/fleet/application/create.vue +341 -0
  347. package/pages/c/_cluster/fleet/application/index.vue +139 -0
  348. package/pages/c/_cluster/fleet/graph/config.js +277 -0
  349. package/pages/c/_cluster/fleet/index.vue +809 -329
  350. package/pages/c/_cluster/fleet/settings/index.vue +229 -0
  351. package/pages/c/_cluster/longhorn/index.vue +5 -2
  352. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +16 -1
  353. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +2 -2
  354. package/pages/explorer/resource/detail/configmap.vue +42 -0
  355. package/pages/explorer/resource/detail/secret.vue +50 -0
  356. package/pages/home.vue +9 -55
  357. package/pages/support/index.vue +4 -6
  358. package/plugins/dashboard-store/actions.js +50 -14
  359. package/plugins/dashboard-store/getters.js +38 -21
  360. package/plugins/dashboard-store/mutations.js +51 -7
  361. package/plugins/dashboard-store/resource-class.js +30 -4
  362. package/plugins/steve/__tests__/subscribe.spec.ts +66 -1
  363. package/plugins/steve/actions.js +3 -0
  364. package/plugins/steve/steve-pagination-utils.ts +17 -8
  365. package/plugins/steve/subscribe.js +235 -43
  366. package/rancher-components/BadgeState/BadgeState.vue +3 -1
  367. package/rancher-components/Banner/Banner.vue +13 -0
  368. package/rancher-components/Form/Checkbox/Checkbox.vue +11 -6
  369. package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
  370. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -0
  371. package/rancher-components/RcItemCard/RcItemCard.test.ts +189 -0
  372. package/rancher-components/RcItemCard/RcItemCard.vue +430 -0
  373. package/rancher-components/RcItemCard/RcItemCardAction.vue +24 -0
  374. package/rancher-components/RcItemCard/index.ts +2 -0
  375. package/store/auth.js +3 -0
  376. package/store/catalog.js +85 -25
  377. package/store/growl.js +97 -8
  378. package/store/index.js +39 -14
  379. package/store/notifications.ts +426 -0
  380. package/store/prefs.js +0 -1
  381. package/store/slideInPanel.ts +6 -0
  382. package/store/type-map.js +19 -15
  383. package/store/uiplugins.ts +15 -1
  384. package/types/fleet.d.ts +59 -0
  385. package/types/notifications/index.ts +74 -0
  386. package/types/resources/settings.d.ts +19 -1
  387. package/types/shell/index.d.ts +388 -307
  388. package/types/store/dashboard-store.types.ts +33 -3
  389. package/types/store/pagination.types.ts +6 -1
  390. package/types/store/subscribe.types.ts +50 -0
  391. package/utils/__tests__/fleet.test.ts +148 -0
  392. package/utils/__tests__/object.test.ts +54 -1
  393. package/utils/__tests__/string.test.ts +273 -1
  394. package/utils/__tests__/time.test.ts +31 -0
  395. package/utils/auth.js +41 -5
  396. package/utils/crypto/encryption.ts +103 -0
  397. package/utils/cspAdaptor.ts +51 -0
  398. package/utils/fleet-types.ts +0 -0
  399. package/utils/fleet.ts +190 -2
  400. package/utils/object.js +36 -0
  401. package/utils/pagination-utils.ts +27 -2
  402. package/utils/pagination-wrapper.ts +132 -50
  403. package/utils/release-notes.ts +48 -0
  404. package/utils/selector-typed.ts +7 -2
  405. package/utils/settings.ts +4 -1
  406. package/utils/string.js +24 -0
  407. package/utils/style.ts +39 -0
  408. package/utils/{time.js → time.ts} +25 -6
  409. package/utils/uiplugins.ts +22 -0
  410. package/utils/validators/formRules/__tests__/index.test.ts +36 -3
  411. package/utils/validators/formRules/index.ts +13 -3
  412. package/utils/window.js +11 -7
  413. package/components/__tests__/ApplicationCard.test.ts +0 -27
  414. package/components/cards/ApplicationCard.vue +0 -145
  415. package/components/fleet/ForceDirectedTreeChart/chartIcons.js +0 -17
  416. package/config/product/legacy.js +0 -62
  417. package/config/secret.js +0 -14
  418. package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +0 -249
  419. package/pages/c/_cluster/legacy/pages/_page.vue +0 -29
  420. package/pages/c/_cluster/legacy/project/_page.vue +0 -57
  421. package/pages/c/_cluster/legacy/project/index.vue +0 -32
  422. package/pages/c/_cluster/legacy/project/pipelines.vue +0 -96
  423. /package/components/ResourceDetail/{Masthead.vue → Masthead/legacy.vue} +0 -0
  424. /package/{components/form/SSHKnownHosts → dialog}/__tests__/KnownHostsEditDialog.test.ts +0 -0
@@ -1,39 +1,47 @@
1
1
  <script>
2
+ import { markRaw } from 'vue';
2
3
  import AsyncButton from '@shell/components/AsyncButton';
3
4
  import Loading from '@shell/components/Loading';
4
5
  import { Banner } from '@components/Banner';
5
- import Carousel from '@shell/components/Carousel';
6
- import ButtonGroup from '@shell/components/ButtonGroup';
7
- import SelectIconGrid from '@shell/components/SelectIconGrid';
8
- import TypeDescription from '@shell/components/TypeDescription';
9
6
  import {
10
- REPO_TYPE, REPO, CHART, VERSION, SEARCH_QUERY, _FLAGGED, CATEGORY, DEPRECATED as DEPRECATED_QUERY, HIDDEN, OPERATING_SYSTEM
7
+ REPO_TYPE, REPO, CHART, VERSION, SEARCH_QUERY, SORT_BY, _FLAGGED, CATEGORY, DEPRECATED, HIDDEN, TAG, STATUS
11
8
  } from '@shell/config/query-params';
9
+ import { APP_STATUS, compatibleVersionsFor, filterAndArrangeCharts, normalizeFilterQuery } from '@shell/store/catalog';
12
10
  import { lcFirst } from '@shell/utils/string';
13
11
  import { sortBy } from '@shell/utils/sort';
12
+ import debounce from 'lodash/debounce';
14
13
  import { mapGetters } from 'vuex';
15
- import { Checkbox } from '@components/Form/Checkbox';
16
- import Select from '@shell/components/form/Select';
17
- import { mapPref, HIDE_REPOS, SHOW_PRE_RELEASE, SHOW_CHART_MODE } from '@shell/store/prefs';
18
- import { removeObject, addObject, findBy } from '@shell/utils/array';
19
- import { compatibleVersionsFor, filterAndArrangeCharts } from '@shell/store/catalog';
14
+ import { SHOW_PRE_RELEASE } from '@shell/store/prefs';
20
15
  import { CATALOG } from '@shell/config/labels-annotations';
21
16
  import { isUIPlugin } from '@shell/config/uiplugins';
22
- import TabTitle from '@shell/components/TabTitle';
17
+ import { RcItemCard } from '@components/RcItemCard';
18
+ import { get } from '@shell/utils/object';
19
+ import { CATALOG as CATALOG_TYPES, CATALOG_SORT_OPTIONS } from '@shell/config/types';
20
+ import FilterPanel from '@shell/components/FilterPanel';
21
+ import AppChartCardSubHeader from '@shell/pages/c/_cluster/apps/charts/AppChartCardSubHeader';
22
+ import AppChartCardFooter from '@shell/pages/c/_cluster/apps/charts/AppChartCardFooter';
23
+ import AddRepoLink from '@shell/pages/c/_cluster/apps/charts/AddRepoLink';
24
+ import StatusLabel from '@shell/pages/c/_cluster/apps/charts/StatusLabel';
25
+ import Select from '@shell/components/form/Select';
26
+
27
+ const createInitialFilters = () => ({
28
+ repos: [],
29
+ categories: [],
30
+ statuses: [],
31
+ tags: []
32
+ });
23
33
 
24
34
  export default {
25
35
  name: 'Charts',
26
36
  components: {
27
37
  AsyncButton,
28
38
  Banner,
29
- Carousel,
30
- ButtonGroup,
31
39
  Loading,
32
- Checkbox,
33
- Select,
34
- SelectIconGrid,
35
- TypeDescription,
36
- TabTitle
40
+ RcItemCard,
41
+ FilterPanel,
42
+ AppChartCardSubHeader,
43
+ AppChartCardFooter,
44
+ Select
37
45
  },
38
46
 
39
47
  async fetch() {
@@ -42,31 +50,66 @@ export default {
42
50
  const query = this.$route.query;
43
51
 
44
52
  this.searchQuery = query[SEARCH_QUERY] || '';
45
- this.showDeprecated = query[DEPRECATED_QUERY] === 'true' || query[DEPRECATED_QUERY] === _FLAGGED;
53
+ this.debouncedSearchQuery = query[SEARCH_QUERY] || '';
54
+ this.selectedSortOption = query[SORT_BY] || CATALOG_SORT_OPTIONS.RECOMMENDED;
46
55
  this.showHidden = query[HIDDEN] === _FLAGGED;
47
- this.category = query[CATEGORY] || '';
48
- this.allRepos = this.areAllEnabled();
56
+ this.filters.repos = normalizeFilterQuery(query[REPO]) || [];
57
+ this.filters.categories = normalizeFilterQuery(query[CATEGORY]) || [];
58
+ this.filters.statuses = normalizeFilterQuery(query[STATUS]) || [];
59
+ this.filters.tags = normalizeFilterQuery(query[TAG]) || [];
60
+
61
+ this.installedApps = await this.$store.dispatch('cluster/findAll', { type: CATALOG_TYPES.APP });
49
62
  },
50
63
 
51
64
  data() {
52
65
  return {
53
- allRepos: null,
54
- category: null,
55
- operatingSystem: null,
56
- searchQuery: null,
57
- showDeprecated: null,
58
- showHidden: null,
59
- chartOptions: [
66
+ searchQuery: null,
67
+ debouncedSearchQuery: null,
68
+ showDeprecated: null,
69
+ showHidden: null,
70
+ filters: createInitialFilters(),
71
+ // to optimize UI responsiveness by immediately updating the filter state
72
+ internalFilters: createInitialFilters(),
73
+ isFilterUpdating: false,
74
+ installedApps: [],
75
+ statusOptions: [
76
+ {
77
+ value: APP_STATUS.INSTALLED,
78
+ label: {
79
+ component: markRaw(StatusLabel),
80
+ componentProps: {
81
+ label: this.t('generic.installed'),
82
+ icon: 'icon-warning',
83
+ iconColor: 'warning',
84
+ tooltip: this.t('catalog.charts.statusFilterCautions.installation')
85
+ }
86
+ }
87
+ },
60
88
  {
61
- label: this.t('catalog.charts.browseBtn'),
62
- value: 'browse',
63
- ariaLabel: this.t('catalog.charts.browseAriaLabel')
89
+ value: APP_STATUS.DEPRECATED,
90
+ label: this.t('generic.deprecated'),
64
91
  },
65
92
  {
66
- label: this.t('catalog.charts.featuredBtn'),
67
- value: 'featured',
68
- ariaLabel: this.t('catalog.charts.featuredAriaLabel')
93
+ value: APP_STATUS.UPGRADEABLE,
94
+ label: {
95
+ component: markRaw(StatusLabel),
96
+ componentProps: {
97
+ label: this.t('generic.upgradeable'),
98
+ icon: 'icon-warning',
99
+ iconColor: 'warning',
100
+ tooltip: this.t('catalog.charts.statusFilterCautions.upgradeable')
101
+ }
102
+ }
69
103
  }
104
+ ],
105
+ appCardsCache: {},
106
+ selectedSortOption: CATALOG_SORT_OPTIONS.RECOMMENDED,
107
+ sortOptions: [
108
+ { kind: 'group', label: this.t('catalog.charts.sort.prefix') },
109
+ { value: CATALOG_SORT_OPTIONS.RECOMMENDED, label: this.t('catalog.charts.sort.recommended') },
110
+ { value: CATALOG_SORT_OPTIONS.LAST_UPDATED_DESC, label: this.t('catalog.charts.sort.lastUpdatedDesc') },
111
+ { value: CATALOG_SORT_OPTIONS.ALPHABETICAL_ASC, label: this.t('catalog.charts.sort.alphaAscending') },
112
+ { value: CATALOG_SORT_OPTIONS.ALPHABETICAL_DESC, label: this.t('catalog.charts.sort.alphaDescending') },
70
113
  ]
71
114
  };
72
115
  },
@@ -75,84 +118,46 @@ export default {
75
118
  ...mapGetters(['currentCluster']),
76
119
  ...mapGetters({ allCharts: 'catalog/charts', loadingErrors: 'catalog/errors' }),
77
120
 
78
- chartMode: mapPref(SHOW_CHART_MODE),
79
-
80
- hideRepos: mapPref(HIDE_REPOS),
81
-
82
121
  repoOptions() {
83
- let nextColor = 0;
84
- // Colors 3 and 4 match `rancher` and `partner` colors, so just avoid them
85
- const colors = [1, 2, 5, 6, 7, 8];
86
-
87
122
  let out = this.$store.getters['catalog/repos'].map((r) => {
88
123
  return {
89
- _key: r._key,
90
- label: r.nameDisplay,
91
- color: r.color,
92
- weight: ( r.isRancher ? 1 : ( r.isPartner ? 2 : 3 ) ),
93
- enabled: !this.hideRepos.includes(r._key),
124
+ value: r._key,
125
+ label: r.nameDisplay,
126
+ weight: ( r.isRancher ? 1 : ( r.isPartner ? 2 : 3 ) ),
94
127
  };
95
128
  });
96
129
 
97
130
  out = sortBy(out, ['weight', 'label']);
98
131
 
99
- for ( const entry of out ) {
100
- if ( !entry.color ) {
101
- entry.color = `color${ colors[nextColor] }`;
102
- nextColor++;
103
- if ( nextColor >= colors.length ) {
104
- nextColor = 0;
105
- }
106
- }
107
- }
132
+ // not a filter, just a link for adding a new repo
133
+ out.push({
134
+ value: 'add-repo-link',
135
+ component: markRaw(AddRepoLink),
136
+ componentProps: { clusterId: this.clusterId }
137
+ });
108
138
 
109
139
  return out;
110
140
  },
111
141
 
112
- repoOptionsForDropdown() {
113
- return [{
114
- label: this.t('catalog.repo.all'), all: true, enabled: this.areAllEnabled()
115
- }, ...this.repoOptions];
116
- },
117
-
118
- flattenedRepoNames() {
119
- const allChecked = this.repoOptionsForDropdown.find((repo) => repo.all && repo.enabled);
120
-
121
- if (allChecked) {
122
- return allChecked.label;
123
- }
124
-
125
- // None checked
126
- if (!this.repoOptionsForDropdown.find((repo) => repo.enabled)) {
127
- return this.t('generic.none');
128
- }
142
+ tagOptions() {
143
+ const outSet = new Set();
129
144
 
130
- const shownRepos = this.repoOptions.filter((repo) => !this.hideRepos.includes(repo._key));
131
- const reducedRepos = shownRepos.reduce((acc, c, i) => {
132
- acc += c.label;
133
- const length = shownRepos.length;
134
-
135
- if (i < length - 1) {
136
- acc += ', ';
145
+ this.allCharts.forEach((chart) => {
146
+ if (Array.isArray(chart.tags)) {
147
+ chart.tags.forEach((tag) => outSet.add(tag));
137
148
  }
149
+ });
138
150
 
139
- return acc;
140
- }, '');
141
-
142
- return reducedRepos;
151
+ return Array.from(outSet).map((tag) => ({ value: tag.toLowerCase(), label: tag }));
143
152
  },
144
153
 
145
154
  /**
146
- * Filter allll charts by invalid entries (deprecated, hidden and ui plugin).
155
+ * Filter all charts by invalid entries (hidden and ui plugin).
147
156
  *
148
157
  * This does not include any user provided filters (like selected repos, categories and text query)
149
158
  */
150
159
  enabledCharts() {
151
160
  return (this.allCharts || []).filter((c) => {
152
- if ( c.deprecated && !this.showDeprecated ) {
153
- return false;
154
- }
155
-
156
161
  if ( c.hidden && !this.showHidden ) {
157
162
  return false;
158
163
  }
@@ -169,136 +174,169 @@ export default {
169
174
  * Filter enabled charts allll filters. These are what the user will see in the list
170
175
  */
171
176
  filteredCharts() {
172
- return this.filterCharts({
173
- category: this.category,
174
- searchQuery: this.searchQuery,
175
- hideRepos: this.hideRepos
177
+ const {
178
+ categories, repos, tags, statuses
179
+ } = this.filters;
180
+ const res = this.filterCharts({
181
+ category: categories,
182
+ searchQuery: this.debouncedSearchQuery,
183
+ repo: repos,
184
+ tag: tags,
185
+ sort: this.selectedSortOption
176
186
  });
177
- },
178
187
 
179
- /**
180
- * Filter valid charts (alll filters minus user provided ones) by whether they are featured or not
181
- *
182
- * This will power the carousel
183
- */
184
- featuredCharts() {
185
- const filteredCharts = this.filterCharts({});
188
+ // status filtering is separated from other filters because "isInstalled" and "upgradeable" statuses are already calculated in models/chart.js
189
+ // by doing this we won't need to re-calculate it in filterAndArrangeCharts
190
+ if (!statuses.length) {
191
+ return res;
192
+ }
186
193
 
187
- const featuredCharts = filteredCharts.filter((value) => value.featured).sort((a, b) => a.featured - b.featured);
194
+ return res.filter((chart) => {
195
+ const chartStatuses = [
196
+ chart.deprecated && APP_STATUS.DEPRECATED,
197
+ chart.isInstalled && APP_STATUS.INSTALLED,
198
+ chart.upgradeable && APP_STATUS.UPGRADEABLE
199
+ ].filter(Boolean);
188
200
 
189
- return featuredCharts.slice(0, 5);
201
+ return chartStatuses.some((status) => statuses.includes(status));
202
+ });
190
203
  },
191
204
 
192
- categories() {
205
+ categoryOptions() {
193
206
  const map = {};
194
207
 
195
- // Filter charts by everything except itself
196
- const charts = this.filterCharts({
197
- searchQuery: this.searchQuery,
198
- hideRepos: this.hideRepos
199
- });
200
-
201
- for ( const chart of charts ) {
208
+ for ( const chart of this.allCharts ) {
202
209
  for ( const c of chart.categories ) {
203
210
  if ( !map[c] ) {
204
211
  const labelKey = `catalog.charts.categories.${ lcFirst(c) }`;
205
212
 
206
213
  map[c] = {
207
214
  label: this.$store.getters['i18n/withFallback'](labelKey, null, c),
208
- value: c,
209
- count: 0
215
+ value: c.toLowerCase()
210
216
  };
211
217
  }
212
-
213
- map[c].count++;
214
218
  }
215
219
  }
216
220
 
217
221
  const out = Object.values(map);
218
222
 
219
- out.unshift({
220
- label: this.t('catalog.charts.categories.all'),
221
- value: '',
222
- count: charts.length
223
- });
224
-
225
223
  return sortBy(out, ['label']);
226
224
  },
227
225
 
228
- showCarousel() {
229
- return this.chartMode === 'featured' && this.featuredCharts.length;
230
- }
226
+ filterPanelFilters() {
227
+ return [
228
+ {
229
+ key: 'repos',
230
+ title: this.t('gitPicker.github.repo.label'),
231
+ options: this.repoOptions
232
+ },
233
+ {
234
+ key: 'categories',
235
+ title: this.t('generic.category'),
236
+ options: this.categoryOptions
237
+ },
238
+ {
239
+ key: 'statuses',
240
+ title: this.t('tableHeaders.status'),
241
+ options: this.statusOptions
242
+ },
243
+ {
244
+ key: 'tags',
245
+ title: this.t('generic.tag'),
246
+ options: this.tagOptions
247
+ }
248
+ ];
249
+ },
231
250
 
232
- },
251
+ appChartCards() {
252
+ return this.filteredCharts.map((chart) => {
253
+ if (!this.appCardsCache[chart.id]) {
254
+ // Cache the converted value. We're caching chart.cardContent anyway, so no need to worry about showing updates to state
255
+ this.appCardsCache[chart.id] = {
256
+ id: chart.id,
257
+ pill: chart.featured ? { label: { key: 'generic.shortFeatured' }, tooltip: { key: 'generic.featured' } } : undefined,
258
+ header: {
259
+ title: { text: chart.chartNameDisplay },
260
+ statuses: chart.cardContent.statuses
261
+ },
262
+ subHeaderItems: chart.cardContent.subHeaderItems,
263
+ image: { src: chart.versions[0].icon, alt: { text: this.t('catalog.charts.iconAlt', { app: get(chart, 'chartNameDisplay') }) } },
264
+ content: { text: chart.chartDescription },
265
+ footerItems: chart.cardContent.footerItems,
266
+ rawChart: chart
267
+ };
268
+ }
233
269
 
234
- watch: {
235
- searchQuery(q) {
236
- this.$router.applyQuery({ [SEARCH_QUERY]: q || undefined });
270
+ return this.appCardsCache[chart.id];
271
+ });
237
272
  },
238
273
 
239
- category(cat) {
240
- this.$router.applyQuery({ [CATEGORY]: cat || undefined });
274
+ clusterId() {
275
+ return this.$store.getters['clusterId'];
241
276
  },
242
277
 
243
- operatingSystem(os) {
244
- this.$router.applyQuery({ [OPERATING_SYSTEM]: os || undefined });
278
+ noFiltersApplied() {
279
+ return Object.values(this.internalFilters).every((arr) => arr.length === 0) && !this.searchQuery;
245
280
  },
246
281
 
247
- showDeprecated(neu) {
248
- this.$router.applyQuery({ [DEPRECATED_QUERY]: neu || undefined });
249
- }
250
- },
251
-
252
- methods: {
253
- colorForChart(chart) {
254
- const repos = this.repoOptions;
255
- const repo = findBy(repos, '_key', chart.repoKey);
256
-
257
- if ( repo ) {
258
- return repo.color;
259
- }
260
-
261
- return null;
262
- },
282
+ totalMessage() {
283
+ const count = !this.isFilterUpdating ? this.appChartCards.length : '. . .';
263
284
 
264
- toggleAll(on) {
265
- for ( const r of this.repoOptions ) {
266
- this.toggleRepo(r, on, false);
285
+ if (this.noFiltersApplied) {
286
+ return this.t('catalog.charts.totalChartsMessage', { count });
287
+ } else {
288
+ return this.t('catalog.charts.totalMatchedChartsMessage', { count });
267
289
  }
290
+ }
291
+ },
268
292
 
269
- this.$nextTick(() => {
270
- this.allRepos = this.areAllEnabled();
271
- });
293
+ watch: {
294
+ searchQuery: {
295
+ handler: debounce(function(q) {
296
+ this.debouncedSearchQuery = q;
297
+ this.$router.applyQuery({ [SEARCH_QUERY]: q || undefined });
298
+ }, 300),
299
+ immediate: false
272
300
  },
273
301
 
274
- areAllEnabled() {
275
- const all = this.$store.getters['catalog/repos'];
302
+ filters: {
303
+ deep: true,
304
+ handler(newFilters) {
305
+ const query = {
306
+ [REPO]: normalizeFilterQuery(newFilters.repos),
307
+ [CATEGORY]: normalizeFilterQuery(newFilters.categories),
308
+ [STATUS]: normalizeFilterQuery(newFilters.statuses),
309
+ [TAG]: normalizeFilterQuery(newFilters.tags)
310
+ };
276
311
 
277
- for ( const r of all ) {
278
- if ( this.hideRepos.includes(r._key) ) {
279
- return false;
280
- }
312
+ this.$router.applyQuery(query);
313
+ this.internalFilters = JSON.parse(JSON.stringify(newFilters));
281
314
  }
282
-
283
- return true;
284
315
  },
285
316
 
286
- toggleRepo(repo, on, updateAll = true) {
287
- const hidden = this.hideRepos;
317
+ selectedSortOption: {
318
+ handler(neu) {
319
+ this.$router.applyQuery({ [SORT_BY]: neu || undefined });
320
+ },
321
+ immediate: false
322
+ },
323
+ },
288
324
 
289
- if ( on ) {
290
- removeObject(hidden, repo._key);
291
- } else {
292
- addObject(hidden, repo._key);
293
- }
325
+ methods: {
326
+ get,
294
327
 
295
- this.hideRepos = hidden;
328
+ onFilterChange(newFilters) {
329
+ this.isFilterUpdating = true;
330
+ this.internalFilters = newFilters;
296
331
 
297
- if ( updateAll ) {
298
- this.allRepos = this.areAllEnabled();
299
- }
332
+ this.applyFiltersDebounced(newFilters);
300
333
  },
301
334
 
335
+ applyFiltersDebounced: debounce(function(newFilters) {
336
+ this.filters = newFilters;
337
+ this.isFilterUpdating = false;
338
+ }, 100),
339
+
302
340
  selectChart(chart) {
303
341
  let version;
304
342
  const OSs = this.currentCluster.workerOSs;
@@ -319,8 +357,8 @@ export default {
319
357
  [VERSION]: version
320
358
  };
321
359
 
322
- if (chart.deprecated && this.showDeprecated) {
323
- query[DEPRECATED_QUERY] = 'true';
360
+ if (chart.deprecated) {
361
+ query[DEPRECATED] = 'true';
324
362
  }
325
363
 
326
364
  this.$router.push({
@@ -333,6 +371,20 @@ export default {
333
371
  });
334
372
  },
335
373
 
374
+ handleFooterItemClick(type, value) {
375
+ if (type === REPO) {
376
+ const repoKey = this.repoOptions.find((option) => option.label === value)?.value;
377
+
378
+ if (!this.filters.repos.includes(repoKey)) {
379
+ this.filters.repos.push(repoKey);
380
+ }
381
+ } else if (type === CATEGORY && !this.filters.categories.includes(value.toLowerCase())) {
382
+ this.filters.categories.push(value.toLowerCase());
383
+ } else if (type === TAG && !this.filters.tags.includes(value.toLowerCase())) {
384
+ this.filters.tags.push(value.toLowerCase());
385
+ }
386
+ },
387
+
336
388
  focusSearch() {
337
389
  if ( this.$refs.searchQuery ) {
338
390
  this.$refs.searchQuery.focus();
@@ -350,21 +402,31 @@ export default {
350
402
  }
351
403
  },
352
404
 
353
- filterCharts({ category, searchQuery, hideRepos }) {
405
+ filterCharts({
406
+ repo, category, tag, searchQuery, sort
407
+ }) {
354
408
  const enabledCharts = (this.enabledCharts || []);
355
409
  const clusterProvider = this.currentCluster.status.provider || 'other';
356
410
 
357
411
  return filterAndArrangeCharts(enabledCharts, {
358
412
  clusterProvider,
413
+ showRepos: repo,
359
414
  category,
415
+ tag,
360
416
  searchQuery,
361
- showDeprecated: this.showDeprecated,
417
+ showDeprecated: true,
362
418
  showHidden: this.showHidden,
363
- hideRepos,
364
419
  hideTypes: [CATALOG._CLUSTER_TPL],
365
420
  showPrerelease: this.$store.getters['prefs/get'](SHOW_PRE_RELEASE),
421
+ sort
366
422
  });
367
- }
423
+ },
424
+
425
+ resetAllFilters() {
426
+ this.internalFilters = createInitialFilters();
427
+ this.filters = createInitialFilters();
428
+ this.searchQuery = '';
429
+ },
368
430
  },
369
431
  };
370
432
  </script>
@@ -372,118 +434,47 @@ export default {
372
434
  <template>
373
435
  <Loading v-if="$fetchState.pending" />
374
436
  <div v-else>
375
- <header>
376
- <div class="title">
377
- <h1
378
- data-testid="charts-header-title"
379
- class="m-0"
380
- >
381
- <TabTitle>{{ t('catalog.charts.header') }}</TabTitle>
382
- </h1>
383
- </div>
384
- <div
385
- v-if="featuredCharts.length > 0"
386
- class="actions-container"
437
+ <div class="header">
438
+ <h1
439
+ data-testid="charts-header-title"
440
+ class="m-0"
387
441
  >
388
- <ButtonGroup
389
- v-model:value="chartMode"
390
- :options="chartOptions"
391
- />
392
- </div>
393
- </header>
394
- <div v-if="showCarousel">
395
- <h3>{{ t('catalog.charts.featuredCharts') }}</h3>
396
- <Carousel
397
- :sliders="featuredCharts"
398
- data-testid="charts-carousel"
399
- @clicked="(row) => selectChart(row)"
442
+ {{ t('catalog.chart.header.charts') }}
443
+ </h1>
444
+ <AsyncButton
445
+ class="refresh-repo-button"
446
+ :action-label="t('catalog.charts.refreshButton.label')"
447
+ :waitingLabel="t('catalog.charts.refreshButton.label')"
448
+ :success-label="t('catalog.charts.refreshButton.label')"
449
+ mode="refresh"
450
+ role="button"
451
+ :aria-label="t('catalog.charts.refresh')"
452
+ actionColor="role-secondary"
453
+ successColor="bg-success"
454
+ @click="refresh"
400
455
  />
401
456
  </div>
402
-
403
- <TypeDescription resource="chart" />
404
- <div class="left-right-split">
405
- <Select
406
- :searchable="false"
407
- :options="repoOptionsForDropdown"
408
- :value="flattenedRepoNames"
409
- class="checkbox-select"
410
- :close-on-select="false"
411
- data-testid="charts-filter-repos"
412
- @option:selecting="$event.all ? toggleAll(!$event.enabled) : toggleRepo($event, !$event.enabled) "
413
- >
414
- <template #selected-option="selected">
415
- {{ selected.label }}
416
- </template>
417
- <template #option="repo">
418
- <Checkbox
419
- :value="repo.enabled"
420
- :label="repo.label"
421
- class="pull-left repo in-select"
422
- :class="{ [repo.color]: true}"
423
- :color="repo.color"
424
- >
425
- <template #label>
426
- <span>{{ repo.label }}</span><i
427
- v-if="!repo.all"
428
- class=" pl-5 icon icon-dot icon-sm"
429
- :class="{[repo.color]: true}"
430
- />
431
- </template>
432
- </Checkbox>
433
- </template>
434
- </Select>
435
-
436
- <Select
437
- v-model:value="category"
438
- :clearable="false"
439
- :searchable="false"
440
- :options="categories"
441
- placement="bottom"
442
- label="label"
443
- style="min-width: 200px;"
444
- :reduce="opt => opt.value"
445
- data-testid="charts-filter-category"
457
+ <div class="search-input">
458
+ <input
459
+ ref="searchQuery"
460
+ v-model="searchQuery"
461
+ type="search"
462
+ class="input"
463
+ :placeholder="t('catalog.charts.search')"
464
+ data-testid="charts-filter-input"
465
+ :aria-label="t('catalog.charts.search')"
466
+ role="textbox"
446
467
  >
447
- <template #option="opt">
448
- {{ opt.label }} ({{ opt.count }})
449
- </template>
450
- </Select>
451
-
452
- <div class="filter-block">
453
- <input
454
- ref="searchQuery"
455
- v-model="searchQuery"
456
- type="search"
457
- class="input-sm"
458
- :placeholder="t('catalog.charts.search')"
459
- data-testid="charts-filter-input"
460
- :aria-label="t('catalog.charts.search')"
461
- role="textbox"
462
- >
463
-
464
- <button
465
- v-shortkey.once="['/']"
466
- class="hide"
467
- @shortkey="focusSearch()"
468
- />
469
- <AsyncButton
470
- role="button"
471
- :aria-label="t('catalog.charts.refresh')"
472
- class="refresh-btn"
473
- mode="refresh"
474
- size="sm"
475
- @click="refresh"
476
- />
477
- </div>
478
-
479
- <div class="mt-10">
480
- <Checkbox
481
- v-model:value="showDeprecated"
482
- :label="t('catalog.charts.deprecatedChartsFilter.label')"
483
- data-testid="charts-show-deprecated-filter"
484
- />
485
- </div>
468
+ <i
469
+ v-if="!searchQuery"
470
+ class="icon icon-search"
471
+ />
486
472
  </div>
473
+ <button
474
+ v-shortkey.once="['/']"
475
+ class="hide"
476
+ @shortkey="focusSearch()"
477
+ />
487
478
 
488
479
  <Banner
489
480
  v-for="(err, i) in loadingErrors"
@@ -492,226 +483,257 @@ export default {
492
483
  :label="err"
493
484
  />
494
485
 
495
- <div v-if="allCharts.length">
486
+ <div class="wrapper">
487
+ <FilterPanel
488
+ :modelValue="internalFilters"
489
+ :filters="filterPanelFilters"
490
+ @update:modelValue="onFilterChange"
491
+ />
492
+
496
493
  <div
497
494
  v-if="filteredCharts.length === 0"
498
- style="width: 100%;"
495
+ class="charts-empty-state"
496
+ data-testid="charts-empty-state"
499
497
  >
500
- <div class="m-50 text-center">
501
- <h1>{{ t('catalog.charts.noCharts') }}</h1>
498
+ <h1
499
+ class="empty-state-title"
500
+ data-testid="charts-empty-state-title"
501
+ >
502
+ {{ t('catalog.charts.noCharts.title') }}
503
+ </h1>
504
+ <div class="empty-state-tips">
505
+ <h4
506
+ v-clean-html="t('catalog.charts.noCharts.messagePart1', {}, true)"
507
+ />
508
+ <a
509
+ tabindex="0"
510
+ role="button"
511
+ class="empty-state-reset-filters link"
512
+ data-testid="charts-empty-state-reset-filters"
513
+ @click="resetAllFilters"
514
+ >
515
+ {{ t('catalog.charts.noCharts.messagePart2') }}
516
+ </a>
517
+ <h4
518
+ v-clean-html="t('catalog.charts.noCharts.messagePart3', { repositoriesUrl: `/c/${clusterId}/apps/catalog.cattle.io.clusterrepo`}, true)"
519
+ />
502
520
  </div>
521
+ <h4
522
+ v-clean-html="t('catalog.charts.noCharts.messagePart4', {}, true)"
523
+ />
503
524
  </div>
504
- <SelectIconGrid
525
+ <div
505
526
  v-else
506
- data-testid="chart-selection-grid"
507
- component-test-id="chart-selection"
508
- :rows="filteredCharts"
509
- name-field="chartNameDisplay"
510
- description-field="chartDescription"
511
- :color-for="colorForChart"
512
- @clicked="(row) => selectChart(row)"
513
- />
514
- </div>
515
- <div
516
- v-else
517
- class="m-50 text-center"
518
- >
519
- <h1>{{ t('catalog.charts.noCharts') }}</h1>
527
+ class="right-section"
528
+ >
529
+ <div class="total-and-sort">
530
+ <div class="total">
531
+ <p class="total-message">
532
+ {{ totalMessage }}
533
+ </p>
534
+ <a
535
+ v-if="!noFiltersApplied"
536
+ class="reset-filters"
537
+ role="button"
538
+ :aria-label="t('catalog.charts.resetFilters.title')"
539
+ @click="resetAllFilters"
540
+ >
541
+ {{ t('catalog.charts.resetFilters.title') }}
542
+ </a>
543
+ </div>
544
+ <Select
545
+ v-model:value="selectedSortOption"
546
+ :clearable="false"
547
+ :searchable="false"
548
+ :options="sortOptions"
549
+ placement="bottom"
550
+ class="charts-sort-select"
551
+ >
552
+ <template #selected-option="{ label }">
553
+ <span class="mmr-1">{{ t('catalog.charts.sort.prefix') }}:</span>{{ label }}
554
+ </template>
555
+
556
+ <template #option="{ label, kind }">
557
+ <span
558
+ v-if="kind === 'group'"
559
+ class="mml-2 mmr-2"
560
+ >
561
+ {{ label }}:
562
+ </span>
563
+ <span
564
+ v-else
565
+ class="mml-6"
566
+ >
567
+ {{ label }}
568
+ </span>
569
+ </template>
570
+ </Select>
571
+ </div>
572
+ <div
573
+ class="app-chart-cards"
574
+ data-testid="app-chart-cards-container"
575
+ >
576
+ <rc-item-card
577
+ v-for="card in appChartCards"
578
+ :id="card.id"
579
+ :key="card.id"
580
+ :pill="card.pill"
581
+ :header="card.header"
582
+ :image="card.image"
583
+ :content="card.content"
584
+ :value="card.rawChart"
585
+ variant="medium"
586
+ :class="{ 'single-card': appChartCards.length === 1 }"
587
+ :clickable="true"
588
+ @card-click="selectChart"
589
+ >
590
+ <template
591
+ v-once
592
+ #item-card-sub-header
593
+ >
594
+ <AppChartCardSubHeader :items="card.subHeaderItems" />
595
+ </template>
596
+ <template
597
+ v-once
598
+ #item-card-footer
599
+ >
600
+ <AppChartCardFooter
601
+ :items="card.footerItems"
602
+ @click:item="handleFooterItemClick"
603
+ />
604
+ </template>
605
+ </rc-item-card>
606
+ </div>
607
+ </div>
520
608
  </div>
521
609
  </div>
522
610
  </template>
523
611
 
524
612
  <style lang="scss" scoped>
525
- .left-right-split {
526
- padding: 0 0 20px 0;
527
- width: 100%;
528
- z-index: z-index('fixedTableHeader');
529
- background: transparent;
530
- display: grid;
531
- grid-template-columns: 40% auto auto;
532
- align-content: center;
533
- grid-column-gap: 10px;
534
-
535
- .filter-block {
536
- display: flex;
537
- }
538
- .refresh-btn {
539
- margin-left: 10px;
540
- }
541
-
542
- &.with-os-options {
543
- grid-template-columns: 40% auto auto auto;
544
- }
545
613
 
546
- @media only screen and (max-width: map-get($breakpoints, '--viewport-12')) {
547
- &{
548
- grid-template-columns: auto auto !important;
549
- grid-template-rows: 40px 40px;
550
- grid-row-gap: 20px;
551
- }
552
- }
614
+ .header {
615
+ display: flex;
616
+ justify-content: space-between;
617
+ align-items: center;
618
+ margin-bottom: 24px;
553
619
 
554
- @media only screen and (max-width: map-get($breakpoints, '--viewport-7')) {
555
- &{
556
- &{
557
- grid-template-columns: auto !important;
558
- grid-template-rows: 40px 40px 40px !important;
620
+ .refresh-repo-button {
559
621
 
560
- &.with-os-options {
561
- grid-template-rows: 40px 40px 40px 40px !important;
562
- }
563
- }
564
- }
622
+ :deep(.icon) {
623
+ font-size: 14px;
565
624
  }
625
+ }
566
626
  }
567
627
 
568
- .checkbox-select {
569
- .vs__search {
570
- position: absolute;
571
- right: 0
628
+ .search-input {
629
+ position: relative;
630
+ margin-bottom: 24px;
631
+
632
+ input {
633
+ height: 48px;
634
+ padding-left: 16px;
635
+ padding-right: 16px;
572
636
  }
573
637
 
574
- .vs__selected-options {
575
- overflow: hidden;
576
- white-space: nowrap;
577
- text-overflow: ellipsis;
578
- display: inline-block;
579
- line-height: 2.4rem;
638
+ .icon-search {
639
+ position: absolute;
640
+ top: 16px;
641
+ right: 16px;
642
+ font-size: 16px;
580
643
  }
581
644
  }
582
645
 
583
- .checkbox-outer-container.in-select {
584
- transform: translateX(-5px);
585
- padding: 7px 0 6px 13px;
586
- width: calc(100% + 10px);
646
+ .right-section {
647
+ display: flex;
648
+ flex-direction: column;
649
+ gap: var(--gap-md);
650
+ flex: 1;
651
+ }
652
+
653
+ .total-and-sort {
654
+ display: flex;
655
+ align-items: center;
656
+ justify-content: space-between;
657
+ flex-wrap: wrap;
658
+ gap: var(--gap-md);
659
+ padding: 8px 0;
587
660
 
588
- :deep() .checkbox-label {
661
+ .total {
589
662
  display: flex;
590
- align-items: center;
591
663
 
592
- & i {
593
- line-height: inherit;
664
+ .total-message {
665
+ font-size: 16px;
666
+ font-weight: 600;
667
+ color: var(--body-text);
668
+ text-overflow: ellipsis;
669
+ white-space: nowrap;
670
+ overflow: hidden;
594
671
  }
595
- }
596
672
 
597
- &:first-child {
598
- &:hover {
599
- background: var(--input-hover-bg);
673
+ .reset-filters {
674
+ font-size: 16px;
675
+ font-weight: 600;
676
+ margin-left: 8px;
677
+ cursor: pointer;
600
678
  }
601
679
  }
602
680
 
603
- &:hover :deep() .checkbox-label {
604
- color: var(--body-text);
605
- }
681
+ .charts-sort-select {
682
+ width: 300px;
606
683
 
607
- &.rancher {
608
- &:hover {
609
- background: var(--app-rancher-accent);
610
- }
611
- &:hover :deep() .checkbox-label {
612
- color: var(--app-rancher-accent-text);
613
- }
614
- & i {
615
- color: var(--app-rancher-accent)
684
+ // make the color of the selected item consistent with the group title when the select dropdown is open
685
+ :deep(.v-select.inline.vs--single.vs--open .vs__selected) {
686
+ opacity: 1;
687
+ color: var(--dropdown-disabled-text);
616
688
  }
617
689
  }
690
+ }
618
691
 
619
- &.partner {
620
- &:hover {
621
- background: var(--app-partner-accent);
622
- }
623
- &:hover :deep() .checkbox-label {
624
- color: var(--app-partner-accent-text);
625
- }
626
- & i {
627
- color: var(--app-partner-accent)
628
- }
629
- }
692
+ .wrapper {
693
+ display: flex;
694
+ gap: var(--gap-lg);
695
+ }
630
696
 
631
- &.color1 {
632
- &:hover {
633
- background: var(--app-color1-accent);
634
- }
635
- &:hover :deep() .checkbox-label {
636
- color: var(--app-color1-accent-text);
637
- }
638
- & i {
639
- color: var(--app-color1-accent)
640
- }
641
- }
642
- &.color2 {
643
- &:hover {
644
- background: var(--app-color2-accent);
645
- }
646
- &:hover :deep() .checkbox-label {
647
- color: var(--app-color2-accent-text);
648
- }
649
- & i {
650
- color: var(--app-color2-accent)
651
- }
652
- }
653
- &.color3 {
654
- &:hover {
655
- background: var(--app-color3-accent);
656
- }
657
- &:hover :deep() .checkbox-label {
658
- color: var(--app-color3-accent-text);
659
- }
660
- & i {
661
- color: var(--app-color3-accent)
662
- }
663
- }
664
- &.color4 {
665
- &:hover {
666
- background: var(--app-color4-accent);
667
- }
668
- &:hover :deep().checkbox-label {
669
- color: var(--app-color4-accent-text);
670
- }
671
- & i {
672
- color: var(--app-color4-accent)
673
- }
697
+ .charts-empty-state {
698
+ width: 100%;
699
+ padding: 72px 0;
700
+ text-align: center;
701
+
702
+ .empty-state-title {
703
+ margin-bottom: 24px;
674
704
  }
675
- &.color5 {
676
- &:hover {
677
- background: var(--app-color5-accent);
678
- }
679
- &:hover :deep() .checkbox-label {
680
- color: var(--app-color5-accent-text);
705
+
706
+ .empty-state-tips {
707
+ margin-bottom: 12px;
708
+
709
+ .empty-state-reset-filters {
710
+ font-size: 16px;
681
711
  }
682
- & i {
683
- color: var(--app-color5-accent)
712
+
713
+ h4 {
714
+ display: inline;
684
715
  }
685
716
  }
686
- &.color6 {
687
- &:hover {
688
- background: var(--app-color6-accent);
689
- }
690
- &:hover :deep() .checkbox-label {
691
- color: var(--app-color6-accent-text);
692
- }
693
- & i {
694
- color: var(--app-color6-accent)
695
- }
717
+
718
+ :deep(h4 .icon-external-link) {
719
+ text-decoration: underline;
696
720
  }
697
- &.color7 {
698
- &:hover {
699
- background: var(--app-color7-accent);
700
- }
701
- &:hover :deep() .checkbox-label {
702
- color: var(--app-color7-accent-text);
703
- }
704
- & i {
705
- color: var(--app-color7-accent)
706
- }
721
+
722
+ :deep(h4:hover .icon-external-link) {
723
+ text-decoration: none;
707
724
  }
708
- &.color8 {
709
- &:hover {
710
- background: var(--app-color8-accent);
711
- }
712
- & i {
713
- color: var(--app-color8-accent)
714
- }
725
+ }
726
+
727
+ .app-chart-cards {
728
+ display: grid;
729
+ grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
730
+ grid-gap: var(--gap-md);
731
+ width: 100%;
732
+ height: max-content;
733
+ overflow: hidden;
734
+
735
+ .single-card {
736
+ max-width: 500px;
715
737
  }
716
738
  }
717
739