refactor(editor): Apply Prettier (no-changelog) (#4920)

*  Adjust `format` script

* 🔥 Remove exemption for `editor-ui`

* 🎨 Prettify

* 👕 Fix lint
This commit is contained in:
Iván Ovejero
2022-12-14 10:04:10 +01:00
committed by GitHub
parent bcde07e032
commit 5ca2148c7e
284 changed files with 19247 additions and 15540 deletions

View File

@@ -147,14 +147,14 @@ import {
STICKY_NODE_TYPE,
} from '@/constants';
import { workflowActivate } from '@/mixins/workflowActivate';
import { pinData } from "@/mixins/pinData";
import { pinData } from '@/mixins/pinData';
import { dataPinningEventBus } from '@/event-bus/data-pinning-event-bus';
import { mapStores } from 'pinia';
import { useWorkflowsStore } from '@/stores/workflows';
import { useNDVStore } from '@/stores/ndv';
import { useNodeTypesStore } from '@/stores/nodeTypes';
import { useUIStore } from '@/stores/ui';
import {useSettingsStore} from "@/stores/settings";
import { useSettingsStore } from '@/stores/settings';
export default mixins(
externalHooks,
@@ -200,21 +200,18 @@ export default mixins(
},
mounted() {
this.ndvStore.setNDVSessionId;
dataPinningEventBus.$on('data-pinning-discovery', ({ isTooltipVisible }: { isTooltipVisible: boolean }) => {
this.pinDataDiscoveryTooltipVisible = isTooltipVisible;
});
dataPinningEventBus.$on(
'data-pinning-discovery',
({ isTooltipVisible }: { isTooltipVisible: boolean }) => {
this.pinDataDiscoveryTooltipVisible = isTooltipVisible;
},
);
},
destroyed () {
destroyed() {
dataPinningEventBus.$off('data-pinning-discovery');
},
computed: {
...mapStores(
useNodeTypesStore,
useNDVStore,
useUIStore,
useWorkflowsStore,
useSettingsStore,
),
...mapStores(useNodeTypesStore, useNDVStore, useUIStore, useWorkflowsStore, useSettingsStore),
sessionId(): string {
return this.ndvStore.sessionId;
},
@@ -253,7 +250,9 @@ export default mixins(
const isWebhookBasedNode = !!this.activeNodeType?.webhooks?.length;
const isPollingNode = this.activeNodeType?.polling;
const override = !!this.activeNodeType?.triggerPanel;
return !this.readOnly && this.isTriggerNode && (isWebhookBasedNode || isPollingNode || override);
return (
!this.readOnly && this.isTriggerNode && (isWebhookBasedNode || isPollingNode || override)
);
},
workflow(): Workflow {
return this.getCurrentWorkflow();
@@ -278,9 +277,7 @@ export default mixins(
);
},
isActiveStickyNode(): boolean {
return (
!!this.ndvStore.activeNode && this.ndvStore.activeNode .type === STICKY_NODE_TYPE
);
return !!this.ndvStore.activeNode && this.ndvStore.activeNode.type === STICKY_NODE_TYPE;
},
workflowExecution(): IExecutionResponse | null {
return this.workflowsStore.getWorkflowExecution;
@@ -361,7 +358,7 @@ export default mixins(
}
return `${BASE_NODE_SURVEY_URL}${this.activeNodeType.name}`;
},
outputPanelEditMode(): { enabled: boolean; value: string; } {
outputPanelEditMode(): { enabled: boolean; value: string } {
return this.ndvStore.outputPanelEditMode;
},
isWorkflowRunning(): boolean {
@@ -378,9 +375,16 @@ export default mixins(
const usedCredentials = this.workflowsStore.usedCredentials;
let hasForeignCredential = false;
if (credentials && this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.WorkflowSharing)) {
if (
credentials &&
this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.WorkflowSharing)
) {
Object.values(credentials).forEach((credential) => {
if (credential.id && usedCredentials[credential.id] && !usedCredentials[credential.id].currentUserHasAccess) {
if (
credential.id &&
usedCredentials[credential.id] &&
!usedCredentials[credential.id].currentUserHasAccess
) {
hasForeignCredential = true;
}
});
@@ -458,7 +462,7 @@ export default mixins(
},
},
methods: {
onInputItemHover(e: {itemIndex: number, outputIndex: number} | null) {
onInputItemHover(e: { itemIndex: number; outputIndex: number } | null) {
if (!this.inputNodeName) {
return;
}
@@ -475,7 +479,7 @@ export default mixins(
};
this.ndvStore.setHoveringItem(item);
},
onOutputItemHover(e: {itemIndex: number, outputIndex: number} | null) {
onOutputItemHover(e: { itemIndex: number; outputIndex: number } | null) {
if (e === null || !this.activeNode) {
this.ndvStore.setHoveringItem(null);
return;
@@ -589,16 +593,18 @@ export default mixins(
const { value } = this.outputPanelEditMode;
if (!this.isValidPinDataSize(value)) {
dataPinningEventBus.$emit(
'data-pinning-error', { errorType: 'data-too-large', source: 'on-ndv-close-modal' },
);
dataPinningEventBus.$emit('data-pinning-error', {
errorType: 'data-too-large',
source: 'on-ndv-close-modal',
});
return;
}
if (!this.isValidPinDataJSON(value)) {
dataPinningEventBus.$emit(
'data-pinning-error', { errorType: 'invalid-json', source: 'on-ndv-close-modal' },
);
dataPinningEventBus.$emit('data-pinning-error', {
errorType: 'invalid-json',
source: 'on-ndv-close-modal',
});
return;
}
@@ -652,7 +658,7 @@ export default mixins(
input_node_type: this.inputNode ? this.inputNode.type : '',
});
},
onStopExecution(){
onStopExecution() {
this.$emit('stopExecution');
},
},