Skip to content

Commit

Permalink
#299 - added some console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Castro Ventura, Daniel committed Nov 28, 2022
1 parent 638202b commit 3b79faf
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

/**
Expand Down Expand Up @@ -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
Expand All @@ -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`,
Expand Down Expand Up @@ -604,4 +616,4 @@ export default class mcdo_RetrieveTable extends LightningElement {
this.showTable = !isLoading;
this.refreshButtonDisabled = isLoading;
}
}
}

0 comments on commit 3b79faf

Please sign in to comment.