Skip to content
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

Open
wants to merge 29 commits into
base: rn-1468-mobile-tasks-ui-backend
Choose a base branch
from

Conversation

tcaiger
Copy link
Contributor

@tcaiger tcaiger commented Jan 21, 2025

Issue #: feat(datatrak): RN-1468: Tasks mobile UI

Changes:

  • Add mobile task filters
  • Responsive styles for task dashboard page

Screenshots:

Dashboard page
Screenshot 2025-01-23 at 9 48 50 AM

Filters
Screenshot 2025-01-23 at 9 42 51 AM

Copy link
Contributor

@jaskfla jaskfla left a 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?

Comment on lines +17 to +20
type SearchCondition = {
comparator: string;
comparisonValue: string;
};
Copy link
Contributor

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?

Suggested change
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> = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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[]> => {
Copy link
Contributor

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

Comment on lines +22 to +23
...(searchTerm && { searchTerm }),
...(countryCode && { countryCode }),
Copy link
Contributor

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 ifs. 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}>
Copy link
Contributor

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)

Suggested change
<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}
>

Comment on lines +31 to +33
const PopperComponent = ({ children }) => {
return <>{children}</>;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
placeholder="Search..."
placeholder="Search"

label={
<TabLabel>
<span>{tab.label}</span>
{tab.active && <Dot />}
Copy link
Contributor

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

Suggested change
{tab.active && <Dot />}
{tab.active && <Dot aria-hidden />}

/>
)}
<DialogActions>
<Button variant="text" color="default" onClick={() => clearFilters()}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Button variant="text" color="default" onClick={() => clearFilters()}>
<Button variant="text" color="default" onClick={clearFilters}>

Comment on lines +1 to +4
/*
* Tupaia
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*
* Tupaia
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants