@rancher/shell 3.0.8-rc.8 → 3.0.8

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 (260) hide show
  1. package/apis/impl/apis.ts +61 -0
  2. package/apis/index.ts +40 -0
  3. package/apis/intf/modal.ts +90 -0
  4. package/apis/intf/shell.ts +36 -0
  5. package/apis/intf/slide-in.ts +98 -0
  6. package/apis/intf/system.ts +41 -0
  7. package/apis/shell/__tests__/modal.test.ts +80 -0
  8. package/apis/shell/__tests__/notifications.test.ts +71 -0
  9. package/apis/shell/__tests__/slide-in.test.ts +54 -0
  10. package/apis/shell/__tests__/system.test.ts +129 -0
  11. package/apis/shell/index.ts +38 -0
  12. package/apis/shell/modal.ts +41 -0
  13. package/apis/shell/notifications.ts +65 -0
  14. package/apis/shell/slide-in.ts +33 -0
  15. package/apis/shell/system.ts +65 -0
  16. package/apis/vue-shim.d.ts +11 -0
  17. package/assets/brand/suse/dark/rancher-logo.svg +1 -64
  18. package/assets/styles/global/_tooltip.scss +6 -1
  19. package/assets/translations/en-us.yaml +14 -1
  20. package/components/ActionMenuShell.vue +3 -1
  21. package/components/BackLink.vue +8 -0
  22. package/components/BannerGraphic.vue +1 -5
  23. package/components/BrandImage.vue +17 -6
  24. package/components/Cron/CronExpressionEditor.vue +1 -1
  25. package/components/Cron/CronExpressionEditorModal.vue +1 -1
  26. package/components/CruResource.vue +8 -1
  27. package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +1 -0
  28. package/components/Drawer/ResourceDetailDrawer/__tests__/composables.test.ts +50 -1
  29. package/components/Drawer/ResourceDetailDrawer/composables.ts +19 -0
  30. package/components/Drawer/ResourceDetailDrawer/index.vue +4 -1
  31. package/components/Drawer/ResourceDetailDrawer/types.ts +2 -1
  32. package/components/LocaleSelector.vue +2 -2
  33. package/components/ModalManager.vue +11 -1
  34. package/components/Questions/__tests__/Yaml.test.ts +1 -1
  35. package/components/Questions/__tests__/index.test.ts +159 -0
  36. package/components/RelatedResources.vue +5 -0
  37. package/components/Resource/Detail/Metadata/Annotations/index.vue +2 -2
  38. package/components/Resource/Detail/Metadata/Labels/index.vue +2 -2
  39. package/components/Resource/Detail/Metadata/index.vue +3 -3
  40. package/components/Resource/Detail/ResourcePopover/index.vue +5 -1
  41. package/components/Resource/Detail/composables.ts +2 -2
  42. package/components/ResourceDetail/Masthead/latest.vue +23 -21
  43. package/components/ResourceDetail/index.vue +3 -0
  44. package/components/ResourceTable.vue +54 -21
  45. package/components/SlideInPanelManager.vue +16 -11
  46. package/components/SortableTable/THead.vue +2 -1
  47. package/components/SortableTable/index.vue +20 -2
  48. package/components/Tabbed/__tests__/index.test.ts +86 -0
  49. package/components/Tabbed/index.vue +37 -2
  50. package/components/__tests__/NamespaceFilter.test.ts +49 -0
  51. package/components/auth/SelectPrincipal.vue +28 -6
  52. package/components/auth/__tests__/SelectPrincipal.test.ts +119 -0
  53. package/components/auth/login/ldap.vue +3 -3
  54. package/components/fleet/FleetSecretSelector.vue +1 -1
  55. package/components/form/KeyValue.vue +1 -1
  56. package/components/form/NameNsDescription.vue +1 -1
  57. package/components/form/NodeScheduling.vue +2 -2
  58. package/components/form/ResourceTabs/composable.ts +2 -2
  59. package/components/form/ResourceTabs/index.vue +0 -2
  60. package/components/form/__tests__/NameNsDescription.test.ts +42 -0
  61. package/components/formatter/InternalExternalIP.vue +4 -1
  62. package/components/formatter/LinkName.vue +5 -0
  63. package/components/formatter/__tests__/InternalExternalIP.test.ts +1 -1
  64. package/components/nav/Group.vue +25 -7
  65. package/components/nav/Header.vue +1 -1
  66. package/components/nav/NamespaceFilter.vue +1 -0
  67. package/components/nav/Type.vue +17 -6
  68. package/components/nav/WindowManager/panels/TabBodyContainer.vue +1 -1
  69. package/components/nav/__tests__/Type.test.ts +59 -0
  70. package/components/templates/standalone.vue +1 -1
  71. package/composables/cruResource.ts +27 -0
  72. package/composables/focusTrap.ts +3 -1
  73. package/composables/resourceDetail.ts +15 -0
  74. package/composables/useI18n.ts +10 -1
  75. package/composables/useLabeledFormElement.ts +3 -4
  76. package/config/__test__/uiplugins.test.ts +309 -0
  77. package/config/labels-annotations.js +1 -0
  78. package/config/product/explorer.js +3 -1
  79. package/config/product/fleet.js +1 -1
  80. package/config/router/navigation-guards/clusters.js +3 -3
  81. package/config/router/navigation-guards/products.js +1 -1
  82. package/config/router/routes.js +7 -7
  83. package/config/types.js +7 -0
  84. package/config/uiplugins.js +46 -2
  85. package/core/__tests__/extension-manager-impl.test.js +437 -0
  86. package/core/extension-manager-impl.js +21 -25
  87. package/core/plugin-helpers.ts +2 -2
  88. package/core/plugin.ts +9 -1
  89. package/core/plugins-loader.js +2 -2
  90. package/core/types-provisioning.ts +5 -1
  91. package/core/types.ts +35 -0
  92. package/detail/provisioning.cattle.io.cluster.vue +9 -6
  93. package/dialog/DeveloperLoadExtensionDialog.vue +13 -4
  94. package/dialog/MoveNamespaceDialog.vue +20 -4
  95. package/dialog/RollbackWorkloadDialog.vue +2 -5
  96. package/dialog/SearchDialog.vue +1 -0
  97. package/dialog/__tests__/MoveNamespaceDialog.test.ts +249 -0
  98. package/directives/__tests__/clean-tooltip.test.ts +298 -0
  99. package/directives/clean-tooltip.ts +234 -0
  100. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +2 -2
  101. package/edit/__tests__/fleet.cattle.io.helmop.test.ts +100 -3
  102. package/edit/autoscaling.horizontalpodautoscaler/index.vue +1 -0
  103. package/edit/configmap.vue +1 -0
  104. package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -0
  105. package/edit/fleet.cattle.io.helmop.vue +11 -6
  106. package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
  107. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +1 -0
  108. package/edit/logging-flow/index.vue +1 -0
  109. package/edit/logging.banzaicloud.io.output/index.vue +1 -0
  110. package/edit/management.cattle.io.fleetworkspace.vue +1 -1
  111. package/edit/management.cattle.io.project.vue +1 -0
  112. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +4 -1
  113. package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +2 -1
  114. package/edit/monitoring.coreos.com.prometheusrule/index.vue +1 -0
  115. package/edit/monitoring.coreos.com.receiver/index.vue +2 -1
  116. package/edit/monitoring.coreos.com.route.vue +1 -1
  117. package/edit/namespace.vue +1 -0
  118. package/edit/networking.istio.io.destinationrule/index.vue +1 -0
  119. package/edit/networking.k8s.io.ingress/index.vue +1 -0
  120. package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +1 -0
  121. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -0
  122. package/edit/node.vue +1 -0
  123. package/edit/persistentvolume/index.vue +27 -22
  124. package/edit/persistentvolume/plugins/awsElasticBlockStore.vue +13 -14
  125. package/edit/persistentvolume/plugins/azureDisk.vue +49 -48
  126. package/edit/persistentvolume/plugins/azureFile.vue +15 -14
  127. package/edit/persistentvolume/plugins/cephfs.vue +15 -14
  128. package/edit/persistentvolume/plugins/cinder.vue +15 -14
  129. package/edit/persistentvolume/plugins/csi.vue +18 -16
  130. package/edit/persistentvolume/plugins/fc.vue +13 -14
  131. package/edit/persistentvolume/plugins/flexVolume.vue +15 -14
  132. package/edit/persistentvolume/plugins/flocker.vue +1 -3
  133. package/edit/persistentvolume/plugins/gcePersistentDisk.vue +13 -14
  134. package/edit/persistentvolume/plugins/glusterfs.vue +15 -14
  135. package/edit/persistentvolume/plugins/hostPath.vue +40 -39
  136. package/edit/persistentvolume/plugins/iscsi.vue +13 -14
  137. package/edit/persistentvolume/plugins/local.vue +1 -3
  138. package/edit/persistentvolume/plugins/longhorn.vue +23 -22
  139. package/edit/persistentvolume/plugins/nfs.vue +15 -14
  140. package/edit/persistentvolume/plugins/photonPersistentDisk.vue +1 -14
  141. package/edit/persistentvolume/plugins/portworxVolume.vue +15 -14
  142. package/edit/persistentvolume/plugins/quobyte.vue +15 -14
  143. package/edit/persistentvolume/plugins/rbd.vue +15 -14
  144. package/edit/persistentvolume/plugins/scaleIO.vue +15 -14
  145. package/edit/persistentvolume/plugins/storageos.vue +15 -14
  146. package/edit/persistentvolume/plugins/vsphereVolume.vue +1 -3
  147. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +21 -21
  148. package/edit/provisioning.cattle.io.cluster/index.vue +5 -5
  149. package/edit/provisioning.cattle.io.cluster/rke2.vue +9 -8
  150. package/edit/resources.cattle.io.restore.vue +1 -1
  151. package/edit/secret/index.vue +1 -1
  152. package/edit/service.vue +1 -0
  153. package/edit/serviceaccount.vue +1 -0
  154. package/edit/storage.k8s.io.storageclass/index.vue +1 -0
  155. package/edit/workload/Job.vue +2 -2
  156. package/edit/workload/index.vue +2 -1
  157. package/edit/workload/mixins/workload.js +1 -1
  158. package/initialize/App.vue +4 -4
  159. package/initialize/install-plugins.js +19 -5
  160. package/machine-config/azure.vue +1 -1
  161. package/machine-config/components/GCEImage.vue +1 -1
  162. package/mixins/__tests__/brand.spec.ts +2 -2
  163. package/mixins/brand.js +1 -7
  164. package/mixins/create-edit-view/index.js +5 -0
  165. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +128 -5
  166. package/models/chart.js +70 -74
  167. package/models/management.cattle.io.cluster.js +21 -3
  168. package/models/provisioning.cattle.io.cluster.js +31 -11
  169. package/package.json +11 -10
  170. package/pages/auth/login.vue +4 -6
  171. package/pages/auth/setup.vue +1 -1
  172. package/pages/auth/verify.vue +3 -3
  173. package/pages/c/_cluster/apps/charts/__tests__/chart.test.ts +135 -0
  174. package/pages/c/_cluster/apps/charts/chart.vue +33 -15
  175. package/pages/c/_cluster/apps/charts/index.vue +122 -24
  176. package/pages/c/_cluster/apps/charts/install.vue +33 -0
  177. package/pages/c/_cluster/explorer/__tests__/index.test.ts +1 -1
  178. package/pages/c/_cluster/explorer/index.vue +8 -6
  179. package/pages/c/_cluster/fleet/index.vue +4 -7
  180. package/pages/c/_cluster/manager/hostedprovider/index.vue +12 -6
  181. package/pages/c/_cluster/settings/brand.vue +1 -1
  182. package/pages/c/_cluster/settings/index.vue +5 -0
  183. package/pages/c/_cluster/uiplugins/__tests__/index.test.ts +7 -0
  184. package/pages/c/_cluster/uiplugins/catalogs.vue +147 -0
  185. package/pages/c/_cluster/uiplugins/index.vue +126 -184
  186. package/pkg/auto-import.js +3 -3
  187. package/pkg/dynamic-importer.lib.js +1 -1
  188. package/pkg/import.js +1 -1
  189. package/plugins/__tests__/mutations.tests.ts +179 -0
  190. package/plugins/dashboard-client-init.js +3 -0
  191. package/plugins/dashboard-store/getters.js +19 -2
  192. package/plugins/dashboard-store/model-loader.js +1 -1
  193. package/plugins/dashboard-store/mutations.js +23 -2
  194. package/plugins/dashboard-store/resource-class.js +11 -5
  195. package/plugins/i18n.js +8 -0
  196. package/plugins/plugin.js +2 -2
  197. package/plugins/steve/__tests__/steve-pagination-utils.test.ts +506 -0
  198. package/plugins/steve/steve-class.js +1 -1
  199. package/plugins/steve/steve-pagination-utils.ts +131 -47
  200. package/rancher-components/Form/Checkbox/Checkbox.vue +1 -1
  201. package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
  202. package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +6 -42
  203. package/rancher-components/Pill/RcStatusBadge/index.ts +0 -1
  204. package/rancher-components/Pill/RcStatusBadge/types.ts +1 -1
  205. package/rancher-components/Pill/RcStatusIndicator/RcStatusIndicator.vue +5 -28
  206. package/rancher-components/Pill/RcStatusIndicator/types.ts +2 -1
  207. package/rancher-components/Pill/types.ts +0 -1
  208. package/rancher-components/RcDropdown/useDropdownContext.ts +2 -4
  209. package/rancher-components/RcIcon/RcIcon.test.ts +51 -0
  210. package/rancher-components/RcIcon/RcIcon.vue +46 -0
  211. package/rancher-components/RcIcon/index.ts +1 -0
  212. package/rancher-components/RcIcon/types.ts +160 -0
  213. package/rancher-components/RcItemCard/RcItemCard.vue +1 -1
  214. package/rancher-components/utils/status.test.ts +67 -0
  215. package/rancher-components/utils/status.ts +77 -0
  216. package/scripts/publish-shell.sh +25 -0
  217. package/scripts/typegen.sh +1 -0
  218. package/store/__tests__/catalog.test.ts +1 -1
  219. package/store/__tests__/type-map.test.ts +164 -2
  220. package/store/action-menu.js +8 -0
  221. package/store/auth.js +25 -13
  222. package/store/catalog.js +6 -0
  223. package/store/i18n.js +3 -3
  224. package/store/index.js +8 -6
  225. package/store/notifications.ts +2 -0
  226. package/store/prefs.js +6 -7
  227. package/store/type-map.js +17 -7
  228. package/store/wm.ts +4 -4
  229. package/types/internal-api/shell/modal.d.ts +6 -6
  230. package/types/notifications/index.ts +126 -15
  231. package/types/rancher/index.d.ts +9 -0
  232. package/types/shell/index.d.ts +54 -3
  233. package/types/store/__tests__/pagination.types.spec.ts +137 -0
  234. package/types/store/pagination.types.ts +157 -9
  235. package/types/vue-shim.d.ts +5 -4
  236. package/utils/__tests__/provider.test.ts +98 -0
  237. package/utils/__tests__/router.test.js +238 -0
  238. package/utils/__tests__/selector-typed.test.ts +263 -0
  239. package/utils/cluster.js +4 -1
  240. package/utils/color.js +1 -1
  241. package/utils/dynamic-content/__tests__/info.test.ts +6 -0
  242. package/utils/dynamic-content/info.ts +43 -0
  243. package/utils/favicon.js +4 -4
  244. package/utils/fleet.ts +8 -1
  245. package/utils/pagination-utils.ts +2 -2
  246. package/utils/pagination-wrapper.ts +1 -1
  247. package/utils/provider.ts +14 -0
  248. package/utils/router.js +50 -0
  249. package/utils/selector-typed.ts +6 -2
  250. package/utils/unit-tests/pagination-utils.spec.ts +8 -8
  251. package/vue.config.js +3 -3
  252. package/composables/useExtensionManager.ts +0 -17
  253. package/core/plugins.js +0 -38
  254. package/directives/clean-tooltip.js +0 -32
  255. package/plugins/internal-api/index.ts +0 -37
  256. package/plugins/internal-api/shared/base-api.ts +0 -13
  257. package/plugins/internal-api/shell/shell.api.ts +0 -108
  258. package/plugins/nuxt-client-init.js +0 -3
  259. package/types/internal-api/shell/growl.d.ts +0 -25
  260. package/types/internal-api/shell/slideIn.d.ts +0 -15
@@ -0,0 +1,160 @@
1
+ import { Status } from '../utils/status';
2
+
3
+ export const RcIconType = {
4
+ actions: 'icon-actions',
5
+ ai: 'icon-ai',
6
+ 'alert-alt': 'icon-alert-alt',
7
+ alert: 'icon-alert',
8
+ anchor: 'icon-anchor',
9
+ apple: 'icon-apple',
10
+ application: 'icon-application',
11
+ apps: 'icon-apps',
12
+ archive: 'icon-archive',
13
+ 'backup-restore': 'icon-backup-restore',
14
+ backup: 'icon-backup',
15
+ 'brush-icon': 'icon-brush-icon',
16
+ 'category-alt': 'icon-category-alt',
17
+ checkmark: 'icon-checkmark',
18
+ 'chevron-beginning': 'icon-chevron-beginning',
19
+ 'chevron-down': 'icon-chevron-down',
20
+ 'chevron-end': 'icon-chevron-end',
21
+ 'chevron-left': 'icon-chevron-left',
22
+ 'chevron-right': 'icon-chevron-right',
23
+ 'chevron-up': 'icon-chevron-up',
24
+ 'circle-plus': 'icon-circle-plus',
25
+ cis: 'icon-cis',
26
+ close: 'icon-close',
27
+ 'cluster-management': 'icon-cluster-management',
28
+ cluster: 'icon-cluster',
29
+ code: 'icon-code',
30
+ comment: 'icon-comment',
31
+ commit: 'icon-commit',
32
+ compass: 'icon-compass',
33
+ 'confirmation-alt': 'icon-confirmation-alt',
34
+ copy: 'icon-copy',
35
+ dashboard: 'icon-dashboard',
36
+ dock: 'icon-dock',
37
+ docker: 'icon-docker',
38
+ document: 'icon-document',
39
+ 'dot-half': 'icon-dot-half',
40
+ 'dot-open': 'icon-dot-open',
41
+ dot: 'icon-dot',
42
+ 'downgrade-alt': 'icon-downgrade-alt',
43
+ download: 'icon-download',
44
+ edit: 'icon-edit',
45
+ elemental: 'icon-elemental',
46
+ endpoints_connected: 'icon-endpoints_connected',
47
+ endpoints_disconnected: 'icon-endpoints_disconnected',
48
+ epinio: 'icon-epinio',
49
+ error: 'icon-error',
50
+ explore: 'icon-explore',
51
+ extension: 'icon-extension',
52
+ 'external-link': 'icon-external-link',
53
+ file: 'icon-file',
54
+ filter_alt: 'icon-filter_alt',
55
+ flask: 'icon-flask',
56
+ fleet: 'icon-fleet',
57
+ folder: 'icon-folder',
58
+ fork: 'icon-fork',
59
+ gatekeeper: 'icon-gatekeeper',
60
+ gear: 'icon-gear',
61
+ gemini: 'icon-gemini',
62
+ git: 'icon-git',
63
+ github: 'icon-github',
64
+ gitlab: 'icon-gitlab',
65
+ globe: 'icon-globe',
66
+ groups: 'icon-groups',
67
+ harvester: 'icon-harvester',
68
+ helm: 'icon-helm',
69
+ hide: 'icon-hide',
70
+ history: 'icon-history',
71
+ home: 'icon-home',
72
+ 'info-circle': 'icon-info-circle',
73
+ info: 'icon-info',
74
+ init_container: 'icon-init_container',
75
+ istio: 'icon-istio',
76
+ keyboard: 'icon-keyboard',
77
+ keyboard_tab: 'icon-keyboard_tab',
78
+ linux: 'icon-linux',
79
+ 'list-flat': 'icon-list-flat',
80
+ 'list-grouped': 'icon-list-grouped',
81
+ lock: 'icon-lock',
82
+ logging: 'icon-logging',
83
+ longhorn: 'icon-longhorn',
84
+ marketplace: 'icon-marketplace',
85
+ menu: 'icon-menu',
86
+ minus: 'icon-minus',
87
+ monitoring: 'icon-monitoring',
88
+ more: 'icon-more',
89
+ namespace: 'icon-namespace',
90
+ notifier: 'icon-notifier',
91
+ 'notify-announcement': 'icon-notify-announcement',
92
+ 'notify-bell': 'icon-notify-bell',
93
+ 'notify-busy': 'icon-notify-busy',
94
+ 'notify-error': 'icon-notify-error',
95
+ 'notify-info': 'icon-notify-info',
96
+ 'notify-tick': 'icon-notify-tick',
97
+ 'notify-warning': 'icon-notify-warning',
98
+ ollama: 'icon-ollama',
99
+ openai: 'icon-openai',
100
+ 'os-management': 'icon-os-management',
101
+ pause: 'icon-pause',
102
+ 'pin-outlined': 'icon-pin-outlined',
103
+ pin: 'icon-pin',
104
+ pipeline: 'icon-pipeline',
105
+ play: 'icon-play',
106
+ plus: 'icon-plus',
107
+ pod_security: 'icon-pod_security',
108
+ print: 'icon-print',
109
+ 'question-mark': 'icon-question-mark',
110
+ 'quick-action': 'icon-quick-action',
111
+ 'rancher-desktop': 'icon-rancher-desktop',
112
+ 'rancher-observability': 'icon-rancher-observability',
113
+ 'refresh-alt': 'icon-refresh-alt',
114
+ refresh: 'icon-refresh',
115
+ 'repository-alt': 'icon-repository-alt',
116
+ repository: 'icon-repository',
117
+ rio: 'icon-rio',
118
+ 'role-binding': 'icon-role-binding',
119
+ search: 'icon-search',
120
+ send: 'icon-send',
121
+ service: 'icon-service',
122
+ show: 'icon-show',
123
+ snapshot: 'icon-snapshot',
124
+ 'sort-down': 'icon-sort-down',
125
+ 'sort-up': 'icon-sort-up',
126
+ sort: 'icon-sort',
127
+ sources: 'icon-sources',
128
+ spinner: 'icon-spinner',
129
+ stackstate: 'icon-stackstate',
130
+ 'star-open': 'icon-star-open',
131
+ star: 'icon-star',
132
+ storage: 'icon-storage',
133
+ 'tag-alt': 'icon-tag-alt',
134
+ terminal: 'icon-terminal',
135
+ 'thinking-process': 'icon-thinking-process',
136
+ trash: 'icon-trash',
137
+ unlock: 'icon-unlock',
138
+ 'upgrade-alt': 'icon-upgrade-alt',
139
+ upload: 'icon-upload',
140
+ 'user-check': 'icon-user-check',
141
+ 'user-xmark': 'icon-user-xmark',
142
+ user: 'icon-user',
143
+ 'version-alt': 'icon-version-alt',
144
+ warning: 'icon-warning',
145
+ windows: 'icon-windows',
146
+ };
147
+
148
+ export const RcIconSize = {
149
+ large: '25px',
150
+ medium: '18px',
151
+ small: '14px',
152
+ none: undefined
153
+ };
154
+
155
+ export interface RcIconProps {
156
+ size: keyof typeof RcIconSize;
157
+ type: keyof typeof RcIconType;
158
+ ariaHidden?: boolean;
159
+ status?: Status | 'inherit';
160
+ }
@@ -72,7 +72,7 @@ interface RcItemCardProps {
72
72
  id: string;
73
73
 
74
74
  /** Any object value associated with this card */
75
- value: ItemValue;
75
+ value?: ItemValue;
76
76
 
77
77
  /** Card title, status icons and action menu. Image will be included in the header in small variant too */
78
78
  header: Header;
@@ -0,0 +1,67 @@
1
+
2
+ import { reactive } from 'vue';
3
+ import { wrapIfVar, useStatusColors, Status } from './status';
4
+
5
+ describe('utils: status', () => {
6
+ describe('wrapIfVar', () => {
7
+ it('should wrap a CSS variable', () => {
8
+ const result = wrapIfVar('--rc-info');
9
+
10
+ expect(result).toBe('var(--rc-info)');
11
+ });
12
+
13
+ it('should not wrap a normal color', () => {
14
+ const result = wrapIfVar('red');
15
+
16
+ expect(result).toBe('red');
17
+ });
18
+ });
19
+
20
+ describe('useStatusColors', () => {
21
+ it.each([
22
+ 'info',
23
+ 'success',
24
+ 'warning',
25
+ 'error',
26
+ 'unknown',
27
+ 'none'
28
+ ])('solid: should return the correct colors for status: %p', (status: Status) => {
29
+ const props = reactive({ status });
30
+ const {
31
+ borderColor,
32
+ backgroundColor,
33
+ textColor
34
+ } = useStatusColors(props, 'solid');
35
+
36
+ expect(borderColor.value).toBe(`var(--rc-${ status })`);
37
+ if (status !== 'none') {
38
+ // eslint-disable-next-line jest/no-conditional-expect
39
+ expect(backgroundColor.value).toBe(`var(--rc-${ status })`);
40
+ }
41
+ expect(textColor.value).toBe(`var(--rc-${ status }-secondary)`);
42
+ });
43
+
44
+ it.each([
45
+ 'info',
46
+ 'success',
47
+ 'warning',
48
+ 'error',
49
+ 'unknown',
50
+ 'none'
51
+ ])('outlined: should return the correct colors for status: %p', (status: Status) => {
52
+ const props = reactive({ status });
53
+ const {
54
+ borderColor,
55
+ backgroundColor,
56
+ textColor
57
+ } = useStatusColors(props, 'outlined');
58
+
59
+ expect(borderColor.value).toBe(`var(--rc-${ status }-secondary)`);
60
+ if (status !== 'none') {
61
+ // eslint-disable-next-line jest/no-conditional-expect
62
+ expect(backgroundColor.value).toBe(`var(--rc-${ status }-secondary)`);
63
+ }
64
+ expect(textColor.value).toBe(`var(--rc-${ status })`);
65
+ });
66
+ });
67
+ });
@@ -0,0 +1,77 @@
1
+ import { computed } from 'vue';
2
+
3
+ export const StatusDefinitions = {
4
+ info: {
5
+ primary: '--rc-info',
6
+ secondary: '--rc-info-secondary'
7
+ },
8
+ success: {
9
+ primary: '--rc-success',
10
+ secondary: '--rc-success-secondary'
11
+ },
12
+ warning: {
13
+ primary: '--rc-warning',
14
+ secondary: '--rc-warning-secondary'
15
+ },
16
+ error: {
17
+ primary: '--rc-error',
18
+ secondary: '--rc-error-secondary'
19
+ },
20
+ unknown: {
21
+ primary: '--rc-unknown',
22
+ secondary: '--rc-unknown-secondary'
23
+ },
24
+ none: {
25
+ primary: '--rc-none',
26
+ secondary: '--rc-none-secondary'
27
+ },
28
+ };
29
+
30
+ export type Status = keyof typeof StatusDefinitions;
31
+ export type StatusObject = { status: Status };
32
+ export type Style = 'solid' | 'outlined';
33
+
34
+ export function wrapIfVar(colorVar: string) {
35
+ return colorVar.startsWith('--') ? `var(${ colorVar })` : colorVar;
36
+ }
37
+
38
+ /**
39
+ * A composable to make it easier to use status colors in multiple components
40
+ *
41
+ * @param propsWithStatus The props which contain a `status: Status` property. Ideally I'd prefer to just pass status but doing so either forces the consumer to wrap the values in a Ref or this code is no longer reactive.
42
+ * @param style {@link Style} Will the block of code being using the solid or outlined styling
43
+ * @returns An object containing the relevant style colors
44
+ */
45
+ export function useStatusColors(propsWithStatus: StatusObject, style: Style) {
46
+ const statusColors = computed(() => {
47
+ return StatusDefinitions[propsWithStatus.status];
48
+ });
49
+ const isOutlined = style === 'outlined';
50
+
51
+ const borderColor = computed(() => {
52
+ const colorVar = isOutlined ? statusColors.value.secondary : statusColors.value.primary;
53
+
54
+ return wrapIfVar(colorVar);
55
+ });
56
+
57
+ const backgroundColor = computed(() => {
58
+ if (propsWithStatus.status === 'none') {
59
+ return 'none';
60
+ }
61
+ const colorVar = isOutlined ? statusColors.value.secondary : statusColors.value.primary;
62
+
63
+ return wrapIfVar(colorVar);
64
+ });
65
+
66
+ const textColor = computed(() => {
67
+ const colorVar = isOutlined ? statusColors.value.primary : statusColors.value.secondary;
68
+
69
+ return wrapIfVar(colorVar);
70
+ });
71
+
72
+ return {
73
+ borderColor,
74
+ backgroundColor,
75
+ textColor
76
+ };
77
+ }
@@ -8,6 +8,7 @@ SHELL_DIR=$BASE_DIR/shell/
8
8
  CREATORS_DIR=$BASE_DIR/creators/extension
9
9
  FORCE_PUBLISH_TO_NPM="false"
10
10
  DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
11
+ DUMMY_VERSION="99.99.99"
11
12
 
12
13
  # if TAG doesn't exist, we can exit as it's needed for any type of publish.
13
14
  if [ -z "$TAG" ]; then
@@ -84,6 +85,14 @@ function publish() {
84
85
  fi
85
86
  }
86
87
 
88
+ update_version_in_package_json() {
89
+ local package_json_path="$1"
90
+ local version="$2"
91
+
92
+ sed -i.bak -e "s/\"version\": \"[0-9]*.[0-9]*.[0-9]*\(-alpha\.[0-9]*\|-release[0-9]*.[0-9]*.[0-9]*\|-rc\.[0-9]*\)\{0,1\}\",/\"version\": \"${version}\",/g" "$package_json_path"
93
+ rm "${package_json_path}.bak"
94
+ }
95
+
87
96
  echo "TAG ${TAG}"
88
97
 
89
98
  # let's get the package name and version from the tag
@@ -102,10 +111,26 @@ fi
102
111
  case $PKG_NAME in
103
112
  "shell")
104
113
  echo "Publishing only Shell pkg via tagged release"
114
+
115
+ # with the changes in https://github.com/rancher/dashboard/pull/16166/files#diff-d954ab41ef46f7fdbaaf6d8c2bc715ad2cc823a829317b6ff93a3c94a92811f1
116
+ # with NPM 11.3 --dry--run now does additional checks, one of them is the version number
117
+ # so for dry runs we need to provide a valid version number here (not something published before)
118
+ if [ ${DRY_RUN} == "true" ]; then
119
+ update_version_in_package_json "${SHELL_DIR}/package.json" "${DUMMY_VERSION}"
120
+ fi
121
+
105
122
  publish "Shell" ${SHELL_DIR} ${PKG_V}
106
123
  ;;
107
124
  "creators")
108
125
  echo "Publishing only Creators pkg via tagged release"
126
+
127
+ # with the changes in https://github.com/rancher/dashboard/pull/16166/files#diff-d954ab41ef46f7fdbaaf6d8c2bc715ad2cc823a829317b6ff93a3c94a92811f1
128
+ # with NPM 11.3 --dry--run now does additional checks, one of them is the version number
129
+ # so for dry runs we need to provide a valid version number here (not something published before)
130
+ if [ ${DRY_RUN} == "true" ]; then
131
+ update_version_in_package_json "${CREATORS_DIR}/package.json" "${DUMMY_VERSION}"
132
+ fi
133
+
109
134
  publish "Extension creator" ${CREATORS_DIR} ${PKG_V}
110
135
  ;;
111
136
  *)
@@ -29,6 +29,7 @@ ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/store/prefs.js --declaration --al
29
29
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/store/plugins.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/store > /dev/null
30
30
 
31
31
  # # plugins
32
+ ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/i18n.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/ > /dev/null
32
33
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/normalize.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
33
34
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/resource-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
34
35
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/classify.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
@@ -88,7 +88,7 @@ describe('catalog', () => {
88
88
  }
89
89
  },
90
90
  state: {
91
- $plugin: { getDynamic: () => require(`@shell/models/chart`) },
91
+ $extension: { getDynamic: () => require(`@shell/models/chart`) },
92
92
  [catalogStoreName]: { } as { [key: string]: any},
93
93
  },
94
94
  getters: {
@@ -1116,7 +1116,169 @@ describe('type-map', () => {
1116
1116
  });
1117
1117
  });
1118
1118
  });
1119
+
1120
+ describe('activeProducts', () => {
1121
+ // Basic schemas for product filtering tests
1122
+ const productSchemas = {
1123
+ myType: {
1124
+ id: 'mytype',
1125
+ _id: 'mytype',
1126
+ type: SCHEMA,
1127
+ _group: 'mygroup',
1128
+ },
1129
+ anotherType: {
1130
+ id: 'anothertype',
1131
+ _id: 'anothertype',
1132
+ type: SCHEMA,
1133
+ _group: 'anothergroup',
1134
+ },
1135
+ };
1136
+
1137
+ const createProductState = (products) => ({
1138
+ products,
1139
+ schemaGeneration: 1,
1140
+ });
1141
+
1142
+ const createProductRootGetters = (moduleSchemas = [], moduleName = 'cluster') => ({
1143
+ 'prefs/get': () => false,
1144
+ [`${ moduleName }/all`]: (resource) => {
1145
+ if (resource === SCHEMA) {
1146
+ return moduleSchemas;
1147
+ }
1148
+
1149
+ return [];
1150
+ },
1151
+ });
1152
+
1153
+ describe('ifHaveType', () => {
1154
+ it('should show product when matching type exists', () => {
1155
+ const state = createProductState([{
1156
+ name: 'test-product',
1157
+ inStore: 'cluster',
1158
+ ifHaveType: 'mytype',
1159
+ }]);
1160
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1161
+
1162
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1163
+
1164
+ expect(active).toHaveLength(1);
1165
+ expect(active[0].name).toBe('test-product');
1166
+ });
1167
+
1168
+ it('should hide product when matching type does not exist', () => {
1169
+ const state = createProductState([{
1170
+ name: 'test-product',
1171
+ inStore: 'cluster',
1172
+ ifHaveType: 'missingtype',
1173
+ }]);
1174
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1175
+
1176
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1177
+
1178
+ expect(active).toHaveLength(0);
1179
+ });
1180
+ });
1181
+
1182
+ describe('ifNotHaveType', () => {
1183
+ it('should show product when matching type does NOT exist', () => {
1184
+ const state = createProductState([{
1185
+ name: 'test-product',
1186
+ inStore: 'cluster',
1187
+ ifNotHaveType: 'missingtype',
1188
+ }]);
1189
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1190
+
1191
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1192
+
1193
+ expect(active).toHaveLength(1);
1194
+ expect(active[0].name).toBe('test-product');
1195
+ });
1196
+
1197
+ it('should hide product when matching type exists', () => {
1198
+ const state = createProductState([{
1199
+ name: 'test-product',
1200
+ inStore: 'cluster',
1201
+ ifNotHaveType: 'mytype',
1202
+ }]);
1203
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1204
+
1205
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1206
+
1207
+ expect(active).toHaveLength(0);
1208
+ });
1209
+
1210
+ it('should support regex pattern in ifNotHaveType', () => {
1211
+ const state = createProductState([{
1212
+ name: 'test-product',
1213
+ inStore: 'cluster',
1214
+ ifNotHaveType: 'my.*',
1215
+ }]);
1216
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1217
+
1218
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1219
+
1220
+ expect(active).toHaveLength(0);
1221
+ });
1222
+
1223
+ it('should show product when regex pattern does not match any type', () => {
1224
+ const state = createProductState([{
1225
+ name: 'test-product',
1226
+ inStore: 'cluster',
1227
+ ifNotHaveType: 'nomatch.*',
1228
+ }]);
1229
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1230
+
1231
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1232
+
1233
+ expect(active).toHaveLength(1);
1234
+ expect(active[0].name).toBe('test-product');
1235
+ });
1236
+ });
1237
+
1238
+ describe('combined ifHaveType and ifNotHaveType', () => {
1239
+ it('should show product when ifHaveType matches and ifNotHaveType does not match', () => {
1240
+ const state = createProductState([{
1241
+ name: 'test-product',
1242
+ inStore: 'cluster',
1243
+ ifHaveType: 'mytype',
1244
+ ifNotHaveType: 'missingtype',
1245
+ }]);
1246
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1247
+
1248
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1249
+
1250
+ expect(active).toHaveLength(1);
1251
+ expect(active[0].name).toBe('test-product');
1252
+ });
1253
+
1254
+ it('should hide product when ifHaveType matches but ifNotHaveType also matches', () => {
1255
+ const state = createProductState([{
1256
+ name: 'test-product',
1257
+ inStore: 'cluster',
1258
+ ifHaveType: 'mytype',
1259
+ ifNotHaveType: 'anothertype',
1260
+ }]);
1261
+ const rootGetters = createProductRootGetters([productSchemas.myType, productSchemas.anotherType]);
1262
+
1263
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1264
+
1265
+ expect(active).toHaveLength(0);
1266
+ });
1267
+
1268
+ it('should hide product when ifHaveType does not match', () => {
1269
+ const state = createProductState([{
1270
+ name: 'test-product',
1271
+ inStore: 'cluster',
1272
+ ifHaveType: 'missingtype',
1273
+ ifNotHaveType: 'anothermissingtype',
1274
+ }]);
1275
+ const rootGetters = createProductRootGetters([productSchemas.myType]);
1276
+
1277
+ const active = getters.activeProducts(state, {}, {}, rootGetters);
1278
+
1279
+ expect(active).toHaveLength(0);
1280
+ });
1281
+ });
1282
+ });
1119
1283
  });
1120
1284
  });
1121
-
1122
- // getTree - Remove ignored schemas, not-applicable to ns filter
@@ -111,6 +111,14 @@ export const mutations = {
111
111
  state.modalData = data;
112
112
  },
113
113
 
114
+ updateModalData(state, data) {
115
+ state.modalData = state.modalData || {};
116
+
117
+ data.forEach(({ key, value }) => {
118
+ state.modalData[key] = value;
119
+ });
120
+ },
121
+
114
122
  clearCallbackData(state) {
115
123
  state.performCallbackData = undefined;
116
124
  },
package/store/auth.js CHANGED
@@ -149,12 +149,16 @@ export const actions = {
149
149
  force = true;
150
150
  }
151
151
 
152
- return dispatch('rancher/findAll', {
152
+ const providers = dispatch('rancher/findAll', {
153
153
  type: 'authProvider',
154
154
  opt: {
155
- url: `/v3-public/authProviders`, watch: false, force
155
+ url: `/v1-public/authproviders`,
156
+ watch: false,
157
+ force
156
158
  }
157
159
  }, { root: true });
160
+
161
+ return providers;
158
162
  },
159
163
 
160
164
  getAuthConfigs({ dispatch }) {
@@ -349,13 +353,21 @@ export const actions = {
349
353
  const driver = await dispatch('getAuthProvider', provider);
350
354
 
351
355
  try {
352
- const res = await driver.doAction('login', {
353
- description: 'UI session',
354
- responseType: 'cookie',
355
- ...body
356
- }, { redirectUnauthorized: false });
357
-
358
- return res;
356
+ return await dispatch(
357
+ 'management/request',
358
+ {
359
+ url: `/v1-public/login`,
360
+ method: 'post',
361
+ data: {
362
+ type: driver.type,
363
+ description: 'UI session',
364
+ responseType: 'cookie',
365
+ ...body
366
+ },
367
+ redirectUnauthorized: false,
368
+ },
369
+ { root: true }
370
+ );
359
371
  } catch (err) {
360
372
  if (err._status === 401) {
361
373
  return Promise.reject(LOGIN_ERRORS.CLIENT_UNAUTHORIZED);
@@ -402,20 +414,20 @@ export const actions = {
402
414
  }
403
415
 
404
416
  // Unload plugins - we will load again on login
405
- await rootState.$plugin.logout();
417
+ await rootState.$extension.logout();
406
418
 
407
- let logoutAction = 'logout';
419
+ let logoutAction = '';
408
420
  const data = {};
409
421
 
410
422
  // SLO - Single-sign logout - will logout auth provider from all places where it's logged in
411
423
  if (options.slo) {
412
- logoutAction = 'logoutAll';
424
+ logoutAction = '?all';
413
425
  data.finalRedirectUrl = returnTo({ isSlo: true }, this);
414
426
  }
415
427
 
416
428
  try {
417
429
  const res = await dispatch('rancher/request', {
418
- url: `/v3/tokens?action=${ logoutAction }`,
430
+ url: `/v1/logout${ logoutAction }`,
419
431
  method: 'post',
420
432
  data,
421
433
  headers: { 'Content-Type': 'application/json' },
package/store/catalog.js CHANGED
@@ -504,11 +504,16 @@ function addChart(ctx, map, chart, repo) {
504
504
 
505
505
  if ( !obj ) {
506
506
  if ( ctx ) { }
507
+
508
+ const primeOnly = chart.annotations?.[CATALOG_ANNOTATIONS.PRIME_ONLY] === 'true';
507
509
  const experimental = !!chart.annotations?.[CATALOG_ANNOTATIONS.EXPERIMENTAL];
508
510
  const windowsIncompatible = !(chart.annotations?.[CATALOG_ANNOTATIONS.PERMITTED_OS] || '').includes('windows');
509
511
  const deploysOnWindows = (chart.annotations?.[CATALOG_ANNOTATIONS.DEPLOYED_OS] || '').includes('windows');
510
512
  const tags = [];
511
513
 
514
+ if (primeOnly) {
515
+ tags.push(ctx.rootGetters['i18n/withFallback']('generic.primeOnly'));
516
+ }
512
517
  if (experimental) {
513
518
  tags.push(ctx.rootGetters['i18n/withFallback']('generic.experimental'));
514
519
  }
@@ -542,6 +547,7 @@ function addChart(ctx, map, chart, repo) {
542
547
  keywords: chart.keywords || [],
543
548
  categories: filterCategories(chart.keywords),
544
549
  deprecated: !!chart.deprecated,
550
+ primeOnly,
545
551
  experimental,
546
552
  hidden: !!chart.annotations?.[CATALOG_ANNOTATIONS.HIDDEN],
547
553
  targetNamespace: chart.annotations?.[CATALOG_ANNOTATIONS.NAMESPACE],