mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(editor): Turn showMessage mixin to composable (#6081)
* refactor(editor): move $getExecutionError from showMessages mixin to pushConnection (it is used there only) * refactor(editor): resolve showMessage mixin methods * fix(editor): use composable instead of mixin * fix(editor): resolve conflicts * fix(editor): replace clearAllStickyNotifications * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): remove last confirmMessage usage * fix(editor): remove $prompt usage * fix(editor): remove $show methods * fix(editor): lint fix * fix(editor): lint fix * fix(editor): fixes after review
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
<script lang="ts">
|
||||
import mixins from 'vue-typed-mixins';
|
||||
|
||||
import { showMessage } from '@/mixins/showMessage';
|
||||
import { useToast } from '@/composables';
|
||||
import { copyPaste } from '@/mixins/copyPaste';
|
||||
import Modal from './Modal.vue';
|
||||
import type { IFormInputs, IInviteResponse, IUser } from '@/Interface';
|
||||
@@ -90,7 +90,7 @@ function getEmail(email: string): string {
|
||||
return parsed;
|
||||
}
|
||||
|
||||
export default mixins(showMessage, copyPaste).extend({
|
||||
export default mixins(copyPaste).extend({
|
||||
components: { Modal },
|
||||
name: 'InviteUsersModal',
|
||||
props: {
|
||||
@@ -98,6 +98,11 @@ export default mixins(showMessage, copyPaste).extend({
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
...useToast(),
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
config: null as IFormInputs | null,
|
||||
@@ -224,7 +229,7 @@ export default mixins(showMessage, copyPaste).extend({
|
||||
);
|
||||
|
||||
if (successfulEmailInvites.length) {
|
||||
this.$showMessage({
|
||||
this.showMessage({
|
||||
type: 'success',
|
||||
title: this.$locale.baseText(
|
||||
successfulEmailInvites.length > 1
|
||||
@@ -244,7 +249,7 @@ export default mixins(showMessage, copyPaste).extend({
|
||||
this.copyToClipboard(successfulUrlInvites[0].user.inviteAcceptUrl);
|
||||
}
|
||||
|
||||
this.$showMessage({
|
||||
this.showMessage({
|
||||
type: 'success',
|
||||
title: this.$locale.baseText(
|
||||
successfulUrlInvites.length > 1
|
||||
@@ -266,7 +271,7 @@ export default mixins(showMessage, copyPaste).extend({
|
||||
|
||||
if (erroredInvites.length) {
|
||||
setTimeout(() => {
|
||||
this.$showMessage({
|
||||
this.showMessage({
|
||||
type: 'error',
|
||||
title: this.$locale.baseText('settings.users.usersEmailedError'),
|
||||
message: this.$locale.baseText('settings.users.emailInvitesSentError', {
|
||||
@@ -282,12 +287,12 @@ export default mixins(showMessage, copyPaste).extend({
|
||||
this.modalBus.emit('close');
|
||||
}
|
||||
} catch (error) {
|
||||
this.$showError(error, this.$locale.baseText('settings.users.usersInvitedError'));
|
||||
this.showError(error, this.$locale.baseText('settings.users.usersInvitedError'));
|
||||
}
|
||||
this.loading = false;
|
||||
},
|
||||
showCopyInviteLinkToast(successfulUrlInvites: IInviteResponse[]) {
|
||||
this.$showMessage({
|
||||
this.showMessage({
|
||||
type: 'success',
|
||||
title: this.$locale.baseText(
|
||||
successfulUrlInvites.length > 1
|
||||
|
||||
Reference in New Issue
Block a user