mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
refactor(editor): Use form event bus everywhere (no-changelog) (#10394)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
This commit is contained in:
parent
bae0116d78
commit
e4c88e75f9
|
@ -34,12 +34,12 @@ import { useToast } from '@/composables/useToast';
|
||||||
import { CHANGE_PASSWORD_MODAL_KEY } from '../constants';
|
import { CHANGE_PASSWORD_MODAL_KEY } from '../constants';
|
||||||
import Modal from '@/components/Modal.vue';
|
import Modal from '@/components/Modal.vue';
|
||||||
import { useUsersStore } from '@/stores/users.store';
|
import { useUsersStore } from '@/stores/users.store';
|
||||||
import { createEventBus } from 'n8n-design-system/utils';
|
import { createFormEventBus, createEventBus } from 'n8n-design-system/utils';
|
||||||
import type { IFormInputs, IFormInput } from '@/Interface';
|
import type { IFormInputs, IFormInput } from '@/Interface';
|
||||||
import { useI18n } from '@/composables/useI18n';
|
import { useI18n } from '@/composables/useI18n';
|
||||||
|
|
||||||
const config = ref<IFormInputs | null>(null);
|
const config = ref<IFormInputs | null>(null);
|
||||||
const formBus = createEventBus();
|
const formBus = createFormEventBus();
|
||||||
const modalBus = createEventBus();
|
const modalBus = createEventBus();
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
|
@ -75,7 +75,7 @@ import {
|
||||||
import { useUsersStore } from '@/stores/users.store';
|
import { useUsersStore } from '@/stores/users.store';
|
||||||
import { useSettingsStore } from '@/stores/settings.store';
|
import { useSettingsStore } from '@/stores/settings.store';
|
||||||
import { useUIStore } from '@/stores/ui.store';
|
import { useUIStore } from '@/stores/ui.store';
|
||||||
import { createEventBus } from 'n8n-design-system/utils';
|
import { createFormEventBus, createEventBus } from 'n8n-design-system/utils';
|
||||||
import { useClipboard } from '@/composables/useClipboard';
|
import { useClipboard } from '@/composables/useClipboard';
|
||||||
|
|
||||||
const NAME_EMAIL_FORMAT_REGEX = /^.* <(.*)>$/;
|
const NAME_EMAIL_FORMAT_REGEX = /^.* <(.*)>$/;
|
||||||
|
@ -110,7 +110,7 @@ export default defineComponent({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config: null as IFormInputs | null,
|
config: null as IFormInputs | null,
|
||||||
formBus: createEventBus(),
|
formBus: createFormEventBus(),
|
||||||
modalBus: createEventBus(),
|
modalBus: createEventBus(),
|
||||||
emails: '',
|
emails: '',
|
||||||
role: ROLE.Member as InvitableRoleName,
|
role: ROLE.Member as InvitableRoleName,
|
||||||
|
|
|
@ -144,7 +144,7 @@ import { useUIStore } from '@/stores/ui.store';
|
||||||
import { useSettingsStore } from '@/stores/settings.store';
|
import { useSettingsStore } from '@/stores/settings.store';
|
||||||
import { useRootStore } from '@/stores/root.store';
|
import { useRootStore } from '@/stores/root.store';
|
||||||
import { useUsersStore } from '@/stores/users.store';
|
import { useUsersStore } from '@/stores/users.store';
|
||||||
import { createEventBus } from 'n8n-design-system/utils';
|
import { createEventBus, createFormEventBus } from 'n8n-design-system/utils';
|
||||||
import { usePostHog } from '@/stores/posthog.store';
|
import { usePostHog } from '@/stores/posthog.store';
|
||||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||||
import { useUsageStore } from '@/stores/usage.store';
|
import { useUsageStore } from '@/stores/usage.store';
|
||||||
|
@ -180,7 +180,7 @@ export default defineComponent({
|
||||||
showAllIndustryQuestions: true,
|
showAllIndustryQuestions: true,
|
||||||
registerForEnterpriseTrial: false,
|
registerForEnterpriseTrial: false,
|
||||||
modalBus: createEventBus(),
|
modalBus: createEventBus(),
|
||||||
formBus: createEventBus(),
|
formBus: createFormEventBus(),
|
||||||
domainBlocklist: [] as string[],
|
domainBlocklist: [] as string[],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -45,7 +45,7 @@ import { createFormEventBus } from 'n8n-design-system';
|
||||||
|
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
|
|
||||||
const formBus = ref(createFormEventBus());
|
const formBus = createFormEventBus();
|
||||||
const readyToSubmit = ref(false);
|
const readyToSubmit = ref(false);
|
||||||
|
|
||||||
const formFields: IFormInputs = [
|
const formFields: IFormInputs = [
|
||||||
|
@ -69,7 +69,7 @@ function onSubmit(values: { mfaCode: string }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickSave() {
|
function onClickSave() {
|
||||||
formBus.value.emit('submit');
|
formBus.emit('submit');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFormReady(isReady: boolean) {
|
function onFormReady(isReady: boolean) {
|
||||||
|
|
|
@ -157,7 +157,7 @@ import { mapStores } from 'pinia';
|
||||||
import { useUsersStore } from '@/stores/users.store';
|
import { useUsersStore } from '@/stores/users.store';
|
||||||
import { useSettingsStore } from '@/stores/settings.store';
|
import { useSettingsStore } from '@/stores/settings.store';
|
||||||
import { useUIStore } from '@/stores/ui.store';
|
import { useUIStore } from '@/stores/ui.store';
|
||||||
import { createEventBus } from 'n8n-design-system/utils';
|
import { createFormEventBus } from 'n8n-design-system/utils';
|
||||||
import type { TableColumnCtx } from 'element-plus';
|
import type { TableColumnCtx } from 'element-plus';
|
||||||
|
|
||||||
type TableRow = {
|
type TableRow = {
|
||||||
|
@ -222,7 +222,7 @@ export default defineComponent({
|
||||||
loadingTable: false,
|
loadingTable: false,
|
||||||
hasAnyChanges: false,
|
hasAnyChanges: false,
|
||||||
formInputs: null as null | IFormInputs,
|
formInputs: null as null | IFormInputs,
|
||||||
formBus: createEventBus(),
|
formBus: createFormEventBus(),
|
||||||
readyToSubmit: false,
|
readyToSubmit: false,
|
||||||
page: 0,
|
page: 0,
|
||||||
loginEnabled: false,
|
loginEnabled: false,
|
||||||
|
|
|
@ -21,7 +21,7 @@ const { showToast, showError } = useToast();
|
||||||
|
|
||||||
const hasAnyBasicInfoChanges = ref<boolean>(false);
|
const hasAnyBasicInfoChanges = ref<boolean>(false);
|
||||||
const formInputs = ref<null | IFormInputs>(null);
|
const formInputs = ref<null | IFormInputs>(null);
|
||||||
const formBus = ref(createFormEventBus());
|
const formBus = createFormEventBus();
|
||||||
const readyToSubmit = ref(false);
|
const readyToSubmit = ref(false);
|
||||||
const currentSelectedTheme = ref(useUIStore().theme);
|
const currentSelectedTheme = ref(useUIStore().theme);
|
||||||
const themeOptions = ref<Array<{ name: ThemeOption; label: string }>>([
|
const themeOptions = ref<Array<{ name: ThemeOption; label: string }>>([
|
||||||
|
@ -151,7 +151,7 @@ async function updatePersonalisationSettings() {
|
||||||
uiStore.setTheme(currentSelectedTheme.value);
|
uiStore.setTheme(currentSelectedTheme.value);
|
||||||
}
|
}
|
||||||
function onSaveClick() {
|
function onSaveClick() {
|
||||||
formBus.value.emit('submit');
|
formBus.emit('submit');
|
||||||
}
|
}
|
||||||
function openPasswordModal() {
|
function openPasswordModal() {
|
||||||
uiStore.openModal(CHANGE_PASSWORD_MODAL_KEY);
|
uiStore.openModal(CHANGE_PASSWORD_MODAL_KEY);
|
||||||
|
|
Loading…
Reference in a new issue