-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(datatrak): RN-1468: Tasks mobile UI #6063
base: rn-1468-mobile-tasks-ui-backend
Are you sure you want to change the base?
Conversation
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.
Flurry of comments, but only because it’s a big PR. Overall looks great—impressive stuff 🎉
All comments minor, except one weird one about icon grids, which might be easier to discuss in Slack?
type SearchCondition = { | ||
comparator: string; | ||
comparisonValue: string; | ||
}; |
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.
Wondering if Comparison
makes more sense here?
type SearchCondition = { | |
comparator: string; | |
comparisonValue: string; | |
}; | |
interface SearchCondition { | |
comparator: string; | |
comparisonValue: string; | |
}; |
const country = await models.country.findOne({ code: countryCode }); | ||
|
||
const queryUrl = countryCode ? `countries/${country.id}/surveys` : 'surveys'; | ||
|
||
const filter: Record<string, string> = {}; | ||
const filter: Record<string, string | SearchCondition> = {}; |
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.
const filter: Record<string, string | SearchCondition> = {}; | |
const filter: { project_id: Project['id']; name: Comparison } = {}; |
(): Promise<DatatrakWebSurveyRequest.ResBody[]> => | ||
get('surveys', { | ||
['surveys', projectId, countryCode, searchTerm], | ||
(): Promise<DatatrakWebSurveyRequest.ResBody[]> => { |
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 believe if we use useQuery<DatatrakWebSurveyRequest.ResBody[], Error>
, this type should flow through here
...(searchTerm && { searchTerm }), | ||
...(countryCode && { countryCode }), |
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 notice that SurveysRoute.ts
does the same thing with if
s. Do we have a preference between the two?
const params = {};
if (searchTerm) params.searchTerm = searchTerm;
// params: { fields, projectId, ...params };
I don’t really have a strong opinion here—also happy to leave as-is
}; | ||
|
||
return ( | ||
<svg viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}> |
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.
Sorry, I missed width
and height
on this. (Fixed in my branch, merging imminently)
<svg viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}> | |
<svg | |
viewBox="0 0 8 8" | |
fill="none" | |
width={8} | |
height={8} | |
xmlns="http://www.w3.org/2000/svg" | |
{...props} | |
> |
const PopperComponent = ({ children }) => { | ||
return <>{children}</>; | ||
}; |
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.
const PopperComponent = ({ children }) => { | |
return <>{children}</>; | |
}; | |
const PopperComponent = ({ children }) => children; |
inputValue={searchValue} | ||
getOptionLabel={option => (option ? option.label : '')} | ||
getOptionSelected={(option, selected) => option.id === selected?.id} | ||
placeholder="Search..." |
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.
placeholder="Search..." | |
placeholder="Search…" |
label={ | ||
<TabLabel> | ||
<span>{tab.label}</span> | ||
{tab.active && <Dot />} |
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.
Had a quick glance at the MUI docs, and I think <Tab>
sorts out role="tab" aria-selected
for us
{tab.active && <Dot />} | |
{tab.active && <Dot aria-hidden />} |
/> | ||
)} | ||
<DialogActions> | ||
<Button variant="text" color="default" onClick={() => clearFilters()}> |
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.
<Button variant="text" color="default" onClick={() => clearFilters()}> | |
<Button variant="text" color="default" onClick={clearFilters}> |
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ |
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.
/* | |
* Tupaia | |
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | |
*/ |
Issue #: feat(datatrak): RN-1468: Tasks mobile UI
Changes:
Screenshots:
Dashboard page
Filters