From 427f15b31cc2b28d7c7740487c873c6142b25d3c Mon Sep 17 00:00:00 2001 From: ReubenFrankel <60552974+ReubenFrankel@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:43:19 +0000 Subject: [PATCH] Use presence of `meltano_sdk` keyword to display SDK settings (#1709) --- src/components/PluginSettingsSection.vue | 42 ++++++++++++++---------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/components/PluginSettingsSection.vue b/src/components/PluginSettingsSection.vue index 50d6281b8..b622ea5a8 100644 --- a/src/components/PluginSettingsSection.vue +++ b/src/components/PluginSettingsSection.vue @@ -9,18 +9,18 @@ find the setting you're looking for, click on any setting name from the list:

-
+
Expand To Show SDK Settings
    -
  • - + {{ setting.name }}
  • @@ -54,7 +54,7 @@ > that defines the settings for this plugin.

    - +

    {{ setting.label }} ({{ setting.name }})

    @@ -84,14 +84,12 @@ >meltano config {{ name }} set {{ setting.name.replace(".", " ") }} [value]
    -
    -
    +
    +
    Expand To Show SDK Settings - +

    {{ setting.label }} ({{ setting.name }})

    @@ -155,15 +153,25 @@ export default { ], }; }, - methods: { + computed: { + $settingsWithHref() { + return this.settings.map((setting) => ({ + ...setting, + href: `#${setting.name.replace(/\./g, "-")}-setting`, + })); + }, + $isSdkPlugin() { + return this.$page.plugins.keywords.includes("meltano_sdk"); + }, definedSettings() { - return this.settings.filter((setting) => !this.hardcodedValues.includes(setting.name)); + return this.$isSdkPlugin + ? this.$settingsWithHref.filter((setting) => !this.hardcodedValues.includes(setting.name)) + : this.$settingsWithHref; }, sdkSettings() { - return this.settings.filter((setting) => this.hardcodedValues.includes(setting.name)); - }, - getSettingHref(setting) { - return `#${setting.name.replace(/\./g, "-")}-setting`; + return this.$isSdkPlugin + ? this.$settingsWithHref.filter((setting) => this.hardcodedValues.includes(setting.name)) + : []; }, }, };