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

app-project: Redesign how your stats are displayed on the classify page #6472

Merged
merged 20 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4e1f716
create new YourProjectStats component with useSWR for data
goplayoutside3 Nov 15, 2024
015eaa1
create a stats container component and a RequireUser component
goplayoutside3 Nov 15, 2024
0a67bde
create ClassificationsChart component with VisX
goplayoutside3 Nov 15, 2024
d669f06
fix styling of ClassificationChart
goplayoutside3 Nov 15, 2024
abe26aa
remove all the legacy YourStats code
goplayoutside3 Nov 15, 2024
9468468
Delete FinishedForTheDay component per designer request
goplayoutside3 Nov 15, 2024
6db35bd
fix consistent returns warning
goplayoutside3 Nov 15, 2024
465891f
Merge branch 'master'
goplayoutside3 Nov 19, 2024
10a9912
add a mutate function for incrementing stats on classification
goplayoutside3 Nov 19, 2024
be27129
match Figma design and edit translation dictionaries
goplayoutside3 Nov 20, 2024
b8720b7
write unit tests for YourProjectStats
goplayoutside3 Nov 20, 2024
7705b3f
include mutate in the ClassifierWrapper useCallback
goplayoutside3 Nov 20, 2024
89251aa
be sure to increment session count on each classification
goplayoutside3 Nov 20, 2024
66ff700
add auth.checkCurrent() to usePanoptesAuth() hook
goplayoutside3 Nov 20, 2024
d7ec5b0
adjust layout of ClassifyPage
goplayoutside3 Nov 21, 2024
5624eb5
clean up translation keys
goplayoutside3 Nov 21, 2024
c59c58b
Merge branch 'master' into your-project-stats-refactor
goplayoutside3 Nov 21, 2024
89d5e36
Merge branch 'master' into your-project-stats-refactor
goplayoutside3 Nov 27, 2024
3f2b679
copy usePanoptesAuthToken hook behavior from lib-user into app-project
goplayoutside3 Dec 5, 2024
968154c
Merge branch 'master' into your-project-stats-refactor
goplayoutside3 Dec 6, 2024
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
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/cs/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dismiss": "Tyto zprávy již nezobrazovat."
},
"YourStats": {
"title": "Statistiky projektu {{projectName}}"
"title": "Statistiky"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/de/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"content": "Glückwunsch! Du hast den nächsten Workflow freigeschalten. Wenn Du lieber in diesem Workflow bleiben möchtest, kannst Du auswählen hier zu bleiben."
},
"YourStats": {
"title": "{{projectName}} Statistik"
"title": "Statistik"
}
}
}
}
21 changes: 4 additions & 17 deletions packages/app-project/public/locales/en/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@
"title": "There was an error in the classifier :("
}
},
"FinishedForTheDay": {
"buttons": {
"stats": "See the stats"
},
"text": "Your answers are saved for the research team while you're working. See the project stats and return to the {{projectName}} home page.",
"title": "Finished for the day?",
"ProjectImage": {
"alt": "Image for {{projectName}}"
}
},
Comment on lines -58 to -67
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This component is deleted for good, so its translation keys are deleted throughout.

"RecentSubjects": {
"text": "Discuss a subject on Talk, or add it to your Favourites or a collection.",
"title": "Your recent classifications"
Expand All @@ -77,13 +67,10 @@
"title": "New Workflow Available"
},
"YourStats": {
"todaysCount": "Classifications today",
"totalCount": "Classifications total",
"text": "Keep up the great work!",
"title": "Your {{projectName}} statistics",
"DailyClassificationsChart": {
"title": "{{projectName}} daily classification counts"
}
"allTime": "All Time",
"lastSeven": "Last 7 Days",
"link": "See more",
"title": "Your Stats"
Comment on lines -80 to +72
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm able to reuse "title" in all languages, but the rest of the translation keys will be modified and/or deleted in Lokalise post-merge.

}
}
}
18 changes: 1 addition & 17 deletions packages/app-project/public/locales/es/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
"title": "Se ha producido un error en el clasificador :("
}
},
"FinishedForTheDay": {
"ProjectImage": {
"alt": "Imagen para {{projectName}}"
},
"buttons": {
"stats": "Ver las estadísticas"
},
"text": "Mientras estás trabajando, tus respuestas se guardan para el equipo de investigación. Mira las estadísticas del proyecto y vuelve a la página de inicio de {{projectName}}.",
"title": "¿Has terminado por hoy?"
},
"RecentSubjects": {
"text": "Comenta un objeto en Hablemos o añádelo a tus Favoritos o a una colección.",
"title": "Tus clasificaciones recientes"
Expand All @@ -52,13 +42,7 @@
"title": "Nuevo flujo de trabajo disponible"
},
"YourStats": {
"DailyClassificationsChart": {
"title": "Recuentos diarios de la clasificación de {{projectName}}"
},
"text": "¡Sigue con ese gran trabajo!",
"title": "Estadística de {{projectName}}",
"todaysCount": "Las clasificaciones de hoy",
"totalCount": "Total de clasificaciones"
"title": "Estadística"
}
},
"Home": {
Expand Down
21 changes: 2 additions & 19 deletions packages/app-project/public/locales/fr/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@
"title": "Il y a eu une erreur avec le classificateur :("
}
},
"FinishedForTheDay": {
"ProjectImage": {
"alt": "Image pour {{projectName}}"
},
"buttons": {
"anotherProject": "Trouver un autre projet",
"stats": "Afficher les statistiques"
},
"text": "Vos réponses sont enregistrées pour l'équipe de recherche pendant que vous travaillez. Consultez les statistiques du projet et revenez à la page d'accueil de {{projectName}}.",
"title": "Terminé pour aujourd'hui?"
},
"RecentSubjects": {
"text": "Discutez d'un sujet sur Talk ou ajoutez-le à vos favoris ou à une collection.",
"title": "Vos classifications récentes"
Expand All @@ -53,13 +42,7 @@
"title": "Nouveau module disponible"
},
"YourStats": {
"DailyClassificationsChart": {
"title": "Nombre de classifications quotidiennes de {{projectName}}"
},
"text": "Continuez votre excellent travail !",
"title": "Statistiques de {{projectName}}",
"todaysCount": "Classifications d'aujourd'hui",
"totalCount": "Total des classifications"
"title": "Statistiques"
}
},
"Home": {
Expand Down Expand Up @@ -87,4 +70,4 @@
"title": "Discussions"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/hi/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dismiss": "मुझे आगे से संदेश ना दिखाएं"
},
"YourStats": {
"title": "{{projectName}} के आँकड़े"
"title": "आँकड़े"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/hr/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dismiss": "Ne pokazuj mi ove poruke u budućnosti."
},
"YourStats": {
"title": "{{projectName}} statistika"
"title": "statistika"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/it/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dismiss": "Non mostrare più questi messaggi."
},
"YourStats": {
"title": "Statistiche {{projectName}}"
"title": "Statistiche"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/ja/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dismiss": "今後メッセージを表示しない"
},
"YourStats": {
"title": "{{projectName}} 統計"
"title": "統計"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/nl/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"title": "Je recente waarnemingen"
},
"YourStats": {
"title": "{{projectName}} statistieken"
"title": "statistieken"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/pl/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"Classify": {
"YourStats": {
"title": "{{projectName}} statystyka"
"title": "statystyka"
}
}
}
}
21 changes: 2 additions & 19 deletions packages/app-project/public/locales/pt/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@
"title": "Ocorreu um erro no classificador :("
}
},
"FinishedForTheDay": {
"ProjectImage": {
"alt": "Imagem para {{projectName}}"
},
"buttons": {
"anotherProject": "Encontrar outro projeto",
"stats": "Ver as estatísticas"
},
"text": "As suas respostas serão guardadas para a equipa de investigação enquanto não estiver a trabalhar. Veja as estatísticas do projeto e volte à página inicial de {{projectName}}.",
"title": "Terminou por hoje?"
},
"RecentSubjects": {
"text": "Fale sobre qualquer objeto em Conversar ou adicione-o aos favoritos ou a uma coleção.",
"title": "As suas classificações recentes"
Expand All @@ -53,13 +42,7 @@
"title": "Novo fluxo de trabalho disponível"
},
"YourStats": {
"DailyClassificationsChart": {
"title": "Número de classificações diárias de {{projectName}}"
},
"text": "Continue o bom trabalho!",
"title": "Estatísticas {{projectName}}",
"todaysCount": "Classificações de hoje",
"totalCount": "Total de classificações"
"title": "Estatísticas"
}
},
"Home": {
Expand Down Expand Up @@ -87,4 +70,4 @@
"title": "Debater"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/ru/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dismiss": "Не показывать больше"
},
"YourStats": {
"title": "{{projectName}} Статистика"
"title": "Статистика"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/sv/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dismiss": "Visa inte fler meddelanden."
},
"YourStats": {
"title": "{{projectName}} statistik"
"title": "statistik"
}
}
}
}
21 changes: 2 additions & 19 deletions packages/app-project/public/locales/test/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@
"title": "Translated"
}
},
"FinishedForTheDay": {
"ProjectImage": {
"alt": "Translated {{projectName}}"
},
"buttons": {
"anotherProject": "Translated",
"stats": "Translated"
},
"text": "Translated {{projectName}} Translated",
"title": "Translated"
},
"RecentSubjects": {
"text": "Translated",
"title": "Translated"
Expand All @@ -53,13 +42,7 @@
"title": "Translated"
},
"YourStats": {
"DailyClassificationsChart": {
"title": "{{projectName}} Translated"
},
"text": "Translated",
"title": "Translated {{projectName}} Translated",
"todaysCount": "Translated",
"totalCount": "Translated"
"title": "Translated"
}
},
"Home": {
Expand Down Expand Up @@ -87,4 +70,4 @@
"title": "Translated"
}
}
}
}
18 changes: 1 addition & 17 deletions packages/app-project/public/locales/tr/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
"title": "Sınıflandırıcıda bir hata oluştu :("
}
},
"FinishedForTheDay": {
"ProjectImage": {
"alt": "{{projectName}} için resim"
},
"buttons": {
"stats": "İstatistikleri görün"
},
"text": "Siz çalışırken yanıtlarınız araştırma ekibi için kaydedilir. Proje istatistiklerini görün ve {{projectName}} ana sayfasına dönün.",
"title": "Bugünlük işiniz bitti mi?"
},
"RecentSubjects": {
"text": "Sohbet'te bir konuyu tartışın veya Favorilerinize ya da bir koleksiyona ekleyin.",
"title": "En son çalışmalarınız"
Expand All @@ -52,13 +42,7 @@
"title": "Yeni İş Akışı Mevcut"
},
"YourStats": {
"DailyClassificationsChart": {
"title": "{{projectName}} günlük sınıflandırma sayıları"
},
"text": "Böyle harika çalışmaya devam edin!",
"title": "{{projectName}} İstatistiğiniz",
"todaysCount": "Bugünün sınıflandırmaları",
"totalCount": "Toplam sınıflandırma"
"title": "İstatistiğiniz"
}
},
"Home": {
Expand Down
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/zh-CN/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"Classify": {
"YourStats": {
"title": "{{projectName}} 数据"
"title": "数据"
}
}
}
}
4 changes: 2 additions & 2 deletions packages/app-project/public/locales/zh-TW/screens.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"title": "這些是你最近完成的分類"
},
"YourStats": {
"title": "{{projectName}} 數據"
"title": "數據"
}
}
}
}
8 changes: 3 additions & 5 deletions packages/app-project/src/screens/ClassifyPage/ClassifyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import withResponsiveContext from '@zooniverse/react-components/helpers/withResp
import CollectionsModal from '@shared/components/CollectionsModal'
import ConnectWithProject from '@shared/components/ConnectWithProject'
import ProjectStatistics from '@shared/components/ProjectStatistics'
import FinishedForTheDay from './components/FinishedForTheDay'
import RecentSubjects from './components/RecentSubjects'
import YourStats from './components/YourStats'
import YourProjectStatsContainer from './components/YourProjectStats/YourProjectStatsContainer.js'
import StandardLayout from '@shared/components/StandardLayout'
import WorkflowAssignmentModal from './components/WorkflowAssignmentModal'
import WorkflowMenuModal from './components/WorkflowMenuModal'
Expand Down Expand Up @@ -110,12 +109,11 @@ function ClassifyPage({
</Box>

<Box as='aside' gap='medium' width='min(100%, 90rem)'>
<FinishedForTheDay />
<Grid
columns={screenSize === 'small' ? ['auto'] : ['1fr', '2fr']}
columns={screenSize === 'small' ? ['auto'] : ['2fr', '5fr']}
gap={screenSize === 'small' ? 'small' : 'medium'}
>
<YourStats />
<YourProjectStatsContainer />
<RecentSubjects size={screenSize === 'small' ? 1 : 3} />
</Grid>
<ProjectStatistics />
Expand Down
Loading