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

feat: always show available compiler plugin names #636

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
61 changes: 30 additions & 31 deletions src/components/Windows/ExtensionStore/ExtensionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,42 +126,41 @@

<span>{{ extension.description }}</span>

<template
<v-divider
v-if="
(extension.connected &&
extension.connected.contributesCompilerPlugins) ||
extension.compilerPlugins.length > 0 ||
!extension.isCompatibleVersion()
"
class="my-2"
/>

<div
class="d-flex align-center"
v-if="extension.compilerPlugins.length > 0"
>
<v-divider class="my-2" />
<v-icon class="pr-1" color="secondary">mdi-cogs</v-icon>
<span class="font-weight-bold">
{{
t(
'windows.extensionStore.compilerPluginDownload.compilerPlugins'
)
}}:&nbsp;
</span>

<span>
{{ compilerPlugins }}
</span>
</div>

<div
v-if="
extension.connected &&
extension.connected.contributesCompilerPlugins
"
<div
v-if="!extension.isCompatibleVersion()"
class="d-flex align-center pt-1"
>
<v-icon class="pr-1" color="error">mdi-alert-circle</v-icon>
<span class="font-weight-bold">
{{ t('windows.extensionStore.incompatibleVersion') }}</span
>
<v-icon color="secondary">mdi-format-list-bulleted</v-icon>
<span class="font-weight-bold">
{{
t(
'windows.extensionStore.compilerPluginDownload.compilerPlugins'
)
}}:
</span>

<span>
{{ compilerPlugins }}
</span>
</div>

<div v-if="!extension.isCompatibleVersion()" class="pt-1">
<span class="font-weight-bold">
<v-icon color="error">mdi-alert-circle</v-icon>
{{ t('windows.extensionStore.incompatibleVersion') }}</span
>
</div>
</template>
</div>
</div>
</template>

Expand Down Expand Up @@ -195,7 +194,7 @@ export default {
return this.$vuetify.breakpoint.mobile
},
compilerPlugins() {
return Object.keys(this.extension.connected.compilerPlugins)
return this.extension.compilerPlugins
.map((plugin) => `"${plugin}"`)
.join(', ')
},
Expand Down
6 changes: 6 additions & 0 deletions src/components/Windows/ExtensionStore/ExtensionViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export class ExtensionViewer {
}
//#endregion

get compilerPlugins() {
const ext = this.extension
if(ext) return Object.keys(ext.compilerPlugins ?? {})

return Object.keys(this.config?.compiler?.plugins ?? {})
}
get isInstalled() {
return this._isInstalled
}
Expand Down