refactor(editor): Apply Prettier (no-changelog) (#4920)
* ⚡ Adjust `format` script * 🔥 Remove exemption for `editor-ui` * 🎨 Prettify * 👕 Fix lint
This commit is contained in:
@@ -17,20 +17,37 @@
|
||||
<template #empty>
|
||||
<div class="text-center mt-s">
|
||||
<n8n-heading tag="h2" size="xlarge" class="mb-2xs">
|
||||
{{ $locale.baseText(currentUser.firstName ? 'workflows.empty.heading' : 'workflows.empty.heading.userNotSetup', { interpolate: { name: currentUser.firstName } }) }}
|
||||
{{
|
||||
$locale.baseText(
|
||||
currentUser.firstName
|
||||
? 'workflows.empty.heading'
|
||||
: 'workflows.empty.heading.userNotSetup',
|
||||
{ interpolate: { name: currentUser.firstName } },
|
||||
)
|
||||
}}
|
||||
</n8n-heading>
|
||||
<n8n-text size="large" color="text-base">
|
||||
{{ $locale.baseText('workflows.empty.description') }}
|
||||
</n8n-text>
|
||||
</div>
|
||||
<div class="text-center mt-2xl">
|
||||
<n8n-card :class="[$style.emptyStateCard, 'mr-s']" hoverable @click="addWorkflow" data-test-id="new-workflow-card">
|
||||
<n8n-card
|
||||
:class="[$style.emptyStateCard, 'mr-s']"
|
||||
hoverable
|
||||
@click="addWorkflow"
|
||||
data-test-id="new-workflow-card"
|
||||
>
|
||||
<n8n-icon :class="$style.emptyStateCardIcon" icon="file" />
|
||||
<n8n-text size="large" class="mt-xs" color="text-base">
|
||||
{{ $locale.baseText('workflows.empty.startFromScratch') }}
|
||||
</n8n-text>
|
||||
</n8n-card>
|
||||
<n8n-card :class="$style.emptyStateCard" hoverable @click="goToTemplates" data-test-id="new-workflow-template-card">
|
||||
<n8n-card
|
||||
:class="$style.emptyStateCard"
|
||||
hoverable
|
||||
@click="goToTemplates"
|
||||
data-test-id="new-workflow-template-card"
|
||||
>
|
||||
<n8n-icon :class="$style.emptyStateCardIcon" icon="box-open" />
|
||||
<n8n-text size="large" class="mt-xs" color="text-base">
|
||||
{{ $locale.baseText('workflows.empty.browseTemplates') }}
|
||||
@@ -67,7 +84,8 @@
|
||||
v-for="option in statusFilterOptions"
|
||||
:key="option.label"
|
||||
:label="option.label"
|
||||
:value="option.value">
|
||||
:value="option.value"
|
||||
>
|
||||
</n8n-option>
|
||||
</n8n-select>
|
||||
</div>
|
||||
@@ -76,20 +94,20 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {showMessage} from '@/mixins/showMessage';
|
||||
import { showMessage } from '@/mixins/showMessage';
|
||||
import mixins from 'vue-typed-mixins';
|
||||
|
||||
import SettingsView from './SettingsView.vue';
|
||||
import ResourcesListLayout from "@/components/layouts/ResourcesListLayout.vue";
|
||||
import PageViewLayout from "@/components/layouts/PageViewLayout.vue";
|
||||
import PageViewLayoutList from "@/components/layouts/PageViewLayoutList.vue";
|
||||
import WorkflowCard from "@/components/WorkflowCard.vue";
|
||||
import TemplateCard from "@/components/TemplateCard.vue";
|
||||
import {EnterpriseEditionFeature, VIEWS} from '@/constants';
|
||||
import ResourcesListLayout from '@/components/layouts/ResourcesListLayout.vue';
|
||||
import PageViewLayout from '@/components/layouts/PageViewLayout.vue';
|
||||
import PageViewLayoutList from '@/components/layouts/PageViewLayoutList.vue';
|
||||
import WorkflowCard from '@/components/WorkflowCard.vue';
|
||||
import TemplateCard from '@/components/TemplateCard.vue';
|
||||
import { EnterpriseEditionFeature, VIEWS } from '@/constants';
|
||||
import { debounceHelper } from '@/mixins/debounce';
|
||||
import Vue from "vue";
|
||||
import {ITag, IUser, IWorkflowDb} from "@/Interface";
|
||||
import TagsDropdown from "@/components/TagsDropdown.vue";
|
||||
import Vue from 'vue';
|
||||
import { ITag, IUser, IWorkflowDb } from '@/Interface';
|
||||
import TagsDropdown from '@/components/TagsDropdown.vue';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useSettingsStore } from '@/stores/settings';
|
||||
@@ -104,10 +122,7 @@ const StatusFilter = {
|
||||
ALL: '',
|
||||
};
|
||||
|
||||
export default mixins(
|
||||
showMessage,
|
||||
debounceHelper,
|
||||
).extend({
|
||||
export default mixins(showMessage, debounceHelper).extend({
|
||||
name: 'WorkflowsView',
|
||||
components: {
|
||||
ResourcesListLayout,
|
||||
@@ -130,22 +145,19 @@ export default mixins(
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapStores(
|
||||
useSettingsStore,
|
||||
useUIStore,
|
||||
useUsersStore,
|
||||
useWorkflowsStore,
|
||||
),
|
||||
...mapStores(useSettingsStore, useUIStore, useUsersStore, useWorkflowsStore),
|
||||
currentUser(): IUser {
|
||||
return this.usersStore.currentUser || {} as IUser;
|
||||
return this.usersStore.currentUser || ({} as IUser);
|
||||
},
|
||||
allWorkflows(): IWorkflowDb[] {
|
||||
return this.workflowsStore.allWorkflows;
|
||||
},
|
||||
isShareable(): boolean {
|
||||
return this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.WorkflowSharing);
|
||||
return this.settingsStore.isEnterpriseFeatureEnabled(
|
||||
EnterpriseEditionFeature.WorkflowSharing,
|
||||
);
|
||||
},
|
||||
statusFilterOptions(): Array<{ label: string, value: string | boolean }> {
|
||||
statusFilterOptions(): Array<{ label: string; value: string | boolean }> {
|
||||
return [
|
||||
{
|
||||
label: this.$locale.baseText('workflows.filters.status.all'),
|
||||
@@ -187,11 +199,21 @@ export default mixins(
|
||||
this.filters.tags.push(tagId);
|
||||
}
|
||||
},
|
||||
onFilter(resource: IWorkflowDb, filters: { tags: string[]; search: string; status: string | boolean }, matches: boolean): boolean {
|
||||
onFilter(
|
||||
resource: IWorkflowDb,
|
||||
filters: { tags: string[]; search: string; status: string | boolean },
|
||||
matches: boolean,
|
||||
): boolean {
|
||||
if (this.settingsStore.areTagsEnabled && filters.tags.length > 0) {
|
||||
matches = matches && filters.tags.every(
|
||||
(tag) => (resource.tags as ITag[])?.find((resourceTag) => typeof resourceTag === 'object' ? `${resourceTag.id}` === `${tag}` : `${resourceTag}` === `${tag}`),
|
||||
);
|
||||
matches =
|
||||
matches &&
|
||||
filters.tags.every((tag) =>
|
||||
(resource.tags as ITag[])?.find((resourceTag) =>
|
||||
typeof resourceTag === 'object'
|
||||
? `${resourceTag.id}` === `${tag}`
|
||||
: `${resourceTag}` === `${tag}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (filters.status !== '') {
|
||||
@@ -233,10 +255,9 @@ export default mixins(
|
||||
font-size: 48px;
|
||||
|
||||
svg {
|
||||
width: 48px!important;
|
||||
width: 48px !important;
|
||||
color: var(--color-foreground-dark);
|
||||
transition: color 0.3s ease;}
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user