Skip to content

Commit 676ecb4

Browse files
committed
Formatting button gets removed instead of disabled
1 parent 44200ed commit 676ecb4

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
@@ -85,7 +85,7 @@ export class EditorDraftComponent implements AfterViewInit, OnChanges {
8585
this.onlineStatusService.onlineStatus$
8686
]).pipe(map(([isLoading, isOnline]) => isLoading || !isOnline));
8787

88-
showDraftOptionsButton$: Observable<boolean> = this.activatedProjectService.projectId$.pipe(
88+
isFormattingSupportedForLatest$: Observable<boolean> = this.activatedProjectService.projectId$.pipe(
8989
filterNullish(),
9090
switchMap(projectId => this.draftGenerationService.getLastCompletedBuild(projectId)),
9191
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
@@ -408,8 +408,7 @@
408408
"draft_legacy_warning": "We have updated our drafting functionality. You can take advantage of this by [link:generateDraftUrl]generating a new draft[/link].",
409409
"error_applying_draft": "Failed to add the draft to the project. Try again later.",
410410
"format_draft": "Formatting options",
411-
"format_draft_can": "Customize formatting options for the draft",
412-
"format_draft_cannot": "You can only change formatting for books from the latest draft",
411+
"format_draft_tooltip": "Customize formatting options for the draft",
413412
"no_draft_notice": "{{ bookChapterName }} has no draft.",
414413
"offline_notice": "Generated drafts are not available offline.",
415414
"overwrite": "Adding the draft will overwrite the current chapter. Are you sure you want to continue?",

0 commit comments

Comments
 (0)