From 3141565cc94032b483fa014ea804a99e7fcd5d9e Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 5 Sep 2021 17:15:54 +0100 Subject: [PATCH] :lipstick: Show provider in tooltip, if available --- src/components/LinkItems/Item.vue | 13 ++++++++----- src/components/LinkItems/Section.vue | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/LinkItems/Item.vue b/src/components/LinkItems/Item.vue index dbe96ca99d..800c865864 100644 --- a/src/components/LinkItems/Item.vue +++ b/src/components/LinkItems/Item.vue @@ -63,6 +63,7 @@ export default { color: String, // Optional text and icon color, specified in hex code backgroundColor: String, // Optional item background color url: String, // URL to the resource, optional but recommended + provider: String, // Optional provider name, for external apps hotkey: Number, // Shortcut for quickly launching app target: { // Where resource will open, either 'newtab', 'sametab' or 'modal' type: String, @@ -131,14 +132,16 @@ export default { }, /* Returns configuration object for the tooltip */ getTooltipOptions() { - if (!this.description) return {}; // If no description, then skip - const hotkeyText = this.hotkey ? `\nPress '${this.hotkey}' to launch` : ''; + if (!this.description && !this.provider) return {}; // If no description, then skip + const description = this.description ? this.description : ''; + const providerText = this.provider ? `Provider: ${this.provider}` : ''; + const lb1 = description && providerText ? '
' : ''; + const hotkeyText = this.hotkey ? `
Press '${this.hotkey}' to launch` : ''; return { - disabled: !this.description, - content: this.description + hotkeyText, + content: providerText + lb1 + description + hotkeyText, trigger: 'hover focus', hideOnTargetClick: true, - html: false, + html: true, placement: this.statusResponse ? 'left' : 'auto', delay: { show: 600, hide: 200 }, classes: 'item-description-tooltip', diff --git a/src/components/LinkItems/Section.vue b/src/components/LinkItems/Section.vue index 51edd31729..8f4206c5cf 100644 --- a/src/components/LinkItems/Section.vue +++ b/src/components/LinkItems/Section.vue @@ -31,6 +31,7 @@ :statusCheckHeaders="item.statusCheckHeaders" :itemSize="newItemSize" :hotkey="item.hotkey" + :provider="item.provider" :enableStatusCheck="shouldEnableStatusCheck(item.statusCheck)" :statusCheckInterval="getStatusCheckInterval()" :statusCheckAllowInsecure="item.statusCheckAllowInsecure"