diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index 89d2e42..bc039ac 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -18,6 +18,7 @@ class CCPMethodEditorController extends HTMLElement{ description : "New empty method", version : "1.0.0", jobControlOptions : "async-execute", + metadata : [], inputs : {}, outputs : {}, additionalParameters : { @@ -143,6 +144,28 @@ class CCPMethodEditorController extends HTMLElement{ background-color: rgba(0,0,0,.3); z-index: 10; } + + ul.author_list{ + list-style: none; + display: flex; + flex-direction: row; + gap:2px; + padding-left: 0; + font-size: small; + font-weight: 300; + } + li.author_list_item{ + display: inline-block; + padding: 0.25em 0.4em; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.25rem; + background-color: #eeffff; + color: #9900CC; + border: solid 1px #9900CC; + } ` #erase_icon = ` @@ -219,7 +242,7 @@ class CCPMethodEditorController extends HTMLElement{ (resp)=>{ if(resp.status === 201 || resp.status === 204){ return resp.text() - }else throw "Error saving process" + }else throw "Error saving process: " + resp.status }).then(data=>{ if(!this.#isupdate) this.#isupdate = true; this.unlockRender() @@ -272,18 +295,15 @@ class CCPMethodEditorController extends HTMLElement{ cloneMethod(method){ if(this.#locked) return; this.lockRender() - this.#boot.secureFetch(this.#serviceurl + "/processes/" + method).then( + this.#boot.secureFetch(this.#serviceurl + "/methods/" + method + "/clone").then( (resp)=>{ if(resp.status === 200){ return resp.json() - }else throw "Error retrieving process" + }else throw "Error retrieving process: " + resp.status } ).then(data=>{ this.#current = data - this.#current.id = Math.abs((Math.random() * 10e11)|0) this.#isupdate = false - this.#current.title = "Clone of " + this.#current.title - this.#current.description = "[Clone of] " + this.#current.description this.#tmp_inputs = Object.keys(this.#current.inputs).map(k=>this.#current.inputs[k]) this.#tmp_outputs = Object.keys(this.#current.outputs).map(k=>this.#current.outputs[k]) this.unlockRender() @@ -295,11 +315,11 @@ class CCPMethodEditorController extends HTMLElement{ editMethod(method){ if(this.#locked) return; this.lockRender() - this.#boot.secureFetch(this.#serviceurl + "/processes/" + method).then( + this.#boot.secureFetch(this.#serviceurl + "/methods/" + method + "/updatable").then( (resp)=>{ if(resp.status === 200){ return resp.json() - }else throw "Error retrieving process" + }else throw "Error retrieving process: " + resp.status } ).then(data=>{ this.#current = data @@ -370,6 +390,9 @@ class CCPMethodEditorController extends HTMLElement{
+
+ ${this.renderAuthors()} +
@@ -698,6 +721,16 @@ class CCPMethodEditorController extends HTMLElement{ ` } + renderAuthors(){ + return ` +
    + ${ this.#current.metadata. + filter(md=>md.role === "author"). + map(a=>`
  • ${a.title}
  • `) } +
+ ` + } + renderSaveButton(){ return `