Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use presence of meltano_sdk keyword to display SDK settings #1709

Merged
merged 5 commits into from
Mar 20, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions src/components/PluginSettingsSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
find the setting you're looking for, click on any setting name from the list:
</p>
<ul class="list-disc list-inside pl-4">
<li v-for="(setting, index) in definedSettings()" v-bind:key="index">
<a :href="getSettingHref(setting)"
<li v-for="(setting, index) in definedSettings" v-bind:key="index">
<a :href="setting.href"
><code>{{ setting.name }}</code></a
>
</li>
</ul>
<div v-if="sdkSettings().length > 0">
<div v-if="sdkSettings.length > 0 && $page.plugins.keywords.includes('meltano_sdk')">
pnadolny13 marked this conversation as resolved.
Show resolved Hide resolved
<details>
<summary class="text-xl pb-4 pt-4 font-bold font-hg">Expand To Show SDK Settings</summary>
<ul class="list-disc list-inside pl-4">
<li v-for="(setting, index) in sdkSettings()" v-bind:key="index">
<a :href="getSettingHref(setting)"
<li v-for="(setting, index) in sdkSettings" v-bind:key="index">
<a :href="setting.href"
><code>{{ setting.name }}</code></a
>
</li>
Expand Down Expand Up @@ -54,7 +54,7 @@
>
that defines the settings for this plugin.
</p>
<span class="mt-6" v-for="(setting, index) in definedSettings()" v-bind:key="index">
<span class="mt-6" v-for="(setting, index) in definedSettings" v-bind:key="index">
<p class="mt-3 text-xl" :id="setting.name.replace(/\./g, '-') + '-setting'">
<code>{{ setting.label }} ({{ setting.name }})</code>
</p>
Expand Down Expand Up @@ -84,14 +84,12 @@
><code >meltano config {{ name }} set {{ setting.name.replace(".", " ") }} [value]</code></pre>
</span>

<div v-if="sdkSettings().length > 0">
<details
:open="sdkSettings().some((setting) => getSettingHref(setting) === this.$route.hash)"
>
<div v-if="sdkSettings.length > 0 && $page.plugins.keywords.includes('meltano_sdk')">
<details :open="sdkSettings.some((setting) => setting.href === this.$route.hash)">
<summary class="text-2xl pb-4 pt-4 font-bold font-hg">
Expand To Show SDK Settings
</summary>
<span class="mt-6" v-for="(setting, index) in sdkSettings()" v-bind:key="index">
<span class="mt-6" v-for="(setting, index) in sdkSettings" v-bind:key="index">
<p class="mt-3 text-xl" :id="setting.name.replace(/\./g, '-') + '-setting'">
<code>{{ setting.label }} ({{ setting.name }})</code>
</p>
Expand Down Expand Up @@ -155,15 +153,22 @@ export default {
],
};
},
methods: {
computed: {
$settingsWithHref() {
return this.settings.map((setting) => ({
...setting,
href: `#${setting.name.replace(/\./g, "-")}-setting`,
}));
},
definedSettings() {
return this.settings.filter((setting) => !this.hardcodedValues.includes(setting.name));
return this.$settingsWithHref.filter(
(setting) => !this.hardcodedValues.includes(setting.name)
);
},
sdkSettings() {
return this.settings.filter((setting) => this.hardcodedValues.includes(setting.name));
},
getSettingHref(setting) {
return `#${setting.name.replace(/\./g, "-")}-setting`;
return this.$settingsWithHref.filter((setting) =>
this.hardcodedValues.includes(setting.name)
);
},
},
};
Expand Down