diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index 2d949c5..6e53f7c 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -24,7 +24,8 @@ class CCPExecutionForm extends HTMLElement{ } attributeChangedCallback(name, oldValue, newValue) { - if((oldValue != newValue) && (name === "method")){ + //if((oldValue != newValue) && (name === "method")){ + if(name === "method"){ this.#method = newValue this.loadMethod() } diff --git a/ccp/js/executionhistorycontroller.js b/ccp/js/executionhistorycontroller.js index 9c70943..b0217c6 100644 --- a/ccp/js/executionhistorycontroller.js +++ b/ccp/js/executionhistorycontroller.js @@ -77,9 +77,6 @@ class CCPExecutionHistory extends HTMLElement {
- ${ this.#archive ? ` + + @@ -390,6 +393,15 @@ class CCPExecutionHistory extends HTMLElement { } }).catch(err=>{ alert(err)}) } + + toArchiveFolder(id){ + this.#boot.secureFetch(`${this.#serviceurl}/executions/${id}/archive-to-folder`, { method: "POST" }) + .then(reply =>{ + if (!reply.ok) { + throw "Unable to archive" + } + }).catch(err=>{ alert(err)}) + } fromArchive(url){ if(url){ @@ -503,11 +515,17 @@ class CCPExecutionHistory extends HTMLElement { } } if(ev.target.getAttribute("name") === "archive"){ - if(confirm(" Please confirm aarchiving of execution to workspace?")){ + if(confirm(" Please confirm archiving of execution to workspace?")){ const id = ev.currentTarget.getAttribute("data-index") this.toArchive(id) } } + if(ev.target.getAttribute("name") === "archivefolder"){ + if(confirm(" Please confirm archiving of execution outputs to workspace?")){ + const id = ev.currentTarget.getAttribute("data-index") + this.toArchiveFolder(id) + } + } }, recurse : [ { diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index 1aedbc2..12c98e3 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -169,13 +169,13 @@ class FileInputRenderer extends Renderer{ const ename = tgt.getAttribute("name") if(ename === this.name){ const file = ev.target.files[0] - if(file.type !== this.schema.contentMediaType){ + /*if(file.type !== this.schema.contentMediaType){ alert("Unsupported media type. Must be " + this.schema.contentMediaType) ev.stopPropagation() ev.preventDefault() tgt.value = null return false - } + }*/ if(file.size > 100*1024){ alert("This input allows only small files (100K). Use references instead ") ev.stopPropagation() diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index bac2927..38f48fa 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -201,7 +201,7 @@ class CCPMethodEditorController extends HTMLElement{ } this.#boot.secureFetch(url, args).then( (resp)=>{ - if(resp.status === 201 || resp.status === 204){ + if(resp.ok){ return resp.text() }else throw "Error saving process: " + resp.status }).then(data=>{