Skip to content

Commit

Permalink
fix: add void on non-await async calls
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrozav committed May 15, 2023
1 parent b80f186 commit 8d3aeb2
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ import {
updateNodeAuthType,
isCredentialModalState,
} from '@/utils';
import { externalHooks } from '@/mixins/externalHooks';
interface NodeAccessMap {
[nodeType: string]: ICredentialNodeAccess | null;
}
export default mixins(nodeHelpers).extend({
export default mixins(nodeHelpers, externalHooks).extend({
name: 'CredentialEdit',
components: {
CredentialSharing,
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/ExecutionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export default mixins(externalHooks, genericHelpers, executionHelpers).extend({
await this.loadWorkflows();
this.handleAutoRefreshToggle();
this.$externalHooks().run('executionsList.openDialog');
void this.$externalHooks().run('executionsList.openDialog');
this.$telemetry.track('User opened Executions log', {
workflow_id: this.workflowsStore.workflowId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export default mixins(executionHelpers, debounceHelper, workflowHelpers).extend(
this.tagsStore.upsertTags(tags);
this.$externalHooks().run('workflow.open', { workflowId, workflowName: data.name });
void this.$externalHooks().run('workflow.open', { workflowId, workflowName: data.name });
this.uiStore.stateIsDirty = false;
},
async addNodes(nodes: INodeUi[], connections?: IConnections) {
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/ExpressionEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default mixins(externalHooks, genericHelpers, debounceHelper).extend({
itemSelected(eventData: IVariableItemSelected) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(this.$refs.inputFieldExpression as any).itemSelected(eventData);
this.$externalHooks().run('expressionEdit.itemSelected', {
void this.$externalHooks().run('expressionEdit.itemSelected', {
parameter: this.parameter,
value: this.value,
selectedItem: eventData,
Expand Down Expand Up @@ -222,7 +222,7 @@ export default mixins(externalHooks, genericHelpers, debounceHelper).extend({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(this.$refs.expressionResult && (this.$refs.expressionResult as any).getValue()) ||
undefined;
this.$externalHooks().run('expressionEdit.dialogVisibleChanged', {
void this.$externalHooks().run('expressionEdit.dialogVisibleChanged', {
dialogVisible: newValue,
parameter: this.parameter,
value: this.value,
Expand Down
6 changes: 2 additions & 4 deletions packages/editor-ui/src/components/MainSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
import type { IExecutionResponse, IMenuItem, IVersion } from '@/Interface';
import type { MessageBoxInputData } from 'element-ui/types/message-box';
import GiftNotificationIcon from './GiftNotificationIcon.vue';
import WorkflowSettings from '@/components/WorkflowSettings.vue';
import { genericHelpers } from '@/mixins/genericHelpers';
import { useMessage } from '@/composables';
Expand All @@ -138,7 +137,6 @@ export default defineComponent({
name: 'MainSidebar',
components: {
GiftNotificationIcon,
WorkflowSettings,
},
mixins: [genericHelpers, workflowHelpers, workflowRun, userHelpers, debounceHelper],
setup(props) {
Expand Down Expand Up @@ -329,7 +327,7 @@ export default defineComponent({
async mounted() {
this.basePath = this.rootStore.baseUrl;
if (this.$refs.user) {
this.$externalHooks().run('mainSidebar.mounted', { userRef: this.$refs.user });
void this.$externalHooks().run('mainSidebar.mounted', { userRef: this.$refs.user });
}
if (window.innerWidth < 900 || this.uiStore.isNodeView) {
this.uiStore.sidebarMenuCollapsed = true;
Expand Down Expand Up @@ -467,7 +465,7 @@ export default defineComponent({
return defaultSettingsRoute;
},
onResize(event: UIEvent) {
this.callDebounced('onResizeEnd', { debounceTime: 100 }, event);
void this.callDebounced('onResizeEnd', { debounceTime: 100 }, event);
},
onResizeEnd(event: UIEvent) {
const browserWidth = (event.target as Window).outerWidth;
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/NodeDetailsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ export default defineComponent({
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()),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/NodeSettingsTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default mixins(externalHooks).extend({
methods: {
onTabSelect(tab: string) {
if (tab === 'docs' && this.nodeType) {
this.$externalHooks().run('dataDisplay.onDocumentationUrlClick', {
void this.$externalHooks().run('dataDisplay.onDocumentationUrlClick', {
nodeType: this.nodeType as INodeTypeDescription,
documentationUrl: this.documentationUrl,
});
Expand Down
8 changes: 4 additions & 4 deletions packages/editor-ui/src/components/ParameterInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers, debounceHelpe
this.updateNodeCredentialIssues(node);
}
this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation });
void this.$externalHooks().run('nodeSettings.credentialSelected', { updateInformation });
},
/**
* Check whether a param value must be skipped when collecting node param issues for validation.
Expand Down Expand Up @@ -1125,7 +1125,7 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers, debounceHelpe
had_parameter: typeof prevValue === 'string' && prevValue.includes('$parameter'),
};
this.$telemetry.track('User switched parameter mode', telemetryPayload);
this.$externalHooks().run('parameterInput.modeSwitch', telemetryPayload);
void this.$externalHooks().run('parameterInput.modeSwitch', telemetryPayload);
}
},
},
Expand All @@ -1134,7 +1134,7 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers, debounceHelpe
const remoteParameterOptions = this.$el.querySelectorAll('.remote-parameter-option');
if (remoteParameterOptions.length > 0) {
this.$externalHooks().run('parameterInput.updated', { remoteParameterOptions });
void this.$externalHooks().run('parameterInput.updated', { remoteParameterOptions });
}
});
},
Expand Down Expand Up @@ -1174,7 +1174,7 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers, debounceHelpe
);
}
this.$externalHooks().run('parameterInput.mount', {
void this.$externalHooks().run('parameterInput.mount', {
parameter: this.parameter,
inputFieldRef: this.$refs['inputField'],
});
Expand Down
6 changes: 3 additions & 3 deletions packages/editor-ui/src/components/RunData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten
view: this.displayMode,
run_index: this.runIndex,
};
this.$externalHooks().run('runData.onDataPinningSuccess', telemetryPayload);
void this.$externalHooks().run('runData.onDataPinningSuccess', telemetryPayload);
this.$telemetry.track('Ndv data pinning success', telemetryPayload);
},
onDataPinningError({
Expand Down Expand Up @@ -1055,7 +1055,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten
view: !this.hasNodeRun && !this.hasPinData ? 'none' : this.displayMode,
};
this.$externalHooks().run('runData.onTogglePinData', telemetryPayload);
void this.$externalHooks().run('runData.onTogglePinData', telemetryPayload);
this.$telemetry.track('User clicked pin data icon', telemetryPayload);
}
Expand Down Expand Up @@ -1164,7 +1164,7 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten
}
this.closeBinaryDataDisplay();
this.$externalHooks().run('runData.displayModeChanged', {
void this.$externalHooks().run('runData.displayModeChanged', {
newValue: displayMode,
oldValue: previous,
});
Expand Down
10 changes: 7 additions & 3 deletions packages/editor-ui/src/components/WorkflowSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,9 @@ export default mixins(externalHooks, genericHelpers).extend({
this.timeoutHMS = this.convertToHMS(workflowSettings.executionTimeout);
this.isLoading = false;
this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: true });
void this.$externalHooks().run('workflowSettings.dialogVisibleChanged', {
dialogVisible: true,
});
this.$telemetry.track('User opened workflow settings', {
workflow_id: this.workflowsStore.workflowId,
});
Expand All @@ -534,7 +536,9 @@ export default mixins(externalHooks, genericHelpers).extend({
},
closeDialog() {
this.modalBus.emit('close');
this.$externalHooks().run('workflowSettings.dialogVisibleChanged', { dialogVisible: false });
void this.$externalHooks().run('workflowSettings.dialogVisibleChanged', {
dialogVisible: false,
});
},
setTimeout(key: string, value: string) {
const time = value ? parseInt(value, 10) : 0;
Expand Down Expand Up @@ -825,7 +829,7 @@ export default mixins(externalHooks, genericHelpers).extend({
this.closeDialog();
this.$externalHooks().run('workflowSettings.saveSettings', { oldSettings });
void this.$externalHooks().run('workflowSettings.saveSettings', { oldSettings });
this.$telemetry.track('User updated workflow settings', {
workflow_id: this.workflowsStore.workflowId,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/mixins/pushConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export const pushConnection = defineComponent({
) {
const error = runDataExecuted.data.resultData.error as ExpressionError;

this.getWorkflowDataToSave().then((workflowData) => {
void this.getWorkflowDataToSave().then((workflowData) => {
const eventData: IDataObject = {
caused_by_credential: false,
error_message: error.description,
Expand Down Expand Up @@ -511,7 +511,7 @@ export const pushConnection = defineComponent({
.length;
}

this.$externalHooks().run('pushConnection.executionFinished', {
void this.$externalHooks().run('pushConnection.executionFinished', {
itemsCount,
nodeName: runDataExecuted.data.resultData.lastNodeExecuted,
errorMessage: runDataExecutedErrorMessage,
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/mixins/workflowActivate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const workflowActivate = defineComponent({
ndv_input: telemetrySource === 'ndv',
};
this.$telemetry.track('User set workflow active status', telemetryPayload);
this.$externalHooks().run('workflowActivate.updateWorkflowActivation', telemetryPayload);
void this.$externalHooks().run('workflowActivate.updateWorkflowActivation', telemetryPayload);

try {
if (isWorkflowActive && newActiveState) {
Expand Down Expand Up @@ -106,7 +106,7 @@ export const workflowActivate = defineComponent({
const activationEventName = isCurrentWorkflow
? 'workflow.activeChangeCurrent'
: 'workflow.activeChange';
this.$externalHooks().run(activationEventName, {
void this.$externalHooks().run(activationEventName, {
workflowId: currWorkflowId,
active: newActiveState,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/mixins/workflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ export const workflowHelpers = defineComponent({

this.uiStore.stateIsDirty = false;
this.uiStore.removeActiveAction('workflowSaving');
this.$externalHooks().run('workflow.afterUpdate', { workflowData });
void this.$externalHooks().run('workflow.afterUpdate', { workflowData });

return true;
} catch (error) {
Expand Down Expand Up @@ -896,7 +896,7 @@ export const workflowHelpers = defineComponent({

this.uiStore.removeActiveAction('workflowSaving');
this.uiStore.stateIsDirty = false;
this.$externalHooks().run('workflow.afterUpdate', { workflowData });
void this.$externalHooks().run('workflow.afterUpdate', { workflowData });

getCurrentWorkflow(true); // refresh cache
return true;
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/mixins/workflowRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const workflowRun = defineComponent({
duration: 0,
});
this.titleSet(workflow.name as string, 'ERROR');
this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName });
void this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName });

await this.getWorkflowDataToSave().then((workflowData) => {
this.$telemetry.track('Workflow execution preflight failed', {
Expand Down
Loading

0 comments on commit 8d3aeb2

Please sign in to comment.