fix(editor): Implement simple view for templates experiment (no-changelog) (#6637)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
OlegIvaniv 2023-07-11 12:16:48 +02:00 committed by GitHub
parent d6b2ae0255
commit 180ab8d7c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -13,7 +13,7 @@
</div>
<div v-else>
<n8n-heading :bold="true" size="small">{{ workflow.name }}</n8n-heading>
<div :class="$style.content">
<div :class="$style.content" v-if="!simpleView">
<span v-if="workflow.totalViews">
<n8n-text size="small" color="text-light">
<font-awesome-icon icon="eye" />
@ -72,6 +72,10 @@ export default defineComponent({
loading: {
type: Boolean,
},
simpleView: {
type: Boolean,
default: false,
},
},
components: {
TimeAgo,
@ -122,6 +126,7 @@ export default defineComponent({
background-color: var(--color-background-xlight);
display: flex;
align-items: center;
padding: 0 var(--spacing-s) var(--spacing-s) var(--spacing-s);
background-color: var(--color-background-xlight);
cursor: pointer;

View file

@ -1,6 +1,6 @@
<template>
<div :class="$style.list" v-if="loading || workflows.length">
<div :class="$style.header" v-if="!hideHeader">
<div :class="$style.header" v-if="!simpleView">
<n8n-heading :bold="true" size="medium" color="text-light">
{{ $locale.baseText('templates.workflows') }}
<span v-if="!loading && totalWorkflows" v-text="`(${totalWorkflows})`" />
@ -12,6 +12,7 @@
:key="workflow.id"
:workflow="workflow"
:firstItem="index === 0"
:simple-view="simpleView"
:lastItem="index === workflows.length - 1 && !loading"
:useWorkflowButton="useWorkflowButton"
@click="(e) => onCardClick(e, workflow.id)"
@ -57,7 +58,7 @@ export default defineComponent({
totalWorkflows: {
type: Number,
},
hideHeader: {
simpleView: {
type: Boolean,
default: false,
},

View file

@ -65,7 +65,7 @@
:loading="loadingWorkflows"
:total-workflows="totalWorkflows"
:workflows="isFixedListExperiment ? fixedTemplatesList : workflows"
:hide-header="isFixedListExperiment"
:simple-view="isFixedListExperiment"
@loadMore="onLoadMore"
@openTemplate="onOpenTemplate"
/>