-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3554 Create missing chapters when adding draft to a project #3432
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3432 +/- ##
==========================================
- Coverage 82.08% 82.08% -0.01%
==========================================
Files 611 611
Lines 36314 36355 +41
Branches 5966 5968 +2
==========================================
+ Hits 29810 29843 +33
- Misses 5641 5645 +4
- Partials 863 867 +4 ☔ View full report in Codecov by Sentry. |
SFProject project = await EnsureProjectPermissionAsync( | ||
curUserId, | ||
sfProjectId, | ||
isServalAdmin: false, | ||
cancellationToken | ||
); |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
project
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 16 days ago
To fix the issue, remove the useless assignment to the local variable project
while retaining the awaited call to EnsureProjectPermissionAsync
. This means changing the line from SFProject project = await EnsureProjectPermissionAsync(...);
to simply await EnsureProjectPermissionAsync(...);
. No other code in the vicinity needs to change, and no new methods or imports are required for this fix. The edit occurs only within the scope of the method GetPretranslationChapterCountAsync
in file src/SIL.XForge.Scripture/Services/MachineApiService.cs
, replacing lines 1178 through 1183.
-
Copy modified line R1178
@@ -1175,7 +1175,7 @@ | ||
) | ||
{ | ||
// Ensure that the user has permission | ||
SFProject project = await EnsureProjectPermissionAsync( | ||
await EnsureProjectPermissionAsync( | ||
curUserId, | ||
sfProjectId, | ||
isServalAdmin: false, |
e25084e
to
8f77130
Compare
I am converting this to a draft while we move towards getting draft apply working on the backend |
Adding a draft to a book that is empty fails to create the missing chapters. We needed a way to detect how many chapters exist in the generated draft and notify the front end so that it can create the missing chapters and update the project texts property. This PR creates a new endpoint that can be used to get the chapters that have drafts.
This change is