fixed confirmation dialogs and header layout for method list component

This commit is contained in:
dcore94 2023-05-23 19:55:04 +02:00
parent 7d3c583b20
commit c46389e539
5 changed files with 15 additions and 15 deletions

View File

@ -32,7 +32,7 @@ class CCPExecutionForm extends HTMLElement{
connectNewExecutionRequest(){ connectNewExecutionRequest(){
document.addEventListener("newexecutionrequest", ev=>{ document.addEventListener("newexecutionrequest", ev=>{
if(window.confirm("Confirm overwrite of execution form?")){ if(window.confirm("Please confirm overwrite of execution form?")){
this.setAttribute("method", ev.detail) this.setAttribute("method", ev.detail)
this.parentElement.scrollIntoViewIfNeeded() this.parentElement.scrollIntoViewIfNeeded()
} }

View File

@ -188,7 +188,7 @@ class CCPExecutionHistory extends HTMLElement {
this.#archiveupload.addEventListener("click", ev=>{ this.#archiveupload.addEventListener("click", ev=>{
const link = ev.target.parentElement.querySelector("input").value const link = ev.target.parentElement.querySelector("input").value
if(link){ if(link){
if(confirm("Confirm importing of execution from link?")){ if(confirm("Please confirm importing of execution from link?")){
this.fromArchive(link) this.fromArchive(link)
} }
} }
@ -419,7 +419,7 @@ class CCPExecutionHistory extends HTMLElement {
if(ev.dataTransfer && ev.dataTransfer.files && ev.dataTransfer.files.length){ if(ev.dataTransfer && ev.dataTransfer.files && ev.dataTransfer.files.length){
const files = Array.prototype.slice.call(ev.dataTransfer.files) const files = Array.prototype.slice.call(ev.dataTransfer.files)
const zips = files.filter(f=>f.type === "application/zip") const zips = files.filter(f=>f.type === "application/zip")
if(confirm("Confirm import of execution files?")){ if(confirm("Please confirm import of execution files?")){
this.importExecutions(files) this.importExecutions(files)
} }
} }
@ -480,7 +480,7 @@ class CCPExecutionHistory extends HTMLElement {
}, },
on_click: ev=>{ on_click: ev=>{
if(ev.target.getAttribute("name") === "delete"){ if(ev.target.getAttribute("name") === "delete"){
if(window.confirm("Confirm deletion of this execution?")){ if(window.confirm("Please confirm deletion of this execution?")){
const id = ev.currentTarget.getAttribute("data-index") const id = ev.currentTarget.getAttribute("data-index")
this.deleteExecution(id) this.deleteExecution(id)
} }
@ -498,7 +498,7 @@ class CCPExecutionHistory extends HTMLElement {
this.reexecute(id, 1) this.reexecute(id, 1)
} }
if(ev.target.getAttribute("name") === "archive"){ if(ev.target.getAttribute("name") === "archive"){
if(confirm("Confirm aarchiving of execution to workspace?")){ if(confirm(" Please confirm aarchiving of execution to workspace?")){
const id = ev.currentTarget.getAttribute("data-index") const id = ev.currentTarget.getAttribute("data-index")
this.toArchive(id) this.toArchive(id)
} }

View File

@ -184,7 +184,7 @@ class CCPMethodEditorController extends HTMLElement{
if(this.#locked) return; if(this.#locked) return;
if(this.#current != null){ if(this.#current != null){
this.adoptTemporaries() this.adoptTemporaries()
const text = `Confirm ${this.#isupdate ? "updating" : "creation"} of ${this.#current.title} version ${this.#current.version}` const text = `Please confirm ${this.#isupdate ? "updating" : "creation"} of ${this.#current.title} version ${this.#current.version}`
if(window.confirm(text)){ if(window.confirm(text)){
this.lockRender() this.lockRender()
const url = this.#serviceurl + "/methods" const url = this.#serviceurl + "/methods"
@ -214,7 +214,7 @@ class CCPMethodEditorController extends HTMLElement{
deleteMethod(){ deleteMethod(){
if(this.#locked) return; if(this.#locked) return;
if(this.#current != null){ if(this.#current != null){
const text = `Confirm deletion of ${this.#current.title} version ${this.#current.version}` const text = `Please confirm deletion of ${this.#current.title} version ${this.#current.version}`
if(window.confirm(text)){ if(window.confirm(text)){
this.lockRender() this.lockRender()
const url = this.#serviceurl + "/methods/" + this.#current.id const url = this.#serviceurl + "/methods/" + this.#current.id

View File

@ -99,12 +99,12 @@ class CCPMethodList extends HTMLElement{
</ul> </ul>
</template> </template>
<div class="card"> <div class="card">
<div class="card-header" style="min-width:600px"> <div class="card-header">
<div class="ccp-toolbar-header"> <div class="ccp-toolbar-header d-flex flex-wrap justify-content-between">
<div> <div>
<span name="header" class="mr-2">Methods</span> <span name="header">Methods</span>
</div> </div>
<div class="ccp-toolbar-right d-flex" style="gap:2px"> <div class="d-flex flex-wrap" style="gap:2px">
<button name="refresh" class="btn btn-primary ccp-toolbar-button" title="Refresh"> <button name="refresh" class="btn btn-primary ccp-toolbar-button" title="Refresh">
<svg viewBox="0 0 48 48"><path d="M24 40q-6.65 0-11.325-4.675Q8 30.65 8 24q0-6.65 4.675-11.325Q17.35 8 24 8q4.25 0 7.45 1.725T37 14.45V8h3v12.7H27.3v-3h8.4q-1.9-3-4.85-4.85Q27.9 11 24 11q-5.45 0-9.225 3.775Q11 18.55 11 24q0 5.45 3.775 9.225Q18.55 37 24 37q4.15 0 7.6-2.375 3.45-2.375 4.8-6.275h3.1q-1.45 5.25-5.75 8.45Q29.45 40 24 40Z"/></svg> <svg viewBox="0 0 48 48"><path d="M24 40q-6.65 0-11.325-4.675Q8 30.65 8 24q0-6.65 4.675-11.325Q17.35 8 24 8q4.25 0 7.45 1.725T37 14.45V8h3v12.7H27.3v-3h8.4q-1.9-3-4.85-4.85Q27.9 11 24 11q-5.45 0-9.225 3.775Q11 18.55 11 24q0 5.45 3.775 9.225Q18.55 37 24 37q4.15 0 7.6-2.375 3.45-2.375 4.8-6.275h3.1q-1.45 5.25-5.75 8.45Q29.45 40 24 40Z"/></svg>
</button> </button>
@ -154,7 +154,7 @@ class CCPMethodList extends HTMLElement{
this.#archiveupload.addEventListener("click", ev=>{ this.#archiveupload.addEventListener("click", ev=>{
const link = ev.target.parentElement.querySelector("input").value const link = ev.target.parentElement.querySelector("input").value
if(link){ if(link){
if(confirm("Confirm importing of method from link?")){ if(confirm("Please confirm importing of method from link?")){
this.fromArchive(link) this.fromArchive(link)
} }
} }
@ -331,7 +331,7 @@ class CCPMethodList extends HTMLElement{
if(ev.dataTransfer && ev.dataTransfer.files && ev.dataTransfer.files.length){ if(ev.dataTransfer && ev.dataTransfer.files && ev.dataTransfer.files.length){
const files = Array.prototype.slice.call(ev.dataTransfer.files) const files = Array.prototype.slice.call(ev.dataTransfer.files)
const jsons = files.filter(f=>f.type === "application/json") const jsons = files.filter(f=>f.type === "application/json")
if(confirm("Confirm import of method files?")){ if(confirm("Please confirm import of method files?")){
this.importMethods(files) this.importMethods(files)
} }
ev.preventDefault() ev.preventDefault()
@ -392,7 +392,7 @@ class CCPMethodList extends HTMLElement{
const event = new CustomEvent('neweditrequest', { detail: ev.currentTarget.bss_input.data }); const event = new CustomEvent('neweditrequest', { detail: ev.currentTarget.bss_input.data });
document.dispatchEvent(event) document.dispatchEvent(event)
}else if(ev.target.getAttribute("name") === "archive"){ }else if(ev.target.getAttribute("name") === "archive"){
if(confirm("Confirm archiving of method to workspace?")){ if(confirm("Please confirm archiving of method to workspace?")){
this.toArchive(id) this.toArchive(id)
} }
} }

View File

@ -111,7 +111,7 @@ class CCPOutputWidgetEditorController extends HTMLElement {
return ` return `
<div class="col"> <div class="col">
<div class="form-field" title="File path"> <div class="form-field" title="File path">
<input value="${this.#output.metadata[0].href}" name="href" class="form-control" placeholder="mime"/> <input value="${this.#output.metadata[0].href}" name="href" class="form-control" placeholder="file path"/>
</div> </div>
</div> </div>
` `