refactor(editor): Add GitHub 30k stars banner (no-changelog) (#6204)

*  Add GitHub 30k stars banner

* refactor(editor): Add date check to GitHub 30k stars banner (#6210)
This commit is contained in:
Iván Ovejero
2023-05-10 09:51:11 +02:00
committed by GitHub
parent eae3a55cc6
commit e3f47994b1
4 changed files with 34 additions and 1 deletions

View File

@@ -61,6 +61,20 @@
<page-view-layout-list :overflow="type !== 'list'" v-else>
<template #header>
<div class="mb-xs">
<n8n-callout
v-if="starsBannerShouldRender"
theme="secondary"
icon="star"
:class="$style['github-stars-banner']"
>
<span v-html="$locale.baseText('githubStars.banner.title')"></span>
<template #trailingContent>
<n8n-link :to="repoUrl" size="small" theme="secondary" bold underline>
{{ $locale.baseText('githubStars.banner.link') }}
</n8n-link>
</template>
</n8n-callout>
<div :class="$style['filters-row']">
<n8n-input
:class="[$style['search'], 'mr-2xs']"
@@ -187,7 +201,11 @@ import mixins from 'vue-typed-mixins';
import PageViewLayout from '@/components/layouts/PageViewLayout.vue';
import PageViewLayoutList from '@/components/layouts/PageViewLayoutList.vue';
import { EnterpriseEditionFeature } from '@/constants';
import {
EnterpriseEditionFeature,
GITHUB_STARS_BANNER_SHOW_UNTIL_DATE,
MAIN_REPOSITORY_URL,
} from '@/constants';
import TemplateCard from '@/components/TemplateCard.vue';
import type { PropType } from 'vue';
import { debounceHelper } from '@/mixins/debounce';
@@ -299,10 +317,14 @@ export default mixins(showMessage, debounceHelper).extend({
rowsPerPage: 10 as number | '*',
resettingFilters: false,
EnterpriseEditionFeature,
repoUrl: MAIN_REPOSITORY_URL,
};
},
computed: {
...mapStores(useSettingsStore, useUsersStore),
starsBannerShouldRender() {
return this.resourceKey === 'workflows' && new Date() < GITHUB_STARS_BANNER_SHOW_UNTIL_DATE;
},
subviewResources(): IResource[] {
if (!this.shareable) {
return this.resources as IResource[];
@@ -533,4 +555,8 @@ export default mixins(showMessage, debounceHelper).extend({
.datatable {
padding-bottom: var(--spacing-s);
}
.github-stars-banner {
margin-bottom: var(--spacing-m);
}
</style>