From 4bb01684443e4ff3e1ebcefd79b75d416eb8d485 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Thu, 9 Feb 2023 20:15:34 +0000 Subject: [PATCH] Improve presentation of Harvester Manager Built-in Extension (#8004) * Improve presentation of VM Built-in Extension * Update description following PR feedback --- pkg/harvester-manager/icon.svg | 22 +++++++++++++++++++ pkg/harvester-manager/index.ts | 3 +++ pkg/harvester-manager/package.json | 6 +++-- .../c/_cluster/uiplugins/PluginInfoPanel.vue | 11 ++++++++-- shell/pages/c/_cluster/uiplugins/index.vue | 7 +++--- 5 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 pkg/harvester-manager/icon.svg diff --git a/pkg/harvester-manager/icon.svg b/pkg/harvester-manager/icon.svg new file mode 100644 index 0000000000..b05ebd321d --- /dev/null +++ b/pkg/harvester-manager/icon.svg @@ -0,0 +1,22 @@ + + + + + + diff --git a/pkg/harvester-manager/index.ts b/pkg/harvester-manager/index.ts index f3c566aa4e..842492e078 100644 --- a/pkg/harvester-manager/index.ts +++ b/pkg/harvester-manager/index.ts @@ -9,5 +9,8 @@ export default function(plugin: IPlugin) { // Provide plugin metadata from package.json plugin.metadata = require('./package.json'); + // Built-in icon + plugin.metadata.icon = require('./icon.svg'); + plugin.addProduct(require('./config/harvester-manager')); } diff --git a/pkg/harvester-manager/package.json b/pkg/harvester-manager/package.json index e918831790..82496334bb 100644 --- a/pkg/harvester-manager/package.json +++ b/pkg/harvester-manager/package.json @@ -1,9 +1,11 @@ { "name": "harvester-manager", - "description": "harvester-manager plugin", + "description": "Provides the Virtualization Management feature in Rancher Manager", "version": "0.1.0", "private": false, - "rancher": true, + "rancher": { + "catalog.cattle.io/display-name": "Virtualization Manager" + }, "scripts": { "dev": "./node_modules/.bin/nuxt dev", "nuxt": "./node_modules/.bin/nuxt" diff --git a/shell/pages/c/_cluster/uiplugins/PluginInfoPanel.vue b/shell/pages/c/_cluster/uiplugins/PluginInfoPanel.vue index 5d280e9155..9fd9f970a1 100644 --- a/shell/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +++ b/shell/pages/c/_cluster/uiplugins/PluginInfoPanel.vue @@ -148,7 +148,7 @@ export default { class="slideIn__header" data-testid="extension-details-title" > - {{ info.name }} + {{ info.label }}

{{ info.description }} @@ -230,8 +230,11 @@ export default {

- {{ t('plugins.version', { version: info.displayVersion }) }} + {{ t('plugins.info.versions') }}

+
@@ -352,6 +355,10 @@ export default { color: var(--link-text); background: var(--link); } + + &.version-builtin { + display: inline-block; + } } &__header { diff --git a/shell/pages/c/_cluster/uiplugins/index.vue b/shell/pages/c/_cluster/uiplugins/index.vue index 1ef5ad2a3c..660e46a238 100644 --- a/shell/pages/c/_cluster/uiplugins/index.vue +++ b/shell/pages/c/_cluster/uiplugins/index.vue @@ -221,10 +221,12 @@ export default { const chart = all.find(c => c.name === p.name); if (!chart) { - // A pluign is loaded, but there is no chart, so add an item so that it shows up + // A plugin is loaded, but there is no chart, so add an item so that it shows up + const rancher = typeof p.metadata?.rancher === 'object' ? p.metadata.rancher : {}; + const label = rancher[UI_PLUGIN_CHART_ANNOTATIONS.DISPLAY_NAME] || p.name; const item = { name: p.name, - label: p.name, + label, description: p.metadata?.description, icon: p.metadata?.icon, id: p.id, @@ -880,7 +882,6 @@ export default { width: 40px; -o-object-fit: contain; object-fit: contain; - position: relative; top: 2px; left: 2px; }