Skip to content

Commit 3742393

Browse files
VULCAN-126/Override default message (#683)
* Override default message * Refactored code * refactored code * Added docs --------- Co-authored-by: Monish <[email protected]>
1 parent 295857b commit 3742393

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ that the graph can be explored further. Dynamic Dashboard Parameters
127127
|Hide Selections |on/off |off |If enabled, hides the property selector
128128
(footer of the visualization).
129129

130+
|Override no data message |Text |Query returned no data. |Override the message displayed to the user when their query returns no data.
131+
130132
|Auto-run query |on/off |on |when activated automatically runs the query
131133
when the report is displayed. When set to `off', the query is displayed
132134
and will need to be executed manually.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ set to ``[2, 1, 1]''.
5454
the bottom right of the table footer. This button lets the user download
5555
the complete set of table results (all pages) as a CSV file.
5656

57+
|Override no data message |Text |Query returned no data. |Override the message displayed to the user when their query returns no data.
58+
5759
|Auto-run query |on/off |on |when activated automatically runs the query
5860
when the report is displayed. When set to `off', the query is displayed
5961
and will need to be executed manually.

src/config/ReportConfig.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ const _REPORT_TYPES = {
9292
type: SELECTION_TYPES.NUMBER,
9393
default: '0 (No refresh)',
9494
},
95+
noDataMessage: {
96+
label: 'Override no data message',
97+
type: SELECTION_TYPES.TEXT,
98+
default: 'Query returned no data.',
99+
},
95100
},
96101
},
97102
graph: {
@@ -184,7 +189,6 @@ const _REPORT_TYPES = {
184189
type: SELECTION_TYPES.TEXT,
185190
default: 'width',
186191
},
187-
188192
relationshipParticles: {
189193
label: 'Animated particles on Relationships',
190194
type: SELECTION_TYPES.LIST,
@@ -302,6 +306,11 @@ const _REPORT_TYPES = {
302306
values: [true, false],
303307
default: false,
304308
},
309+
noDataMessage: {
310+
label: 'Override no data message',
311+
type: SELECTION_TYPES.TEXT,
312+
default: 'Query returned no data.',
313+
},
305314
},
306315
},
307316
bar: {

src/report/Report.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export const NeoReport = ({
250250
} else if (status == QueryStatus.RUNNING) {
251251
return loadingIcon;
252252
} else if (status == QueryStatus.NO_DATA) {
253-
return <NeoCodeViewerComponent value={'Query returned no data.'} />;
253+
return <NeoCodeViewerComponent value={settings?.noDataMessage || 'Query returned no data.'} />;
254254
} else if (status == QueryStatus.NO_DRAWABLE_DATA) {
255255
return <NoDrawableDataErrorMessage />;
256256
} else if (status == QueryStatus.COMPLETE) {

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4580,9 +4580,9 @@
45804580
integrity sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==
45814581

45824582
"@types/node@^16.18.39":
4583-
version "16.18.59"
4584-
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.59.tgz#4cdbd631be6d9be266a96fb17b5d0d7ad6bbe26c"
4585-
integrity sha512-PJ1w2cNeKUEdey4LiPra0ZuxZFOGvetswE8qHRriV/sUkL5Al4tTmPV9D2+Y/TPIxTHHgxTfRjZVKWhPw/ORhQ==
4583+
version "16.18.61"
4584+
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.61.tgz#5ea47e3018348bf3bbbe646b396ba5e720310be1"
4585+
integrity sha512-k0N7BqGhJoJzdh6MuQg1V1ragJiXTh8VUBAZTWjJ9cUq23SG0F0xavOwZbhiP4J3y20xd6jxKx+xNUhkMAi76Q==
45864586

45874587
"@types/parse-json@^4.0.0":
45884588
version "4.0.0"

0 commit comments

Comments
 (0)