Skip to content

Commit f98ae1e

Browse files
authored
Add project short name to unconnected projects on draft page (#3358)
1 parent 1f15ef5 commit f98ae1e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h1>
8585
key="draft_generation.info_alert_no_source_access"
8686
[params]="{
8787
connectProjectUrl: { route: '/connect-project' },
88-
name: source?.name
88+
name: projectLabel(source)
8989
}"
9090
></transloco>
9191
</app-notice>
@@ -96,7 +96,7 @@ <h1>
9696
key="draft_generation.info_alert_no_training_source_access"
9797
[params]="{
9898
connectProjectUrl: { route: '/connect-project' },
99-
name: trainingSource?.name
99+
name: projectLabel(trainingSource)
100100
}"
101101
></transloco>
102102
</app-notice>
@@ -107,7 +107,7 @@ <h1>
107107
key="draft_generation.info_alert_no_additional_training_source_access"
108108
[params]="{
109109
connectProjectUrl: { route: '/connect-project' },
110-
name: additionalTrainingSource?.name
110+
name: projectLabel(additionalTrainingSource)
111111
}"
112112
></transloco>
113113
</app-notice>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ import { filterNullish, quietTakeUntilDestroyed } from 'xforge-common/util/rxjs-
2727
import { issuesEmailTemplate } from 'xforge-common/utils';
2828
import { environment } from '../../../environments/environment';
2929
import { SFProjectProfileDoc } from '../../core/models/sf-project-profile-doc';
30+
import { SelectableProject } from '../../core/paratext.service';
3031
import { SFProjectService } from '../../core/sf-project.service';
3132
import { BuildDto } from '../../machine-api/build-dto';
3233
import { BuildStates } from '../../machine-api/build-states';
3334
import { ServalProjectComponent } from '../../serval-administration/serval-project.component';
3435
import { SharedModule } from '../../shared/shared.module';
36+
import { projectLabel } from '../../shared/utils';
3537
import { WorkingAnimatedIndicatorComponent } from '../../shared/working-animated-indicator/working-animated-indicator.component';
3638
import { NllbLanguageService } from '../nllb-language.service';
3739
import { DraftDownloadButtonComponent } from './draft-download-button/draft-download-button.component';
@@ -440,6 +442,10 @@ export class DraftGenerationComponent extends DataLoadingComponent implements On
440442
.subscribe((job?: BuildDto) => (this.draftJob = job));
441443
}
442444

445+
projectLabel(project?: SelectableProject): string {
446+
return project == null ? '' : projectLabel(project);
447+
}
448+
443449
private pollBuild(): void {
444450
this.jobSubscription?.unsubscribe();
445451
this.jobSubscription = this.activatedProject.changes$

0 commit comments

Comments
 (0)