Skip to content

Commit

Permalink
Removed commented blocks, console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamS-Quartech committed Nov 1, 2023
1 parent 30e8ce6 commit 1fefe0e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const AsyncAutocompleteDataGridEditCell = <DataGridType extends GridValidRowMode
useEnhancedEffect(() => {

Check warning on line 58 in app/src/components/data-grid/autocomplete/AsyncAutocompleteDataGridEditCell.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/data-grid/autocomplete/AsyncAutocompleteDataGridEditCell.tsx#L58

Added line #L58 was not covered by tests
if (dataGridProps.hasFocus) {
ref.current?.focus();

Check warning on line 60 in app/src/components/data-grid/autocomplete/AsyncAutocompleteDataGridEditCell.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/data-grid/autocomplete/AsyncAutocompleteDataGridEditCell.tsx#L60

Added line #L60 was not covered by tests
console.log('Focus fired!');
}
}, [dataGridProps.hasFocus]);
// The current data grid value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const AutocompleteDataGridEditCell = <DataGridType extends GridValidRowModel, Va
useEnhancedEffect(() => {

Check warning on line 52 in app/src/components/data-grid/autocomplete/AutocompleteDataGridEditCell.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/data-grid/autocomplete/AutocompleteDataGridEditCell.tsx#L52

Added line #L52 was not covered by tests
if (dataGridProps.hasFocus) {
ref.current?.focus();

Check warning on line 54 in app/src/components/data-grid/autocomplete/AutocompleteDataGridEditCell.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/data-grid/autocomplete/AutocompleteDataGridEditCell.tsx#L54

Added line #L54 was not covered by tests
console.log('Focus fired!');
}
}, [dataGridProps.hasFocus]);

Expand Down
79 changes: 1 addition & 78 deletions app/src/features/surveys/observations/ObservationsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,27 +282,6 @@ const ObservationsTable = (props: ISpeciesObservationTableProps) => {
}}
/>
);

// return (
// <TextField
// onChange={(event) => {
// if (!/^\d{0,7}$/.test(event.target.value)) {
// // If the value is not a number, return
// return;
// }

// apiRef?.current.setEditCellValue({
// id: params.id,
// field: params.field,
// value: event.target.value
// });
// }}
// value={params.value ?? ''}
// variant="outlined"
// type="text"
// inputProps={{ inputMode: 'numeric' }}
// />
// );
}
},
{
Expand Down Expand Up @@ -347,27 +326,7 @@ const ObservationsTable = (props: ISpeciesObservationTableProps) => {
return <>{params.value}</>;
},
renderEditCell: (params) => {
return (
<TimePickerDataGrid dataGridProps={params} />
// <LocalizationProvider dateAdapter={AdapterMoment}>
// <TimePicker
// value={(params.value && moment(params.value, 'HH:mm:ss')) || null}
// onChange={(value) => {
// apiRef?.current.setEditCellValue({ id: params.id, field: params.field, value: value });
// }}
// onAccept={(value) => {
// apiRef?.current.setEditCellValue({
// id: params.id,
// field: params.field,
// value: value?.format('HH:mm:ss')
// });
// }}
// views={['hours', 'minutes', 'seconds']}
// timeSteps={{ hours: 1, minutes: 1, seconds: 1 }}
// ampm={false}
// />
// </LocalizationProvider>
);
return <TimePickerDataGrid dataGridProps={params} />;

Check warning on line 329 in app/src/features/surveys/observations/ObservationsTable.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/features/surveys/observations/ObservationsTable.tsx#L329

Added line #L329 was not covered by tests
}
},
{
Expand Down Expand Up @@ -407,24 +366,6 @@ const ObservationsTable = (props: ISpeciesObservationTableProps) => {
}
}}
/>
// <TextField
// onChange={(event) => {
// if (!/^-?\d{0,3}(?:\.\d{0,12})?$/.test(event.target.value)) {
// // If the value is not a subset of a legal latitude value, prevent the value from being applied
// return;
// }

// apiRef?.current.setEditCellValue({
// id: params.id,
// field: params.field,
// value: event.target.value
// });
// }}
// value={params.value ?? ''}
// variant="outlined"
// type="text"
// inputProps={{ inputMode: 'numeric' }}
// />
);
}
},
Expand Down Expand Up @@ -465,24 +406,6 @@ const ObservationsTable = (props: ISpeciesObservationTableProps) => {
}
}}
/>
// <TextField
// onChange={(event) => {
// if (!/^-?\d{0,3}(?:\.\d{0,12})?$/.test(event.target.value)) {
// // If the value is not a subset of a legal longitude value, prevent the value from being applied
// return;
// }

// apiRef?.current.setEditCellValue({
// id: params.id,
// field: params.field,
// value: event.target.value
// });
// }}
// value={params.value ?? ''}
// variant="outlined"
// type="text"
// inputProps={{ inputMode: 'numeric' }}
// />
);
}
},
Expand Down

0 comments on commit 1fefe0e

Please sign in to comment.