feat(editor): Show banner for non-production licenses (#6943)

https://linear.app/n8n/issue/PAY-692
This commit is contained in:
Iván Ovejero
2023-08-17 14:00:17 +02:00
committed by GitHub
parent d3f01270c7
commit 413570c49d
10 changed files with 33 additions and 20 deletions

View File

@@ -1,15 +1,16 @@
<script setup lang="ts">
import NonProductionLicenseBanner from '@/components/banners/NonProductionLicenseBanner.vue';
import TrialOverBanner from '@/components/banners/TrialOverBanner.vue';
import TrialBanner from '@/components/banners/TrialBanner.vue';
import V1Banner from '@/components/banners/V1Banner.vue';
import { useUIStore } from '@/stores/ui.store';
import { onMounted, watch } from 'vue';
import { getBannerRowHeight } from '@/utils';
import type { Banners } from 'n8n-workflow';
import type { BannerName } from 'n8n-workflow';
const uiStore = useUIStore();
function shouldShowBanner(bannerName: Banners) {
function shouldShowBanner(bannerName: BannerName) {
return uiStore.banners[bannerName].dismissed === false;
}
@@ -32,5 +33,6 @@ watch(uiStore.banners, async () => {
<trial-over-banner v-if="shouldShowBanner('TRIAL_OVER')" />
<trial-banner v-if="shouldShowBanner('TRIAL')" />
<v1-banner v-if="shouldShowBanner('V1')" />
<non-production-license-banner v-if="shouldShowBanner('NON_PRODUCTION_LICENSE')" />
</div>
</template>

View File

@@ -1,9 +1,9 @@
<script lang="ts" setup>
import { useUIStore } from '@/stores/ui.store';
import type { Banners } from 'n8n-workflow';
import type { BannerName } from 'n8n-workflow';
interface Props {
name: Banners;
name: BannerName;
theme?: string;
customIcon?: string;
dismissible?: boolean;

View File

@@ -0,0 +1,12 @@
<script lang="ts" setup>
import BaseBanner from '@/components/banners/BaseBanner.vue';
import { i18n as locale } from '@/plugins/i18n';
</script>
<template>
<base-banner name="NON_PRODUCTION_LICENSE" :dismissible="false">
<template #mainContent>
<span>{{ locale.baseText('banners.nonProductionLicense.message') }}</span>
</template>
</base-banner>
</template>