-
Notifications
You must be signed in to change notification settings - Fork 29
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
base: master
Are you sure you want to change the base?
Changes from 15 commits
4e1f716
015eaa1
0a67bde
d669f06
abe26aa
9468468
6db35bd
465891f
10a9912
be27129
b8720b7
7705b3f
89251aa
66ff700
d7ec5b0
5624eb5
c59c58b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}}" | ||
} | ||
}, | ||
"RecentSubjects": { | ||
"text": "Discuss a subject on Talk, or add it to your Favourites or a collection.", | ||
"title": "Your recent classifications" | ||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm able to reuse |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ | |
"dismiss": "今後メッセージを表示しない" | ||
}, | ||
"YourStats": { | ||
"title": "{{projectName}} 統計" | ||
"title": "統計" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
}, | ||
"Classify": { | ||
"YourStats": { | ||
"title": "{{projectName}} statystyka" | ||
"title": "statystyka" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
}, | ||
"Classify": { | ||
"YourStats": { | ||
"title": "{{projectName}} 数据" | ||
"title": "数据" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
"title": "這些是你最近完成的分類" | ||
}, | ||
"YourStats": { | ||
"title": "{{projectName}} 數據" | ||
"title": "數據" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -5,6 +5,7 @@ export default function usePanoptesAuth(userID) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const [authorization, setAuthorization] = useState() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
async function checkAuth() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
auth.checkCurrent() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const token = await auth.checkBearerToken() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+8
to
9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is inspired by #6345. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You’ll need front-end-monorepo/packages/lib-react-components/src/hooks/useUnreadMessages.js Lines 20 to 21 in cb221b9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that I look at this hook again, it's broken. It saves the bearer token in component state, so that it gets reused even after it has expired. This hook won't refresh expired auth tokens. Panoptes refresh tokens are valid for something like 2 weeks, but auth tokens only last for two hours. Your code will work for the first two hours of any browser session, then stop fetching after that. That's my fault. I think I wrote this before I properly understood how OAuth works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const bearerToken = token ? `Bearer ${token}` : '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setAuthorization(bearerToken) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -15,4 +16,4 @@ export default function usePanoptesAuth(userID) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, [userID]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return authorization | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
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.
This component is deleted for good, so its translation keys are deleted throughout.