feat(editor): Workflow history [WIP]- Add workflow history opening button to main header component (no-changelog) (#7310)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
Csaba Tuncsik
2023-10-04 16:45:18 +02:00
committed by GitHub
parent b59b9086d7
commit 4bc9164032
15 changed files with 334 additions and 113 deletions

View File

@@ -101,6 +101,13 @@
data-test-id="workflow-save-button"
@click="onSaveButtonClick"
/>
<router-link
v-if="isWorkflowHistoryFeatureEnabled"
:to="workflowHistoryRoute"
:class="$style.workflowHistoryButton"
>
<n8n-icon icon="history" size="medium" />
</router-link>
<div :class="$style.workflowMenuContainer">
<input
:class="$style.hiddenInput"
@@ -335,6 +342,19 @@ export default defineComponent({
return actions;
},
isWorkflowHistoryFeatureEnabled(): boolean {
return this.settingsStore.isEnterpriseFeatureEnabled(
EnterpriseEditionFeature.WorkflowHistory,
);
},
workflowHistoryRoute(): { name: string; params: { workflowId: string } } {
return {
name: VIEWS.WORKFLOW_HISTORY,
params: {
workflowId: this.currentWorkflowId,
},
};
},
},
methods: {
async onSaveButtonClick() {
@@ -389,7 +409,7 @@ export default defineComponent({
const saved = await this.saveCurrentWorkflow({ tags });
this.$telemetry.track('User edited workflow tags', {
workflow_id: this.currentWorkflowId as string,
workflow_id: this.currentWorkflowId,
new_tag_count: tags.length,
});
@@ -690,4 +710,9 @@ $--header-spacing: 20px;
.disabledShareButton {
cursor: not-allowed;
}
.workflowHistoryButton {
margin-left: var(--spacing-l);
color: var(--color-text-dark);
}
</style>