Skip to content

Commit b758843

Browse files
authored
Merge branch 'develop' into feature/VULCAN-126-fix
2 parents 25dee21 + 2d030a4 commit b758843

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2033
-1017
lines changed
Loading
98.2 KB
Loading

docs/modules/ROOT/pages/user-guide/reports/table.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,22 @@ following style rules can be applied to the table:
7373
- The text color of a single cell in the table.
7474

7575
If a column is hidden (header prefixed with __ double underscore), it can still be used as an entry point for a styling rule.
76+
77+
== Report Actions
78+
79+
With the link:../../extensions/report-actions[Report Actions] extension, tables can be turned into interactive components that set parameters.
80+
Two flavours of report actions for tables exist:
81+
82+
=== 1. Select a value from a row
83+
Adding a **Cell Click** action to a table column, turns the values in that row into clickable buttons.
84+
When the user clicks on the button, a predefined parameter is set to one of the columns in that row.
85+
86+
image::select-single-table.png[Select a value from a table to be used as a parameter]
87+
88+
=== 2. Select multiple from a row
89+
Adding a **Row Clicked** action to a table prepends each row with a checkbox.
90+
The user can then check one or more boxes to update a dashboard parameter.
91+
92+
> Keep in mind that regardless if one or more values are selected, the type of the dashboard parameter is a list of values. The queries using the parameter must ensure that the list type is handled correctly.
93+
94+
image::select-multiple-table.png[Select multiple values to be used as a parameter]

gallery/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"devDependencies": {
3535
"autoprefixer": "^10.4.12",
36-
"postcss": "^8.4.17",
36+
"postcss": "^8.4.31",
3737
"tailwindcss": "^3.1.8"
3838
}
3939
}

gallery/yarn.lock

Lines changed: 104 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
dependencies:
2727
"@babel/highlight" "^7.18.6"
2828

29+
"@babel/code-frame@^7.22.13":
30+
version "7.22.13"
31+
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e"
32+
integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==
33+
dependencies:
34+
"@babel/highlight" "^7.22.13"
35+
chalk "^2.4.2"
36+
2937
"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.4":
3038
version "7.21.4"
3139
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.4.tgz#457ffe647c480dff59c2be092fc3acf71195c87f"
@@ -71,6 +79,16 @@
7179
"@jridgewell/trace-mapping" "^0.3.17"
7280
jsesc "^2.5.1"
7381

82+
"@babel/generator@^7.23.0":
83+
version "7.23.0"
84+
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420"
85+
integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==
86+
dependencies:
87+
"@babel/types" "^7.23.0"
88+
"@jridgewell/gen-mapping" "^0.3.2"
89+
"@jridgewell/trace-mapping" "^0.3.17"
90+
jsesc "^2.5.1"
91+
7492
"@babel/helper-annotate-as-pure@^7.18.6":
7593
version "7.18.6"
7694
resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb"
@@ -136,6 +154,11 @@
136154
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be"
137155
integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==
138156

157+
"@babel/helper-environment-visitor@^7.22.20":
158+
version "7.22.20"
159+
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167"
160+
integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==
161+
139162
"@babel/helper-explode-assignable-expression@^7.18.6":
140163
version "7.18.6"
141164
resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096"
@@ -151,13 +174,28 @@
151174
"@babel/template" "^7.20.7"
152175
"@babel/types" "^7.21.0"
153176

177+
"@babel/helper-function-name@^7.23.0":
178+
version "7.23.0"
179+
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759"
180+
integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==
181+
dependencies:
182+
"@babel/template" "^7.22.15"
183+
"@babel/types" "^7.23.0"
184+
154185
"@babel/helper-hoist-variables@^7.18.6":
155186
version "7.18.6"
156187
resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678"
157188
integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==
158189
dependencies:
159190
"@babel/types" "^7.18.6"
160191

192+
"@babel/helper-hoist-variables@^7.22.5":
193+
version "7.22.5"
194+
resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb"
195+
integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==
196+
dependencies:
197+
"@babel/types" "^7.22.5"
198+
161199
"@babel/helper-member-expression-to-functions@^7.20.7", "@babel/helper-member-expression-to-functions@^7.21.0":
162200
version "7.21.0"
163201
resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz#319c6a940431a133897148515877d2f3269c3ba5"
@@ -241,16 +279,33 @@
241279
dependencies:
242280
"@babel/types" "^7.18.6"
243281

282+
"@babel/helper-split-export-declaration@^7.22.6":
283+
version "7.22.6"
284+
resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c"
285+
integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==
286+
dependencies:
287+
"@babel/types" "^7.22.5"
288+
244289
"@babel/helper-string-parser@^7.19.4":
245290
version "7.19.4"
246291
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63"
247292
integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==
248293

294+
"@babel/helper-string-parser@^7.22.5":
295+
version "7.22.5"
296+
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f"
297+
integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==
298+
249299
"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1":
250300
version "7.19.1"
251301
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
252302
integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==
253303

304+
"@babel/helper-validator-identifier@^7.22.20":
305+
version "7.22.20"
306+
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0"
307+
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==
308+
254309
"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.21.0":
255310
version "7.21.0"
256311
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180"
@@ -284,11 +339,25 @@
284339
chalk "^2.0.0"
285340
js-tokens "^4.0.0"
286341

342+
"@babel/highlight@^7.22.13":
343+
version "7.22.20"
344+
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54"
345+
integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==
346+
dependencies:
347+
"@babel/helper-validator-identifier" "^7.22.20"
348+
chalk "^2.4.2"
349+
js-tokens "^4.0.0"
350+
287351
"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.4":
288352
version "7.21.4"
289353
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17"
290354
integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==
291355

356+
"@babel/parser@^7.22.15", "@babel/parser@^7.23.0":
357+
version "7.23.0"
358+
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719"
359+
integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==
360+
292361
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6":
293362
version "7.18.6"
294363
resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2"
@@ -1049,19 +1118,28 @@
10491118
"@babel/parser" "^7.20.7"
10501119
"@babel/types" "^7.20.7"
10511120

1052-
"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.4", "@babel/traverse@^7.7.2":
1053-
version "7.21.4"
1054-
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36"
1055-
integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==
1121+
"@babel/template@^7.22.15":
1122+
version "7.22.15"
1123+
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38"
1124+
integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==
10561125
dependencies:
1057-
"@babel/code-frame" "^7.21.4"
1058-
"@babel/generator" "^7.21.4"
1059-
"@babel/helper-environment-visitor" "^7.18.9"
1060-
"@babel/helper-function-name" "^7.21.0"
1061-
"@babel/helper-hoist-variables" "^7.18.6"
1062-
"@babel/helper-split-export-declaration" "^7.18.6"
1063-
"@babel/parser" "^7.21.4"
1064-
"@babel/types" "^7.21.4"
1126+
"@babel/code-frame" "^7.22.13"
1127+
"@babel/parser" "^7.22.15"
1128+
"@babel/types" "^7.22.15"
1129+
1130+
"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.4", "@babel/traverse@^7.7.2":
1131+
version "7.23.2"
1132+
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8"
1133+
integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==
1134+
dependencies:
1135+
"@babel/code-frame" "^7.22.13"
1136+
"@babel/generator" "^7.23.0"
1137+
"@babel/helper-environment-visitor" "^7.22.20"
1138+
"@babel/helper-function-name" "^7.23.0"
1139+
"@babel/helper-hoist-variables" "^7.22.5"
1140+
"@babel/helper-split-export-declaration" "^7.22.6"
1141+
"@babel/parser" "^7.23.0"
1142+
"@babel/types" "^7.23.0"
10651143
debug "^4.1.0"
10661144
globals "^11.1.0"
10671145

@@ -1074,6 +1152,15 @@
10741152
"@babel/helper-validator-identifier" "^7.19.1"
10751153
to-fast-properties "^2.0.0"
10761154

1155+
"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0":
1156+
version "7.23.0"
1157+
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb"
1158+
integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==
1159+
dependencies:
1160+
"@babel/helper-string-parser" "^7.22.5"
1161+
"@babel/helper-validator-identifier" "^7.22.20"
1162+
to-fast-properties "^2.0.0"
1163+
10771164
"@bcoe/v8-coverage@^0.2.3":
10781165
version "0.2.3"
10791166
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
@@ -3068,7 +3155,7 @@ case-sensitive-paths-webpack-plugin@^2.4.0:
30683155
resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4"
30693156
integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==
30703157

3071-
chalk@^2.0.0, chalk@^2.4.1:
3158+
chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2:
30723159
version "2.4.2"
30733160
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
30743161
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -7487,10 +7574,10 @@ postcss@^7.0.35:
74877574
picocolors "^0.2.1"
74887575
source-map "^0.6.1"
74897576

7490-
postcss@^8.0.9, postcss@^8.3.5, postcss@^8.4.17, postcss@^8.4.19, postcss@^8.4.4:
7491-
version "8.4.23"
7492-
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.23.tgz#df0aee9ac7c5e53e1075c24a3613496f9e6552ab"
7493-
integrity sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==
7577+
postcss@^8.0.9, postcss@^8.3.5, postcss@^8.4.19, postcss@^8.4.31, postcss@^8.4.4:
7578+
version "8.4.31"
7579+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d"
7580+
integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==
74947581
dependencies:
74957582
nanoid "^3.3.6"
74967583
picocolors "^1.0.0"

public/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
border: none !important;
8787
}
8888

89+
.MuiDataGrid-footerContainer > div {
90+
margin-top: -40px;
91+
}
92+
8993
.MuiChip-root:before {
9094
border: none !important;
9195
}

src/application/Application.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ const mapDispatchToProps = (dispatch) => ({
214214
dispatch(setConnected(false));
215215
dispatch(createConnectionFromDesktopIntegrationThunk());
216216
},
217-
loadDashboard: (text) => {
217+
loadDashboard: (uuid, text) => {
218218
dispatch(clearNotification());
219-
dispatch(loadDashboardThunk(text));
219+
dispatch(loadDashboardThunk(uuid, text));
220220
},
221221
resetDashboard: () => dispatch(resetDashboardState()),
222222
clearOldDashboard: () => dispatch(setOldDashboard(null)),

src/application/ApplicationActions.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ export const setConnected = (connected: boolean) => ({
2020
payload: { connected },
2121
});
2222

23+
export const SET_DRAFT = 'APPLICATION/SET_DRAFT';
24+
export const setDraft = (draft: boolean) => ({
25+
type: SET_DRAFT,
26+
payload: { draft },
27+
});
28+
2329
export const SET_CONNECTION_MODAL_OPEN = 'APPLICATION/SET_CONNECTION_MODAL_OPEN';
2430
export const setConnectionModalOpen = (open: boolean) => ({
2531
type: SET_CONNECTION_MODAL_OPEN,

src/application/ApplicationReducer.ts

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
* Reducers define changes to the application state when a given action is taken.
33
*/
44

5+
import { HARD_RESET_CARD_SETTINGS, UPDATE_ALL_SELECTIONS, UPDATE_FIELDS, UPDATE_SCHEMA } from '../card/CardActions';
56
import { DEFAULT_NEO4J_URL } from '../config/ApplicationConfig';
7+
import { SET_DASHBOARD, SET_DASHBOARD_UUID } from '../dashboard/DashboardActions';
8+
import { UPDATE_DASHBOARD_SETTING } from '../settings/SettingsActions';
69
import {
710
CLEAR_DESKTOP_CONNECTION_PROPERTIES,
811
CLEAR_NOTIFICATION,
@@ -15,6 +18,7 @@ import {
1518
SET_CONNECTION_PROPERTIES,
1619
SET_DASHBOARD_TO_LOAD_AFTER_CONNECTING,
1720
SET_DESKTOP_CONNECTION_PROPERTIES,
21+
SET_DRAFT,
1822
SET_OLD_DASHBOARD,
1923
SET_PARAMETERS_TO_LOAD_AFTER_CONNECTING,
2024
SET_REPORT_HELP_MODAL_OPEN,
@@ -36,6 +40,7 @@ const initialState = {
3640
notificationMessage: null,
3741
connectionModalOpen: false,
3842
welcomeScreenOpen: true,
43+
draft: false,
3944
aboutModalOpen: false,
4045
connection: {
4146
protocol: 'neo4j',
@@ -55,6 +60,25 @@ const initialState = {
5560
export const applicationReducer = (state = initialState, action: { type: any; payload: any }) => {
5661
const { type, payload } = action;
5762

63+
// This is a special application-level flag used to determine whether the dashboard needs to be saved to the database.
64+
if (action.type.startsWith('DASHBOARD/') || action.type.startsWith('PAGE/') || action.type.startsWith('CARD/')) {
65+
// if anything changes EXCEPT for the selected page, we flag that we are drafting a dashboard.
66+
const NON_TRANSFORMATIVE_ACTIONS = [
67+
UPDATE_DASHBOARD_SETTING,
68+
UPDATE_SCHEMA,
69+
HARD_RESET_CARD_SETTINGS,
70+
SET_DASHBOARD,
71+
UPDATE_ALL_SELECTIONS,
72+
UPDATE_FIELDS,
73+
SET_DASHBOARD_UUID,
74+
];
75+
if (!state.draft && !NON_TRANSFORMATIVE_ACTIONS.includes(type)) {
76+
state = update(state, { draft: true });
77+
return state;
78+
}
79+
}
80+
81+
// Ignore any non-application actions.
5882
if (!action.type.startsWith('APPLICATION/')) {
5983
return state;
6084
}
@@ -75,16 +99,18 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
7599
state = update(state, { connected: connected });
76100
return state;
77101
}
102+
case SET_DRAFT: {
103+
const { draft } = payload;
104+
state = update(state, { draft: draft });
105+
return state;
106+
}
78107
case SET_CONNECTION_MODAL_OPEN: {
79108
const { open } = payload;
80109
state = update(state, { connectionModalOpen: open });
81110
return state;
82111
}
83112
case SET_ABOUT_MODAL_OPEN: {
84113
const { open } = payload;
85-
if (!open) {
86-
console.log('');
87-
}
88114
state = update(state, { aboutModalOpen: open });
89115
return state;
90116
}

src/application/ApplicationSelectors.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export const getNotificationTitle = (state: any) => {
2121
return state.application.notificationTitle;
2222
};
2323

24+
export const dashboardIsDraft = (state: any) => {
25+
return state.application.draft;
26+
};
27+
2428
export const applicationIsConnected = (state: any) => {
2529
return state.application.connected;
2630
};

0 commit comments

Comments
 (0)