Skip to content

Commit fb9c1c3

Browse files
committed
Formatting button gets removed instead of disabled
1 parent a3f22b0 commit fb9c1c3

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor-draft/editor-draft.component.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@
4343
</mat-form-field>
4444
}
4545
<div class="apply-draft-button-container">
46-
@if (showDraftOptionsButton$ | async) {
47-
<span
48-
[matTooltip]="t(canConfigureFormatting ? 'format_draft_can' : 'format_draft_cannot')"
49-
[style.cursor]="canConfigureFormatting ? 'pointer' : 'not-allowed'"
50-
>
51-
<button mat-button (click)="navigateToFormatting()" [disabled]="!canConfigureFormatting">
46+
@if ((isFormattingSupportedForLatest$ | async) && canConfigureFormatting) {
47+
<span [matTooltip]="t('format_draft_tooltip')">
48+
<button mat-button (click)="navigateToFormatting()">
5249
<mat-icon>build</mat-icon>
5350
<transloco key="editor_draft_tab.format_draft"></transloco>
5451
</button>

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor-draft/editor-draft.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class EditorDraftComponent implements AfterViewInit, OnChanges {
115115
this.onlineStatusService.onlineStatus$
116116
]).pipe(map(([isLoading, isOnline]) => isLoading || !isOnline));
117117

118-
showDraftOptionsButton$: Observable<boolean> = this.activatedProjectService.projectId$.pipe(
118+
isFormattingSupportedForLatest$: Observable<boolean> = this.activatedProjectService.projectId$.pipe(
119119
filterNullish(),
120120
switchMap(projectId => this.draftGenerationService.getLastCompletedBuild(projectId)),
121121
map(build => this.draftOptionsService.areFormattingOptionsSupportedForBuild(build))

src/SIL.XForge.Scripture/ClientApp/src/assets/i18n/non_checking_en.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@
410410
"draft_legacy_warning": "We have updated our drafting functionality. You can take advantage of this by [link:generateDraftUrl]generating a new draft[/link].",
411411
"error_applying_draft": "Failed to add the draft to the project. Try again later.",
412412
"format_draft": "Formatting options",
413-
"format_draft_can": "Customize formatting options for the draft",
414-
"format_draft_cannot": "You can only change formatting for books from the latest draft",
413+
"format_draft_tooltip": "Customize formatting options for the draft",
415414
"no_draft_notice": "{{ bookChapterName }} has no draft.",
416415
"offline_notice": "Generated drafts are not available offline.",
417416
"overwrite": "Adding the draft will overwrite the current chapter. Are you sure you want to continue?",

0 commit comments

Comments
 (0)