Skip to content

Commit 1ab5b8b

Browse files
committed
Fix schema calc
1 parent 2fec0c1 commit 1ab5b8b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/extensions/styling/StyleRuleCreationModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const NeoCustomReportStyleModal = ({
163163
* This will be dynamic based on the type of report we are customizing.
164164
*/
165165
const createFieldVariableSuggestions = () => {
166-
if (!schema) {
166+
if (!schema && !fields) {
167167
return [];
168168
}
169169
if (type == 'graph' || type == 'map') {

src/report/Report.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const NeoReport = ({
3737
setFields = (f) => {
3838
fields = f;
3939
}, // The callback to update the set of query fields after query execution.
40-
setSchema,
40+
setSchemaDispatch,
4141
setGlobalParameter = () => {}, // callback to update global (dashboard) parameters.
4242
getGlobalParameter = (_: string) => {
4343
return '';
@@ -69,6 +69,13 @@ export const NeoReport = ({
6969

7070
const debouncedRunCypherQuery = useCallback(debounce(runCypherQuery, RUN_QUERY_DELAY_MS), []);
7171

72+
const setSchema = (id, schema) => {
73+
if (type === 'graph' || type === 'map') {
74+
setSchemaDispatch(id, schema);
75+
} else {
76+
console.log('Not a valid report type for Schema');
77+
}
78+
};
7279
const populateReport = (debounced = true) => {
7380
// If this is a 'text-only' report, no queries are ran, instead we pass the input directly to the report.
7481
const reportTypes = getReportTypes(extensions);
@@ -341,7 +348,7 @@ const mapDispatchToProps = (dispatch) => ({
341348
getCustomDispatcher: () => {
342349
return dispatch;
343350
},
344-
setSchema: (id: any, schema: any) => {
351+
setSchemaDispatch: (id: any, schema: any) => {
345352
dispatch(updateFieldsThunk(id, schema, true));
346353
},
347354
});

0 commit comments

Comments
 (0)