From 7c9272e727fc2fd1140ddbdcbb1bd911b7d69ed8 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Tue, 18 Jun 2019 20:17:48 -0400 Subject: [PATCH] 4.5.1 Added: Add-Ons can now be flagged as unlisted and not be displayed in the list of add-ons unless the user enters the add-on's ID. --- .../main_menu/components/addon-list.vue | 79 ++++++++++++++++++- src/modules/main_menu/components/addon.vue | 3 + 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/modules/main_menu/components/addon-list.vue b/src/modules/main_menu/components/addon-list.vue index 7dd7d11d..5d4472d9 100644 --- a/src/modules/main_menu/components/addon-list.vue +++ b/src/modules/main_menu/components/addon-list.vue @@ -32,6 +32,53 @@ @navigate="navigate" /> + +
+
+
+ + +
+
+ {{ t('addon.unlisted.explain', "Unlisted Add-Ons are add-ons that have undergone approval but have opted to avoid being listed in the main listing. This could be due to the add-on being specialized for certain users, or due to the add-on being still under development. If you know an unlisted add-on's ID, enter it here for it to be displayed.") }} +
+ +
+ + +
+
+
+
+
@@ -43,7 +90,9 @@ export default { data() { return { ready: this.item.isReady(), - reload: this.item.isReloadRequired() + reload: this.item.isReloadRequired(), + unlisted: [], + unlisted_open: false } }, @@ -80,7 +129,35 @@ export default { }, methods: { + addUnlisted() { + let value = this.$refs.unlisted.value; + if ( value ) + value = value.trim().toLowerCase(); + + if ( value && value.length ) + for(const addon of this.item.getAddons()) + if ( addon.unlisted && addon.id === value ) { + this.unlisted.push(value); + break; + } + + this.$refs.unlisted.value = ''; + this.closeUnlisted(); + }, + + closeUnlisted() { + this.unlisted_open = false; + }, + + toggleUnlisted() { + this.unlisted_open = ! this.unlisted_open; + }, + shouldShow(addon) { + // If an add-on is unlisted, don't list it. + if ( addon.unlisted && ! this.item.isAddonEnabled(addon.id) && ! this.unlisted.includes(addon.id) ) + return false; + if ( ! this.filter || ! this.filter.length ) return true; diff --git a/src/modules/main_menu/components/addon.vue b/src/modules/main_menu/components/addon.vue index ef3c5b60..a4a0d0e6 100644 --- a/src/modules/main_menu/components/addon.vue +++ b/src/modules/main_menu/components/addon.vue @@ -17,6 +17,9 @@ {{ t('addon.dev', 'Developer') }} +
+ {{ t('addon.unlisted', 'Unlisted') }} +