Enable multiple args in logging via nodes (#2501)

*  Enable multiple args in logging via nodes

* 👕 Fix lint

*  Change to behave more as expected

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Iván Ovejero 2021-12-04 11:57:13 +01:00 committed by GitHub
parent c0b519a149
commit c50b6c2c21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -924,7 +924,7 @@ export async function executeWorkflow(
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export function sendMessageToUI(source: string, message: any) { export function sendMessageToUI(source: string, messages: any[]) {
if (this.sessionId === undefined) { if (this.sessionId === undefined) {
return; return;
} }
@ -936,7 +936,7 @@ export function sendMessageToUI(source: string, message: any) {
'sendConsoleMessage', 'sendConsoleMessage',
{ {
source: `Node: "${source}"`, source: `Node: "${source}"`,
message, messages,
}, },
this.sessionId, this.sessionId,
); );

View file

@ -1649,13 +1649,13 @@ export function getExecuteFunctions(
async putExecutionToWait(waitTill: Date): Promise<void> { async putExecutionToWait(waitTill: Date): Promise<void> {
runExecutionData.waitTill = waitTill; runExecutionData.waitTill = waitTill;
}, },
sendMessageToUI(message: any): void { sendMessageToUI(...args: any[]): void {
if (mode !== 'manual') { if (mode !== 'manual') {
return; return;
} }
try { try {
if (additionalData.sendMessageToUI) { if (additionalData.sendMessageToUI) {
additionalData.sendMessageToUI(node.name, message); additionalData.sendMessageToUI(node.name, args);
} }
} catch (error) { } catch (error) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions // eslint-disable-next-line @typescript-eslint/restrict-template-expressions

View file

@ -461,7 +461,7 @@ export interface IPushDataTestWebhook {
export interface IPushDataConsoleMessage { export interface IPushDataConsoleMessage {
source: string; source: string;
message: string; messages: string[];
} }
export interface IVersionNotificationSettings { export interface IVersionNotificationSettings {

View file

@ -165,7 +165,7 @@ export const pushConnection = mixins(
if (receivedData.type === 'sendConsoleMessage') { if (receivedData.type === 'sendConsoleMessage') {
const pushData = receivedData.data; const pushData = receivedData.data;
console.log(pushData.source, pushData.message); // eslint-disable-line no-console console.log(pushData.source, ...pushData.messages); // eslint-disable-line no-console
return true; return true;
} }