Skip to content

Commit fb0397e

Browse files
authored
Merge pull request #555 from neo4j-labs/fix/schemaLite
Performance fix on schema calculation
2 parents 3914eaa + 1e8396a commit fb0397e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-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: 7 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,11 @@ 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+
}
76+
};
7277
const populateReport = (debounced = true) => {
7378
// If this is a 'text-only' report, no queries are ran, instead we pass the input directly to the report.
7479
const reportTypes = getReportTypes(extensions);
@@ -341,7 +346,7 @@ const mapDispatchToProps = (dispatch) => ({
341346
getCustomDispatcher: () => {
342347
return dispatch;
343348
},
344-
setSchema: (id: any, schema: any) => {
349+
setSchemaDispatch: (id: any, schema: any) => {
345350
dispatch(updateFieldsThunk(id, schema, true));
346351
},
347352
});

0 commit comments

Comments
 (0)