feat(editor): create new workflows page (#4267)

* feat(editor): extract credentials view into reusable layout components for workflows view

* feat(editor): add workflow card and start work on empty state

* feat: add hoverable card and finish workflows empty state

* fix: undo workflows response interface changes

* chore: fix linting issues.

* fix: remove enterprise sharing env schema

* fix(editor): fix workflows resource view when sharing is enabled

* fix: change owner tag design and order

* feat: add personalization survey on workflows page

* fix: update component snapshots

* feat: refactored workflow card to use workflow-activator properly

* fix: fix workflow activator and proptypes

* fix: hide owner tag for workflow card until sharing is available

* fix: fixed ownedBy and sharedWith appearing for workflows list

* feat: update tags component design

* refactor: change resource filter select to n8n-user-select

* fix: made telemetry messages reusable

* chore: remove unused import

* refactor: fix component name casing

* refactor: use Vue.set to make workflow property reactive

* feat: add support for clicking on tags for filtering

* chore: fix tags linting issues

* fix: fix resources list layout when title words are very long

* refactor: add active and inactive status text to workflow activator

* fix: fix credentials and workflows sorting when name contains leading whitespace

* fix: remove wrongfully added style tag

* feat: add translations and storybook examples for truncated tags

* fix: remove enterprise sharing env from schema

* refactor: fix workflows module and workflows field store naming conflict

* fix: fix workflow activator wrapping

* feat: updated empty workflows list cards design

* feat: update workflow activator margins and workflow card

* feat: add duplicate workflow functionality and update tags

* feat: fix duplicate workflow flow

* fix: fix status color for workflow activator with could not be started status

* fix: remove createdAt and updatedAt from workflow duplication
This commit is contained in:
Alex Grozav
2022-10-18 16:28:21 +03:00
committed by GitHub
parent bb4e08c076
commit be7aac3279
44 changed files with 1612 additions and 970 deletions

View File

@@ -47,15 +47,15 @@ import { showMessage } from "@/components/mixins/showMessage";
import TagsDropdown from "@/components/TagsDropdown.vue";
import Modal from "./Modal.vue";
import { mapGetters } from "vuex";
import {restApi} from "@/components/mixins/restApi";
import {IWorkflowDb} from "@/Interface";
export default mixins(showMessage, workflowHelpers).extend({
export default mixins(showMessage, workflowHelpers, restApi).extend({
components: { TagsDropdown, Modal },
name: "DuplicateWorkflow",
props: ["modalName", "isActive"],
props: ["modalName", "isActive", "data"],
data() {
const currentTagIds = this.$store.getters[
"workflowTags"
] as string[];
const currentTagIds = this.data.tags;
return {
name: '',
@@ -68,7 +68,7 @@ export default mixins(showMessage, workflowHelpers).extend({
};
},
async mounted() {
this.$data.name = await this.$store.dispatch('workflows/getDuplicateCurrentWorkflowName');
this.name = await this.$store.dispatch('workflows/getDuplicateCurrentWorkflowName', this.data.name);
this.$nextTick(() => this.focusOnNameInput());
},
computed: {
@@ -113,21 +113,29 @@ export default mixins(showMessage, workflowHelpers).extend({
return;
}
const currentWorkflowId = this.$store.getters.workflowId;
const currentWorkflowId = this.data.id;
this.$data.isSaving = true;
this.isSaving = true;
const saved = await this.saveAsNewWorkflow({name, tags: this.currentTagIds, resetWebhookUrls: true, openInNewWindow: true, resetNodeIds: true});
const { createdAt, updatedAt, ...workflow } = await this.restApi().getWorkflow(this.data.id);
const saved = await this.saveAsNewWorkflow({
name,
data: workflow,
tags: this.currentTagIds,
resetWebhookUrls: true,
openInNewWindow: true,
resetNodeIds: true,
});
if (saved) {
this.closeDialog();
this.$telemetry.track('User duplicated workflow', {
old_workflow_id: currentWorkflowId,
workflow_id: this.$store.getters.workflowId,
workflow_id: this.data.id,
});
}
this.$data.isSaving = false;
this.isSaving = false;
},
closeDialog(): void {
this.modalBus.$emit("close");