Skip to content

Commit 733461b

Browse files
authored
SF-3572 Inform user which books aren't available as training data (#3524)
1 parent 1f876e2 commit 733461b

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,6 @@ <h2>{{ t("reference_books") }}</h2>
191191
{{ t("choose_books_for_training_error") }}
192192
</app-notice>
193193
}
194-
@if (translatedBooksWithNoSource.length > 0) {
195-
<app-notice class="warn-source-books-missing" type="warning" icon="warning">
196-
{{ t("source_books_missing") }}
197-
</app-notice>
198-
}
199194
<div class="button-strip">
200195
<button mat-stroked-button matStepperPrevious>
201196
<mat-icon>chevron_{{ i18n.backwardDirectionWord }}</mat-icon>

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/draft-generation-steps.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ describe('DraftGenerationStepsComponent', () => {
365365
expect(component.unusableTranslateSourceBooks).toEqual([6]);
366366
expect(component.unusableTrainingSourceBooks).toEqual([6]);
367367
// warn when translated book has no source
368-
expect(fixture.nativeElement.querySelector('.warn-source-books-missing')).not.toBeNull();
368+
expect(fixture.nativeElement.querySelector('.unusable-training-books')).not.toBeNull();
369369
}));
370370

371371
it('should set "emptyTranslateSourceBooks"', fakeAsync(() => {

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ export class DraftGenerationStepsComponent implements OnInit {
124124
protected draftingSources: DraftSource[] = [];
125125
protected trainingSources: DraftSource[] = [];
126126
protected trainingTargets: DraftSource[] = [];
127-
protected translatedBooksWithNoSource: number[] = [];
128127
protected trainingDataFiles: Readonly<TrainingData>[] = [];
129128

130129
private trainingDataQuery?: RealtimeQuery<TrainingDataDoc>;
@@ -284,12 +283,6 @@ export class DraftGenerationStepsComponent implements OnInit {
284283
isPresentInASource = true;
285284
} else {
286285
this.unusableTrainingSourceBooks.push(bookNum);
287-
const textProgress: TextProgress | undefined = this.progressService.texts.find(
288-
t => t.text.bookNum === bookNum
289-
);
290-
if (textProgress != null && textProgress.translated > minimumTranslatedSegments) {
291-
this.translatedBooksWithNoSource.push(bookNum);
292-
}
293286
}
294287
if (trainingSources[1] != null && additionalTrainingSourceBooks.has(bookNum)) {
295288
this.availableTrainingBooks[trainingSources[1].projectRef].push({ number: bookNum, selected: selected });
@@ -349,7 +342,7 @@ export class DraftGenerationStepsComponent implements OnInit {
349342
}
350343

351344
get firstTrainingSource(): string {
352-
return this.trainingSources[0]?.shortName ?? '';
345+
return projectLabel(this.trainingSources[0]);
353346
}
354347

355348
get trainingSourceBooksSelected(): boolean {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
"reference_books": "Reference books",
255255
"remote_changes": "The source configuration for draft generation has been modified. Please start a new draft and review the latest source configuration.",
256256
"remote_changes_start_over": "Start over",
257-
"source_books_missing": "The reference text is missing one or more of the translated books in your project. Consider choosing a reference text that contains a match for all the translated books",
258257
"summary_header": "Summary",
259258
"summary_notifications": "Notifications",
260259
"summary_title": "Summary",

0 commit comments

Comments
 (0)