-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 editor for audio translations #3692
Conversation
Btw, I'm slightly worried about the GCS part of this, since I wasn't able to test it when working on this PR. We should make sure to do some robust tests of the end-to-end audio upload/play functionality during the release prep week. (I'd appreciate a slightly more detailed review on that part of the code.) |
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 looks good! Couldn't find any major flaws, perhaps the biggest thing being that errors are hidden behind the add translation modal.
I also tried deploying to test and successfully uploaded audio to GCS via the creator view, so as far as uploading goes I think it's pretty set. We just need to make sure that we can also reliably download the data directly from GCS. As you said, we should do more e2e testing on this. Also, the bucket should be set to be publicly accessible if it hasn't already yet.
Thanks Sean!
Also, I barely got under the 10,000 file limit after a couple of tries... here is the skip_files I used (including the defaults). I'm bad at regex so it could probably be cleaned up.
skip_files:
- ^(./)?#.#$
- ^(./)?.~$
- ^(./)?..py[co]$
- ^(./)?./RCS/.*$
- ^(./)?..$
- ^(.*)Spec.js$
- tests/.*$
- data/.*$
- scripts/.*$
core/domain/fs_domain.py
Outdated
raise NotImplementedError | ||
|
||
def commit(self, unused_user_id, filepath, raw_bytes, mimetype): | ||
bucket_name = constants.GCS_RESOURCE_BUCKET_NAME |
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.
Just a note that this will probably have to change to feconf when merging in the learner portion.
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.
Done -- thanks for the heads-up!
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl( | ||
'/components/forms/' + | ||
'add_audio_translation_modal_directive.html'), | ||
backdrop: true, |
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 think use 'static' backdrop to prevent clicking outside for closing the modal
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.
Done.
var parsedResponse = angular.fromJson(transformedData); | ||
alertsService.addWarning( | ||
parsedResponse.error || | ||
'Error communicating with server.'); |
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.
Hmm it seems like the alert is hidden since a modal is being used :\ Maybe just display the error in the modal?
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.
Done.
$scope.getAudioLanguageDescription = ( | ||
LanguageUtilService.getAudioLanguageDescription); | ||
|
||
$scope.getAudioLanguageFullUrl = function(filename) { |
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.
Naming seems a bit off, getAudioTranslationFullUrl?
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.
Done.
|
||
if (allowedAudioLanguageCodes.length === 0) { | ||
alertsService.addWarning( | ||
'Sorry, all audio translation slots are full.'); |
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.
Maybe change the wording to something like "there are no more available languages to translate into"
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.
Much better, thanks! Done.
<[getAudioLanguageDescription(languageCode)]> | ||
</div> | ||
<div class="col-lg-9 col-md-9 col-sm-9"> | ||
<audio controls preload="none" controlsList="nodownload"> |
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.
Hm, do we need the volume control here? It might be misleading in that it will control the actual volume playback for the learner.
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.
Unfortunately I don't think we can remove it. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/controlsList -- adjusting controls of HTML5 audio elements is fiddly, and I don't think there's full support in all browsers yet.
}); | ||
}; | ||
|
||
$scope.deleteAudioTranslation = function(languageCode) { |
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.
Not essential, but after trying it out it I kind of feel that a confirmation dialog should appear here for deletion.
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.
Done.
Codecov Report
@@ Coverage Diff @@
## develop #3692 +/- ##
===========================================
+ Coverage 45.01% 45.08% +0.07%
===========================================
Files 264 264
Lines 20344 20403 +59
Branches 3168 3172 +4
===========================================
+ Hits 9158 9199 +41
- Misses 11186 11204 +18
Continue to review full report at Codecov.
|
# Karma test files | ||
- ^(.*/)Spec.js$ | ||
# Other folders to ignore | ||
- tests/ |
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.
Note: I can't omit data/, since the dev server actually needs it. The dev server obeys this skip_files attribute.
I think we should investigate if we can skip more files, but probably outside the scope of this PR.
Hi @tjiang11 -- I've addressed the comments, and I think this PR should be complete and ready to merge. PTAL! |
Thanks @seanlip ! I think you need to put LanguageUtilService in the collection player (failing test) |
Done, thanks @tjiang11! Do you have other comments? |
Hm wait, actually--can we only show the modal that asks whether they want to flag audio translations if it will actually make a difference? e.g. don't show the modal if all the audio translations are already flagged. |
Definitely! I'll do that in a separate PR tonight, as we discussed. |
* upstream/develop: (39 commits) Add a one-off job to list which explorations use gadgets; remove old fallbacks job. (oppia#3717) Fix oppia#2998 implement collection skills update commands (oppia#3710) Improvements and bug fixes to changes introduced by PR oppia#3671 (oppia#3684) Fix oppia#3688: refactoring ExplorationStatusHandler to remove unpublish and publicize functionality as it is not called from frontend. (oppia#3715) fix oppia#3698: Shift exception handling for NotLoggedInException so that it does not generate log errors. (oppia#3714) Revert "Fix oppia#3707 Change text of collection learner view "start here"" (oppia#3713) Fix oppia#3701 Fixed Continue button name issue (oppia#3711) Fix oppia#3467: Introduce re-training and add_to_training_queue methods (oppia#3650) Fix oppia#3707 Change text of collection learner view "start here" (oppia#3700) Audio fixes: make audio download URL safe; don't show flagging modal if all translations are flagged; use templateUrl for modals. (oppia#3709) Learner audio updates (oppia#3705) Move hint button to left corner for supplemental cards (oppia#3702) Make the representation of the learner's 'Continue' answer more conversational. (oppia#3675) Add editor for audio translations (oppia#3692) Fix oppia#3686 fixed text overflow for contributors list (oppia#3697) Fix oppia#3551: Manually set cookie value during language change (oppia#3622) Learner view audio translations (oppia#3681) The sixth milestone of the learner dashboard. (oppia#3680) Routine update of translations. (oppia#3685) SiteWide ACL Refactor: Milestone 3.1 (oppia#3682) ...
Hi @tjiang11 -- unfortunately, this is all I was able to do tonight, but I think it's not bad :) Could you please take it for a spin and also do a preliminary code review? Note that this has quite a few dependencies on #3681 (which you'll notice when reviewing) -- so if you could get that into develop asap, that would be great, since there's a fair bit of merge work needed!
I haven't yet written tests. I'll do that tomorrow, though I'd appreciate a first pass first (both code and UI) to make sure things aren't too amiss.
Also, the following stuff has not been done. I'd welcome advice on whether you think either or both of them are necessary for v1?
"Edit audio" modal(Tony and I decided that this wasn't really necessary)Thanks!
Edit: Additional TODO --