-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add translation progress bar #40
Conversation
@@ -0,0 +1,16 @@ | |||
.translation { |
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.
very nice looking progress bar 👌 did you run it by Shaahana?
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.
sorry completely slipped my mind just messaged i will make any updates according to her comments
41a6c69
to
a660e43
Compare
ef89942
to
37e9acc
Compare
@@ -245,3 +249,6 @@ def get_story_translations_available_for_review(self, language, level): | |||
except Exception as error: | |||
self.logger.error(str(error)) | |||
raise error | |||
|
|||
def _get_num_translated_lines(self, translation_contents): | |||
return sum(1 for _ in translation_contents if _.translation_content) |
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.
How does this handle empty strings?
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.
i believe Python empty strings evaluate to False so it should only sum if the translation_content is not an empty string--this seemed to be the case when i was testing but let me know if it's not working for you/if there's a more elegant way to do the check i'm happy to change it!!
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.
I'd prefer something like the [True,True,False].count(True)
solution, ie len(arr) - arr.count('')
might work
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.
Nice! Just left some quick comments
@@ -11,3 +11,8 @@ code { | |||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | |||
monospace; | |||
} | |||
|
|||
:root { |
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.
nice to see variable css!
Story.description.label("description"), | ||
Story.youtube_link.label("youtube_link"), | ||
Story.level.label("level"), | ||
( |
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.
are the outer brackets (ie (
) needed?
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.
nope removed now! i must have accidentally added it in with the rebasing/formatting
@@ -245,3 +249,6 @@ def get_story_translations_available_for_review(self, language, level): | |||
except Exception as error: | |||
self.logger.error(str(error)) | |||
raise error | |||
|
|||
def _get_num_translated_lines(self, translation_contents): | |||
return sum(1 for _ in translation_contents if _.translation_content) |
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.
I'd prefer something like the [True,True,False].count(True)
solution, ie len(arr) - arr.count('')
might work
@@ -0,0 +1,24 @@ | |||
import React from "react"; | |||
import { ProgressBar } from "react-bootstrap"; |
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.
we haven't made any formal component library decisions so I'm happy with keeping the bootstrap. I am curious, do you have a particular reason for bootstrap or are you comfortable with it?
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.
oops i can definitely swap it out later once we decide on a component library! not too much thought behind it, but thought it would be easier to quickly spin up a functional progress bar
i thought i had saw bootstrap used elsewhere in the repo but i think i just imagined it now 😅
i have used it a few times before but definitely can switch it to something else!!
@@ -35,6 +36,11 @@ const App = () => { | |||
<PrivateRoute exact path="/entity/update" component={UpdatePage} /> | |||
<PrivateRoute exact path="/entity" component={DisplayPage} /> | |||
<PrivateRoute exact path="/stories" component={HomePage} /> | |||
<PrivateRoute |
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.
heads up: may need rebase if jenn merges first
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.
Will rebase 👍
37e9acc
to
e7db980
Compare
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.
🚢 🚢
* create query to get story translation progress * return percentage in get/update translation * update progress bar styling
Notion ticket link
Add translation progress state
Implementation description
storyTranslationById
query (addednumTranslatedLines
toStoryTranslationResponseDTO
)Steps to test
http://localhost:3000/translation/{storyId}/{storyTranslationId}
(currently hardcoded at 25%)What should reviewers focus on?
backend/python/app/services/implementations/story_service.py
frontend/src/components/translation/TranslationProgressBar.tsx
Checklist
docker exec -it planet-read_py-backend_1 /bin/bash -c "black . && isort --profile black ."