From 3b79faf740ebe1ce08346859e233d882a942c6d0 Mon Sep 17 00:00:00 2001 From: "Castro Ventura, Daniel" Date: Mon, 28 Nov 2022 16:09:25 +0000 Subject: [PATCH] #299 - added some console.logs --- .../mcdo_RetrieveTable/mcdo_RetrieveTable.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/force-app/main/default/lwc/mcdo_RetrieveTable/mcdo_RetrieveTable.js b/force-app/main/default/lwc/mcdo_RetrieveTable/mcdo_RetrieveTable.js index 27a1847..44f96df 100644 --- a/force-app/main/default/lwc/mcdo_RetrieveTable/mcdo_RetrieveTable.js +++ b/force-app/main/default/lwc/mcdo_RetrieveTable/mcdo_RetrieveTable.js @@ -163,9 +163,10 @@ export default class mcdo_RetrieveTable extends LightningElement { channelName = "/event/copado__Event__e"; _subscribeToMessageService() { - subscribeMessageService(this._context, COMMIT_PAGE_COMMUNICATION_CHANNEL, (message) => - this._handleCommitPageCommunicationMessage(message) - ); + subscribeMessageService(this._context, COMMIT_PAGE_COMMUNICATION_CHANNEL, (message) => { + console.log(`message: ${message}`); + this._handleCommitPageCommunicationMessage(message); + }); } /** @@ -334,12 +335,20 @@ export default class mcdo_RetrieveTable extends LightningElement { */ async subscribeToCompletionEvent(jobExecutionId) { const messageCallback = async (response) => { + console.log( + `response.data.payload.copado__Topic_Uri__c: ${response.data.payload.copado__Topic_Uri__c}` + ); + console.log( + `response.data.payload.copado__Payload__c: ${response.data.payload.copado__Payload__c}` + ); + console.log(`response.data.payload: ${response.data.payload}`); if ( response.data.payload.copado__Topic_Uri__c === `/execution-completed/${jobExecutionId}` ) { // retrieve is done: refresh table with new data this.updateMetadataGrid(response, jobExecutionId); + console.log("its completed"); } else if ( response.data.payload.copado__Topic_Uri__c.startsWith( "/events/copado/v1/step-monitor/" // + resultId @@ -351,12 +360,15 @@ export default class mcdo_RetrieveTable extends LightningElement { this.progressStatus = stepStatus.data.progressStatus || this.progressStatus; } catch { // ignore + console.log("its not yet completed"); } } }; try { + console.log(`this.channelName: ${this.channelName}`); this.empSubscription = await subscribeEmp(this.channelName, -1, messageCallback); + console.log(`this.empSubscription: ${JSON.stringify(this.empSubscription)}`); } catch (err) { this.showError( `${err.name}: An error occurred while subscribing to Emp API`, @@ -604,4 +616,4 @@ export default class mcdo_RetrieveTable extends LightningElement { this.showTable = !isLoading; this.refreshButtonDisabled = isLoading; } -} \ No newline at end of file +}