mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
feat(editor): Migrate copyPaste mixin to composables (no-changelog) (#8179)
This commit is contained in:
@@ -64,7 +64,6 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import { copyPaste } from '@/mixins/copyPaste';
|
||||
import Modal from './Modal.vue';
|
||||
import type { IFormInputs, IInviteResponse, IUser } from '@/Interface';
|
||||
import { ROLE } from '@/utils/userUtils';
|
||||
@@ -73,6 +72,7 @@ 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 { useClipboard } from '@/composables/useClipboard';
|
||||
|
||||
const NAME_EMAIL_FORMAT_REGEX = /^.* <(.*)>$/;
|
||||
|
||||
@@ -90,14 +90,16 @@ function getEmail(email: string): string {
|
||||
export default defineComponent({
|
||||
name: 'InviteUsersModal',
|
||||
components: { Modal },
|
||||
mixins: [copyPaste],
|
||||
props: {
|
||||
modalName: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
const clipboard = useClipboard();
|
||||
|
||||
return {
|
||||
clipboard,
|
||||
...useToast(),
|
||||
};
|
||||
},
|
||||
@@ -258,7 +260,7 @@ export default defineComponent({
|
||||
|
||||
if (successfulUrlInvites.length) {
|
||||
if (successfulUrlInvites.length === 1) {
|
||||
this.copyToClipboard(successfulUrlInvites[0].user.inviteAcceptUrl);
|
||||
void this.clipboard.copy(successfulUrlInvites[0].user.inviteAcceptUrl);
|
||||
}
|
||||
|
||||
this.showMessage({
|
||||
@@ -328,7 +330,7 @@ export default defineComponent({
|
||||
},
|
||||
onCopyInviteLink(user: IUser) {
|
||||
if (user.inviteAcceptUrl && this.showInviteUrls) {
|
||||
this.copyToClipboard(user.inviteAcceptUrl);
|
||||
void this.clipboard.copy(user.inviteAcceptUrl);
|
||||
this.showCopyInviteLinkToast([]);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user