feat: Replace new Vue() with custom event bus (no-changelog) (#5780)

* refactor: replace new Vue() with custom event bus (no-changelog)

* fix: export types from design system main

* fix: update component types

* fix: update form inputs event bus
This commit is contained in:
Alex Grozav
2023-04-06 16:32:45 +03:00
committed by GitHub
parent 89c12fc1a7
commit 5651a52364
67 changed files with 347 additions and 210 deletions

View File

@@ -160,6 +160,7 @@ import { getWorkflowPermissions, IPermissions } from '@/permissions';
import { useUsersStore } from '@/stores/users';
import { useUsageStore } from '@/stores/usage';
import { BaseTextKey } from '@/plugins/i18n';
import { createEventBus } from '@/event-bus';
const hasChanged = (prev: string[], curr: string[]) => {
if (prev.length !== curr.length) {
@@ -187,7 +188,7 @@ export default mixins(workflowHelpers, titleChange).extend({
isTagsEditEnabled: false,
isNameEditEnabled: false,
appliedTagIds: [],
tagsEditBus: new Vue(),
tagsEditBus: createEventBus(),
MAX_WORKFLOW_NAME_LENGTH,
tagsSaving: false,
EnterpriseEditionFeature,
@@ -328,7 +329,7 @@ export default mixins(workflowHelpers, titleChange).extend({
setTimeout(() => {
// allow name update to occur before disabling name edit
this.$data.isNameEditEnabled = false;
this.$data.tagsEditBus.$emit('focus');
this.$data.tagsEditBus.emit('focus');
}, 0);
},
async onTagsUpdate(tags: string[]) {