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(editor): implement executions preview via the new executions tab in node view #4311

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
403d494
✨ Added main header tabs with current workflow execution count
MiloradFilipovic Sep 27, 2022
b7bbb82
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Sep 30, 2022
9bbec22
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 4, 2022
8aef947
feat(editor): header tab navigation (no-changelog) (#4244)
MiloradFilipovic Oct 6, 2022
9c9a223
✨ Implemented empty states for executions view
MiloradFilipovic Oct 6, 2022
411f2cf
⚡ Adding execute button shake flag to the store so it doesn't mess up…
MiloradFilipovic Oct 6, 2022
75c8404
💄 Started adding new styles to execution sidebar
MiloradFilipovic Oct 6, 2022
071f4f2
💄 Adding hover style for execution list
MiloradFilipovic Oct 6, 2022
909a43d
⚡ Added ExecutionsCard component and added executions helper mixin
MiloradFilipovic Oct 6, 2022
7a3a6dc
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 8, 2022
7f32971
✔️ Fixing leftover conflict
MiloradFilipovic Oct 8, 2022
179721d
✔️ One more conflict
MiloradFilipovic Oct 8, 2022
cd27392
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 10, 2022
c9d4e89
✨ Implemented retry execution menu and manual execution icon. Other m…
MiloradFilipovic Oct 10, 2022
0fa95f7
✨ Implemented executions filtering
MiloradFilipovic Oct 10, 2022
7ba377f
💄 Updating running executions details in preview
MiloradFilipovic Oct 10, 2022
de6f09d
⚡ Added info accordion to executions sidebar
MiloradFilipovic Oct 10, 2022
974fbc7
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 11, 2022
1bd88b9
✨ Implemented auto-refresh for executions sidebar
MiloradFilipovic Oct 11, 2022
6416a5a
💄 Adding running execution landing page, minor fixes
MiloradFilipovic Oct 11, 2022
2aef6b7
💄 General refactoring
MiloradFilipovic Oct 11, 2022
6dabdc3
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 11, 2022
34fcbc3
✔️ Adding leftover conflict changes
MiloradFilipovic Oct 11, 2022
6980511
✔️ Updating `InfoTip` component test snapshots
MiloradFilipovic Oct 11, 2022
e105bbb
✔️ Fixing linting error
MiloradFilipovic Oct 11, 2022
1ad67cc
✔️ Fixing lint errors in vuex store module
MiloradFilipovic Oct 11, 2022
7547f11
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 12, 2022
fc8c00e
👌 Started addressing review feedback
MiloradFilipovic Oct 12, 2022
8f4b306
⚡ Updating executions preview behaviour when filters are applied
MiloradFilipovic Oct 13, 2022
26a88cf
🐛 Fixing a bug where nodes and connections disappear if something is …
MiloradFilipovic Oct 13, 2022
bdef1d7
🐛 Fixing pasting in executions view and wrong workflow activator state
MiloradFilipovic Oct 13, 2022
f4333d5
⚡ Improved workflow switching and navigation, updated error message w…
MiloradFilipovic Oct 14, 2022
a1e76d6
⚡ Some more navigation updates
MiloradFilipovic Oct 14, 2022
9eeb7f2
💄 Fixing tab centering, execution filter button layout, added auto-re…
MiloradFilipovic Oct 14, 2022
f6ecb40
🐛 Fixing a bug when saving workflow using save button
MiloradFilipovic Oct 14, 2022
f0f3171
💄 Addressing design feedback, added delete execution button
MiloradFilipovic Oct 15, 2022
d980149
⚡ Moving main execution logic to the root executions view
MiloradFilipovic Oct 15, 2022
2b1aa9a
⚡ Implemented execution delete function
MiloradFilipovic Oct 15, 2022
892f3a6
⚡ Updating how switching tabs for new unsaved workflows work
MiloradFilipovic Oct 16, 2022
1fec270
⚡ Remembering active execution when switching tabs
MiloradFilipovic Oct 16, 2022
dab053e
💄 Addressing design feedback regarding info accordion
MiloradFilipovic Oct 16, 2022
d6eff29
💄 Updating execution card styling
MiloradFilipovic Oct 16, 2022
dbc2162
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 16, 2022
6c15615
⚡ Resetting executions when creating new workflow
MiloradFilipovic Oct 16, 2022
557a3ba
Fixing lint error
MiloradFilipovic Oct 16, 2022
ace9511
⚡ Hiding executions preview is active execution is not in the results…
MiloradFilipovic Oct 17, 2022
0026cf4
⚡ Fixing navigation to and from templates and executions
MiloradFilipovic Oct 17, 2022
95daf4d
⚡ Implemented execution lazy loading and added new background to exec…
MiloradFilipovic Oct 17, 2022
a7a1ee8
💄 Disabling import when on executions tab
MiloradFilipovic Oct 17, 2022
0125b7e
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 17, 2022
d5ba9ae
⚡ Handling opening executions from different workflow
MiloradFilipovic Oct 17, 2022
5c3fc27
⚡ Updating active execution on route change
MiloradFilipovic Oct 17, 2022
38ee173
⚡ Updating execution tab detection
MiloradFilipovic Oct 17, 2022
dd8be42
⚡ Simplifying and updating navigation. Adding new route for new workf…
MiloradFilipovic Oct 19, 2022
3106b59
⚡ Updating workflow saving logic to work with new routes
MiloradFilipovic Oct 19, 2022
6c9005d
🐛 Fixing a bug when returning to executions from different workflow
MiloradFilipovic Oct 19, 2022
f4bc3a0
💄 Updating executions info accordion and node details view modal in e…
MiloradFilipovic Oct 19, 2022
8e16680
💄 Updating workflow activated modal to point to new executions view
MiloradFilipovic Oct 19, 2022
8981872
⚡ Implemented opening new executions view from execution modal
MiloradFilipovic Oct 19, 2022
0f1b66d
⚡ Handling jsplumb init errors, updating unknown executions style
MiloradFilipovic Oct 19, 2022
ec0d654
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 19, 2022
bee40e2
⚡ Updating main sidebar after syncing branch
MiloradFilipovic Oct 19, 2022
54a8672
⚡ Opening new trigger menu from executions view
MiloradFilipovic Oct 19, 2022
ccbf121
💄 Updating sidebar resize behaviour
MiloradFilipovic Oct 19, 2022
d024f85
✔️ Fixing lint errors
MiloradFilipovic Oct 19, 2022
91f9a33
⚡ Loading executions when mounting executions view
MiloradFilipovic Oct 19, 2022
7462d18
⚡ Resetting execution data when creating a new workflow
MiloradFilipovic Oct 19, 2022
394bd8c
💄 Minor wording updates
MiloradFilipovic Oct 19, 2022
8fe9739
⚡ Not reloading node view when new workflows are saved
MiloradFilipovic Oct 20, 2022
7500c42
Removing leftover console log
MiloradFilipovic Oct 20, 2022
035b83f
🐛 Fixed a bug with save dialog not appearing when leaving executions tab
MiloradFilipovic Oct 20, 2022
4f3514c
⚡ Updating manual execution settings detection in info accordion
MiloradFilipovic Oct 20, 2022
6616da0
💄 Addressing UI issues found during bug bash
MiloradFilipovic Oct 20, 2022
59ff521
Fixing workflow saving logic
MiloradFilipovic Oct 20, 2022
8ef85d9
⚡ Preventing navigation if clicked tab is already opened
MiloradFilipovic Oct 21, 2022
1437dfe
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 21, 2022
95651c3
⚡ Updating lazy loading behaviour
MiloradFilipovic Oct 21, 2022
45687d0
⚡ Updating delete executions flow
MiloradFilipovic Oct 21, 2022
7193900
⚡ Added retry executions button to the execution preview
MiloradFilipovic Oct 21, 2022
6713a1f
⚡ Adding empty execution state, updating trigger detection logic, rem…
MiloradFilipovic Oct 21, 2022
5691f34
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 21, 2022
b8e1768
💄 Cosmetic code improvements
MiloradFilipovic Oct 21, 2022
4ade4fb
Trying the performance fix for nodeBase
MiloradFilipovic Oct 21, 2022
0696fe6
Removing the `NodeBase`fix
MiloradFilipovic Oct 21, 2022
3a7acb0
🐛 Fixing a bug when saving the current workflow
MiloradFilipovic Oct 21, 2022
40b9e9a
Merge branch 'master' into feature/workflows-executions-navigation-re…
MiloradFilipovic Oct 25, 2022
c6f9c55
👌 Addressing code review feedback
MiloradFilipovic Oct 25, 2022
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
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div :class="['action-dropdown-container', $style.actionDropdownContainer]">
<el-dropdown :placement="placement" :trigger="trigger" @command="onSelect">
<div :class="$style.activator">
<div :class="$style.activator" @click.prevent>
<n8n-icon :icon="activatorIcon"/>
</div>
<el-dropdown-menu slot="dropdown" :class="$style.userActionsMenu">
Expand All @@ -18,7 +18,7 @@
[item.customClass]: item.customClass !== undefined,
}">
<span v-if="item.icon" :class="$style.icon">
<n8n-icon :icon="item.icon"/>
<n8n-icon :icon="item.icon" :size="item.iconSize"/>
</span>
<span :class="$style.label">
{{ item.label }}
Expand Down Expand Up @@ -75,6 +75,12 @@ export default Vue.extend({
type: String,
default: 'ellipsis-v',
},
iconSize: {
type: String,
default: 'medium',
validator: (value: string): boolean =>
['small', 'medium', 'large'].includes(value),
},
trigger: {
type: String,
default: 'click',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
<template>
<div :class="['accordion', $style.container]" >
<div :class="{[$style.header]: true, [$style.expanded]: expanded}" @click="toggle">
<n8n-text color="text-base" size="small" align="left" bold>{{ title }}</n8n-text>

<n8n-icon
:icon="expanded? 'chevron-up' : 'chevron-down'"
bold
/>

<div :class="{[$style.header]: true, [$style.expanded]: expanded }" @click="toggle">
<n8n-icon v-if="headerIcon" :icon="headerIcon.icon" :color="headerIcon.color" size="small" class="mr-2xs"/>
<n8n-text :class="$style.headerText" color="text-base" size="small" align="left" bold>{{ title }}</n8n-text>
<n8n-icon :icon="expanded? 'chevron-up' : 'chevron-down'" bold />
</div>
<div v-if="expanded" :class="{[$style.description]: true, [$style.collapsed]: !expanded}" @click="onClick">
<!-- Info accordion can display list of items with icons or just a HTML description -->
<div v-if="items.length > 0" :class="$style.accordionItems">
<div v-for="item in items" :key="item.id" :class="$style.accordionItem">
<n8n-tooltip :disabled="!item.tooltip">
<div slot="content" v-html="item.tooltip" @click="onTooltipClick(item.id, $event)"></div>
<n8n-icon :icon="item.icon" :color="item.iconColor" size="small" class="mr-2xs"/>
</n8n-tooltip>
<n8n-text size="small" color="text-base">{{ item.label }}</n8n-text>
</div>
</div>
<n8n-text color="text-base" size="small" align="left">
<span v-html="description"></span>
</n8n-text>
</div>
</div>
</template>

<script>
<script lang="ts">
import N8nText from '../N8nText';
import N8nIcon from '../N8nIcon';
import Vue, { PropType } from 'vue';

import Vue from 'vue';
interface IAccordionItem {
id: string;
label: string;
icon: string;
}

export default Vue.extend({
name: 'n8n-info-accordion',
Expand All @@ -36,11 +47,26 @@ export default Vue.extend({
description: {
type: String,
},
items: {
type: Array as PropType<IAccordionItem[]>,
default() {
return [];
},
},
initiallyExpanded: {
type: Boolean,
default: false,
},
headerIcon: {
type: Object as () => { icon: string, color: string },
required: false,
},
},
mounted() {
this.$on('expand', () => {
this.expanded = true;
});
this.expanded = this.initiallyExpanded;
},
data() {
return {
Expand All @@ -54,6 +80,9 @@ export default Vue.extend({
onClick(e) {
this.$emit('click', e);
},
onTooltipClick(item: string, event: MouseEvent) {
this.$emit('tooltipClick', item, event);
},
},
});
</script>
Expand All @@ -67,8 +96,9 @@ export default Vue.extend({
cursor: pointer;
display: flex;
padding: var(--spacing-s);
align-items: center;

*:first-child {
.headerText {
flex-grow: 1;
}
}
Expand All @@ -77,6 +107,18 @@ export default Vue.extend({
padding: var(--spacing-s) var(--spacing-s) var(--spacing-2xs) var(--spacing-s);
}

.accordionItems {
display: flex;
flex-direction: column !important;
align-items: flex-start !important;
width: 100%;
}

.accordionItem {
display: block !important;
text-align: left;
}

.description {
display: flex;
padding: 0 var(--spacing-s) var(--spacing-s) var(--spacing-s);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Vitest Snapshot v1

exports[`N8nInfoTip > should render correctly as note 1`] = `"<div class=\\"n8n-info-tip _info_3egb8_33 _note_3egb8_16 _base_3egb8_1 _bold_3egb8_12\\"><span class=\\"_iconText_3egb8_28\\"><span class=\\"n8n-icon n8n-text _compact_odhsl_34 _size-medium_odhsl_19 _regular_odhsl_5\\"></span><span>Need help doing something?<a href=\\"/docs\\" target=\\"_blank\\">Open docs</a></span></span></div>"`;
exports[`N8nInfoTip > should render correctly as note 1`] = `"<div class=\\"n8n-info-tip _info_3egb8_33 _note_3egb8_16 _base_3egb8_1 _bold_3egb8_12\\"><span class=\\"_iconText_3egb8_28\\"><span class=\\"n8n-icon n8n-text _compact_e4k11_34 _size-medium_e4k11_19 _regular_e4k11_5\\"></span><span>Need help doing something?<a href=\\"/docs\\" target=\\"_blank\\">Open docs</a></span></span></div>"`;

exports[`N8nInfoTip > should render correctly as tooltip 1`] = `
"<div class=\\"n8n-info-tip _info_3egb8_33 _tooltip_3egb8_23 _base_3egb8_1 _bold_3egb8_12\\">
<n8n-tooltip-stub justifybuttons=\\"flex-end\\" buttons=\\"\\" placement=\\"top\\"><span class=\\"_iconText_3egb8_28\\"><span class=\\"n8n-icon n8n-text _compact_odhsl_34 _size-medium_odhsl_19 _regular_odhsl_5\\"></span></span><span>Need help doing something?<a href=\\"/docs\\" target=\\"_blank\\">Open docs</a></span></n8n-tooltip-stub>
<n8n-tooltip-stub justifybuttons=\\"flex-end\\" buttons=\\"\\" placement=\\"top\\"><span class=\\"_iconText_3egb8_28\\"><span class=\\"n8n-icon n8n-text _compact_e4k11_34 _size-medium_e4k11_19 _regular_e4k11_5\\"></span></span><span>Need help doing something?<a href=\\"/docs\\" target=\\"_blank\\">Open docs</a></span></n8n-tooltip-stub>
</div>"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default Vue.extend({
color: var(--color-text-base);
transition: background-color 0.2s ease;
cursor: pointer;
user-select: none;
}

.disabled {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
v-bind="option"
:active="value === option.value"
:size="size"
:disabled="disabled"
@click="(e) => onClick(option.value, e)"
:disabled="disabled || option.disabled"
@click="(e) => onClick(option, e)"
/>
</div>
</template>
Expand Down Expand Up @@ -36,11 +36,11 @@ export default Vue.extend({
RadioButton,
},
methods: {
onClick(value: unknown) {
if (this.disabled) {
onClick(option: {label: string, value: string, disabled?: boolean}) {
if (this.disabled || option.disabled) {
return;
}
this.$emit('input', value);
this.$emit('input', option.value);
},
},
});
Expand Down
6 changes: 5 additions & 1 deletion packages/design-system/src/components/N8nText/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default Vue.extend({
},
color: {
type: String,
validator: (value: string): boolean => ['primary', 'text-dark', 'text-base', 'text-light', 'text-xlight', 'danger', 'success'].includes(value),
validator: (value: string): boolean => ['primary', 'text-dark', 'text-base', 'text-light', 'text-xlight', 'danger', 'success', 'warning'].includes(value),
},
align: {
type: String,
Expand Down Expand Up @@ -126,6 +126,10 @@ export default Vue.extend({
color: var(--color-success);
}

.warning {
color: var(--color-warning);
}

.align-left {
text-align: left;
}
Expand Down
12 changes: 7 additions & 5 deletions packages/editor-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
[$style.sidebarCollapsed]: sidebarMenuCollapsed
}"
>
<div id="header" :class="$style['header']">
<div id="header" :class="$style.header">
<router-view name="header"></router-view>
</div>
<div id="sidebar" :class="$style['sidebar']">
<div id="sidebar" :class="$style.sidebar">
<router-view name="sidebar"></router-view>
</div>
<div id="content" :class="$style['content']">
<router-view />
<div id="content" :class="$style.content">
<keep-alive include="NodeView" :max="1">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed? could this have memory or perf implications?

Copy link
Contributor Author

@MiloradFilipovic MiloradFilipovic Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure it's not optimal but it's the only way to keep the main NodeView active, so it's not reloading every time we switch tabs. I guess this is the UX we are after in this feature.
include and max parameters will limit router view so it only caches one instance of NodeViewand not other components that render in that slot.

<router-view />
</keep-alive>
</div>
<Modals />
<Telemetry />
Expand All @@ -35,7 +37,7 @@ import { showMessage } from './components/mixins/showMessage';
import { IUser } from './Interface';
import { mapGetters } from 'vuex';
import { userHelpers } from './components/mixins/userHelpers';
import { addHeaders, loadLanguage } from './plugins/i18n';
import { loadLanguage } from './plugins/i18n';
import { restApi } from '@/components/mixins/restApi';
import { globalLinkActions } from '@/components/mixins/globalLinkActions';

Expand Down
16 changes: 15 additions & 1 deletion packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,9 @@ export interface IUiState {
isPageLoading: boolean;
currentView: string;
fakeDoorFeatures: IFakeDoor[];
nodeViewInitialized: boolean;
addFirstStepOnLoad: boolean;
executionSidebarAutoRefresh: boolean;
}

export type ILogLevel = 'info' | 'debug' | 'warn' | 'error' | 'verbose';
Expand Down Expand Up @@ -1088,7 +1091,12 @@ export interface IUsersState {
users: {[userId: string]: IUser};
}

export interface IWorkflowsMap {
export interface IWorkflowsState {
currentWorkflowExecutions: IExecutionsSummary[];
activeWorkflowExecution: IExecutionsSummary | null;
finishedExecutionsCount: number;
}
export interface IWorkflowsMap {
MiloradFilipovic marked this conversation as resolved.
Show resolved Hide resolved
[name: string]: IWorkflowDb;
}

Expand Down Expand Up @@ -1145,6 +1153,12 @@ export interface ITab {
tooltip?: string;
}

export interface ITabBarItem {
value: string;
label: string;
disabled?: boolean;
}

export interface IResourceLocatorReqParams {
nodeTypeAndVersion: INodeTypeNameVersion;
path: string;
Expand Down
8 changes: 8 additions & 0 deletions packages/editor-ui/src/api/workflows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IRestApiContext } from '@/Interface';
import { IDataObject } from 'n8n-workflow';
import { makeRestApiRequest } from './helpers';

export async function getNewWorkflow(context: IRestApiContext, name?: string) {
Expand All @@ -19,3 +20,10 @@ export async function getActiveWorkflows(context: IRestApiContext) {
return await makeRestApiRequest(context, 'GET', `/active`);
}

export async function getCurrentExecutions(context: IRestApiContext, filter: IDataObject) {
return await makeRestApiRequest(context, 'GET', '/executions-current', { filter });
}

export async function getFinishedExecutions(context: IRestApiContext, filter: IDataObject) {
return await makeRestApiRequest(context, 'GET', '/executions', { filter });
}
Loading