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: mobile tasking #6021

Open
wants to merge 120 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
46c85b4
media queries
alexd-bes Sep 30, 2024
21dbe04
Background for landing page
alexd-bes Sep 30, 2024
6225db2
Mobile header
alexd-bes Sep 30, 2024
e061fa5
WIP tile
alexd-bes Sep 30, 2024
a119dfd
Update Tile.tsx
alexd-bes Sep 30, 2024
7573aac
leaderboard
alexd-bes Sep 30, 2024
11b7fde
Survey select section
alexd-bes Sep 30, 2024
fe9e80f
Activity feed
alexd-bes Sep 30, 2024
9394bb4
General styling
alexd-bes Sep 30, 2024
91cb6ba
tablet styling
alexd-bes Oct 1, 2024
e0da75d
general styling
alexd-bes Oct 1, 2024
8925a1d
Tasks
alexd-bes Oct 1, 2024
1b644ba
WIP
alexd-bes Oct 2, 2024
1327c27
Task section styling
alexd-bes Oct 2, 2024
cd0fbe5
Update ResponsiveScrollBody.tsx
alexd-bes Oct 2, 2024
5998775
Merge branch 'dev' into rn-1448-responsive-dashboard
tcaiger Oct 10, 2024
a191286
Update Header.tsx
tcaiger Oct 10, 2024
2fdd8e8
Merge branch 'dev' into rn-1448-responsive-dashboard
tcaiger Oct 24, 2024
068d688
Update DrawerMenu.tsx
tcaiger Oct 24, 2024
2e7e757
fix merge
tcaiger Oct 24, 2024
6e5b013
Merge branch 'dev' into rn-1448-responsive-dashboard
tcaiger Nov 7, 2024
2506a0f
mobile survey select page
tcaiger Nov 7, 2024
e84e2d0
tweaks
tcaiger Nov 7, 2024
eeb8d62
fix desktop
tcaiger Nov 7, 2024
d22c04c
Update UserInfo.tsx
tcaiger Nov 7, 2024
5ea7097
Merge branch 'rn-1448-responsive-dashboard' into rn-1452-survey-select
tcaiger Nov 7, 2024
88f5eca
Merge pull request #6004 from beyondessential/dev
avaek Nov 20, 2024
a3591e6
style(datatrakWeb): RN-1453: Mobile survey workflow (#5981)
tcaiger Nov 24, 2024
cf0d978
Merge branch 'dev' into rn-1448-responsive-dashboard
tcaiger Nov 24, 2024
727efc7
Merge branch 'rn-1448-responsive-dashboard' into rn-1452-survey-select
tcaiger Nov 24, 2024
93360bf
pr fixes
tcaiger Nov 24, 2024
22ae677
Merge branch 'dev' into rn-1448-responsive-dashboard
tcaiger Nov 28, 2024
7fd6ebd
fix dashboard style issues 1 - 5
tcaiger Nov 28, 2024
eae9818
fix home scrolling
tcaiger Nov 28, 2024
f891827
tasks styling
tcaiger Nov 28, 2024
d3cebc8
Update SurveySelectSection.tsx
tcaiger Nov 28, 2024
1fe8a2c
Merge branch 'rn-1448-responsive-dashboard' into rn-1452-survey-select
tcaiger Nov 29, 2024
c4c3f82
style project select
tcaiger Nov 29, 2024
b6827a6
Merge pull request #6017 from beyondessential/dev
avaek Dec 2, 2024
38c88f4
styling project select form
tcaiger Dec 2, 2024
b4d0dff
settings header
tcaiger Dec 2, 2024
6507d69
fix dependency cycle
tcaiger Dec 3, 2024
bb57dda
tasks page layout
tcaiger Dec 3, 2024
7d14a4d
filter stories
tcaiger Dec 3, 2024
35a232c
autocomplete stories
tcaiger Dec 3, 2024
756d3e3
survey filter
tcaiger Dec 4, 2024
5fc4ab6
survey filter
tcaiger Dec 5, 2024
09c73e1
project filters
tcaiger Dec 5, 2024
f4a5fe5
filter dots
tcaiger Dec 5, 2024
aa55d8b
assignee filter
tcaiger Dec 6, 2024
644e9ad
project user filter
tcaiger Dec 6, 2024
0063f26
style tweaks
tcaiger Dec 6, 2024
13045af
Merge pull request #6024 from beyondessential/dev
avaek Dec 8, 2024
53aed7a
design feedback
tcaiger Dec 9, 2024
c7a64a4
Merge pull request #6026 from beyondessential/dev
avaek Dec 9, 2024
d7c48b1
feat(datatrak): RN-1449: Mobile datatrak account settings (#6016)
tcaiger Dec 12, 2024
2c2f59c
Merge branch 'rn-1448-responsive-dashboard' into rn-1452-survey-select
tcaiger Dec 12, 2024
469a3ad
Merge branch 'rn-1452-survey-select' into rn-1468-mobile-tasking
tcaiger Dec 12, 2024
741cddf
Update TaskMetrics.tsx
tcaiger Dec 12, 2024
a7ae21f
remove tool tips
tcaiger Dec 12, 2024
c61cd81
Update SurveySelectSection.tsx
tcaiger Dec 12, 2024
e90f8a3
Merge branch 'rn-1448-responsive-dashboard' into rn-1452-survey-select
tcaiger Dec 12, 2024
4a8e428
account deletion
tcaiger Dec 13, 2024
416ab86
Update AccountSettingsPage.tsx
tcaiger Dec 13, 2024
4a3d4ac
Update StickyMobileHeader.tsx
tcaiger Dec 13, 2024
7e4d783
sticky header
tcaiger Dec 13, 2024
c2e267f
style tweaks
tcaiger Dec 15, 2024
2bb9c46
back link on survey
tcaiger Dec 15, 2024
f483ff0
mobiel select back button
tcaiger Dec 15, 2024
65010e7
Update SurveySideMenu.tsx
tcaiger Dec 16, 2024
b74e20d
fix select list
tcaiger Dec 16, 2024
cad4ad5
Update ProjectSelectModal.tsx
tcaiger Dec 16, 2024
fbbf136
project select back button
tcaiger Dec 16, 2024
71864a2
Update RequestCountryAccessForm.tsx
tcaiger Dec 16, 2024
d308bb3
Merge pull request #6029 from beyondessential/dev
avaek Dec 16, 2024
982672f
Update RequestCountryAccessForm.tsx
tcaiger Dec 16, 2024
aa7a293
add storybook
tcaiger Jan 5, 2025
1f2a7ad
Merge branch 'datatrak-storybook' into rn-1452-survey-select
tcaiger Jan 5, 2025
bc2c8b1
fixes
tcaiger Jan 6, 2025
7e49cb7
Update RequestCountryAccessForm.tsx
tcaiger Jan 6, 2025
8e7bc2b
add share
tcaiger Jan 6, 2025
e468866
modal qr codes
tcaiger Jan 6, 2025
9e22324
Update RadioQuestion.tsx
tcaiger Jan 6, 2025
9d7bdd8
ReadOnlyQuestion
tcaiger Jan 6, 2025
18edfeb
ArithmeticQuestion
tcaiger Jan 6, 2025
a3ce3c3
success screen
tcaiger Jan 6, 2025
02825eb
android toasts
tcaiger Jan 6, 2025
4cc9523
Merge branch 'dev' into rn-1452-survey-select
tcaiger Jan 6, 2025
203df21
review screen
tcaiger Jan 7, 2025
a1d7165
refactor(datatrak): update `<StickyMobileHeader>` interface (#6039)
jaskfla Jan 7, 2025
dfd14e4
fix(datatrak): RN-1452: Update survey back button logic (#6040)
tcaiger Jan 9, 2025
4e55356
feat(datatrak): RN-1452: Request project access (#6042)
tcaiger Jan 9, 2025
b1d1618
tweak file upload field
tcaiger Jan 10, 2025
6bef5a7
Merge branch 'dev' into rn-1452-survey-select
tcaiger Jan 12, 2025
9e2fff9
font size tweaks
tcaiger Jan 12, 2025
e299dd2
fix scrolling view
tcaiger Jan 13, 2025
a1ba49c
merge: update epic (#6052)
jaskfla Jan 15, 2025
33656f9
Merge branch 'dev' into rn-1452-survey-select
jaskfla Jan 15, 2025
ace4ff9
Merge branch 'dev' into rn-1452-survey-select
jaskfla Jan 15, 2025
54c04c5
Merge branch 'dev' into rn-1452-survey-select
jaskfla Jan 16, 2025
4c6f96d
Merge branch 'rn-1452-survey-select' into rn-1468-mobile-tasking
tcaiger Jan 16, 2025
103771d
refactor tasks header
tcaiger Jan 16, 2025
61e099a
update filters
tcaiger Jan 17, 2025
5f9e2d6
Merge branch 'dev' into rn-1452-survey-select
jaskfla Jan 17, 2025
aa36183
Merge branch 'dev' into rn-1452-survey-select
jaskfla Jan 19, 2025
21a06ad
Merge branch 'dev' into rn-1452-survey-select
rohan-bes Jan 20, 2025
742b908
tasks filters
tcaiger Jan 20, 2025
669db78
add ProjectUsersRoute
tcaiger Jan 21, 2025
5e96735
add http example
tcaiger Jan 21, 2025
eedb64f
move getFilterUsersForProject
tcaiger Jan 21, 2025
4eea103
Merge branch 'rn-1468-mobile-tasks-ui-backend' into rn-1468-mobile-ta…
tcaiger Jan 21, 2025
4a15c9c
clean up
tcaiger Jan 21, 2025
87098dc
Update MobileTaskFilters.tsx
tcaiger Jan 21, 2025
cd4fee8
fixes
tcaiger Jan 21, 2025
72d1118
remove unused code
tcaiger Jan 22, 2025
89aa451
tweak
tcaiger Jan 22, 2025
275ca2f
style tweaks
tcaiger Jan 22, 2025
1916c1d
Update MobileTaskFilters.tsx
tcaiger Jan 22, 2025
3528381
Update MobileTaskFilters.tsx
tcaiger Jan 22, 2025
1355520
Update TasksTable.tsx
tcaiger Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
filter stories
tcaiger committed Dec 3, 2024
commit 7d14a4d540211e1d41dc9864d081cc24585fc036
32 changes: 32 additions & 0 deletions packages/datatrak-web/src/components/Icons/FiltersIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Tupaia
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import React from 'react';
import { SvgIcon, SvgIconProps } from '@material-ui/core';

export const FiltersIcon = ({ htmlColor = 'currentColor', ...props }: SvgIconProps) => {
return (
<SvgIcon
{...props}
width="26"
height="26"
viewBox="0 0 26 26"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1.05406 5.05555H2.96063C3.18926 5.8872 3.67584 6.6194 4.34639 7.14083C5.01695 7.66227 5.83482 7.94443 6.67568 7.94443C7.51654 7.94443 8.33441 7.66227 9.00496 7.14083C9.67552 6.6194 10.1621 5.8872 10.3907 5.05555H24.9459C25.2255 5.05555 25.4936 4.94141 25.6913 4.73825C25.8889 4.53508 26 4.25953 26 3.97222C26 3.6849 25.8889 3.40935 25.6913 3.20618C25.4936 3.00302 25.2255 2.88888 24.9459 2.88888H10.3907C10.1621 2.05723 9.67552 1.32504 9.00496 0.803599C8.33441 0.282163 7.51654 0 6.67568 0C5.83482 0 5.01695 0.282163 4.34639 0.803599C3.67584 1.32504 3.18926 2.05723 2.96063 2.88888H1.05406C0.774503 2.88888 0.5064 3.00302 0.308726 3.20618C0.111052 3.40935 0 3.6849 0 3.97222C0 4.25953 0.111052 4.53508 0.308726 4.73825C0.5064 4.94141 0.774503 5.05555 1.05406 5.05555ZM6.67568 2.16664C7.02313 2.16664 7.36278 2.27254 7.65168 2.47094C7.94057 2.66933 8.16574 2.95132 8.2987 3.28124C8.43166 3.61116 8.46645 3.97419 8.39867 4.32443C8.33089 4.67467 8.16357 4.99639 7.91789 5.2489C7.67221 5.50141 7.35918 5.67337 7.01841 5.74304C6.67763 5.81271 6.32441 5.77696 6.0034 5.64031C5.6824 5.50365 5.40803 5.27223 5.21499 4.97532C5.02196 4.6784 4.91892 4.32932 4.91892 3.97222C4.91946 3.49352 5.10472 3.03459 5.43405 2.6961C5.76339 2.35761 6.20992 2.1672 6.67568 2.16664Z"
fill="white"
/>
<path
d="M24.9459 11.9167H22.3367C22.108 11.0851 21.6215 10.3529 20.9509 9.83143C20.2803 9.31 19.4625 9.02783 18.6216 9.02783C17.7808 9.02783 16.9629 9.31 16.2923 9.83143C15.6218 10.3529 15.1352 11.0851 14.9066 11.9167H1.05406C0.774503 11.9167 0.5064 12.0309 0.308726 12.234C0.111052 12.4372 0 12.7127 0 13C0 13.2874 0.111052 13.5629 0.308726 13.7661C0.5064 13.9692 0.774503 14.0834 1.05406 14.0834H14.9066C15.1352 14.915 15.6218 15.6472 16.2923 16.1687C16.9629 16.6901 17.7808 16.9723 18.6216 16.9723C19.4625 16.9723 20.2803 16.6901 20.9509 16.1687C21.6215 15.6472 22.108 14.915 22.3367 14.0834H24.9459C25.2255 14.0834 25.4936 13.9692 25.6913 13.7661C25.8889 13.5629 26 13.2874 26 13C26 12.7127 25.8889 12.4372 25.6913 12.234C25.4936 12.0309 25.2255 11.9167 24.9459 11.9167ZM18.6216 14.8056C18.2742 14.8056 17.9345 14.6997 17.6456 14.5013C17.3567 14.3029 17.1316 14.0209 16.9986 13.691C16.8656 13.3611 16.8308 12.998 16.8986 12.6478C16.9664 12.2976 17.1337 11.9758 17.3794 11.7233C17.6251 11.4708 17.9381 11.2989 18.2789 11.2292C18.6197 11.1595 18.9729 11.1953 19.2939 11.3319C19.6149 11.4686 19.8893 11.7 20.0823 11.9969C20.2753 12.2939 20.3784 12.6429 20.3784 13C20.3778 13.4787 20.1926 13.9377 19.8632 14.2761C19.5339 14.6146 19.0874 14.805 18.6216 14.8056Z"
fill="white"
/>
<path
d="M24.9459 20.9445H10.3907C10.1621 20.1128 9.67552 19.3806 9.00496 18.8592C8.33441 18.3377 7.51654 18.0556 6.67568 18.0556C5.83482 18.0556 5.01695 18.3377 4.34639 18.8592C3.67584 19.3806 3.18926 20.1128 2.96063 20.9445H1.05406C0.774503 20.9445 0.5064 21.0586 0.308726 21.2618C0.111052 21.4649 0 21.7405 0 22.0278C0 22.3151 0.111052 22.5907 0.308726 22.7938C0.5064 22.997 0.774503 23.1111 1.05406 23.1111H2.96063C3.18926 23.9428 3.67584 24.675 4.34639 25.1964C5.01695 25.7178 5.83482 26 6.67568 26C7.51654 26 8.33441 25.7178 9.00496 25.1964C9.67552 24.675 10.1621 23.9428 10.3907 23.1111H24.9459C25.2255 23.1111 25.4936 22.997 25.6913 22.7938C25.8889 22.5907 26 22.3151 26 22.0278C26 21.7405 25.8889 21.4649 25.6913 21.2618C25.4936 21.0586 25.2255 20.9445 24.9459 20.9445ZM6.67568 23.8334C6.32823 23.8334 5.98857 23.7275 5.69968 23.5291C5.41078 23.3307 5.18561 23.0487 5.05265 22.7188C4.91968 22.3888 4.88489 22.0258 4.95268 21.6756C5.02046 21.3253 5.18778 21.0036 5.43347 20.7511C5.67915 20.4986 5.99218 20.3266 6.33295 20.257C6.67373 20.1873 7.02696 20.223 7.34796 20.3597C7.66896 20.4964 7.94333 20.7278 8.13637 21.0247C8.3294 21.3216 8.43243 21.6707 8.43243 22.0278C8.43189 22.5065 8.24662 22.9654 7.91729 23.3039C7.58795 23.6424 7.14143 23.8328 6.67568 23.8334Z"
fill="white"
/>
</SvgIcon>
);
};
1 change: 1 addition & 0 deletions packages/datatrak-web/src/components/Icons/index.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
*/
export { Coconut } from './Coconut';
export { FiltersIcon } from './FiltersIcon';
export { Pig } from './Pig';
export { SurveyIcon } from './SurveyIcon';
export { SurveyFolderIcon } from './SurveyFolderIcon';
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/**
* Tupaia
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import React, { useState } from 'react';
import styled from 'styled-components';
import { TransitionProps } from '@material-ui/core/transitions';
import Slide from '@material-ui/core/Slide';
import { Tabs, Tab, Fab, Typography } from '@material-ui/core';
import { FiltersIcon, Modal, Button } from '../../../components';

const FilterButton = styled(Fab).attrs({ color: 'primary' })`
position: absolute;
bottom: 1rem;
right: 2rem;
`;

const StyledModal = styled(Modal)`
.MuiDialog-scrollPaper {
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.MuiPaper-root {
max-height: 600px;
> div {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
`;

const StyledTabs = styled(Tabs)`
border: 1px solid ${({ theme }) => theme.palette.primary.main};
border-radius: 5px;
margin-block-start: 1.5rem;
.MuiTabs-indicator {
display: none;
}
.MuiTab-root {
border-right: 1px solid ${({ theme }) => theme.palette.primary.main};
color: ${({ theme }) => theme.palette.text.primary};
&.Mui-selected {
background: rgba(50, 141, 229, 0.1);
}
&:last-child {
border-right: none;
}
}
`;

const Panel = styled.div`
padding: 1rem 0;
flex: 1;
`;

const SelectList = styled.div`
h100%;
border: 1px solid ${({ theme }) => theme.palette.divider};
`;

const DialogActions = styled.div`
display: flex;
padding: 8px;
align-items: center;
justify-content: center;
`;

const Title = styled(Typography).attrs({
variant: 'h2',
})`
font-size: 1.125rem;
`;

/**
* Taken from [Material UI's example](https://v4.mui.com/components/dialogs/#full-screen-dialogs) to make the dialog slide up from the bottom
*/
export const SlideTransition = React.forwardRef(function Transition(
props: TransitionProps & { children?: React.ReactElement },
ref: React.Ref<unknown>,
) {
return <Slide direction="up" ref={ref} {...props} />;
});

const TabPanel = ({ children, value, index, ...props }) => {
if (value !== index) {
return null;
}

return (
<Panel
role="tabpanel"
id={`full-width-tabpanel-${index}`}
aria-labelledby={`full-width-tab-${index}`}
{...props}
>
{children}
</Panel>
);
};

function a11yProps(index) {
return {
id: `simple-tab-${index}`,
'aria-controls': `simple-tabpanel-${index}`,
};
}

export const MobileTaskFilters = () => {
const [isOpen, setIsOpen] = useState(false);
const [value, setValue] = useState(0);

const handleChange = (event, newValue) => {
setValue(newValue);
};

const openFilters = () => {
setIsOpen(true);
};

const onClose = () => {
setIsOpen(false);
};

return (
<>
<FilterButton onClick={openFilters}>
<FiltersIcon />
</FilterButton>
<StyledModal
open={isOpen}
onClose={onClose}
disablePortal={false}
fullScreen
TransitionComponent={SlideTransition}
>
<Title>Filter by</Title>
<StyledTabs
value={value}
onChange={handleChange}
indicatorColor="primary"
textColor="primary"
variant="fullWidth"
aria-label="full width tabs example"
>
<Tab label="Survey" {...a11yProps(0)} />
<Tab label="Entity" {...a11yProps(1)} />
<Tab label="Assignee" {...a11yProps(2)} />
</StyledTabs>
<TabPanel value={value} index={0}>
<SelectList>Survey options</SelectList>
</TabPanel>
<TabPanel value={value} index={1}>
<SelectList>Entity options</SelectList>
</TabPanel>
<TabPanel value={value} index={2}>
<SelectList>Assignee options</SelectList>
</TabPanel>
<DialogActions>
<Button variant="text" color="default">
Clear filters
</Button>
<Button>Apply</Button>
</DialogActions>
</StyledModal>
</>
);
};
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ import { StatusFilter } from './StatusFilter';
import { ActionButton } from './ActionButton';
import { FilterToolbar } from './FilterToolbar';
import { RepeatScheduleFilter } from './RepeatScheduleFilter';
import { MobileTaskFilters } from './MobileTaskFilters';

const Container = styled.div`
display: flex;
@@ -259,6 +260,7 @@ export const TasksTable = () => {
noDataMessage="No tasks to display. Click the ‘+ Create task’ button above to add a new task."
isLoading={isLoading}
/>
<MobileTaskFilters />
</Container>
);
};
37 changes: 37 additions & 0 deletions packages/datatrak-web/stories/mobileTaskFilters.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Tupaia
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import styled from 'styled-components';
import { MobileTaskFilters } from '../src/features/Tasks/TasksTable/MobileTaskFilters';

const Container = styled.div`
position: relative;
background: #f0f0f0;
border-radius: 10px;
width: 500px;
height: 800px;
max-height: 90vh;
max-width: 90vw;
`;

const meta: Meta<typeof MobileTaskFilters> = {
title: 'components/MobileTaskFilters',
component: MobileTaskFilters,
decorators: [
Story => (
<Container>
<Story />
</Container>
),
],
};

export default meta;
type Story = StoryObj<typeof MobileTaskFilters>;

export const Simple: Story = {
render: () => <MobileTaskFilters />,
};
32 changes: 0 additions & 32 deletions packages/datatrak-web/stories/taskFilter.stories.tsx

This file was deleted.