Skip to content

Commit 33eba02

Browse files
committed
Fix review 2
1 parent 509bb78 commit 33eba02

7 files changed

+32
-43
lines changed

src/chart/parameter/ParameterSelectionChart.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
2828
const setParameterDisplayValue = (value) => setGlobalParameter(parameterDisplayName, value);
2929
const allParameters = props.parameters;
3030
const multiSelector = props?.settings?.multiSelector;
31-
const setManual = props?.settings?.setManual;
31+
const manualParameterSave = props?.settings?.manualParameterSave;
3232
// in NeoDash 2.2.1 or earlier, there was no means to have a different display value in the selector. This condition handles that.
3333
const compatibilityMode = !query?.toLowerCase().includes('as display') || false;
3434

@@ -50,7 +50,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
5050
settings={props.settings}
5151
allParameters={allParameters}
5252
compatibilityMode={compatibilityMode}
53-
setManual={setManual}
53+
manualParameterSave={manualParameterSave}
5454
/>
5555
);
5656
} else if (type == 'Node Property') {
@@ -68,7 +68,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
6868
allParameters={allParameters}
6969
compatibilityMode={compatibilityMode}
7070
multiSelector={multiSelector}
71-
setManual={setManual}
71+
manualParameterSave={manualParameterSave}
7272
/>
7373
);
7474
} else if (type == 'Relationship Property') {
@@ -86,7 +86,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
8686
allParameters={allParameters}
8787
compatibilityMode={compatibilityMode}
8888
multiSelector={multiSelector}
89-
setManual={setManual}
89+
manualParameterSave={manualParameterSave}
9090
/>
9191
);
9292
} else if (type == 'Date Picker') {
@@ -103,7 +103,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
103103
settings={props.settings}
104104
allParameters={allParameters}
105105
compatibilityMode={compatibilityMode}
106-
setManual={setManual}
106+
manualParameterSave={manualParameterSave}
107107
/>
108108
);
109109
} else if (type == 'Custom Query') {
@@ -121,7 +121,7 @@ export const NeoParameterSelectionChart = (props: ChartProps) => {
121121
allParameters={allParameters}
122122
compatibilityMode={compatibilityMode}
123123
multiSelector={multiSelector}
124-
setManual={setManual}
124+
manualParameterSave={manualParameterSave}
125125
/>
126126
);
127127
}

src/chart/parameter/component/FreeTextParameterSelect.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import NeoField from '../../../component/field/Field';
55
import { SelectionConfirmationButton } from './SelectionConfirmationButton';
66

77
const FreeTextParameterSelectComponent = (props: ParameterSelectProps) => {
8-
const { setManual } = props;
8+
const { manualParameterSave } = props;
99
const setParameterTimeout =
1010
props.settings && props.settings.setParameterTimeout ? props.settings.setParameterTimeout : 1000;
1111
const defaultValue =
@@ -51,23 +51,29 @@ const FreeTextParameterSelectComponent = (props: ParameterSelectProps) => {
5151
}
5252

5353
return (
54-
<div style={{ width: '100%', marginTop: '5px' }}>
54+
<div className={'n-flex n-flex-row n-flex-wrap n-items-center'} style={{ width: '100%', marginTop: '5px' }}>
5555
<NeoField
5656
key={'freetext'}
5757
label={helperText ? helperText : `${label} ${property}`}
5858
defaultValue={defaultValue}
5959
value={inputText}
6060
variant='outlined'
6161
placeholder={'Enter text here...'}
62-
style={{ marginBottom: '10px', marginRight: '10px', marginLeft: '15px', width: 'calc(100% - 80px)' }}
62+
style={{
63+
marginBottom: '10px',
64+
marginRight: '10px',
65+
marginLeft: '15px',
66+
minWidth: `calc(100% - ${manualParameterSave ? '70' : '30'}px)`,
67+
maxWidth: 'calc(100% - 30px)',
68+
}}
6369
onChange={(newValue) => {
6470
setRunning(true);
6571
setInputText(newValue);
6672

67-
handleParameters(newValue, setManual);
73+
handleParameters(newValue, manualParameterSave);
6874
}}
6975
/>
70-
{setManual ? (
76+
{manualParameterSave ? (
7177
<SelectionConfirmationButton onClick={() => manualHandleParameters()} key={`selectionConfirmation`} />
7278
) : (
7379
<></>

src/chart/parameter/component/NodePropertyParameterSelect.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
2121
}
2222
return multi ? [] : value;
2323
};
24-
const { multiSelector, setManual } = props;
24+
const { multiSelector, manualParameterSave } = props;
2525
const allParameters = props.allParameters ? props.allParameters : {};
2626
const [extraRecords, setExtraRecords] = React.useState([]);
2727
const [inputDisplayText, setInputDisplayText] = React.useState(
@@ -64,23 +64,23 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
6464
if (isMulti) {
6565
if (value.length == 0 && clearParameterOnFieldClear) {
6666
setInputValue([]);
67-
handleParameters(undefined, undefined, setManual);
67+
handleParameters(undefined, undefined, manualParameterSave);
6868
return true;
6969
}
7070
if (value.length == 0) {
7171
setInputValue([]);
72-
handleParameters([], [], setManual);
72+
handleParameters([], [], manualParameterSave);
7373
return true;
7474
}
7575
} else {
7676
if (value && clearParameterOnFieldClear) {
7777
setInputValue(null);
78-
handleParameters(undefined, undefined, setManual);
78+
handleParameters(undefined, undefined, manualParameterSave);
7979
return true;
8080
}
8181
if (value == null) {
8282
setInputValue(null);
83-
handleParameters(defaultValue, defaultValue, setManual);
83+
handleParameters(defaultValue, defaultValue, manualParameterSave);
8484
return true;
8585
}
8686
return false;
@@ -92,8 +92,8 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
9292
return;
9393
}
9494
let newValue;
95-
let valReference = setManual ? paramValueTemp : props.parameterValue;
96-
let valDisplayReference = setManual ? paramValueDisplayTemp : props.parameterDisplayValue;
95+
let valReference = manualParameterSave ? paramValueTemp : props.parameterValue;
96+
let valDisplayReference = manualParameterSave ? paramValueDisplayTemp : props.parameterDisplayValue;
9797
// Multiple and new entry
9898
if (isMulti && inputValue.length < newDisplay.length) {
9999
newValue = Array.isArray(valReference) ? [...valReference] : [valReference];
@@ -118,7 +118,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
118118
setInputDisplayText(isMulti ? '' : newDisplay);
119119
setInputValue(newDisplay);
120120

121-
handleParameters(newValue, newDisplay, setManual);
121+
handleParameters(newValue, newDisplay, manualParameterSave);
122122
};
123123
return (
124124
<div className={'n-flex n-flex-row n-flex-wrap n-items-center'}>
@@ -128,7 +128,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
128128
options={extraRecords.map((r) => r?._fields?.[displayValueRowIndex] || '(no data)').sort()}
129129
style={{
130130
maxWidth: 'calc(100% - 30px)',
131-
minWidth: `calc(100% - ${setManual ? '70' : '30'}px)`,
131+
minWidth: `calc(100% - ${manualParameterSave ? '70' : '30'}px)`,
132132
marginLeft: '15px',
133133
marginTop: '5px',
134134
}}
@@ -153,7 +153,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
153153
)}
154154
getOptionLabel={(option) => RenderSubValue(option)}
155155
/>
156-
{setManual ? (
156+
{manualParameterSave ? (
157157
<SelectionConfirmationButton onClick={() => manualHandleParameters()} key={`selectionConfirmation`} />
158158
) : (
159159
<></>

src/chart/parameter/component/ParameterSelect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ export interface ParameterSelectProps {
5353
/**
5454
* Add the possibility for manual selection confirmation
5555
*/
56-
setManual?: boolean;
56+
manualParameterSave?: boolean;
5757
}

src/chart/parameter/component/RelationshipPropertyParameterSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const RelationshipPropertyParameterSelectComponent = (props: ParameterSelectProp
2121
allParameters={props.allParameters}
2222
compatibilityMode={props.compatibilityMode}
2323
multiSelector={props.multiSelector}
24-
setManual={props.setManual}
24+
manualParameterSave={props.manualParameterSave}
2525
/>
2626
);
2727
};

src/chart/parameter/component/SelectionConfirmationButton.tsx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { Tooltip } from '@mui/material';
33
import { CheckBadgeIconOutline } from '@neo4j-ndl/react/icons';
44
import { IconButton } from '@neo4j-ndl/react';
55
/**
6-
* Returns a button to delete a property entry from the table inside the GraphChartEditModal.
6+
* Returns a button to confirm a selection entry from the parameter selector.
77
*/
88
export const SelectionConfirmationButton = ({ onClick, key }) => {
99
return (
1010
<Tooltip title={'Confirm'} disableInteractive key={key}>
1111
<IconButton
12-
key={`btn${ key}`}
12+
key={`btn${key}`}
1313
className='logo-btn n-p-1'
1414
aria-label={'btb-confirmation'}
1515
size='large'
@@ -19,22 +19,5 @@ export const SelectionConfirmationButton = ({ onClick, key }) => {
1919
<CheckBadgeIconOutline className='header-icon' type='outline' />
2020
</IconButton>
2121
</Tooltip>
22-
/*
23-
<Fab
24-
25-
size='small'
26-
aria-label='remove'
27-
style={{
28-
background: 'white',
29-
color: 'grey',
30-
marginTop: '-6px',
31-
marginLeft: '20px',
32-
width: '26px',
33-
height: '26px',
34-
minHeight: '26px',
35-
}}
36-
onClick={onClick}
37-
>
38-
*/
3922
);
4023
};

src/config/ReportConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ export const REPORT_TYPES = {
12961296
values: [true, false],
12971297
default: false,
12981298
},
1299-
setManual: {
1299+
manualParameterSave: {
13001300
label: 'Manual Parameter Save',
13011301
type: SELECTION_TYPES.LIST,
13021302
values: [true, false],

0 commit comments

Comments
 (0)