refactor(editor): Turn showMessage mixin to composable (#6081) (#6244)

* 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

* fix(editor): Fix external hook call in App

* fix(editor): mixins & composables

* fix: add pushConnection setup composables to components as well

* fix(editor): mixins & composables

* fix(editor): mixins & composables

* fix: add void on non-await async calls

* fix: fix close without connecting confirmation

* fix: remove .only

---------

Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
Csaba Tuncsik
2023-05-15 18:41:13 +02:00
committed by GitHub
parent f1598d6fdc
commit 51fb913d37
80 changed files with 1126 additions and 978 deletions

View File

@@ -142,7 +142,7 @@ import { workflowHelpers } from '@/mixins/workflowHelpers';
import NodeSettings from '@/components/NodeSettings.vue';
import NDVDraggablePanels from './NDVDraggablePanels.vue';
import mixins from 'vue-typed-mixins';
import { defineComponent } from 'vue';
import OutputPanel from './OutputPanel.vue';
import InputPanel from './InputPanel.vue';
import TriggerPanel from './TriggerPanel.vue';
@@ -150,6 +150,7 @@ import {
BASE_NODE_SURVEY_URL,
EnterpriseEditionFeature,
EXECUTABLE_TRIGGER_NODE_TYPES,
MODAL_CONFIRM,
START_NODE_TYPE,
STICKY_NODE_TYPE,
} from '@/constants';
@@ -163,15 +164,11 @@ import { useNodeTypesStore } from '@/stores/nodeTypes.store';
import { useUIStore } from '@/stores/ui.store';
import { useSettingsStore } from '@/stores/settings.store';
import useDeviceSupport from '@/composables/useDeviceSupport';
import { useMessage } from '@/composables';
export default mixins(
externalHooks,
nodeHelpers,
workflowHelpers,
workflowActivate,
pinData,
).extend({
export default defineComponent({
name: 'NodeDetailsView',
mixins: [externalHooks, nodeHelpers, workflowHelpers, workflowActivate, pinData],
components: {
NodeSettings,
InputPanel,
@@ -191,9 +188,11 @@ export default mixins(
default: false,
},
},
setup() {
setup(props) {
return {
...useDeviceSupport(),
...useMessage(),
...workflowActivate.setup?.(props),
};
},
data() {
@@ -420,7 +419,7 @@ export default mixins(
this.avgInputRowHeight = 0;
setTimeout(this.ndvStore.setNDVSessionId, 0);
this.$externalHooks().run('dataDisplay.nodeTypeChanged', {
void this.$externalHooks().run('dataDisplay.nodeTypeChanged', {
nodeSubtitle: this.getNodeSubtitle(node, this.activeNodeType, this.getCurrentWorkflow()),
});
@@ -608,15 +607,16 @@ export default mixins(
}
if (this.outputPanelEditMode.enabled) {
const shouldPinDataBeforeClosing = await this.confirmMessage(
const shouldPinDataBeforeClosing = await this.confirm(
'',
this.$locale.baseText('ndv.pinData.beforeClosing.title'),
null,
this.$locale.baseText('ndv.pinData.beforeClosing.confirm'),
this.$locale.baseText('ndv.pinData.beforeClosing.cancel'),
{
confirmButtonText: this.$locale.baseText('ndv.pinData.beforeClosing.confirm'),
cancelButtonText: this.$locale.baseText('ndv.pinData.beforeClosing.cancel'),
},
);
if (shouldPinDataBeforeClosing) {
if (shouldPinDataBeforeClosing === MODAL_CONFIRM) {
const { value } = this.outputPanelEditMode;
if (!this.isValidPinDataSize(value)) {