From 297b2f6ffe914878c819fc473ac02300bfee0ed6 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 11 Apr 2024 17:25:41 +0200 Subject: [PATCH] fix enum default selection --- ccp/js/executionformcontroller.js | 9 +++++---- ccp/js/inputwidgetcontroller.js | 3 ++- ccp/js/methodeditorcontroller.js | 7 +++---- ccp/js/methodlistcontroller.js | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index 3a18549..b0c954a 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -11,11 +11,12 @@ class CCPExecutionForm extends HTMLElement{ constructor(){ super() this.#boot = document.querySelector("d4s-boot-2") - this.#serviceurl = this.getAttribute("serviceurl") this.#rootdoc = this.attachShadow({ "mode" : "open"}) - + } + + connectedCallback(){ + this.#serviceurl = this.getAttribute("serviceurl") this.connectNewExecutionRequest() - this.render() const params = new URLSearchParams(window.location.search) @@ -29,7 +30,7 @@ class CCPExecutionForm extends HTMLElement{ this.showMethod() } } - + static get observedAttributes() { return ["method"]; } diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index f4f09c9..66d34b2 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -325,12 +325,13 @@ class CCPEnumInputWidgetController extends CCPBaseInputWidgetController{ } content(){ - const opts = this.options.map(o=>``).join("\n") if(this.value.length <= 1){ + const opts = this.options.map(o=>``).join("\n") return `` } var out = this.value.map((c,i)=>{ + const opts = this.options.map(o=>``).join("\n") return ` ` diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index 16ddd79..14748ee 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -153,15 +153,14 @@ class CCPMethodEditorController extends HTMLElement{ super(); this.#boot = document.querySelector("d4s-boot-2") this.#rootdoc = this.attachShadow({ "mode" : "open"}) + } + + connectedCallback(){ this.#serviceurl = this.getAttribute("serviceurl") this.initMethod() this.fetchInfrastructures() this.connectNewEditRequest() } - - connectedCallback(){ - - } connectNewEditRequest(){ document.addEventListener("neweditrequest", ev=>{ diff --git a/ccp/js/methodlistcontroller.js b/ccp/js/methodlistcontroller.js index f287eaa..e4bb1be 100644 --- a/ccp/js/methodlistcontroller.js +++ b/ccp/js/methodlistcontroller.js @@ -17,11 +17,8 @@ class CCPMethodList extends HTMLElement{ constructor(){ super() this.#boot = document.querySelector("d4s-boot-2") - this.#serviceurl = this.getAttribute("serviceurl") this.#rootdoc = this.attachShadow({ "mode" : "open"}) this.#archive = this.getAttribute("archive") - this.render() - this.fetchProcesses() } render(){ @@ -167,6 +164,9 @@ class CCPMethodList extends HTMLElement{ connectedCallback(){ this.#allowedit = this.getAttribute("allow-edit") === "true" this.#allowexecute = this.getAttribute("allow-execute") === "true" + this.#serviceurl = this.getAttribute("serviceurl") + this.render() + this.fetchProcesses() } fetchProcesses(){ -- 2.17.1