2021-05-29 11:31:21 -07:00
|
|
|
<template>
|
|
|
|
<div>
|
2022-12-14 01:04:10 -08:00
|
|
|
<div :class="{ 'main-header': true, expanded: !this.uiStore.sidebarMenuCollapsed }">
|
2022-07-04 12:48:32 -07:00
|
|
|
<div v-show="!hideMenuBar" class="top-menu">
|
2023-01-16 01:11:15 -08:00
|
|
|
<WorkflowDetails />
|
2022-12-14 01:04:10 -08:00
|
|
|
<tab-bar
|
2023-01-16 01:11:15 -08:00
|
|
|
v-if="onWorkflowPage"
|
2022-12-14 01:04:10 -08:00
|
|
|
:items="tabBarItems"
|
|
|
|
:activeTab="activeHeaderTab"
|
|
|
|
@select="onTabSelected"
|
|
|
|
/>
|
2021-05-29 11:31:21 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import mixins from 'vue-typed-mixins';
|
2022-11-23 04:41:53 -08:00
|
|
|
import { pushConnection } from '@/mixins/pushConnection';
|
2021-05-29 11:31:21 -07:00
|
|
|
import WorkflowDetails from '@/components/MainHeader/WorkflowDetails.vue';
|
2022-10-26 01:02:56 -07:00
|
|
|
import TabBar from '@/components/MainHeader/TabBar.vue';
|
2022-12-14 01:04:10 -08:00
|
|
|
import {
|
|
|
|
MAIN_HEADER_TABS,
|
|
|
|
PLACEHOLDER_EMPTY_WORKFLOW_ID,
|
|
|
|
STICKY_NODE_TYPE,
|
|
|
|
VIEWS,
|
|
|
|
} from '@/constants';
|
2022-10-26 01:02:56 -07:00
|
|
|
import { IExecutionsSummary, INodeUi, ITabBarItem } from '@/Interface';
|
2022-11-23 04:41:53 -08:00
|
|
|
import { workflowHelpers } from '@/mixins/workflowHelpers';
|
2022-10-26 01:02:56 -07:00
|
|
|
import { Route } from 'vue-router';
|
2022-11-04 06:04:31 -07:00
|
|
|
import { mapStores } from 'pinia';
|
|
|
|
import { useUIStore } from '@/stores/ui';
|
|
|
|
import { useNDVStore } from '@/stores/ndv';
|
2021-05-29 11:31:21 -07:00
|
|
|
|
2022-12-14 01:04:10 -08:00
|
|
|
export default mixins(pushConnection, workflowHelpers).extend({
|
|
|
|
name: 'MainHeader',
|
|
|
|
components: {
|
|
|
|
WorkflowDetails,
|
|
|
|
TabBar,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
activeHeaderTab: MAIN_HEADER_TABS.WORKFLOW,
|
|
|
|
workflowToReturnTo: '',
|
|
|
|
dirtyState: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapStores(useNDVStore, useUIStore),
|
|
|
|
tabBarItems(): ITabBarItem[] {
|
|
|
|
return [
|
2023-01-11 06:08:00 -08:00
|
|
|
{ value: MAIN_HEADER_TABS.WORKFLOW, label: this.$locale.baseText('generic.editor') },
|
2022-12-14 01:04:10 -08:00
|
|
|
{ value: MAIN_HEADER_TABS.EXECUTIONS, label: this.$locale.baseText('generic.executions') },
|
|
|
|
];
|
2022-10-26 01:02:56 -07:00
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
activeNode(): INodeUi | null {
|
|
|
|
return this.ndvStore.activeNode;
|
2021-05-29 11:31:21 -07:00
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
hideMenuBar(): boolean {
|
|
|
|
return Boolean(this.activeNode && this.activeNode.type !== STICKY_NODE_TYPE);
|
2021-05-29 11:31:21 -07:00
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
workflowName(): string {
|
|
|
|
return this.workflowsStore.workflowName;
|
2021-05-29 11:31:21 -07:00
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
currentWorkflow(): string {
|
|
|
|
return this.$route.params.name || this.workflowsStore.workflowId;
|
2022-10-26 01:02:56 -07:00
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
onWorkflowPage(): boolean {
|
|
|
|
return (
|
|
|
|
this.$route.meta &&
|
|
|
|
(this.$route.meta.nodeView || this.$route.meta.keepWorkflowAlive === true)
|
|
|
|
);
|
|
|
|
},
|
|
|
|
activeExecution(): IExecutionsSummary {
|
|
|
|
return this.workflowsStore.activeWorkflowExecution as IExecutionsSummary;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.dirtyState = this.uiStore.stateIsDirty;
|
|
|
|
this.syncTabsWithRoute(this.$route);
|
|
|
|
// Initialize the push connection
|
|
|
|
this.pushConnect();
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
this.pushDisconnect();
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route(to, from) {
|
|
|
|
this.syncTabsWithRoute(to);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
syncTabsWithRoute(route: Route): void {
|
|
|
|
if (
|
|
|
|
route.name === VIEWS.EXECUTION_HOME ||
|
2023-01-10 07:28:15 -08:00
|
|
|
route.name === VIEWS.WORKFLOW_EXECUTIONS ||
|
2022-12-14 01:04:10 -08:00
|
|
|
route.name === VIEWS.EXECUTION_PREVIEW
|
|
|
|
) {
|
|
|
|
this.activeHeaderTab = MAIN_HEADER_TABS.EXECUTIONS;
|
|
|
|
} else if (route.name === VIEWS.WORKFLOW || route.name === VIEWS.NEW_WORKFLOW) {
|
|
|
|
this.activeHeaderTab = MAIN_HEADER_TABS.WORKFLOW;
|
|
|
|
}
|
|
|
|
const workflowName = route.params.name;
|
|
|
|
if (workflowName !== 'new') {
|
|
|
|
this.workflowToReturnTo = workflowName;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onTabSelected(tab: string, event: MouseEvent) {
|
|
|
|
switch (tab) {
|
|
|
|
case MAIN_HEADER_TABS.WORKFLOW:
|
|
|
|
if (!['', 'new', PLACEHOLDER_EMPTY_WORKFLOW_ID].includes(this.workflowToReturnTo)) {
|
|
|
|
if (this.$route.name !== VIEWS.WORKFLOW) {
|
|
|
|
this.$router.push({
|
2022-10-26 01:02:56 -07:00
|
|
|
name: VIEWS.WORKFLOW,
|
|
|
|
params: { name: this.workflowToReturnTo },
|
|
|
|
});
|
|
|
|
}
|
2022-12-14 01:04:10 -08:00
|
|
|
} else {
|
|
|
|
if (this.$route.name !== VIEWS.NEW_WORKFLOW) {
|
|
|
|
this.$router.push({ name: VIEWS.NEW_WORKFLOW });
|
|
|
|
this.uiStore.stateIsDirty = this.dirtyState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.activeHeaderTab = MAIN_HEADER_TABS.WORKFLOW;
|
|
|
|
break;
|
|
|
|
case MAIN_HEADER_TABS.EXECUTIONS:
|
|
|
|
this.dirtyState = this.uiStore.stateIsDirty;
|
|
|
|
this.workflowToReturnTo = this.currentWorkflow;
|
|
|
|
const routeWorkflowId =
|
|
|
|
this.currentWorkflow === PLACEHOLDER_EMPTY_WORKFLOW_ID ? 'new' : this.currentWorkflow;
|
|
|
|
if (this.activeExecution) {
|
|
|
|
this.$router
|
|
|
|
.push({
|
2022-10-26 01:02:56 -07:00
|
|
|
name: VIEWS.EXECUTION_PREVIEW,
|
|
|
|
params: { name: routeWorkflowId, executionId: this.activeExecution.id },
|
2022-12-14 01:04:10 -08:00
|
|
|
})
|
|
|
|
.catch(() => {});
|
|
|
|
} else {
|
|
|
|
this.$router.push({ name: VIEWS.EXECUTION_HOME, params: { name: routeWorkflowId } });
|
|
|
|
}
|
|
|
|
// this.modalBus.$emit('closeAll');
|
|
|
|
this.activeHeaderTab = MAIN_HEADER_TABS.EXECUTIONS;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2022-10-26 01:02:56 -07:00
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
|
|
|
});
|
2021-05-29 11:31:21 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.main-header {
|
2022-07-26 03:45:55 -07:00
|
|
|
background-color: var(--color-background-xlight);
|
feat(editor, core, cli): implement new workflow experience (#4358)
* feat(ExecuteWorkflowTrigger node): Implement ExecuteWorkflowTrigger node (#4108)
* feat(ExecuteWorkflowTrigger node): Implement ExecuteWorkflowTrigger node
* feat(editor): Do not show duplicate button if canvas contains `maxNodes` amount of nodes
* feat(ManualTrigger node): Implement ManualTrigger node (#4110)
* feat(ManualTrigger node): Implement ManualTrigger node
* :memo: Remove generics doc items from ManualTrigger node
* feat(editor-ui): Trigger tab redesign (#4150)
* :construction: Begin with TriggerPanel implementation, add Other Trigger Nodes subcategory
* :construction: Extracted categorized categories/subcategory/nodes rendering into its own component — CategorizedItems, removed SubcategoryPanel, added translations
* :sparkles: Implement MainPanel background scrim
* :recycle: Move `categoriesWithNodes`, 'visibleNodeTypes` and 'categorizedItems` to store, implemented dynamic categories count based on `selectedType`
* :bug: Fix SlideTransition for all the NodeCreato panels
* :lipstick: Fix cursos for CategoryItem and NodeItem
* :bug: Make sure ALL_NODE_FILTER is always set when MainPanel is mounted
* :art: Address PR comments
* label: Use Array type for CategorizedItems props
* :label: Add proper types for Vue props
* 🎨 Use standard component registration for CategorizedItems inside TriggerHelperPanel
* 🎨 Use kebab case for main-panel and icon component
* :label: Improve types
* feat(editor-ui): Redesign search input inside node creator panel (#4204)
* :construction: Begin with TriggerPanel implementation, add Other Trigger Nodes subcategory
* :construction: Extracted categorized categories/subcategory/nodes rendering into its own component — CategorizedItems, removed SubcategoryPanel, added translations
* :sparkles: Implement MainPanel background scrim
* :recycle: Move `categoriesWithNodes`, 'visibleNodeTypes` and 'categorizedItems` to store, implemented dynamic categories count based on `selectedType`
* :bug: Fix SlideTransition for all the NodeCreato panels
* :lipstick: Fix cursos for CategoryItem and NodeItem
* :bug: Make sure ALL_NODE_FILTER is always set when MainPanel is mounted
* :art: Address PR comments
* label: Use Array type for CategorizedItems props
* :label: Add proper types for Vue props
* 🎨 Use standard component registration for CategorizedItems inside TriggerHelperPanel
* :sparkles: Redesign search input and unify usage of categorized items
* :label: Use lowercase "Boolean" as `isSearchVisible` computed return type
* :fire: Remove useless emit
* :sparkles: Implement no result view based on subcategory, minor fixes
* :art: Remove unused properties
* feat(node-email): Change EmailReadImap display name and name (#4239)
* feat(editor-ui): Implement "Choose a Triger" action and related behaviour (#4226)
* :sparkles: Implement "Choose a Triger" action and related behaviour
* :mute: Lint fix
* :recycle: Remove PlaceholderTrigger node, add a button instead
* :art: Merge onMouseEnter and onMouseLeave to a single function
* :bulb: Add comment
* :fire: Remove PlaceholderNode registration
* :art: Rename TriggerPlaceholderButton to CanvasAddButton
* :sparkles: Add method to unregister custom action and rework CanvasAddButton centering logic
* :art: Run `setRecenteredCanvasAddButtonPosition` on `CanvasAddButton` mount
* fix(editor): Fix selecting of node from node-creator panel by clicking
* :twisted_rightwards_arrows: Merge fixes
* fix(editor): Show execute workflow trigger instead of workflow trigger in the trigger helper panel
* feat(editor): Fix node creator panel slide transition (#4261)
* fix(editor): Fix node creator panel slide-in/slide-out transitions
* :art: Fix naming
* :art: Use kebab-case for transition component name
* feat(editor): Disable execution and show notice when user tries to run workflow without enabled triggers
* fix(editor): Address first batch of new WF experience review (#4279)
* fix(editor): Fix first batch of review items
* bug(editor): Fix nodeview canvas add button centering
* :mute: Fix linter errors
* bug(ManualTrigger Node): Fix manual trigger node execution
* fix(editor): Do not show canvas add button in execution or demo mode and prevent clicking if creator is open
* fix(editor): do not show pin data tooltip for manual trigger node
* fix(editor): do not use nodeViewOffset on zoomToFit
* :lipstick: Add margin for last node creator item and set font-weight to 700 for category title
* :sparkles: Position welcome note next to the added trigger node
* :bug: Remve always true welcome note
* feat(editor): Minor UI and UX tweaks (#4328)
* :lipstick: Make top viewport buttons less prominent
* :sparkles: Allow user to switch to all tabs if it contains filter results, move nodecreator state props to its own module
* :mute: Fix linting errors
* :mute: Fix linting errors
* :mute: Fix linting errors
* chore(build): Ping Turbo version to 1.5.5
* :lipstick: Minor traigger panel and node view style changes
* :speech_balloon: Update display name of execute workflow trigger
* feat(core, editor): Update subworkflow execution logic (#4269)
* :sparkles: Implement `findWorkflowStart`
* :zap: Extend `WorkflowOperationError`
* :zap: Add `WorkflowOperationError` to toast
* :blue_book: Extend interface
* :sparkles: Add `subworkflowExecutionError` to store
* :sparkles: Create `SubworkflowOperationError`
* :zap: Render subworkflow error as node error
* :truck: Move subworkflow start validation to `cli`
* :zap: Reset subworkflow execution error state
* :fire: Remove unused import
* :zap: Adjust CLI commands
* :fire: Remove unneeded check
* :fire: Remove stray log
* :zap: Simplify syntax
* :zap: Sort in case both Start and EWT present
* :recycle: Address Omar's feedback
* :fire: Remove unneeded lint exception
* :pencil2: Fix copy
* :shirt: Fix lint
* fix: moved find start node function to catchable place
Co-authored-by: Omar Ajoue <krynble@gmail.com>
* :lipstick: Change ExecuteWorkflow node to primary
* :sparkles: Allow user to navigate to all tab if it contains search results
* :bug: Fixed canvas control button while in demo, disable workflow activation for non-activavle nodes and revert zoomToFit bottom offset
* :fix: Do not chow request text if there's results
* :speech_balloon: Update noResults text
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
2022-10-18 05:23:22 -07:00
|
|
|
height: $header-height;
|
2021-05-29 11:31:21 -07:00
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
2022-09-26 06:25:19 -07:00
|
|
|
border-bottom: var(--border-width-base) var(--border-style-base) var(--color-foreground-base);
|
2021-05-29 11:31:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.top-menu {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 0.9em;
|
2022-09-23 07:14:28 -07:00
|
|
|
height: $header-height;
|
2021-05-29 11:31:21 -07:00
|
|
|
font-weight: 400;
|
2022-10-26 01:02:56 -07:00
|
|
|
padding: 0 var(--spacing-m) 0 var(--spacing-xs);
|
2021-05-29 11:31:21 -07:00
|
|
|
}
|
2021-08-21 05:11:32 -07:00
|
|
|
</style>
|