Skip to content

Commit 7662e09

Browse files
committed
ISSUE #4639 - use v5 datepicker to fix big where date reverts to old value on cancel
1 parent b68eef2 commit 7662e09

File tree

4 files changed

+13
-41
lines changed

4 files changed

+13
-41
lines changed

frontend/src/v4/routes/components/dateField/dateField.component.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
* You should have received a copy of the GNU Affero General Public License
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
17-
import { ComponentType, useEffect } from 'react';
18-
import { DatePickerProps } from '@mui/lab/DatePicker';
19-
import { DateTimePickerProps } from '@mui/lab/DateTimePicker';
17+
import { useEffect } from 'react';
2018
import { TextField } from '@mui/material';
2119
import { useState } from 'react';
22-
import { StyledDatePicker, StyledDateTimePicker } from './dateField.styles';
20+
import { DateTimePicker } from '@controls/inputs/datePicker/dateTimePicker.component';
21+
import { DatePicker } from '@controls/inputs/datePicker/datePicker.component';
2322

2423
interface IProps {
2524
value?: any;
@@ -48,7 +47,7 @@ export const DateField = ({
4847
...dateFieldProps
4948
}: IProps) => {
5049
const [value, setValue] = useState(propValue || null);
51-
const Picker: ComponentType<DatePickerProps | DateTimePickerProps> = dateTime ? StyledDateTimePicker : StyledDatePicker;
50+
const Picker = dateTime ? DateTimePicker : DatePicker;
5251

5352
const handleAccept = (newValue) => {
5453
if (newValue) {
@@ -78,11 +77,13 @@ export const DateField = ({
7877
defaultValue={defaultValue}
7978
name={name}
8079
onBlur={onBlur}
81-
className={className}
8280
{...props}
81+
InputProps={{ endAdornment: null }}
8382
/>
8483
)}
84+
className={className}
8585
{...dateFieldProps}
86+
components={{ ActionBar: null }}
8687
/>
8788
);
8889
};

frontend/src/v4/routes/components/dateField/dateField.styles.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

frontend/src/v5/ui/controls/inputs/datePicker/baseCalendarPicker/calendarActionBar/calendarActionBar.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type ICalendarActionBar = {
2525
export const CalendarActionBar = ({ onClear, hidden }: ICalendarActionBar) => {
2626
if (hidden) return null;
2727
return (
28-
<ClearDateAction onClick={onClear} hidden={hidden}>
28+
<ClearDateAction onClick={onClear}>
2929
<FormattedMessage id="datePicker.actionBar.clear" defaultMessage="Clear date" />
3030
</ClearDateAction>
3131
);

frontend/src/v5/ui/v4Adapter/overrides/cards/sharedStyles/sequencesTab.overrides.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ export default css`
3535
}
3636
${SequenceDateContainer} {
3737
width: 190px;
38-
${SequenceDateField} {
38+
${SequenceDateField} { // HERE
39+
outline: 1px solid peru;
3940
.MuiInputBase-root {
41+
outline: 1px solid hotpink;
4042
margin: 0px;
41-
43+
4244
input {
45+
outline: 1px solid lightgoldenrodyellow;
4346
color: ${({ theme }) => theme.palette.secondary.main};
4447
box-sizing: border-box;
4548
width: 184px;

0 commit comments

Comments
 (0)