-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UCL-563 Data grid datetime picker #748
base: master
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
package.json
Outdated
@@ -134,5 +134,8 @@ | |||
"ts-jest": "^29.1.5", | |||
"tslib": "^2.6.3", | |||
"typescript": "^5.5.3" | |||
}, | |||
"dependencies": { | |||
"date-fns": "^4.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should be a peer dependency too? @pawel-napieracz wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
const { dataGrid, getAllByRole } = createDataGridWithDateFilter(); | ||
|
||
expect(dataGrid).toBeInTheDocument(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
await userEvent.clear(toInput); | ||
await userEvent.type(toInput, "not a date[Tab]"); | ||
|
||
expect(getAllByText("The format must be yyyy-mm-dd hh:mm:ss")).toHaveLength(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would split the test into custom dates / field validation, and add more error cases (like the ones reported by Scott
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
<Fragment> | ||
<Icon icon={Icons.Calendar} /> | ||
<Typography variant="body" className={classes["caption"]}> | ||
Date is <b>{dateTagCaption}</b> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to localize all the texts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
to: "To", | ||
cancel: "Cancel", | ||
apply: "Apply", | ||
dateInputPlaceholder: "yyyy-mm-dd hh:mm:ss" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, extract to a static and refer to the format in other places (such as above, in the error message)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return ( | ||
<Fragment> | ||
<InputWrapper | ||
style={{ marginTop: 0, maxWidth: "224px" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why passing the style like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
<InputWrapper | ||
style={{ marginTop: 0, maxWidth: "224px" }} | ||
label={from} | ||
name={"fromDate"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name={"fromDate"} | |
name="fromDate" |
to me it's ok, but @pawel-napieracz hunts me with this :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -66,6 +76,7 @@ export const DatePicker = ({ onSelect, value, required, mode, locale, ...rest }: | |||
{...rest} | |||
{...commonProps} | |||
mode={mode} | |||
endMonth={new Date(3000, 12)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A prophecy...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed on slack
], | ||
isLoading: false, | ||
enableMultiSorting: true | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add the entry with play function that will open the filter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
} | ||
}; | ||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some months take more height than others. This makes the entire modal "jump" a little. I don't think it's a big issue but would be nice to discuss with the UX.
No description provided.