From a6850de17f33a3bdeee7506f2a638d8066dcd201 Mon Sep 17 00:00:00 2001 From: cbolles Date: Wed, 10 Jan 2024 15:47:35 -0500 Subject: [PATCH 01/10] Rendering of study form in tag view --- .../src/components/TagView.component.tsx | 15 ++-- .../src/pages/contribute/Contribute.tsx | 75 +------------------ 2 files changed, 9 insertions(+), 81 deletions(-) diff --git a/packages/client/src/components/TagView.component.tsx b/packages/client/src/components/TagView.component.tsx index 5d2fa274..1a7c5455 100644 --- a/packages/client/src/components/TagView.component.tsx +++ b/packages/client/src/components/TagView.component.tsx @@ -1,12 +1,13 @@ import { JsonForms } from '@jsonforms/react'; import { materialRenderers, materialCells } from '@jsonforms/material-renderers'; -import { useLocation, useNavigate } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import { Box, Button, Container, Typography } from '@mui/material'; import { useState } from 'react'; +import { useStudy } from '../context/Study.context'; export const TagView = () => { - const { state } = useLocation(); - console.log(state); + const { study } = useStudy(); + const [initialData, setData] = useState({ name: '', name_noDefault: '', @@ -31,12 +32,12 @@ export const TagView = () => { }; return ( - - {state ? ( + + {study ? ( { const initialData = { image: placeholder, @@ -88,7 +15,7 @@ export const ContributePage: React.FC = () => { const handleSubmit = () => { //submit logic //redirect to next page - navigate('/tagging', { state: { schema: schema, uischema: uischema } }); + navigate('/tagging'); }; return ( From 08e926883d0f7d9aa5e1c841dba713a5027b35e2 Mon Sep 17 00:00:00 2001 From: cbolles Date: Wed, 10 Jan 2024 16:02:28 -0500 Subject: [PATCH 02/10] Cleanup CSS settings --- .../src/components/TagView.component.tsx | 9 ++-- .../src/pages/contribute/Contribute.tsx | 47 ++++++++----------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/packages/client/src/components/TagView.component.tsx b/packages/client/src/components/TagView.component.tsx index 1a7c5455..f8141a03 100644 --- a/packages/client/src/components/TagView.component.tsx +++ b/packages/client/src/components/TagView.component.tsx @@ -42,15 +42,12 @@ export const TagView = () => { renderers={materialRenderers} cells={materialCells} /> - - - - diff --git a/packages/client/src/pages/contribute/Contribute.tsx b/packages/client/src/pages/contribute/Contribute.tsx index 9b3c80b0..ad130663 100644 --- a/packages/client/src/pages/contribute/Contribute.tsx +++ b/packages/client/src/pages/contribute/Contribute.tsx @@ -1,43 +1,34 @@ import { Typography, Box, Stack, Button } from '@mui/material'; -import placeholder from './placeholder.png'; import { useNavigate } from 'react-router-dom'; +import { useStudy } from '../../context/Study.context'; export const ContributePage: React.FC = () => { - const initialData = { - image: placeholder, - name: 'Study 12', - description: 'This study focuses on the verb conjugation', - instructions: 'Analyze common verb conjugations and recognize a pattern', - complete: false - }; const navigate = useNavigate(); + const { study } = useStudy(); - const handleSubmit = () => { - //submit logic - //redirect to next page + const enterTagging = () => { navigate('/tagging'); }; + // TODO: Add in check for training completion return ( - - Study: {initialData.name} - - - {initialData.complete ? 'Study Training' : 'Study Tagging'} - Study: {initialData.name} - Description: {initialData.description} - Instructions: {initialData.instructions} - {initialData.complete ? ( - - Training Complete! Reach out to your study administrator to get access to tagging - - ) : ( - - )} - + + - + )} + ); }; From c77fd4ebcc363cbc696019338419dde666ab7d94 Mon Sep 17 00:00:00 2001 From: cbolles Date: Wed, 10 Jan 2024 16:22:23 -0500 Subject: [PATCH 03/10] Fix spacing on buttons --- .../client/src/components/TagView.component.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/client/src/components/TagView.component.tsx b/packages/client/src/components/TagView.component.tsx index f8141a03..c1605863 100644 --- a/packages/client/src/components/TagView.component.tsx +++ b/packages/client/src/components/TagView.component.tsx @@ -1,7 +1,7 @@ import { JsonForms } from '@jsonforms/react'; import { materialRenderers, materialCells } from '@jsonforms/material-renderers'; import { useNavigate } from 'react-router-dom'; -import { Box, Button, Container, Typography } from '@mui/material'; +import { Box, Button, Container, Typography, Stack } from '@mui/material'; import { useState } from 'react'; import { useStudy } from '../context/Study.context'; @@ -34,7 +34,7 @@ export const TagView = () => { return ( {study ? ( - + { renderers={materialRenderers} cells={materialCells} /> - + - - - + + + ) : ( No Entries Tagged From e9a383a4cb57a023f17d8b698704ebfbd20360b9 Mon Sep 17 00:00:00 2001 From: cbolles Date: Thu, 11 Jan 2024 11:30:13 -0500 Subject: [PATCH 04/10] Breaking up tag form page --- packages/client/src/App.tsx | 9 ++++---- .../src/components/SideBar.component.tsx | 2 +- .../contribute/EntryView.component.tsx | 4 ++++ .../contribute/TagForm.component.tsx | 21 ++++++++++++++++++ .../{ => contribute}/TagView.component.tsx | 8 +++---- .../{Contribute.tsx => ContributeLanding.tsx} | 4 ++-- .../src/pages/contribute/TaggingInterface.tsx | 20 +++++++++++++++++ .../src/pages/contribute/placeholder.png | Bin 3802 -> 0 bytes .../client/src/pages/studies/NewStudy.tsx | 2 +- 9 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 packages/client/src/components/contribute/EntryView.component.tsx create mode 100644 packages/client/src/components/contribute/TagForm.component.tsx rename packages/client/src/components/{ => contribute}/TagView.component.tsx (91%) rename packages/client/src/pages/contribute/{Contribute.tsx => ContributeLanding.tsx} (92%) create mode 100644 packages/client/src/pages/contribute/TaggingInterface.tsx delete mode 100644 packages/client/src/pages/contribute/placeholder.png diff --git a/packages/client/src/App.tsx b/packages/client/src/App.tsx index 4a2d8cd5..7482aaaf 100644 --- a/packages/client/src/App.tsx +++ b/packages/client/src/App.tsx @@ -7,8 +7,8 @@ import { NewProject } from './pages/projects/NewProject'; import { ProjectControl } from './pages/projects/ProjectControl'; import { SuccessPage } from './pages/SuccessPage'; import { NewStudy } from './pages/studies/NewStudy'; -import { ContributePage } from './pages/contribute/Contribute'; -import { TagView } from './components/TagView.component'; +import { ContributeLanding } from './pages/contribute/ContributeLanding'; +import { TaggingInterface } from './pages/contribute/TaggingInterface'; import { StudyControl } from './pages/studies/StudyControl'; import { ProjectAccess } from './pages/datasets/ProjectAccess'; import { ProjectUserPermissions } from './pages/projects/ProjectUserPermissions'; @@ -29,6 +29,7 @@ import { setContext } from '@apollo/client/link/context'; import { StudyProvider } from './context/Study.context'; import { ConfirmationProvider } from './context/Confirmation.context'; import { DatasetProvider } from './context/Dataset.context'; +import {TaggingInterface} from './pages/contribute/TaggingInterface'; const drawerWidth = 256; const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })<{ @@ -131,8 +132,8 @@ const MyRoutes: FC = () => { } /> } /> } /> - } /> - } /> + } /> + } /> } /> diff --git a/packages/client/src/components/SideBar.component.tsx b/packages/client/src/components/SideBar.component.tsx index 832e1960..91fcbdc4 100644 --- a/packages/client/src/components/SideBar.component.tsx +++ b/packages/client/src/components/SideBar.component.tsx @@ -50,7 +50,7 @@ export const SideBar: FC = ({ open, drawerWidth }) => { name: 'Contribute', action: () => {}, icon: , - subItems: [{ name: 'Tag in Study', action: () => navigate('/study/contribute') }] + subItems: [{ name: 'Tag in Study', action: () => navigate('/contribute/landing') }] }, { name: 'Logout', diff --git a/packages/client/src/components/contribute/EntryView.component.tsx b/packages/client/src/components/contribute/EntryView.component.tsx new file mode 100644 index 00000000..8d3d6625 --- /dev/null +++ b/packages/client/src/components/contribute/EntryView.component.tsx @@ -0,0 +1,4 @@ + +export const EntryView: React.FC = () => { + return

hello

; +}; diff --git a/packages/client/src/components/contribute/TagForm.component.tsx b/packages/client/src/components/contribute/TagForm.component.tsx new file mode 100644 index 00000000..d26288a0 --- /dev/null +++ b/packages/client/src/components/contribute/TagForm.component.tsx @@ -0,0 +1,21 @@ +import { JsonForms } from '@jsonforms/react'; +import { Study } from '../../graphql/graphql'; +import { materialRenderers } from '@jsonforms/material-renderers'; +import { useState } from 'react'; + +export interface TagFormProps { + study: Study; +}; + +export const TagForm: React.FC = (props) => { + const [data, setData] = useState({}); + + return ( + + ); +}; diff --git a/packages/client/src/components/TagView.component.tsx b/packages/client/src/components/contribute/TagView.component.tsx similarity index 91% rename from packages/client/src/components/TagView.component.tsx rename to packages/client/src/components/contribute/TagView.component.tsx index c1605863..28e8c3c6 100644 --- a/packages/client/src/components/TagView.component.tsx +++ b/packages/client/src/components/contribute/TagView.component.tsx @@ -1,9 +1,9 @@ import { JsonForms } from '@jsonforms/react'; import { materialRenderers, materialCells } from '@jsonforms/material-renderers'; import { useNavigate } from 'react-router-dom'; -import { Box, Button, Container, Typography, Stack } from '@mui/material'; +import { Box, Button, Typography, Stack } from '@mui/material'; import { useState } from 'react'; -import { useStudy } from '../context/Study.context'; +import { useStudy } from '../../context/Study.context'; export const TagView = () => { const { study } = useStudy(); @@ -32,7 +32,7 @@ export const TagView = () => { }; return ( - + <> {study ? ( {
)} -
+ ); }; diff --git a/packages/client/src/pages/contribute/Contribute.tsx b/packages/client/src/pages/contribute/ContributeLanding.tsx similarity index 92% rename from packages/client/src/pages/contribute/Contribute.tsx rename to packages/client/src/pages/contribute/ContributeLanding.tsx index ad130663..e2e27f5b 100644 --- a/packages/client/src/pages/contribute/Contribute.tsx +++ b/packages/client/src/pages/contribute/ContributeLanding.tsx @@ -2,12 +2,12 @@ import { Typography, Box, Stack, Button } from '@mui/material'; import { useNavigate } from 'react-router-dom'; import { useStudy } from '../../context/Study.context'; -export const ContributePage: React.FC = () => { +export const ContributeLanding: React.FC = () => { const navigate = useNavigate(); const { study } = useStudy(); const enterTagging = () => { - navigate('/tagging'); + navigate('/contribute/tagging'); }; // TODO: Add in check for training completion diff --git a/packages/client/src/pages/contribute/TaggingInterface.tsx b/packages/client/src/pages/contribute/TaggingInterface.tsx new file mode 100644 index 00000000..8150a3e3 --- /dev/null +++ b/packages/client/src/pages/contribute/TaggingInterface.tsx @@ -0,0 +1,20 @@ +import { Stack } from '@mui/material'; +import { EntryView } from '../../components/contribute/EntryView.component'; +import { TagForm } from '../../components/contribute/TagForm.component'; +import { useStudy } from '../../context/Study.context'; + + +export const TaggingInterface: React.FC = () => { + const { study } = useStudy(); + + return ( + <> + {study && ( + + + + + )} + + ); +}; diff --git a/packages/client/src/pages/contribute/placeholder.png b/packages/client/src/pages/contribute/placeholder.png deleted file mode 100644 index 5a6e78be17cbb207aa6051b59d4e044718a9f51e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3802 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 diff --git a/packages/client/src/pages/studies/NewStudy.tsx b/packages/client/src/pages/studies/NewStudy.tsx index ba89b714..2a8596ca 100644 --- a/packages/client/src/pages/studies/NewStudy.tsx +++ b/packages/client/src/pages/studies/NewStudy.tsx @@ -3,7 +3,7 @@ import { TagsDisplay } from '../../components/TagsDisplay.component'; import { NewStudyJsonForm } from '../../components/NewStudyJsonForm.component'; import { TagTrainingComponent } from '../../components/TagTraining.component'; import { useState, useEffect } from 'react'; -import { StudyCreate, TagSchema } from '../../graphql/graphql'; +import { Study, StudyCreate, TagSchema } from '../../graphql/graphql'; import { PartialStudyCreate } from '../../types/study'; import { CreateStudyDocument } from '../../graphql/study/study'; import { useProject } from '../../context/Project.context'; From 1ae42d9baa059e59441df16a4428f8b313e7690d Mon Sep 17 00:00:00 2001 From: cbolles Date: Thu, 11 Jan 2024 12:11:14 -0500 Subject: [PATCH 05/10] Fix setting of width in entry view --- .../src/components/EntryView.component.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/client/src/components/EntryView.component.tsx b/packages/client/src/components/EntryView.component.tsx index cb8b619b..6d3d11bc 100644 --- a/packages/client/src/components/EntryView.component.tsx +++ b/packages/client/src/components/EntryView.component.tsx @@ -1,3 +1,4 @@ +import {Box} from '@mui/material'; import { Entry } from '../graphql/graphql'; import { useEffect, useRef } from 'react'; @@ -7,15 +8,15 @@ export interface EntryViewProps { } export const EntryView: React.FC = (props) => { - return getEntryView(props.entry); + return getEntryView(props.entry, props.width); }; -const getEntryView = (entry: Entry) => { +const getEntryView = (entry: Entry, width: number) => { if (entry.contentType.startsWith('video/')) { - return ; + return ; } if (entry.contentType.startsWith('image/')) { - return ; + return ; } console.error('Unknown entry type'); return

Placeholder

; @@ -85,12 +86,18 @@ const VideoEntryView: React.FC = (props) => { }, [videoRef.current]); return ( - + + + ); }; const ImageEntryView: React.FC = (props) => { - return ; + return ( + + + + ); }; From e614fea0d92c3aa2b7199bea0313697d8e7f7054 Mon Sep 17 00:00:00 2001 From: cbolles Date: Thu, 11 Jan 2024 12:43:55 -0500 Subject: [PATCH 06/10] Ability to collect tags --- packages/client/src/App.tsx | 1 - .../src/components/EntryView.component.tsx | 40 +++++--- .../contribute/EntryView.component.tsx | 4 - .../contribute/TagForm.component.tsx | 53 +++++++++-- .../contribute/TagView.component.tsx | 64 ------------- packages/client/src/graphql/entry.ts | 2 +- packages/client/src/graphql/graphql.ts | 2 +- packages/client/src/graphql/tag.graphql | 22 +++++ packages/client/src/graphql/tag.ts | 94 ++++++++++++++++++- packages/client/src/graphql/tag/tag.graphql | 0 .../src/pages/contribute/TaggingInterface.tsx | 61 ++++++++++-- 11 files changed, 242 insertions(+), 101 deletions(-) delete mode 100644 packages/client/src/components/contribute/EntryView.component.tsx delete mode 100644 packages/client/src/components/contribute/TagView.component.tsx create mode 100644 packages/client/src/graphql/tag/tag.graphql diff --git a/packages/client/src/App.tsx b/packages/client/src/App.tsx index 7482aaaf..6bc30d06 100644 --- a/packages/client/src/App.tsx +++ b/packages/client/src/App.tsx @@ -29,7 +29,6 @@ import { setContext } from '@apollo/client/link/context'; import { StudyProvider } from './context/Study.context'; import { ConfirmationProvider } from './context/Confirmation.context'; import { DatasetProvider } from './context/Dataset.context'; -import {TaggingInterface} from './pages/contribute/TaggingInterface'; const drawerWidth = 256; const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })<{ diff --git a/packages/client/src/components/EntryView.component.tsx b/packages/client/src/components/EntryView.component.tsx index 6d3d11bc..f25005d8 100644 --- a/packages/client/src/components/EntryView.component.tsx +++ b/packages/client/src/components/EntryView.component.tsx @@ -5,29 +5,34 @@ import { useEffect, useRef } from 'react'; export interface EntryViewProps { entry: Entry; width: number; + pauseFrame?: 'start' | 'end' | 'middle'; + autoPlay?: boolean; + mouseOverControls?: boolean; + displayControls?: boolean; } export const EntryView: React.FC = (props) => { - return getEntryView(props.entry, props.width); + return getEntryView(props); }; -const getEntryView = (entry: Entry, width: number) => { - if (entry.contentType.startsWith('video/')) { - return ; +const getEntryView = (props: EntryViewProps) => { + if (props.entry.contentType.startsWith('video/')) { + return ; } - if (entry.contentType.startsWith('image/')) { - return ; + if (props.entry.contentType.startsWith('image/')) { + return ; } console.error('Unknown entry type'); return

Placeholder

; }; +// TODO: Add in ability to control video play, pause, and middle frame selection const VideoEntryView: React.FC = (props) => { const videoRef = useRef(null); /** Start the video at the begining */ const handleStart: React.MouseEventHandler = () => { - if (!videoRef.current) { + if (!videoRef.current || (props.mouseOverControls != undefined && !props.mouseOverControls)) { return; } videoRef.current.currentTime = 0; @@ -36,20 +41,25 @@ const VideoEntryView: React.FC = (props) => { /** Stop the video */ const handleStop: React.MouseEventHandler = () => { - if (!videoRef.current) { + if (!videoRef.current || (props.mouseOverControls != undefined && !props.mouseOverControls)) { return; } videoRef.current.pause(); - setMiddleFrame(); + setPauseFrame(); }; /** Set the video to the middle frame */ - const setMiddleFrame = async () => { + const setPauseFrame = async () => { if (!videoRef.current) { return; } - const duration = await getDuration(); - videoRef.current.currentTime = duration / 2; + + if (!props.pauseFrame || props.pauseFrame === 'middle') { + const duration = await getDuration(); + videoRef.current.currentTime = duration / 2; + } else if (props.pauseFrame === 'start') { + videoRef.current.currentTime = 0; + } }; /** Get the duration, there is a known issue on Chrome with some audio/video durations */ @@ -82,12 +92,12 @@ const VideoEntryView: React.FC = (props) => { // Set the video to the middle frame when the video is loaded useEffect(() => { - setMiddleFrame(); + setPauseFrame(); }, [videoRef.current]); return ( - @@ -97,7 +107,7 @@ const VideoEntryView: React.FC = (props) => { const ImageEntryView: React.FC = (props) => { return ( - + ); }; diff --git a/packages/client/src/components/contribute/EntryView.component.tsx b/packages/client/src/components/contribute/EntryView.component.tsx deleted file mode 100644 index 8d3d6625..00000000 --- a/packages/client/src/components/contribute/EntryView.component.tsx +++ /dev/null @@ -1,4 +0,0 @@ - -export const EntryView: React.FC = () => { - return

hello

; -}; diff --git a/packages/client/src/components/contribute/TagForm.component.tsx b/packages/client/src/components/contribute/TagForm.component.tsx index d26288a0..cb1c664c 100644 --- a/packages/client/src/components/contribute/TagForm.component.tsx +++ b/packages/client/src/components/contribute/TagForm.component.tsx @@ -1,21 +1,60 @@ import { JsonForms } from '@jsonforms/react'; import { Study } from '../../graphql/graphql'; import { materialRenderers } from '@jsonforms/material-renderers'; -import { useState } from 'react'; +import { SetStateAction, useState, Dispatch } from 'react'; +import { Box, Stack, Button } from '@mui/material'; +import { ErrorObject } from 'ajv'; export interface TagFormProps { study: Study; + setTagData: Dispatch>; }; export const TagForm: React.FC = (props) => { const [data, setData] = useState({}); + const [dataValid, setDataValid] = useState(false); + + const handleFormChange = (data: any, errors: ErrorObject[] | undefined) => { + setData(data); + + // No errors, data could be submitted + if (!errors || errors.length === 0) { + setDataValid(true); + } else { + setDataValid(false); + } + }; + + const handleSubmit = () => { + // Ideally should not get here + if (!dataValid) { + return; + } + props.setTagData(data); + + // Get ready for the next tag + handleClear(); + }; + + const handleClear = () => { + setData({}); + }; return ( - + + + handleFormChange(data, errors)} + renderers={materialRenderers} + /> + + + + + + ); }; diff --git a/packages/client/src/components/contribute/TagView.component.tsx b/packages/client/src/components/contribute/TagView.component.tsx deleted file mode 100644 index 28e8c3c6..00000000 --- a/packages/client/src/components/contribute/TagView.component.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { JsonForms } from '@jsonforms/react'; -import { materialRenderers, materialCells } from '@jsonforms/material-renderers'; -import { useNavigate } from 'react-router-dom'; -import { Box, Button, Typography, Stack } from '@mui/material'; -import { useState } from 'react'; -import { useStudy } from '../../context/Study.context'; - -export const TagView = () => { - const { study } = useStudy(); - - const [initialData, setData] = useState({ - name: '', - name_noDefault: '', - description: '', - done: true, - rating: 0, - cost: 3.14, - dueDate: '2019-05-01' - }); - - const navigate = useNavigate(); - - const handleNext = () => { - //first save tagged data by sending it to backend - //then tag the next entry - - setData({ name: '', name_noDefault: '', description: '', done: false, rating: 0, cost: 0, dueDate: '2023-07-24' }); - }; - - const handleClick = (route: string) => { - navigate('/' + route); - }; - - return ( - <> - {study ? ( - - - - - - - - ) : ( - - No Entries Tagged - - - )} - - ); -}; diff --git a/packages/client/src/graphql/entry.ts b/packages/client/src/graphql/entry.ts index 4585bdab..6e170a4e 100644 --- a/packages/client/src/graphql/entry.ts +++ b/packages/client/src/graphql/entry.ts @@ -10,7 +10,7 @@ export type EntryForDatasetQueryVariables = Types.Exact<{ }>; -export type EntryForDatasetQuery = { __typename?: 'Query', entryForDataset: Array<{ __typename?: 'Entry', _id: string, organization: string, entryID: string, contentType: string, dataset: string, creator?: string | null, dateCreated: any, meta: any, signedUrl: string, signedUrlExpiration: number }> }; +export type EntryForDatasetQuery = { __typename?: 'Query', entryForDataset: Array<{ __typename?: 'Entry', _id: string, organization: string, entryID: string, contentType: string, dataset: string, creator: string, dateCreated: any, meta: any, signedUrl: string, signedUrlExpiration: number }> }; export const EntryForDatasetDocument = gql` diff --git a/packages/client/src/graphql/graphql.ts b/packages/client/src/graphql/graphql.ts index ef268a85..60097ca4 100644 --- a/packages/client/src/graphql/graphql.ts +++ b/packages/client/src/graphql/graphql.ts @@ -69,7 +69,7 @@ export type Entry = { __typename?: 'Entry'; _id: Scalars['String']['output']; contentType: Scalars['String']['output']; - creator?: Maybe; + creator: Scalars['ID']['output']; dataset: Scalars['ID']['output']; dateCreated: Scalars['DateTime']['output']; entryID: Scalars['String']['output']; diff --git a/packages/client/src/graphql/tag.graphql b/packages/client/src/graphql/tag.graphql index 9fff737a..8d204df3 100644 --- a/packages/client/src/graphql/tag.graphql +++ b/packages/client/src/graphql/tag.graphql @@ -3,3 +3,25 @@ mutation createTags($study: ID!, $entries: [ID!]!) { _id } } + +mutation assignTag($study: ID!) { + assignTag(study: $study) { + _id, + entry { + _id, + organization, + entryID, + contentType, + dataset, + creator, + dateCreated, + meta, + signedUrl, + signedUrlExpiration + } + } +} + +mutation completeTag($tag: ID!, $data: JSON!) { + completeTag(tag: $tag, data: $data) +} diff --git a/packages/client/src/graphql/tag.ts b/packages/client/src/graphql/tag.ts index 444b38f6..1321d6fb 100644 --- a/packages/client/src/graphql/tag.ts +++ b/packages/client/src/graphql/tag.ts @@ -13,6 +13,21 @@ export type CreateTagsMutationVariables = Types.Exact<{ export type CreateTagsMutation = { __typename?: 'Mutation', createTags: Array<{ __typename?: 'Tag', _id: string }> }; +export type AssignTagMutationVariables = Types.Exact<{ + study: Types.Scalars['ID']['input']; +}>; + + +export type AssignTagMutation = { __typename?: 'Mutation', assignTag?: { __typename?: 'Tag', _id: string, entry: { __typename?: 'Entry', _id: string, organization: string, entryID: string, contentType: string, dataset: string, creator: string, dateCreated: any, meta: any, signedUrl: string, signedUrlExpiration: number } } | null }; + +export type CompleteTagMutationVariables = Types.Exact<{ + tag: Types.Scalars['ID']['input']; + data: Types.Scalars['JSON']['input']; +}>; + + +export type CompleteTagMutation = { __typename?: 'Mutation', completeTag: boolean }; + export const CreateTagsDocument = gql` mutation createTags($study: ID!, $entries: [ID!]!) { @@ -47,4 +62,81 @@ export function useCreateTagsMutation(baseOptions?: Apollo.MutationHookOptions; export type CreateTagsMutationResult = Apollo.MutationResult; -export type CreateTagsMutationOptions = Apollo.BaseMutationOptions; \ No newline at end of file +export type CreateTagsMutationOptions = Apollo.BaseMutationOptions; +export const AssignTagDocument = gql` + mutation assignTag($study: ID!) { + assignTag(study: $study) { + _id + entry { + _id + organization + entryID + contentType + dataset + creator + dateCreated + meta + signedUrl + signedUrlExpiration + } + } +} + `; +export type AssignTagMutationFn = Apollo.MutationFunction; + +/** + * __useAssignTagMutation__ + * + * To run a mutation, you first call `useAssignTagMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAssignTagMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [assignTagMutation, { data, loading, error }] = useAssignTagMutation({ + * variables: { + * study: // value for 'study' + * }, + * }); + */ +export function useAssignTagMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(AssignTagDocument, options); + } +export type AssignTagMutationHookResult = ReturnType; +export type AssignTagMutationResult = Apollo.MutationResult; +export type AssignTagMutationOptions = Apollo.BaseMutationOptions; +export const CompleteTagDocument = gql` + mutation completeTag($tag: ID!, $data: JSON!) { + completeTag(tag: $tag, data: $data) +} + `; +export type CompleteTagMutationFn = Apollo.MutationFunction; + +/** + * __useCompleteTagMutation__ + * + * To run a mutation, you first call `useCompleteTagMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCompleteTagMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [completeTagMutation, { data, loading, error }] = useCompleteTagMutation({ + * variables: { + * tag: // value for 'tag' + * data: // value for 'data' + * }, + * }); + */ +export function useCompleteTagMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CompleteTagDocument, options); + } +export type CompleteTagMutationHookResult = ReturnType; +export type CompleteTagMutationResult = Apollo.MutationResult; +export type CompleteTagMutationOptions = Apollo.BaseMutationOptions; \ No newline at end of file diff --git a/packages/client/src/graphql/tag/tag.graphql b/packages/client/src/graphql/tag/tag.graphql new file mode 100644 index 00000000..e69de29b diff --git a/packages/client/src/pages/contribute/TaggingInterface.tsx b/packages/client/src/pages/contribute/TaggingInterface.tsx index 8150a3e3..17b2765f 100644 --- a/packages/client/src/pages/contribute/TaggingInterface.tsx +++ b/packages/client/src/pages/contribute/TaggingInterface.tsx @@ -1,19 +1,66 @@ -import { Stack } from '@mui/material'; -import { EntryView } from '../../components/contribute/EntryView.component'; +import { Box } from '@mui/material'; +import { EntryView } from '../../components/EntryView.component'; import { TagForm } from '../../components/contribute/TagForm.component'; import { useStudy } from '../../context/Study.context'; +import { useEffect, useState } from 'react'; +import { AssignTagMutation, useAssignTagMutation } from '../../graphql/tag'; +import { useCompleteTagMutation } from '../../graphql/tag'; export const TaggingInterface: React.FC = () => { const { study } = useStudy(); + const [tag, setTag] = useState(null); + const [assignTag, assignTagResult]= useAssignTagMutation(); + const [tagData, setTagData] = useState({}); + const [completeTag, completeTagResult] = useCompleteTagMutation(); + // Changes to study will trigger a new tag assignment + useEffect(() => { + // No study, then no tag + if (!study) { + setTag(null); + return; + } + + // Assign a tag + assignTag({ variables: { study: study._id }}); + }, [study]); + + // Update to the assigned tag + useEffect(() => { + if (!assignTagResult.data) { + setTag(null); + return; + } + + setTag(assignTagResult.data.assignTag); + }, [assignTagResult.data]); + + // Changes made to the tag data + useEffect(() => { + if (tagData && tag) { + // Submit the tag data + completeTag({ variables: { tag: tag._id, data: tagData }}); + } + }, [tagData]); + + // Tag submission result + // TODO: Handle errors + useEffect(() => { + if (completeTagResult.data && study) { + // Assign a new tag + assignTag({ variables: { study: study._id }}); + } + }, [completeTagResult.data]); + + // TODO: View for when there is no study vs when there is no tag return ( <> - {study && ( - - - - + {study && tag && ( + + + + )} ); From 18a3ecb9039c6a8a6ab6ace3db972ba7daa2a451 Mon Sep 17 00:00:00 2001 From: cbolles Date: Thu, 11 Jan 2024 13:02:01 -0500 Subject: [PATCH 07/10] Add in notification when tagging is complete --- .../NoTagNotification.component.tsx | 14 ++++++++++ .../src/pages/contribute/TaggingInterface.tsx | 28 +++++++++++++++---- 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 packages/client/src/components/contribute/NoTagNotification.component.tsx diff --git a/packages/client/src/components/contribute/NoTagNotification.component.tsx b/packages/client/src/components/contribute/NoTagNotification.component.tsx new file mode 100644 index 00000000..8594b080 --- /dev/null +++ b/packages/client/src/components/contribute/NoTagNotification.component.tsx @@ -0,0 +1,14 @@ +import { Stack, Typography } from '@mui/material'; + +export interface NoTagNotificationProps { + studyName: string; +} + +export const NoTagNotification: React.FC = ({ studyName }) => { + return ( + + No tags Remaining + No tags left for "{studyName}", please check back later + + ); +}; diff --git a/packages/client/src/pages/contribute/TaggingInterface.tsx b/packages/client/src/pages/contribute/TaggingInterface.tsx index 17b2765f..f711ac54 100644 --- a/packages/client/src/pages/contribute/TaggingInterface.tsx +++ b/packages/client/src/pages/contribute/TaggingInterface.tsx @@ -2,9 +2,11 @@ import { Box } from '@mui/material'; import { EntryView } from '../../components/EntryView.component'; import { TagForm } from '../../components/contribute/TagForm.component'; import { useStudy } from '../../context/Study.context'; -import { useEffect, useState } from 'react'; +import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { AssignTagMutation, useAssignTagMutation } from '../../graphql/tag'; import { useCompleteTagMutation } from '../../graphql/tag'; +import {NoTagNotification} from '../../components/contribute/NoTagNotification.component'; +import { Study } from '../../graphql/graphql'; export const TaggingInterface: React.FC = () => { @@ -56,12 +58,26 @@ export const TaggingInterface: React.FC = () => { // TODO: View for when there is no study vs when there is no tag return ( <> - {study && tag && ( - - - - + {study && ( + <> + {tag ? : } + )} ); }; + +interface MainViewProps { + tag: NonNullable; + setTagData: Dispatch>; + study: Study; +} + +const MainView: React.FC = (props) => { + return ( + + + + + ); +}; From 724c1f8ac2adb4d1566be0ef6b3935a8a9163968 Mon Sep 17 00:00:00 2001 From: cbolles Date: Thu, 11 Jan 2024 13:02:29 -0500 Subject: [PATCH 08/10] Fix formatting --- .../src/components/EntryView.component.tsx | 13 ++++++-- .../NoTagNotification.component.tsx | 2 +- .../contribute/TagForm.component.tsx | 14 +++++---- .../pages/contribute/ContributeLanding.tsx | 30 +++++++++---------- .../src/pages/contribute/TaggingInterface.tsx | 26 +++++++++++----- 5 files changed, 53 insertions(+), 32 deletions(-) diff --git a/packages/client/src/components/EntryView.component.tsx b/packages/client/src/components/EntryView.component.tsx index f25005d8..2be4d788 100644 --- a/packages/client/src/components/EntryView.component.tsx +++ b/packages/client/src/components/EntryView.component.tsx @@ -1,4 +1,4 @@ -import {Box} from '@mui/material'; +import { Box } from '@mui/material'; import { Entry } from '../graphql/graphql'; import { useEffect, useRef } from 'react'; @@ -97,7 +97,14 @@ const VideoEntryView: React.FC = (props) => { return ( - @@ -107,7 +114,7 @@ const VideoEntryView: React.FC = (props) => { const ImageEntryView: React.FC = (props) => { return ( - + ); }; diff --git a/packages/client/src/components/contribute/NoTagNotification.component.tsx b/packages/client/src/components/contribute/NoTagNotification.component.tsx index 8594b080..05382cf9 100644 --- a/packages/client/src/components/contribute/NoTagNotification.component.tsx +++ b/packages/client/src/components/contribute/NoTagNotification.component.tsx @@ -6,7 +6,7 @@ export interface NoTagNotificationProps { export const NoTagNotification: React.FC = ({ studyName }) => { return ( - + No tags Remaining No tags left for "{studyName}", please check back later diff --git a/packages/client/src/components/contribute/TagForm.component.tsx b/packages/client/src/components/contribute/TagForm.component.tsx index cb1c664c..9d627d5a 100644 --- a/packages/client/src/components/contribute/TagForm.component.tsx +++ b/packages/client/src/components/contribute/TagForm.component.tsx @@ -8,7 +8,7 @@ import { ErrorObject } from 'ajv'; export interface TagFormProps { study: Study; setTagData: Dispatch>; -}; +} export const TagForm: React.FC = (props) => { const [data, setData] = useState({}); @@ -42,7 +42,7 @@ export const TagForm: React.FC = (props) => { return ( - + = (props) => { onChange={({ data, errors }) => handleFormChange(data, errors)} renderers={materialRenderers} /> - - - + + + diff --git a/packages/client/src/pages/contribute/ContributeLanding.tsx b/packages/client/src/pages/contribute/ContributeLanding.tsx index e2e27f5b..eb032f38 100644 --- a/packages/client/src/pages/contribute/ContributeLanding.tsx +++ b/packages/client/src/pages/contribute/ContributeLanding.tsx @@ -13,22 +13,22 @@ export const ContributeLanding: React.FC = () => { // TODO: Add in check for training completion return ( <> - {study && ( - - Study: {study.name} - - - {false ? 'Study Training' : 'Study Tagging'} - Study: {study.name} - Description: {study.description} - Instructions: {study.instructions} - - + {study && ( + + Study: {study.name} + + + {false ? 'Study Training' : 'Study Tagging'} + Study: {study.name} + Description: {study.description} + Instructions: {study.instructions} + + + - - )} + )} ); }; diff --git a/packages/client/src/pages/contribute/TaggingInterface.tsx b/packages/client/src/pages/contribute/TaggingInterface.tsx index f711ac54..64d2ebd1 100644 --- a/packages/client/src/pages/contribute/TaggingInterface.tsx +++ b/packages/client/src/pages/contribute/TaggingInterface.tsx @@ -5,14 +5,13 @@ import { useStudy } from '../../context/Study.context'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { AssignTagMutation, useAssignTagMutation } from '../../graphql/tag'; import { useCompleteTagMutation } from '../../graphql/tag'; -import {NoTagNotification} from '../../components/contribute/NoTagNotification.component'; +import { NoTagNotification } from '../../components/contribute/NoTagNotification.component'; import { Study } from '../../graphql/graphql'; - export const TaggingInterface: React.FC = () => { const { study } = useStudy(); const [tag, setTag] = useState(null); - const [assignTag, assignTagResult]= useAssignTagMutation(); + const [assignTag, assignTagResult] = useAssignTagMutation(); const [tagData, setTagData] = useState({}); const [completeTag, completeTagResult] = useCompleteTagMutation(); @@ -25,7 +24,7 @@ export const TaggingInterface: React.FC = () => { } // Assign a tag - assignTag({ variables: { study: study._id }}); + assignTag({ variables: { study: study._id } }); }, [study]); // Update to the assigned tag @@ -42,7 +41,7 @@ export const TaggingInterface: React.FC = () => { useEffect(() => { if (tagData && tag) { // Submit the tag data - completeTag({ variables: { tag: tag._id, data: tagData }}); + completeTag({ variables: { tag: tag._id, data: tagData } }); } }, [tagData]); @@ -51,7 +50,7 @@ export const TaggingInterface: React.FC = () => { useEffect(() => { if (completeTagResult.data && study) { // Assign a new tag - assignTag({ variables: { study: study._id }}); + assignTag({ variables: { study: study._id } }); } }, [completeTagResult.data]); @@ -60,7 +59,11 @@ export const TaggingInterface: React.FC = () => { <> {study && ( <> - {tag ? : } + {tag ? ( + + ) : ( + + )} )} @@ -76,7 +79,14 @@ interface MainViewProps { const MainView: React.FC = (props) => { return ( - + ); From b9836245320797227e52004070d7293cfb3e8699 Mon Sep 17 00:00:00 2001 From: cbolles Date: Thu, 11 Jan 2024 13:13:06 -0500 Subject: [PATCH 09/10] Remove un-used import --- packages/client/src/pages/studies/NewStudy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/pages/studies/NewStudy.tsx b/packages/client/src/pages/studies/NewStudy.tsx index 2a8596ca..ba89b714 100644 --- a/packages/client/src/pages/studies/NewStudy.tsx +++ b/packages/client/src/pages/studies/NewStudy.tsx @@ -3,7 +3,7 @@ import { TagsDisplay } from '../../components/TagsDisplay.component'; import { NewStudyJsonForm } from '../../components/NewStudyJsonForm.component'; import { TagTrainingComponent } from '../../components/TagTraining.component'; import { useState, useEffect } from 'react'; -import { Study, StudyCreate, TagSchema } from '../../graphql/graphql'; +import { StudyCreate, TagSchema } from '../../graphql/graphql'; import { PartialStudyCreate } from '../../types/study'; import { CreateStudyDocument } from '../../graphql/study/study'; import { useProject } from '../../context/Project.context'; From 76c6b57138b7849a907c21189e39fb4b47f02028 Mon Sep 17 00:00:00 2001 From: cbolles Date: Fri, 12 Jan 2024 11:02:38 -0500 Subject: [PATCH 10/10] Consolidate tag files --- packages/client/src/graphql/tag.graphql | 27 ------------------- packages/client/src/graphql/tag/tag.graphql | 27 +++++++++++++++++++ packages/client/src/graphql/{ => tag}/tag.ts | 2 +- .../src/pages/contribute/TaggingInterface.tsx | 4 +-- .../client/src/pages/studies/NewStudy.tsx | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 packages/client/src/graphql/tag.graphql rename packages/client/src/graphql/{ => tag}/tag.ts (99%) diff --git a/packages/client/src/graphql/tag.graphql b/packages/client/src/graphql/tag.graphql deleted file mode 100644 index 8d204df3..00000000 --- a/packages/client/src/graphql/tag.graphql +++ /dev/null @@ -1,27 +0,0 @@ -mutation createTags($study: ID!, $entries: [ID!]!) { - createTags(study: $study, entries: $entries) { - _id - } -} - -mutation assignTag($study: ID!) { - assignTag(study: $study) { - _id, - entry { - _id, - organization, - entryID, - contentType, - dataset, - creator, - dateCreated, - meta, - signedUrl, - signedUrlExpiration - } - } -} - -mutation completeTag($tag: ID!, $data: JSON!) { - completeTag(tag: $tag, data: $data) -} diff --git a/packages/client/src/graphql/tag/tag.graphql b/packages/client/src/graphql/tag/tag.graphql index e69de29b..8d204df3 100644 --- a/packages/client/src/graphql/tag/tag.graphql +++ b/packages/client/src/graphql/tag/tag.graphql @@ -0,0 +1,27 @@ +mutation createTags($study: ID!, $entries: [ID!]!) { + createTags(study: $study, entries: $entries) { + _id + } +} + +mutation assignTag($study: ID!) { + assignTag(study: $study) { + _id, + entry { + _id, + organization, + entryID, + contentType, + dataset, + creator, + dateCreated, + meta, + signedUrl, + signedUrlExpiration + } + } +} + +mutation completeTag($tag: ID!, $data: JSON!) { + completeTag(tag: $tag, data: $data) +} diff --git a/packages/client/src/graphql/tag.ts b/packages/client/src/graphql/tag/tag.ts similarity index 99% rename from packages/client/src/graphql/tag.ts rename to packages/client/src/graphql/tag/tag.ts index 1321d6fb..05886d60 100644 --- a/packages/client/src/graphql/tag.ts +++ b/packages/client/src/graphql/tag/tag.ts @@ -1,6 +1,6 @@ /* Generated File DO NOT EDIT. */ /* tslint:disable */ -import * as Types from './graphql'; +import * as Types from '../graphql'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; diff --git a/packages/client/src/pages/contribute/TaggingInterface.tsx b/packages/client/src/pages/contribute/TaggingInterface.tsx index 64d2ebd1..81d0766f 100644 --- a/packages/client/src/pages/contribute/TaggingInterface.tsx +++ b/packages/client/src/pages/contribute/TaggingInterface.tsx @@ -3,8 +3,8 @@ import { EntryView } from '../../components/EntryView.component'; import { TagForm } from '../../components/contribute/TagForm.component'; import { useStudy } from '../../context/Study.context'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; -import { AssignTagMutation, useAssignTagMutation } from '../../graphql/tag'; -import { useCompleteTagMutation } from '../../graphql/tag'; +import { AssignTagMutation, useAssignTagMutation } from '../../graphql/tag/tag'; +import { useCompleteTagMutation } from '../../graphql/tag/tag'; import { NoTagNotification } from '../../components/contribute/NoTagNotification.component'; import { Study } from '../../graphql/graphql'; diff --git a/packages/client/src/pages/studies/NewStudy.tsx b/packages/client/src/pages/studies/NewStudy.tsx index ba89b714..3b27075c 100644 --- a/packages/client/src/pages/studies/NewStudy.tsx +++ b/packages/client/src/pages/studies/NewStudy.tsx @@ -9,7 +9,7 @@ import { CreateStudyDocument } from '../../graphql/study/study'; import { useProject } from '../../context/Project.context'; import { useStudy } from '../../context/Study.context'; import { useApolloClient } from '@apollo/client'; -import { CreateTagsDocument } from '../../graphql/tag'; +import { CreateTagsDocument } from '../../graphql/tag/tag'; export const NewStudy: React.FC = () => { const [activeStep, setActiveStep] = useState(0);