Skip to content

Commit e6d535a

Browse files
changing report config default options (#724)
* changing report config default options * Minor style fixes --------- Co-authored-by: Alfred Rubin <[email protected]> Co-authored-by: Niels de Jong <[email protected]>
1 parent 2d4e5f2 commit e6d535a

File tree

12 files changed

+108
-631
lines changed

12 files changed

+108
-631
lines changed

gallery/tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -20,7 +16,5 @@
2016
"noEmit": true,
2117
"jsx": "react-jsx"
2218
},
23-
"include": [
24-
"src"
25-
],
19+
"include": ["src"]
2620
}

public/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
white-space: pre;
166166
background-position: 0px -11px;
167167
padding-right: 0px !important;
168-
margin-top: 0px !important;
168+
margin-top: 0px;
169169
padding-left: 30px;
170170
padding-top: 0px !important;
171171
padding-bottom: 0px !important;

src/application/ApplicationThunks.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ export const createConnectionThunk =
8787
'ERR - connect to DB',
8888
database,
8989
'',
90-
`Error while trying to establish connection to Neo4j DB in ${
91-
neodashMode
92-
} mode at ${
93-
Date(Date.now()).substring(0, 33)}`
90+
`Error while trying to establish connection to Neo4j DB in ${neodashMode} mode at ${Date(
91+
Date.now()
92+
).substring(0, 33)}`
9493
)
9594
);
9695
}
@@ -113,11 +112,10 @@ export const createConnectionThunk =
113112
'INF - connect to DB',
114113
database,
115114
'',
116-
`${username
117-
} established connection to Neo4j DB in ${
118-
neodashMode
119-
} mode at ${
120-
Date(Date.now()).substring(0, 33)}`
115+
`${username} established connection to Neo4j DB in ${neodashMode} mode at ${Date(Date.now()).substring(
116+
0,
117+
33
118+
)}`
121119
)
122120
);
123121
}

src/application/logging/LoggingThunk.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ export const createLogThunk =
3333
() => {},
3434
(records) => {
3535
if (records && records[0] && records[0]._fields && records[0]._fields[0] && records[0]._fields[0] == uuid) {
36-
console.log(`log created: ${ uuid}`);
36+
console.log(`log created: ${uuid}`);
3737
} else {
3838
// we only show error notification one time
3939
const state = getState();
4040
const loggingSettings = applicationGetLoggingSettings(state);
4141
let LogErrorNotificationNum = Number(loggingSettings.logErrorNotification);
42-
console.log(`Error creating log for ${ (LogErrorNotificationNum - 4) * -1 } times`);
42+
console.log(`Error creating log for ${(LogErrorNotificationNum - 4) * -1} times`);
4343
if (LogErrorNotificationNum > 0) {
4444
dispatch(
4545
createNotificationThunk(
@@ -60,7 +60,7 @@ export const createLogThunk =
6060
const state = getState();
6161
const loggingSettings = applicationGetLoggingSettings(state);
6262
let LogErrorNotificationNum = Number(loggingSettings.logErrorNotification);
63-
console.log(`Error creating log for ${ (LogErrorNotificationNum - 4) * -1 } times`);
63+
console.log(`Error creating log for ${(LogErrorNotificationNum - 4) * -1} times`);
6464
if (LogErrorNotificationNum > 0) {
6565
dispatch(
6666
createNotificationThunk(

src/card/settings/CardSettingsContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import NeoCodeEditorComponent, {
88
import { getReportTypes } from '../../extensions/ExtensionUtils';
99
import { Dropdown } from '@neo4j-ndl/react';
1010
import { EXTENSIONS_CARD_SETTINGS_COMPONENT } from '../../extensions/ExtensionConfig';
11-
import { update } from '../../utils/ObjectManipulation';
11+
import { objMerge } from '../../utils/ObjectManipulation';
1212

1313
const NeoCardSettingsContent = ({
1414
pagenumber,
@@ -156,7 +156,7 @@ const NeoCardSettingsContent = ({
156156
{report && report.settingsComponent ? (
157157
<SettingsComponent
158158
onReportSettingUpdate={onReportSettingUpdate}
159-
settings={update({ helperText: report.helperText, inputMode: report.inputMode }, reportSettings)}
159+
settings={objMerge({ helperText: report.helperText, inputMode: report.inputMode }, reportSettings)}
160160
database={database}
161161
query={query}
162162
onQueryUpdate={onQueryUpdate}

src/chart/bar/BarChart.tsx

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ const NeoBarChart = (props: ChartProps) => {
111111
if (legendPosition === 'Horizontal') {
112112
// Calculate margin based on whether the legend is shown
113113
return showLegend ? legendWidth * 0.3 + marginBottom + 50 : legendWidth * 0.3 + marginBottom;
114-
}
115-
// Return the default marginBottom if legendPosition is not 'Horizontal'
116-
return marginBottom;
117-
114+
}
115+
// Return the default marginBottom if legendPosition is not 'Horizontal'
116+
return marginBottom;
118117
}
119118

120119
// Using the function in your code
@@ -316,33 +315,32 @@ const NeoBarChart = (props: ChartProps) => {
316315
],
317316
},
318317
];
319-
}
320-
// Vertical legend
321-
return [
322-
{
323-
dataFrom: 'keys',
324-
anchor: 'bottom-right',
325-
direction: 'column',
326-
justify: false,
327-
translateX: legendWidth + 10,
328-
translateY: 0,
329-
itemsSpacing: 1,
330-
itemWidth: legendWidth,
331-
itemHeight: 20,
332-
itemDirection: 'left-to-right',
333-
itemOpacity: 0.85,
334-
symbolSize: 15,
335-
effects: [
336-
{
337-
on: 'hover',
338-
style: {
339-
itemOpacity: 1,
340-
},
318+
}
319+
// Vertical legend
320+
return [
321+
{
322+
dataFrom: 'keys',
323+
anchor: 'bottom-right',
324+
direction: 'column',
325+
justify: false,
326+
translateX: legendWidth + 10,
327+
translateY: 0,
328+
itemsSpacing: 1,
329+
itemWidth: legendWidth,
330+
itemHeight: 20,
331+
itemDirection: 'left-to-right',
332+
itemOpacity: 0.85,
333+
symbolSize: 15,
334+
effects: [
335+
{
336+
on: 'hover',
337+
style: {
338+
itemOpacity: 1,
341339
},
342-
],
343-
},
344-
];
345-
340+
},
341+
],
342+
},
343+
];
346344
};
347345

348346
// Height of each legend item

src/chart/bar/util.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function getOriginalRecordForNivoClickEvent(e, records, selection) {
1111
// TODO - rewrite this to be more optimal (using list comprehensions, etc.)
1212
const usesGroups = Object.keys(e.data).length > 2;
1313
const group = e.id;
14-
const {value} = e;
14+
const { value } = e;
1515
const category = e.indexValue;
1616

1717
// Go through all records and find the first record `r` where the event's values match exactly.
@@ -34,12 +34,12 @@ export function getOriginalRecordForNivoClickEvent(e, records, selection) {
3434
return dict;
3535
}
3636
} else if (recordCategory == category && recordValue == value) {
37-
const dict = {};
38-
for (const i in Object.keys(r._fieldLookup)) {
39-
const key = Object.keys(r._fieldLookup)[i];
40-
dict[key] = r._fields[r._fieldLookup[key]];
41-
}
42-
return dict;
37+
const dict = {};
38+
for (const i in Object.keys(r._fieldLookup)) {
39+
const key = Object.keys(r._fieldLookup)[i];
40+
dict[key] = r._fields[r._fieldLookup[key]];
4341
}
42+
return dict;
43+
}
4444
}
4545
}

src/component/editor/CodeViewerComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const NeoCodeViewerComponent = ({ value = '', placeholder = '' }) => {
1818
paddingLeft: '10px',
1919
background: 'none',
2020
overflow: 'scroll !important',
21+
marginTop: '5px',
2122
border: '1px solid lightgray',
2223
}}
2324
className={'textinput-linenumbers'}

0 commit comments

Comments
 (0)