From fae668e93c1520ddf22ff09537630addf4bb7f00 Mon Sep 17 00:00:00 2001 From: luisthieme Date: Mon, 19 Aug 2024 08:52:41 +0200 Subject: [PATCH 01/14] remove need for default validation condition --- ui/components/UIDynamicForm.vue | 1 + ui/index.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/components/UIDynamicForm.vue b/ui/components/UIDynamicForm.vue index b08b9d2..789e2bb 100644 --- a/ui/components/UIDynamicForm.vue +++ b/ui/components/UIDynamicForm.vue @@ -159,6 +159,7 @@ export default { } }, checkCondition(condition) { + if (condition == '') return true; try { const func = Function('fields', 'userTask', 'msg', '"use strict"; return (' + condition + ')'); const result = func(this.formData, this.taskInput, this.msg); diff --git a/ui/index.js b/ui/index.js index c6a65dd..e180c60 100644 --- a/ui/index.js +++ b/ui/index.js @@ -1,2 +1,12 @@ /* Exports of all of the components in this node */ -export { default as UIDynamicForm } from './components/UIDynamicForm.vue' \ No newline at end of file +// NEW +// export { default as UIDynamicForm } from './components/UIDynamicForm.vue' + +// OLD +import UIDynamicForm from './components/UIDynamicForm.vue'; + +export { UIDynamicForm }; + +export default { + 'ui-dynamic-form': UIDynamicForm, +}; From a80d27c0320bcfc8727c34234deaf2c3c39d2977 Mon Sep 17 00:00:00 2001 From: luisthieme Date: Mon, 19 Aug 2024 09:00:45 +0200 Subject: [PATCH 02/14] change back to new export --- ui/index.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ui/index.js b/ui/index.js index e180c60..9352568 100644 --- a/ui/index.js +++ b/ui/index.js @@ -1,12 +1,2 @@ /* Exports of all of the components in this node */ -// NEW -// export { default as UIDynamicForm } from './components/UIDynamicForm.vue' - -// OLD -import UIDynamicForm from './components/UIDynamicForm.vue'; - -export { UIDynamicForm }; - -export default { - 'ui-dynamic-form': UIDynamicForm, -}; +export { default as UIDynamicForm } from './components/UIDynamicForm.vue'; From 440ff6821a84978d631ba0dce6313a7768269472 Mon Sep 17 00:00:00 2001 From: luisthieme Date: Wed, 21 Aug 2024 15:34:18 +0200 Subject: [PATCH 03/14] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index efc433c..a9ab120 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@5minds/node-red-dashboard-2-processcube-dynamic-form", - "version": "1.0.21", + "version": "1.0.22", "description": "The ui component for the ProcessCube dynamic-form", "keywords": [ "processcube", From b79315101dbdffd24fd34f883a84d104426a1899 Mon Sep 17 00:00:00 2001 From: ProcessEngine Bot Date: Wed, 21 Aug 2024 13:36:20 +0000 Subject: [PATCH 04/14] Release v1.0.22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Changelog v1.0.22 (2024-08-21) This changelog covers the changes between [v1.0.21 and v1.0.22](https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form/compare/v1.0.21...v1.0.22). For further reference, please refer to the changelog of the previous version, [v1.0.21](https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form/releases/tag/v1.0.21). ## Merged Pull Requests - #5 Entfernt Notwendigkeit für Default Condition (merged 2024-08-21) - #6 Erlaubt benutzen von Default Values (merged 2024-08-20) ## Corresponding Issues - #4 `ui-dynamic-form` - `FormFields.defaultValue wird nicht berücksichtigt - #3 `ui-dynamic-form` - Condition sollte optional sein. [skip ci] From 794808f8532c5a71b69fdbda5200d589f775faf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6llenbeck?= Date: Mon, 26 Aug 2024 20:00:05 +0200 Subject: [PATCH 05/14] handling message with userid --- package.json | 2 +- ui/components/UIDynamicForm.vue | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a9ab120..0e571e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@5minds/node-red-dashboard-2-processcube-dynamic-form", - "version": "1.0.22", + "version": "1.0.23", "description": "The ui component for the ProcessCube dynamic-form", "keywords": [ "processcube", diff --git a/ui/components/UIDynamicForm.vue b/ui/components/UIDynamicForm.vue index f20301e..173529e 100644 --- a/ui/components/UIDynamicForm.vue +++ b/ui/components/UIDynamicForm.vue @@ -89,7 +89,8 @@ export default { // store the latest message in our client-side vuex store when we receive a new message this.init(); - this.msg = msg; + // TODO: MM - this.msg = msg; + this.messages[this.id] = msg; const hasTask = msg.payload && msg.payload.userTask; const defaultValues = msg.payload.userTask.userTaskConfig.formFields; @@ -160,10 +161,18 @@ export default { actionFn(action) { if (this.checkCondition(action.condition)) { this.showError(false, ''); + // TODO: MM - begin + // this.send( + // { payload: { formData: this.formData, userTask: this.userTask() } }, + // this.actions.findIndex((element) => element.label === action.label) + // ); + const msg = this.messages[this.id] || {}; + msg.payload = { formData: this.formData, userTask: this.userTask() }; this.send( - { payload: { formData: this.formData, userTask: this.userTask() } }, + msg, this.actions.findIndex((element) => element.label === action.label) ); + // TODO: mm - end } else { this.showError(true, action.errorMessage); } From 0eaba66628ae39c638485ff8187d1266f54b8515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6llenbeck?= Date: Mon, 26 Aug 2024 22:55:50 +0200 Subject: [PATCH 06/14] inject --- ui/components/UIDynamicForm.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/components/UIDynamicForm.vue b/ui/components/UIDynamicForm.vue index 173529e..2d3b2fb 100644 --- a/ui/components/UIDynamicForm.vue +++ b/ui/components/UIDynamicForm.vue @@ -39,7 +39,7 @@ import { mapState } from 'vuex'; export default { name: 'UIDynamicForm', - inject: ['$socket'], + inject: ['$socket', '$dataTracker'], // TODO: mm - '$dataTracker' props: { /* do not remove entries from this - Dashboard's Layout Manager's will pass this data to your component */ id: { type: String, required: true }, @@ -76,6 +76,9 @@ export default { ); }, }, + created () { + this.$dataTracker(this.id) + }, mounted() { this.$socket.on('widget-load:' + this.id, (msg) => { this.init(); From 6a751564d404c95fcc2762a89cfd55ffa013cdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6llenbeck?= Date: Mon, 26 Aug 2024 22:58:42 +0200 Subject: [PATCH 07/14] Fix url to repo --- package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0e571e4..ed0d30b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/5minds/.gitnode-red-dashboard-2-processcube-dynamic-form" + "url": "https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form" }, "license": "Apache-2.0", "author": { @@ -25,7 +25,11 @@ { "name": "Luis Thieme", "url": "https://github.com/luisthieme" - } + }, + { + "name": "Colin Law", + "url": "https://github.com/colinl" + }, ], "exports": { "import": "./resources/ui-dynamic-form.esm.js", From afa9d39d2bcd307fb2760a0a51077e405b85007f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6llenbeck?= Date: Mon, 26 Aug 2024 23:01:25 +0200 Subject: [PATCH 08/14] Fix url to repo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ed0d30b..8e60808 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ { "name": "Colin Law", "url": "https://github.com/colinl" - }, + } ], "exports": { "import": "./resources/ui-dynamic-form.esm.js", From 2ef82420c980264b906d5f089c80290a4e430819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6llenbeck?= Date: Mon, 26 Aug 2024 23:32:55 +0200 Subject: [PATCH 09/14] Remove OnSocket evt --- nodes/ui-dynamic-form.js | 24 +++++++++++++----------- ui/components/UIDynamicForm.vue | 5 +---- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/nodes/ui-dynamic-form.js b/nodes/ui-dynamic-form.js index 16ada2d..fc30a4c 100644 --- a/nodes/ui-dynamic-form.js +++ b/nodes/ui-dynamic-form.js @@ -16,17 +16,19 @@ module.exports = function (RED) { // store the latest value in our Node-RED datastore base.stores.data.save(base, node, msg); }, - onSocket: { - 'my-custom-event': function (conn, id, msg) { - console.info('"my-custom-event" received:', conn.id, id, msg); - console.info('conn.id:', conn.id); - console.info('id:', id); - console.info('msg:', msg); - console.info('node.id:', node.id); - // emit a msg in Node-RED from this node - node.send(msg); - }, - }, + // TODO: mm - begin + // onSocket: { + // 'my-custom-event': function (conn, id, msg) { + // console.info('"my-custom-event" received:', conn.id, id, msg); + // console.info('conn.id:', conn.id); + // console.info('id:', id); + // console.info('msg:', msg); + // console.info('node.id:', node.id); + // // emit a msg in Node-RED from this node + // node.send(msg); + // }, + //}, + // TODO: mm - end }; // inform the dashboard UI that we are adding this node diff --git a/ui/components/UIDynamicForm.vue b/ui/components/UIDynamicForm.vue index 2d3b2fb..173529e 100644 --- a/ui/components/UIDynamicForm.vue +++ b/ui/components/UIDynamicForm.vue @@ -39,7 +39,7 @@ import { mapState } from 'vuex'; export default { name: 'UIDynamicForm', - inject: ['$socket', '$dataTracker'], // TODO: mm - '$dataTracker' + inject: ['$socket'], props: { /* do not remove entries from this - Dashboard's Layout Manager's will pass this data to your component */ id: { type: String, required: true }, @@ -76,9 +76,6 @@ export default { ); }, }, - created () { - this.$dataTracker(this.id) - }, mounted() { this.$socket.on('widget-load:' + this.id, (msg) => { this.init(); From 14de986758679c49c1d5cb09378317567945aff1 Mon Sep 17 00:00:00 2001 From: Robin Lenz Date: Tue, 27 Aug 2024 07:44:38 +0200 Subject: [PATCH 10/14] add dataTracker --- ui/components/UIDynamicForm.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/components/UIDynamicForm.vue b/ui/components/UIDynamicForm.vue index 173529e..a7fa144 100644 --- a/ui/components/UIDynamicForm.vue +++ b/ui/components/UIDynamicForm.vue @@ -39,7 +39,7 @@ import { mapState } from 'vuex'; export default { name: 'UIDynamicForm', - inject: ['$socket'], + inject: ['$socket', '$dataTracker'], props: { /* do not remove entries from this - Dashboard's Layout Manager's will pass this data to your component */ id: { type: String, required: true }, @@ -49,6 +49,9 @@ export default { default: () => ({ enabled: false, visible: false }), }, }, + created() { + this.$dataTracker(this.id); + }, setup(props) { console.info('UIDynamicForm setup with:', props); console.debug('Vue function loaded correctly', markRaw); @@ -89,8 +92,6 @@ export default { // store the latest message in our client-side vuex store when we receive a new message this.init(); - // TODO: MM - this.msg = msg; - this.messages[this.id] = msg; const hasTask = msg.payload && msg.payload.userTask; const defaultValues = msg.payload.userTask.userTaskConfig.formFields; From e0743006dc46209496dbeba4e2b01d6c38170566 Mon Sep 17 00:00:00 2001 From: ProcessEngine Bot Date: Tue, 27 Aug 2024 05:59:30 +0000 Subject: [PATCH 11/14] Release v1.0.23 # Changelog v1.0.23 (2024-08-27) This changelog covers the changes between [v1.0.22 and v1.0.23](https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form/compare/v1.0.22...v1.0.23). For further reference, please refer to the changelog of the previous version, [v1.0.22](https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form/releases/tag/v1.0.22). ## Merged Pull Requests - none ## Corresponding Issues - none [skip ci] From 9c82858a3d8f92246ee88ae7db80f08293cde1a1 Mon Sep 17 00:00:00 2001 From: Robin Lenz Date: Tue, 27 Aug 2024 09:22:23 +0200 Subject: [PATCH 12/14] init messages --- ui/components/UIDynamicForm.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/components/UIDynamicForm.vue b/ui/components/UIDynamicForm.vue index a7fa144..e5a5d37 100644 --- a/ui/components/UIDynamicForm.vue +++ b/ui/components/UIDynamicForm.vue @@ -39,7 +39,7 @@ import { mapState } from 'vuex'; export default { name: 'UIDynamicForm', - inject: ['$socket', '$dataTracker'], + inject: ['$socket'], props: { /* do not remove entries from this - Dashboard's Layout Manager's will pass this data to your component */ id: { type: String, required: true }, @@ -49,9 +49,6 @@ export default { default: () => ({ enabled: false, visible: false }), }, }, - created() { - this.$dataTracker(this.id); - }, setup(props) { console.info('UIDynamicForm setup with:', props); console.debug('Vue function loaded correctly', markRaw); @@ -92,6 +89,7 @@ export default { // store the latest message in our client-side vuex store when we receive a new message this.init(); + this.messages[this.id] = msg; const hasTask = msg.payload && msg.payload.userTask; const defaultValues = msg.payload.userTask.userTaskConfig.formFields; From 154c054fe8221e172c66ea731ede8059767c351b Mon Sep 17 00:00:00 2001 From: Robin Lenz Date: Tue, 27 Aug 2024 09:22:51 +0200 Subject: [PATCH 13/14] bump deployment to 1.0.24 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9835985..03b6a2b 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.21", + "version": "1.0.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@5minds/node-red-dashboard-2-processcube-dynamic-form", - "version": "1.0.21", + "version": "1.0.24", "license": "Apache-2.0", "dependencies": { "to-title-case": "^1.0.0", diff --git a/package.json b/package.json index 8e60808..5a93f05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@5minds/node-red-dashboard-2-processcube-dynamic-form", - "version": "1.0.23", + "version": "1.0.24", "description": "The ui component for the ProcessCube dynamic-form", "keywords": [ "processcube", From 3d5d58515794d041135d3985db5127f20b39b9a8 Mon Sep 17 00:00:00 2001 From: ProcessEngine Bot Date: Tue, 27 Aug 2024 07:23:23 +0000 Subject: [PATCH 14/14] Release v1.0.24 # Changelog v1.0.24 (2024-08-27) This changelog covers the changes between [v1.0.23 and v1.0.24](https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form/compare/v1.0.23...v1.0.24). For further reference, please refer to the changelog of the previous version, [v1.0.23](https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form/releases/tag/v1.0.23). ## Merged Pull Requests - none ## Corresponding Issues - none [skip ci]