Skip to content

Commit

Permalink
Merge pull request #1408 from FlowFuse/1407-ui-table---data-is-always…
Browse files Browse the repository at this point in the history
…-replaced-even-if-action-is-append

Set node config action to append if it's not defined
  • Loading branch information
joepavitt authored Oct 22, 2024
2 parents 782c463 + 63bea01 commit 9617edc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cypress/fixtures/flows/dashboard-tables.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"group": "dashboard-ui-group",
"name": "Default",
"label": "text",
"action": "replace",
"order": 0,
"width": 0,
"height": 0,
Expand Down Expand Up @@ -77,6 +78,7 @@
"group": "dashboard-ui-group",
"name": "Max Rows: 2",
"label": "text",
"action": "replace",
"order": 0,
"width": 0,
"height": 0,
Expand All @@ -100,6 +102,7 @@
"group": "dashboard-ui-group",
"name": "Single Row Selection",
"label": "text",
"action": "replace",
"order": 0,
"width": 0,
"height": 0,
Expand All @@ -123,6 +126,7 @@
"group": "dashboard-ui-group",
"name": "Single Row Selection",
"label": "text",
"action": "replace",
"order": 0,
"width": 0,
"height": 0,
Expand All @@ -146,6 +150,7 @@
"group": "dashboard-ui-group",
"name": "dashboard-ui-table-table-buttons-string-value",
"label": "dashboard-ui-table-table-buttons-string-value",
"action": "replace",
"order": 0,
"width": 0,
"height": 0,
Expand Down Expand Up @@ -195,6 +200,7 @@
"group": "dashboard-ui-group",
"name": "dashboard-ui-table-buttons-text-from-payload",
"label": "text",
"action": "replace",
"order": 0,
"width": 0,
"height": 0,
Expand Down
4 changes: 4 additions & 0 deletions nodes/widgets/ui_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ module.exports = function (RED) {
})
}

if (!config.action || typeof config.action === 'undefined') {
config.action = 'append'
}

// inform the dashboard UI that we are adding this node
group.register(node, config, {
onAction: true,
Expand Down

0 comments on commit 9617edc

Please sign in to comment.