Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(editor): Use form event bus everywhere (no-changelog) #10394

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/ChangePasswordModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import { useToast } from '@/composables/useToast';
import { CHANGE_PASSWORD_MODAL_KEY } from '../constants';
import Modal from '@/components/Modal.vue';
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 { useI18n } from '@/composables/useI18n';

const config = ref<IFormInputs | null>(null);
const formBus = createEventBus();
const formBus = createFormEventBus();
const modalBus = createEventBus();
const password = ref('');
const loading = ref(false);
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/InviteUsersModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import {
import { useUsersStore } from '@/stores/users.store';
import { useSettingsStore } from '@/stores/settings.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';

const NAME_EMAIL_FORMAT_REGEX = /^.* <(.*)>$/;
Expand Down Expand Up @@ -110,7 +110,7 @@ export default defineComponent({
data() {
return {
config: null as IFormInputs | null,
formBus: createEventBus(),
formBus: createFormEventBus(),
modalBus: createEventBus(),
emails: '',
role: ROLE.Member as InvitableRoleName,
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/PersonalizationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ import { useUIStore } from '@/stores/ui.store';
import { useSettingsStore } from '@/stores/settings.store';
import { useRootStore } from '@/stores/root.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 { useExternalHooks } from '@/composables/useExternalHooks';
import { useUsageStore } from '@/stores/usage.store';
Expand Down Expand Up @@ -180,7 +180,7 @@ export default defineComponent({
showAllIndustryQuestions: true,
registerForEnterpriseTrial: false,
modalBus: createEventBus(),
formBus: createEventBus(),
formBus: createFormEventBus(),
domainBlocklist: [] as string[],
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { createFormEventBus } from 'n8n-design-system';

const i18n = useI18n();

const formBus = ref(createFormEventBus());
const formBus = createFormEventBus();
const readyToSubmit = ref(false);

const formFields: IFormInputs = [
Expand All @@ -69,7 +69,7 @@ function onSubmit(values: { mfaCode: string }) {
}

function onClickSave() {
formBus.value.emit('submit');
formBus.emit('submit');
}

function onFormReady(isReady: boolean) {
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/views/SettingsLdapView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ import { mapStores } from 'pinia';
import { useUsersStore } from '@/stores/users.store';
import { useSettingsStore } from '@/stores/settings.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';

type TableRow = {
Expand Down Expand Up @@ -222,7 +222,7 @@ export default defineComponent({
loadingTable: false,
hasAnyChanges: false,
formInputs: null as null | IFormInputs,
formBus: createEventBus(),
formBus: createFormEventBus(),
readyToSubmit: false,
page: 0,
loginEnabled: false,
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/views/SettingsPersonalView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { showToast, showError } = useToast();

const hasAnyBasicInfoChanges = ref<boolean>(false);
const formInputs = ref<null | IFormInputs>(null);
const formBus = ref(createFormEventBus());
const formBus = createFormEventBus();
const readyToSubmit = ref(false);
const currentSelectedTheme = ref(useUIStore().theme);
const themeOptions = ref<Array<{ name: ThemeOption; label: string }>>([
Expand Down Expand Up @@ -151,7 +151,7 @@ async function updatePersonalisationSettings() {
uiStore.setTheme(currentSelectedTheme.value);
}
function onSaveClick() {
formBus.value.emit('submit');
formBus.emit('submit');
}
function openPasswordModal() {
uiStore.openModal(CHANGE_PASSWORD_MODAL_KEY);
Expand Down
Loading