From 7e353a6bc989850cbef48d28890b29adba249557 Mon Sep 17 00:00:00 2001 From: luisthieme Date: Tue, 25 Jun 2024 10:45:23 +0200 Subject: [PATCH] fix waiting screen --- nodes/dynamic-form.html | 121 +++++++++- nodes/dynamic-form.js | 9 +- package-lock.json | 4 +- resources/dynamic-form.umd.js | 2 +- resources/dynamic-form.umd.js.map | 2 +- ui/components/DynamicForm.vue | 381 ++++++++++++++++-------------- 6 files changed, 321 insertions(+), 198 deletions(-) diff --git a/nodes/dynamic-form.html b/nodes/dynamic-form.html index 42e6ff5..315ac7d 100644 --- a/nodes/dynamic-form.html +++ b/nodes/dynamic-form.html @@ -6,10 +6,15 @@ name: { value: "" }, group: { type: 'ui-group', required: true }, order: { value: 0 }, + options: { + value: [{ label: ''}], + validate: function (v) { + const unique = new Set(v.map(function (o) { return o.label })); + return v.length === unique.size; + } + }, waiting_title: { value: "Waiting for Warten auf den Usertask..." }, waiting_info: { value: "Der Usertask wird automatisch angezeigt, wenn ein entsprechender Task vorhanden ist." }, - submit_title: { value: "Submit your task" }, - cancel_title: { value: "Cancel your task" }, width: { value: 0, validate: function (v) { @@ -21,10 +26,14 @@ return valid } }, - height: { value: 0 } + height: { value: 0 }, + outputs: { value: 1} }, inputs: 1, outputs: 1, + outputLabels: function(index) { + return this.options[index].label + }, icon: "file.svg", label: function() { return this.name || "dynamic-form"; @@ -35,7 +44,81 @@ height: '#node-input-height', group: '#node-input-group' }); - } + + function generateOption(i, option) { + const container = $('
  • ', { + style: 'background: var(--red-ui-secondary-background, #fff); margin:0; padding:8px 0px 0px;' + }); + + // Create input fields for value and label + const row = $('
    ').appendTo(container); + $('', { + class: 'node-input-option-label', + type: 'text', + style: 'margin-left:7px; width:calc(100% - 48px);', + placeholder: 'Label', + value: option.label + }).appendTo(row).typedInput({ + type: 'str', types: ['str'] + }); + + // $('', { + // class: 'node-input-option-condition', + // type: 'text', + // style: 'margin-left:7px; width:calc(50% - 32px);', + // placeholder: 'Condition', + // value: option.condition + // }).appendTo(row).typedInput({ + // type: 'str', types: ['str'] + // }); + + // Create delete button for the option + const finalSpan = $('', { style: 'float:right; margin-right:8px;' }).appendTo(row); + const deleteButton = $('', { href: '#', class: 'editor-button editor-button-small', style: 'margin-top:7px; margin-left:5px;' }).appendTo(finalSpan); + $('', { class: 'fa fa-remove' }).appendTo(deleteButton); + + deleteButton.click(function () { + container.css({ background: 'var(--red-ui-secondary-background-inactive, #fee)' }); + container.fadeOut(300, function () { + $(this).remove(); + }); + }); + + $('#node-input-option-container').append(container); + } + + $('#node-input-add-option').click(function () { + generateOption($('#node-input-option-container').children().length + 1, {}); + $('#node-input-option-container-div').scrollTop($('#node-input-option-container-div').get(0).scrollHeight); + }); + + for (let i = 0; i < this.options.length; i++) { + const option = this.options[i]; + generateOption(i + 1, option); + } + + $('#node-input-option-container').sortable({ + axis: 'y', + handle: '.node-input-option-handle', + cursor: 'move' + }); + }, + oneditsave: function () { + const options = $('#node-input-option-container').children(); + const node = this; + node.options = []; + options.each(function (i) { + const option = $(this); + const o = { + label: option.find('.node-input-option-label').val(), + // condition: option.find('.node-input-option-condition').val() + }; + + node.options.push(o); + }); + + this.outputs = node.options.length || 1 + }, }); @@ -54,6 +137,26 @@
    + + + +
    + action +
    +
    @@ -62,12 +165,4 @@
    -
    - - -
    -
    - - -
    - \ No newline at end of file + diff --git a/nodes/dynamic-form.js b/nodes/dynamic-form.js index 967ce9a..f2e00b3 100644 --- a/nodes/dynamic-form.js +++ b/nodes/dynamic-form.js @@ -37,5 +37,12 @@ module.exports = function (RED) { } } - RED.nodes.registerType('dynamic-form', DynamicFormNode) + RED.nodes.registerType('dynamic-form', DynamicFormNode, { + defaults: { + outputs: { value: 1 } + }, + outputs: function(config) { + return config.outputs || 1; + } + }) } diff --git a/package-lock.json b/package-lock.json index e12ffc6..217c8cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@5minds/node-red-dashboard-2-processcube-dynamic-form", - "version": "1.0.0", + "version": "1.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@5minds/node-red-dashboard-2-processcube-dynamic-form", - "version": "1.0.0", + "version": "1.0.5", "license": "Apache-2.0", "dependencies": { "to-title-case": "^1.0.0", diff --git a/resources/dynamic-form.umd.js b/resources/dynamic-form.umd.js index 61a68e8..3a1b14d 100644 --- a/resources/dynamic-form.umd.js +++ b/resources/dynamic-form.umd.js @@ -1,3 +1,3 @@ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".dynamic-form-wrapper[data-v-19b58e9c]{padding:10px;margin:10px;border:1px solid black}.dynamic-form-class[data-v-19b58e9c]{color:green;font-weight:700}h1[data-v-19b58e9c]{margin-bottom:10px}h2[data-v-19b58e9c]{margin-top:1.5rem;margin-bottom:.75rem}h3[data-v-19b58e9c]{margin-top:1rem}p[data-v-19b58e9c]{margin-bottom:5px}ul li[data-v-19b58e9c]{list-style-type:circle;list-style-position:inside;margin-left:15px}pre[data-v-19b58e9c]{padding:12px;margin:12px;background-color:#eee}code[data-v-19b58e9c]{font-size:.825rem;color:#ae0000}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})(); -(function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuex")):typeof define=="function"&&define.amd?define(["exports","vue","vuex"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a["dynamic-form"]={},a.Vue,a.vuex))})(this,function(a,e,u){"use strict";const p=(t,r)=>{const s=t.__vccOpts||t;for(const[c,n]of r)s[c]=n;return s},f={name:"DynamicForm",inject:["$socket"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})},state:{type:Object,default:()=>({enabled:!1,visible:!1})}},setup(t){console.info("DynamicForm setup with:",t),console.debug("Vue function loaded correctly",e.markRaw)},data(){return{form:{},formData:{}}},computed:{...u.mapState("data",["messages"]),waiting_title(){return this.props.waiting_title||"Warten auf den Usertask..."},waiting_info(){return this.props.waiting_info||"Der Usertask wird automatisch angezeigt, wenn ein entsprechender Task vorhanden ist."},submit_title(){return this.props.submit_title||"Submit your task"},cancel_title(){return this.props.cancel_title||"Cancel your task"}},mounted(){this.$socket.on("widget-load:"+this.id,t=>{this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.on("msg-input:"+this.id,t=>{if(t.payload.formFields){const r=t.payload.formFields.reduce((s,c)=>(s[c.id]=c.defaultValue||"",s),{});this.formData=r}else console.debug("No formFields in msg.payload",t.payload.formFields);this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.emit("widget-load",this.id)},unmounted(){var t,r;(t=this.$socket)==null||t.off("widget-load"+this.id),(r=this.$socket)==null||r.off("msg-input:"+this.id)},methods:{hasUserTask(){return this.messages&&this.messages[this.id]&&this.messages[this.id].payload.userTask},userTask(){return this.hasUserTask()?this.messages[this.id].payload.userTask:{}},fields(){return(this.hasUserTask()?this.userTask().userTaskConfig.formFields:[]).map(s=>({...s,component:k(s.type),items:h(s.type,s)}))},hasFields(){return this.hasUserTask&&this.userTask.userTaskConfig.formFields.length>0},send(t){this.$socket.emit("widget-action",this.id,t)},submit(){this.send({payload:{formData:this.formData,userTask:this.userTask(),action:"submit"}})},cancel(){this.send({payload:{formData:this.formData,userTask:this.userTask(),action:"cancel"}})}}};function h(t,r){return t==="enum"?r.enumValues.map(s=>({title:s.name,value:s.id})):null}function k(t){switch(t){case"string":return"v-text-field";case"long":case"date":return"v-text-field";case"enum":return"v-select";case"boolean":return"v-checkbox";case"text":return"v-text-field";case"select":return"v-select";case"checkbox":return"v-checkbox";case"radio":return"v-radio";case"switch":return"v-switch";case"slider":return"v-slider";case"time":return"v-time-picker";case"datetime":return"v-datetime-picker";case"color":return"v-color-picker";case"file":return"v-file-input";case"textarea":return"v-textarea";case"password":return"v-text-field";case"number":return"v-text-field";case"email":return"v-text-field";case"tel":return"v-text-field";case"url":return"v-text-field";default:return"v-text-field"}}const _={className:"dynamic-form-wrapper"},y={key:0},b={key:1};function x(t,r,s,c,n,i){const l=e.resolveComponent("v-col"),d=e.resolveComponent("v-row"),m=e.resolveComponent("v-btn"),w=e.resolveComponent("v-form"),C=e.resolveComponent("v-alert");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createCommentVNode(" Component must be wrapped in a block so props such as className and style can be passed in from parent "),e.createElementVNode("div",_,[i.hasFields?(e.openBlock(),e.createElementBlock("p",y,[e.createVNode(w,{ref:"form",modelValue:n.form,"onUpdate:modelValue":r[0]||(r[0]=o=>n.form=o)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.fields(),(o,T)=>(e.openBlock(),e.createBlock(d,{key:T},{default:e.withCtx(()=>[e.createVNode(l,{cols:"12"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),{id:o.id,modelValue:n.formData[o.id],"onUpdate:modelValue":V=>n.formData[o.id]=V,required:o.required,items:o.items,label:o.label},null,8,["id","modelValue","onUpdate:modelValue","required","items","label"]))]),_:2},1024)]),_:2},1024))),128)),e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(l,{cols:"6"},{default:e.withCtx(()=>[e.createVNode(m,{variant:"outlined",block:"",onClick:i.cancel},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.cancel_title),1)]),_:1},8,["onClick"])]),_:1}),e.createVNode(l,{cols:"6"},{default:e.withCtx(()=>[e.createVNode(m,{block:"",onClick:i.submit},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.submit_title),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])):(e.openBlock(),e.createElementBlock("p",b,[e.createVNode(C,{text:i.waiting_info,title:i.waiting_title},null,8,["text","title"])]))])],2112)}const g=p(f,[["render",x],["__scopeId","data-v-19b58e9c"],["__file","/Users/moellenbeck/projects/5minds/reps/node-red-dashboard-2-processcube-dynamic-form/ui/components/DynamicForm.vue"]]);a.DynamicForm=g,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}); +(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuex")):typeof define=="function"&&define.amd?define(["exports","vue","vuex"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i["dynamic-form"]={},i.Vue,i.vuex))})(this,function(i,e,p){"use strict";const u=(t,o)=>{const s=t.__vccOpts||t;for(const[a,r]of o)s[a]=r;return s},f={name:"DynamicForm",inject:["$socket"],props:{id:{type:String,required:!0},props:{type:Object,default:()=>({})},state:{type:Object,default:()=>({enabled:!1,visible:!1})}},setup(t){console.info("DynamicForm setup with:",t),console.debug("Vue function loaded correctly",e.markRaw)},data(){return{actions:[],form:{},formData:{}}},computed:{...p.mapState("data",["messages"]),waiting_title(){return this.props.waiting_title||"Warten auf den Usertask..."},waiting_info(){return this.props.waiting_info||"Der Usertask wird automatisch angezeigt, wenn ein entsprechender Task vorhanden ist."}},mounted(){this.$socket.on("widget-load:"+this.id,t=>{this.init(),this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.on("msg-input:"+this.id,t=>{if(this.init(),t.payload.formFields){const o=t.payload.formFields.reduce((s,a)=>(s[a.id]=a.defaultValue||"",s),{});this.formData=o}else console.debug("No formFields in msg.payload",t.payload.formFields);this.$store.commit("data/bind",{widgetId:this.id,msg:t})}),this.$socket.emit("widget-load",this.id)},unmounted(){var t,o;(t=this.$socket)==null||t.off("widget-load"+this.id),(o=this.$socket)==null||o.off("msg-input:"+this.id)},methods:{hasUserTask(){return this.messages&&this.messages[this.id]&&this.messages[this.id].payload.userTask},userTask(){return this.hasUserTask()?this.messages[this.id].payload.userTask:{}},fields(){return(this.hasUserTask()?this.userTask().userTaskConfig.formFields:[]).map(s=>({...s,component:k(s.type),items:h(s.type,s)}))},hasFields(){return console.info("luisss"),this.messages&&this.messages[this.id]&&this.messages[this.id].payload.userTask!==void 0},send(t,o){const s=[];s[o]=t,console.info(s),this.$socket.emit("widget-action",this.id,s)},init(){this.actions=this.props.options},actionFn(t){this.send({payload:{formData:this.formData,userTask:this.userTask()}},this.actions.findIndex(o=>o.label===t))}}};function h(t,o){return t==="enum"?o.enumValues.map(s=>({title:s.name,value:s.id})):null}function k(t){switch(t){case"string":return"v-text-field";case"long":case"date":return"v-text-field";case"enum":return"v-select";case"boolean":return"v-checkbox";case"text":return"v-text-field";case"select":return"v-select";case"checkbox":return"v-checkbox";case"radio":return"v-radio";case"switch":return"v-switch";case"slider":return"v-slider";case"time":return"v-time-picker";case"datetime":return"v-datetime-picker";case"color":return"v-color-picker";case"file":return"v-file-input";case"textarea":return"v-textarea";case"password":return"v-text-field";case"number":return"v-text-field";case"email":return"v-text-field";case"tel":return"v-text-field";case"url":return"v-text-field";default:return"v-text-field"}}const _={className:"dynamic-form-wrapper"},y={key:0},g={key:1};function x(t,o,s,a,r,l){const b=e.resolveComponent("v-col"),d=e.resolveComponent("v-row"),F=e.resolveComponent("v-btn"),B=e.resolveComponent("v-form"),T=e.resolveComponent("v-alert");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createCommentVNode(" Component must be wrapped in a block so props such as className and style can be passed in from parent "),e.createElementVNode("div",_,[l.hasFields()?(e.openBlock(),e.createElementBlock("p",y,[e.createVNode(B,{ref:"form",modelValue:r.form,"onUpdate:modelValue":o[0]||(o[0]=n=>r.form=n)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.fields(),(n,c)=>(e.openBlock(),e.createBlock(d,{key:c},{default:e.withCtx(()=>[e.createVNode(b,{cols:"12"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{id:n.id,modelValue:r.formData[n.id],"onUpdate:modelValue":m=>r.formData[n.id]=m,required:n.required,items:n.items,label:n.label},null,8,["id","modelValue","onUpdate:modelValue","required","items","label"]))]),_:2},1024)]),_:2},1024))),128)),e.createVNode(d,{style:{display:"flex",gap:"8px",padding:"12px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.actions,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,style:{"flex-grow":"1"}},[(e.openBlock(),e.createBlock(F,{key:c,style:{width:"100%"},onClick:m=>l.actionFn(n.label)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.label),1)]),_:2},1032,["onClick"]))]))),128))]),_:1})]),_:1},8,["modelValue"])])):(e.openBlock(),e.createElementBlock("p",g,[e.createVNode(T,{text:l.waiting_info,title:l.waiting_title},null,8,["text","title"])]))])],2112)}const w=u(f,[["render",x],["__scopeId","data-v-19b58e9c"],["__file","/Users/guestuser/5minds/Solutions/node-red/dashboard2/repos/node-red-dashboard-2-processcube-dynamic-form/ui/components/DynamicForm.vue"]]);i.DynamicForm=w,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=dynamic-form.umd.js.map diff --git a/resources/dynamic-form.umd.js.map b/resources/dynamic-form.umd.js.map index 826fae1..27648c2 100644 --- a/resources/dynamic-form.umd.js.map +++ b/resources/dynamic-form.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"dynamic-form.umd.js","sources":["../ui/components/DynamicForm.vue"],"sourcesContent":["\n\n\n\n\n"],"names":["_sfc_main","props","markRaw","mapState","msg","formData","acc","field","_a","_b","mapFieldTypes","mapItems","type","enumValue","fieldType","_hoisted_1","_openBlock","_createElementBlock","_Fragment","_createCommentVNode","_createElementVNode","$options","_hoisted_2","_createVNode","_component_v_form","$data","_cache","$event","_withCtx","_renderList","index","_createBlock","_component_v_row","_component_v_col","_resolveDynamicComponent","_component_v_btn","_createTextVNode","_toDisplayString","_hoisted_3","_component_v_alert"],"mappings":"+WAsCKA,EAAU,CACX,KAAM,cACN,OAAQ,CAAC,SAAS,EAClB,MAAO,CAEH,GAAI,CAAE,KAAM,OAAQ,SAAU,EAAM,EACpC,MAAO,CAAE,KAAM,OAAQ,QAAS,KAAO,CAAE,EAAG,EAC5C,MAAO,CAAE,KAAM,OAAQ,QAAS,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A,CAFD,KAAK,GAAG,EAAA,CAnBnC,QAAAL,EAAA,QAoBwB,IAA0E,CAA1EL,EAAAA,YAA0EY,EAAA,CAAnE,QAAQ,WAAW,MAAA,GAAO,QAAOd,EAAM,SApBtE,QAAAO,EAAA,QAoBwE,IAAkB,CApB1FQ,EAAAA,gBAAAC,EAAAA,gBAoB2EhB,EAAY,YAAA,EAAA,CAAA,IApBvF,EAAA,oBAAA,EAAA,IAsBoBE,EAAAA,YAEQU,EAAA,CAFD,KAAK,GAAG,EAAA,CAtBnC,QAAAL,EAAA,QAuBwB,IAAuD,CAAvDL,EAAAA,YAAuDY,EAAA,CAAhD,MAAA,GAAO,QAAOd,EAAM,SAvBnD,QAAAO,EAAA,QAuBqD,IAAkB,CAvBvEQ,EAAAA,gBAAAC,EAAAA,gBAuBwDhB,EAAY,YAAA,EAAA,CAAA,IAvBpE,EAAA,oBAAA,EAAA,MAAA,EAAA,MAAA,EAAA,yBA4BQL,EAAAA,YAAAC,EAAAA,mBAEI,IA9BZqB,EAAA,CA6BYf,EAAAA,YAAuDgB,EAAA,CAA7C,KAAMlB,EAAY,aAAG,MAAOA,EAAa"} \ No newline at end of file +{"version":3,"file":"dynamic-form.umd.js","sources":["../ui/components/DynamicForm.vue"],"sourcesContent":["\n\n\n\n\n"],"names":["_sfc_main","props","markRaw","mapState","msg","formData","acc","field","_a","_b","mapFieldTypes","mapItems","index","msgArr","action","element","type","enumValue","fieldType","_hoisted_1","_openBlock","_createElementBlock","_Fragment","_createCommentVNode","_createElementVNode","$options","_hoisted_2","_createVNode","_component_v_form","$data","_cache","$event","_withCtx","_renderList","_createBlock","_component_v_row","_component_v_col","_resolveDynamicComponent","_component_v_btn","_createTextVNode","_toDisplayString","_hoisted_3","_component_v_alert"],"mappings":"+WA0CKA,EAAU,CACb,KAAM,cACN,OAAQ,CAAC,SAAS,EAClB,MAAO,CAEL,GAAI,CAAE,KAAM,OAAQ,SAAU,EAAM,EACpC,MAAO,CAAE,KAAM,OAAQ,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EAAM,MACb,MAAOA,EAAM,uFAb5B,EAAA,WAAA,EAAA,iBAiBQoB,EAAAA,YAYQQ,EAAA,CAZD,MAAA,CAA8C,QAAA,OAAA,IAAA,MAAA,QAAA,MAAA,CAAA,EAAA,CAjB7D,QAAAH,EAAA,QAmBY,IAAkC,EADpCZ,EAAAA,UAAA,EAAA,EAAAC,EAAA,mBAUMC,gBA5BhBW,EAmBsC,WAAAJ,EAAA,QAnBtC,CAmBoBf,EAAQF,mBADlBS,EAUM,mBAAA,MAAA,CARH,IAAKT,EACN,MAAA,CAAoB,YAAA,GAAA,mBACpBsB,EAKQ,YAAAI,EAAA,CAJL,IAAK1B,EACN,MAAA,CAAmB,MAAA,MAAA,EAClB,QAAOmB,GAAAN,EAAA,SAASX,EAAO,KAAK,IAzB3C,QAAAkB,EAAA,QA0Bc,IAAkB,CA1BhCO,EAAAA,gBA0BiBC,EAAAA,gBAAA1B,EAAO,KAAK,EAAA,CAAA,IA1B7B,EAAA,kCAAA,EAAA,MAAA,EAAA,yBAgCIM,EAAAA,YAAAC,EAAAA,mBAEI,IAlCRoB,EAAA,CAiCMd,EAAAA,YAAuDe,EAAA,CAA7C,KAAMjB,EAAY,aAAG,MAAOA,EAAa"} \ No newline at end of file diff --git a/ui/components/DynamicForm.vue b/ui/components/DynamicForm.vue index 2dac378..e8ad09b 100644 --- a/ui/components/DynamicForm.vue +++ b/ui/components/DynamicForm.vue @@ -1,208 +1,229 @@