SF-3905 Use new apply draft logic in the editor draft tab - #4072
SF-3905 Use new apply draft logic in the editor draft tab#4072pmachapman wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4072 +/- ##
==========================================
- Coverage 81.09% 81.08% -0.02%
==========================================
Files 666 666
Lines 43258 43273 +15
Branches 7060 7063 +3
==========================================
+ Hits 35079 35086 +7
- Misses 7013 7019 +6
- Partials 1166 1168 +2 ☔ View full report in Codecov by Harness. |
93c7871 to
2c99c32
Compare
RaymondLuong3
left a comment
There was a problem hiding this comment.
@RaymondLuong3 reviewed 16 files and all commit messages, and made 5 comments.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on pmachapman).
src/SIL.XForge.Scripture/ClientApp/src/app/core/text-doc.service.spec.ts line 358 at r1 (raw file):
}); it('should return false if the user not have the permission', () => {
Typo: if the user does not have the permission
Code quote:
the user not have the permission'src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text.component.ts line 590 at r1 (raw file):
const textDoc = await this.projectService.getText(this._id); this.onCreateSub?.unsubscribe(); this.onCreateSub = textDoc.create$.subscribe(() => this.bindQuill());
It looks like this code can be refactored into its own method and with a name like subscribeToTextDocCreation
Code quote:
const textDoc = await this.projectService.getText(this._id);
this.onCreateSub?.unsubscribe();
this.onCreateSub = textDoc.create$.subscribe(() => this.bindQuill());src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/text.component.ts line 1220 at r1 (raw file):
const textDoc = await this.projectService.getText(this._id); this.onCreateSub?.unsubscribe(); this.onCreateSub = textDoc.create$.subscribe(() => this.bindQuill());
This can be replaced with the method suggested above.
Code quote:
const textDoc = await this.projectService.getText(this._id);
this.onCreateSub?.unsubscribe();
this.onCreateSub = textDoc.create$.subscribe(() => this.bindQuill());src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor-draft/editor-draft.component.ts line 417 at r1 (raw file):
this.draftCheckState = 'draft-present'; this.isDraftApplied = true; this.userAppliedDraft = true;
It seems like this.isDraftApplied and this.userAppliedDraft should not be true if applying the draft failed. Maybe I am missing the reason we still want those values to be true here?
Code quote:
this.isDraftApplied = true;
this.userAppliedDraft = true;src/SIL.XForge.Scripture/Controllers/SFProjectsRpcController.cs line 1214 at r1 (raw file):
} [Obsolete("Use ApplyPreTranslationToProject instead. Deprecated 2026-03")]
This can be safely removed, it is almost 6 months old. But we can do that in a follow up too.
Code quote:
[Obsolete("Use ApplyPreTranslationToProject instead. Deprecated 2026-03")]
This PR updates the editor draft tab to use the new draft application logic, but retaining the same interface as the draft tab had previously. This resolves in particular an issue that prevented the old editor draft tab form adding a draft to a chapter of a book that was not in the project already.
I also took the opportunity to add/correct some dates in
[Obsolete]attributes, so we can make a decision on when to remove these obsolete functions in future.This change is