mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(editor): Fix broken types for globally defined components (no-changelog) (#16505)
Co-authored-by: Mutasem Aldmour <mutasem@n8n.io>
This commit is contained in:
@@ -2,7 +2,13 @@
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import Modal from './Modal.vue';
|
||||
import type { IFormInputs, IInviteResponse, IUser, InvitableRoleName } from '@/Interface';
|
||||
import type {
|
||||
FormFieldValueUpdate,
|
||||
IFormInputs,
|
||||
IInviteResponse,
|
||||
IUser,
|
||||
InvitableRoleName,
|
||||
} from '@/Interface';
|
||||
import { EnterpriseEditionFeature, VALID_EMAIL_REGEX, INVITE_USER_MODAL_KEY } from '@/constants';
|
||||
import { ROLE } from '@n8n/api-types';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
@@ -127,11 +133,15 @@ const validateEmails = (value: string | number | boolean | null | undefined) =>
|
||||
return false;
|
||||
};
|
||||
|
||||
function onInput(e: { name: string; value: InvitableRoleName }) {
|
||||
if (e.name === 'emails') {
|
||||
function isInvitableRoleName(val: unknown): val is InvitableRoleName {
|
||||
return typeof val === 'string' && [ROLE.Member, ROLE.Admin].includes(val as InvitableRoleName);
|
||||
}
|
||||
|
||||
function onInput(e: FormFieldValueUpdate) {
|
||||
if (e.name === 'emails' && typeof e.value === 'string') {
|
||||
emails.value = e.value;
|
||||
}
|
||||
if (e.name === 'role') {
|
||||
if (e.name === 'role' && isInvitableRoleName(e.value)) {
|
||||
role.value = e.value;
|
||||
}
|
||||
}
|
||||
@@ -312,7 +322,7 @@ function getEmail(email: string): string {
|
||||
</n8n-users-list>
|
||||
</div>
|
||||
<n8n-form-inputs
|
||||
v-else
|
||||
v-else-if="config"
|
||||
:inputs="config"
|
||||
:event-bus="formBus"
|
||||
:column-view="true"
|
||||
|
||||
Reference in New Issue
Block a user