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:
Csaba Tuncsik
2023-05-12 10:13:42 +02:00
committed by GitHub
parent 0666377ef8
commit b95fcd7323
75 changed files with 990 additions and 862 deletions

View File

@@ -40,25 +40,30 @@
</template>
<script lang="ts">
import Modal from './Modal.vue';
import Modal from '@/components/Modal.vue';
import {
IMPORT_CURL_MODAL_KEY,
CURL_IMPORT_NOT_SUPPORTED_PROTOCOLS,
CURL_IMPORT_NODES_PROTOCOLS,
} from '../constants';
import { showMessage } from '@/mixins/showMessage';
import mixins from 'vue-typed-mixins';
} from '@/constants';
import { useToast } from '@/composables';
import { defineComponent } from 'vue';
import type { INodeUi } from '@/Interface';
import { mapStores } from 'pinia';
import { useUIStore } from '@/stores/ui.store';
import { useNDVStore } from '@/stores/ndv.store';
import { createEventBus } from '@/event-bus';
export default mixins(showMessage).extend({
export default defineComponent({
name: 'ImportCurlModal',
components: {
Modal,
},
setup() {
return {
...useToast(),
};
},
data() {
return {
IMPORT_CURL_MODAL_KEY,
@@ -122,7 +127,7 @@ export default mixins(showMessage).extend({
}
},
showProtocolErrorWithSupportedNode(protocol: string, node: string): void {
this.$showToast({
this.showToast({
title: this.$locale.baseText('importParameter.showError.invalidProtocol1.title', {
interpolate: {
node,
@@ -138,7 +143,7 @@ export default mixins(showMessage).extend({
});
},
showProtocolError(protocol: string): void {
this.$showToast({
this.showToast({
title: this.$locale.baseText('importParameter.showError.invalidProtocol2.title'),
message: this.$locale.baseText('importParameter.showError.invalidProtocol.message', {
interpolate: {
@@ -150,7 +155,7 @@ export default mixins(showMessage).extend({
});
},
showInvalidcURLCommandError(): void {
this.$showToast({
this.showToast({
title: this.$locale.baseText('importParameter.showError.invalidCurlCommand.title'),
message: this.$locale.baseText('importParameter.showError.invalidCurlCommand.message'),
type: 'error',