From cf0563dd43fb023703cc393566e801e31a82f18e Mon Sep 17 00:00:00 2001 From: dcore94 Date: Fri, 5 May 2023 18:00:40 +0200 Subject: [PATCH] fix communications between form and monitor --- ccp/js/executionformcontroller.js | 6 +----- ccp/js/executionhistorycontroller.js | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index a72e56c..c703cb1 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -161,12 +161,8 @@ class CCPExecutionForm extends HTMLElement{ if(data.status !== "accepted"){ throw "Execution has not been accepted by server" } - const event = new CustomEvent('newexecution', { detail: data.jobID }); + const event = new CustomEvent('newexecution', { detail: data }); document.dispatchEvent(event) - this.#executionmonitor = document.querySelector("d4s-ccp-executionhistory") - if(this.#executionmonitor){ - this.#executionmonitor.addExecution( { self : data.links[0].href, events : [data], jobID : data.jobID, method : this.#data.title}) - } this.unlockRender() }).catch(err => {alert("Unable to call execute: " + err); this.unlockRender()}) } diff --git a/ccp/js/executionhistorycontroller.js b/ccp/js/executionhistorycontroller.js index 611739c..8433e60 100644 --- a/ccp/js/executionhistorycontroller.js +++ b/ccp/js/executionhistorycontroller.js @@ -259,7 +259,8 @@ class CCPExecutionHistory extends HTMLElement { connectNewExecution(){ document.addEventListener("newexecution", ev=>{ - this.#data = [ {id: ev.detail } ].concat(this.#data) + this.#data = [ {id: ev.detail } ].concat(this.#data) + this.updateList() }) }