diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index 93a7d3e..37fe2d6 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -509,20 +509,8 @@ window.customElements.define('d4s-ccp-input-file', CCPFileInputWidgetController) class CCPRemoteFileInputWidgetController extends CCPBaseInputWidgetController{ - #iss = null; - #addresses = { - "https://accounts.dev.d4science.org/auth/realms/d4science" : "https://workspace-repository.dev.d4science.org/storagehub/workspace", - "https://accounts.pre.d4science.org/auth/realms/d4science" : "https://pre.d4science.org/workspace", - "https://accounts.d4science.org/auth/realms/d4science" : "https://api.d4science.org/workspace" - }; - constructor(){ super() - this.#iss = document.querySelector("d4s-boot-2").loginToken.iss - } - - get baseurl(){ - return this.#addresses[this.#iss] } connectedCallback(){ @@ -535,6 +523,12 @@ class CCPRemoteFileInputWidgetController extends CCPBaseInputWidgetController{ } addToolContent(){ + const iss = document.querySelector("d4s-boot-2").loginToken.iss; + const addresses = { + "https://accounts.dev.d4science.org/auth/realms/d4science" : "https://workspace-repository.dev.d4science.org/storagehub/workspace", + "https://accounts.pre.d4science.org/auth/realms/d4science" : "https://pre.d4science.org/workspace", + "https://accounts.d4science.org/auth/realms/d4science" : "https://api.d4science.org/workspace" + }; this.rootdoc.querySelector("div[name=tools]").innerHTML += ` @@ -545,7 +539,7 @@ class CCPRemoteFileInputWidgetController extends CCPBaseInputWidgetController{ x