-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3674 Don't show the apply draft button if the selected draft is empty #3650
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3650 +/- ##
=======================================
Coverage 83.29% 83.30%
=======================================
Files 611 611
Lines 37646 37650 +4
Branches 6182 6183 +1
=======================================
+ Hits 31358 31364 +6
+ Misses 5332 5331 -1
+ Partials 956 955 -1 ☔ View full report in Codecov by Sentry. |
RaymondLuong3
left a comment
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 one minor comment but otherwise it works well.
@RaymondLuong3 reviewed 3 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pmachapman).
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor-draft/editor-draft.component.ts line 152 at r1 (raw file):
if (this.targetProject == null || this.bookNum == null || this.chapter == null || this.draftDelta?.ops == null) { return false; }
Looks like this can be replaced with if (!this.hasDraftToApply)
Code quote:
if (this.targetProject == null || this.bookNum == null || this.chapter == null || this.draftDelta?.ops == null) {
return false;
}
pmachapman
left a comment
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.
@pmachapman made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3).
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor-draft/editor-draft.component.ts line 152 at r1 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
Looks like this can be replaced with
if (!this.hasDraftToApply)
Yes, logically it is equivalent, but the linter forces me to change this method to:
get canApplyDraft(): boolean {
if (!this.hasDraftToApply) {
return false;
}
return this.draftHandlingService.canApplyDraft(
this.targetProject!,
this.bookNum!,
this.chapter!,
this.draftDelta!.ops
);
}If you think that is still OK, I can make the change, I just thought all of the bangs looked ugly so Ikept the == null's at the top of the getter.
RaymondLuong3
left a comment
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.
@RaymondLuong3 made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pmachapman).
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor-draft/editor-draft.component.ts line 152 at r1 (raw file):
Previously, pmachapman (Peter Chapman) wrote…
Yes, logically it is equivalent, but the linter forces me to change this method to:
get canApplyDraft(): boolean { if (!this.hasDraftToApply) { return false; } return this.draftHandlingService.canApplyDraft( this.targetProject!, this.bookNum!, this.chapter!, this.draftDelta!.ops ); }If you think that is still OK, I can make the change, I just thought all of the bangs looked ugly so Ikept the
== null's at the top of the getter.
Yes, let's make that change. Since it is logical that this method depends on the value of hasDraftToApply and it is sensible that we first check if there is a draft to apply before we check permissions.
ddec8ea to
70903f8
Compare
pmachapman
left a comment
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.
@pmachapman made 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3).
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor-draft/editor-draft.component.ts line 152 at r1 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
Yes, let's make that change. Since it is logical that this method depends on the value of
hasDraftToApplyand it is sensible that we first check if there is a draft to apply before we check permissions.
Done.
This PR fixes a bug where the apply draft button appears in the editor for chapters that are not drafted.
This change is