Repository navigation
SF-3934 Translator offered option to import a chapter to a book that does not exist - #4175
pmachapman wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4175 +/- ##
=======================================
Coverage 81.17% 81.17%
=======================================
Files 666 666
Lines 42666 42699 +33
Branches 7069 7055 -14
=======================================
+ Hits 34632 34661 +29
- Misses 6870 6891 +21
+ Partials 1164 1147 -17 ☔ View full report in Codecov by Harness. |
816e311 to
63456a3
Compare
63456a3 to
af2f5b5
Compare
RaymondLuong3
left a comment
There was a problem hiding this comment.
The code looks good. A couple non-blocking comments.
@RaymondLuong3 reviewed 15 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on pmachapman).
src/SIL.XForge.Scripture/Controllers/SFProjectsRpcController.cs line 48 at r1 (raw file):
try { // Ensure the user can apply to the draft to at least one of the chapters selected
typo:
Code quote:
// Ensure the user can apply to the draft to at src/SIL.XForge.Scripture/Services/SFProjectService.cs line 1959 at r1 (raw file):
/// If one of those checks fails, an exception is thrown. /// </remarks> public async Task EnsureUserCanApplyDraftToProjectAsync(string userId, string projectId, string scriptureRange)
There are many nuances to this method. It really checks that a user has edit permission on at least 1 chapter in the range. The method comments make that explicit. I think the method name matches more with its intended use rather than its logic, so I think that is Ok.
Code quote:
EnsureUserCanApplyDraftToProjectAsync(string userId, string projectId, string scriptureRange)af2f5b5 to
08ddcc9
Compare
pmachapman
left a comment
There was a problem hiding this comment.
@pmachapman made 2 comments and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on RaymondLuong3).
src/SIL.XForge.Scripture/Controllers/SFProjectsRpcController.cs line 48 at r1 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
typo:
Done. Thank you!
src/SIL.XForge.Scripture/Services/SFProjectService.cs line 1959 at r1 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
There are many nuances to this method. It really checks that a user has edit permission on at least 1 chapter in the range. The method comments make that explicit. I think the method name matches more with its intended use rather than its logic, so I think that is Ok.
I struggled to name this method. I am all ears if you can think of a better name!
|
📸 Screenshot diff deployed! (1 change) View the visual diff at: https://pr-4175--sf-screenshot-diffs.netlify.app |
This PR displays an error to a Translator if they attempt to apply a draft to a book or chapter that does not exist if they do not have permission to edit that books or chapter. Translators can have the "edit all books" permission granted in Paratext that gives the ability to create books, and they may or may not have permission to add a missing chapter depending on their chapter permissions in Paratext.
I also removed some older permissions for creating texts from frontend, as drafts are no longer applied to missing chapters in that way.
This change is