Merge pull request 'master' (#10) from master into prod
Reviewed-on: #10
This commit is contained in:
commit
8649ef8d3d
|
@ -77,6 +77,17 @@ class CCPExecutionForm extends HTMLElement{
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5>Options</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col form-check">
|
||||
<input class="form-check-input" type="checkbox" name="auto-archive-outputs" alt="Automatically archive outputs to workspace" title="Automatically archive outputs to workspace" checked="checked">
|
||||
<label class="form-check-label">Automatically archive outputs to workspace</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5>Outputs</h5>
|
||||
|
@ -236,6 +247,13 @@ class CCPExecutionForm extends HTMLElement{
|
|||
outputs.forEach(o=>{
|
||||
if(o.enabled) request.outputs[o.name] = { transmissionMode : "value" };
|
||||
})
|
||||
|
||||
const autoarchiveoption = this.#rootdoc.querySelector("input[name='auto-archive-outputs']")
|
||||
if (autoarchiveoption.checked){
|
||||
request.subscribers = [
|
||||
{ successUri : "http://registry:8080/executions/archive-to-folder" }
|
||||
]
|
||||
}
|
||||
|
||||
return request
|
||||
}
|
||||
|
@ -248,7 +266,7 @@ class CCPExecutionForm extends HTMLElement{
|
|||
return Array.prototype.slice.call(this.#rootdoc.querySelectorAll("d4s-ccp-output"))
|
||||
}
|
||||
|
||||
initValues(inputs){
|
||||
initInputValues(inputs){
|
||||
Object.keys(inputs).forEach(k=>{
|
||||
const w = this.#rootdoc.querySelector(`d4s-ccp-input[name=${k}]`)
|
||||
if(w){
|
||||
|
@ -256,6 +274,11 @@ class CCPExecutionForm extends HTMLElement{
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
initOptionValues(request){
|
||||
const autoarchiveoption = this.#rootdoc.querySelector("input[name='auto-archive-outputs']")
|
||||
autoarchiveoption.checked = request.subscribers && request.subscribers.filter(s=>s.successUri === "http://registry:8080/executions/archive-to-folder").length === 1
|
||||
}
|
||||
|
||||
prepareFromExecution(exec){
|
||||
let f1 =
|
||||
|
@ -288,7 +311,8 @@ class CCPExecutionForm extends HTMLElement{
|
|||
this.#data.executable = resp.status === 200
|
||||
}).then(()=>{
|
||||
this.showMethod()
|
||||
this.initValues(requestdata.inputs)
|
||||
this.initInputValues(requestdata.inputs)
|
||||
this.initOptionValues(requestdata)
|
||||
}).catch(err=>alert(err))
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class CCPOutputWidgetController extends HTMLElement {
|
|||
render(){
|
||||
return `
|
||||
<div class="col form-check">
|
||||
<input class="form-check-input" type="checkbox" name="this.#output.id" alt="${this.#output.description}" title="${this.#output.description}" checked="checked"/>
|
||||
<input class="form-check-input" type="checkbox" name="${this.#output.id}" alt="${this.#output.description}" title="${this.#output.description}" checked="checked"/>
|
||||
<label class="form-check-label">${this.#output.title}</label>
|
||||
</div>
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue