Skip to content

Commit 8f8192d

Browse files
committed
Frontend updates
1 parent 6945cd5 commit 8f8192d

File tree

11 files changed

+203
-595
lines changed

11 files changed

+203
-595
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/core/models/sf-project-settings.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ export interface SFProjectSettings {
88
sourceParatextId?: string | null;
99
biblicalTermsEnabled?: boolean | null;
1010

11+
/* DraftSourcesSettingsChange */
1112
additionalTrainingDataFiles?: string[] | null;
12-
additionalTrainingSourceEnabled?: boolean | null;
13-
additionalTrainingSourceParatextId?: string | null;
14-
alternateSourceEnabled?: boolean | null;
15-
alternateSourceParatextId?: string | null;
16-
alternateTrainingSourceEnabled?: boolean | null;
17-
alternateTrainingSourceParatextId?: string | null;
18-
servalConfig?: string | null;
13+
draftingSourcesParatextIds?: string[] | null;
14+
trainingSourcesParatextIds?: string[] | null;
1915

2016
checkingEnabled?: boolean | null;
2117
usersSeeEachOthersResponses?: boolean | null;

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-project.component.spec.ts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -299,30 +299,31 @@ describe('ServalProjectComponent', () => {
299299
],
300300
translateConfig: {
301301
draftConfig: {
302-
alternateSourceEnabled: true,
303-
alternateSource: {
304-
paratextId: 'ptproject03',
305-
projectRef: 'project03',
306-
name: 'Project 03',
307-
shortName: 'P3',
308-
writingSystem: { tag: 'en' }
309-
},
310-
alternateTrainingSourceEnabled: true,
311-
alternateTrainingSource: {
312-
paratextId: 'ptproject04',
313-
projectRef: 'project04',
314-
name: 'Project 04',
315-
shortName: 'P4',
316-
writingSystem: { tag: 'en' }
317-
},
318-
additionalTrainingSourceEnabled: true,
319-
additionalTrainingSource: {
320-
paratextId: 'ptproject05',
321-
projectRef: 'project05',
322-
name: 'Project 05',
323-
shortName: 'P5',
324-
writingSystem: { tag: 'en' }
325-
},
302+
draftingSources: [
303+
{
304+
paratextId: 'ptproject03',
305+
projectRef: 'project03',
306+
name: 'Project 03',
307+
shortName: 'P3',
308+
writingSystem: { tag: 'en' }
309+
}
310+
],
311+
trainingSources: [
312+
{
313+
paratextId: 'ptproject04',
314+
projectRef: 'project04',
315+
name: 'Project 04',
316+
shortName: 'P4',
317+
writingSystem: { tag: 'en' }
318+
},
319+
{
320+
paratextId: 'ptproject05',
321+
projectRef: 'project05',
322+
name: 'Project 05',
323+
shortName: 'P5',
324+
writingSystem: { tag: 'en' }
325+
}
326+
],
326327
lastSelectedTrainingScriptureRanges: args.draftConfig?.lastSelectedTrainingScriptureRanges ?? undefined,
327328
lastSelectedTranslationScriptureRanges:
328329
args.draftConfig?.lastSelectedTranslationScriptureRanges ?? undefined,

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-projects.component.spec.ts

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,22 @@ class TestEnvironment {
191191
name: 'Project 01',
192192
translateConfig: {
193193
draftConfig: {
194-
alternateSourceEnabled: true,
195-
alternateSource: {
196-
paratextId: 'ptproject03',
197-
projectRef: 'project03',
198-
name: 'Project 03',
199-
shortName: 'P3'
200-
},
201-
alternateTrainingSourceEnabled: true,
202-
alternateTrainingSource: {
203-
paratextId: 'ptproject04',
204-
projectRef: 'project04',
205-
name: 'Project 04',
206-
shortName: 'P4'
207-
}
194+
draftingSources: [
195+
{
196+
paratextId: 'ptproject03',
197+
projectRef: 'project03',
198+
name: 'Project 03',
199+
shortName: 'P3'
200+
}
201+
],
202+
trainingSources: [
203+
{
204+
paratextId: 'ptproject04',
205+
projectRef: 'project04',
206+
name: 'Project 04',
207+
shortName: 'P4'
208+
}
209+
]
208210
},
209211
preTranslate: true,
210212
source: {
@@ -235,20 +237,22 @@ class TestEnvironment {
235237
shortName: 'P3',
236238
translateConfig: {
237239
draftConfig: {
238-
alternateSourceEnabled: true,
239-
alternateSource: {
240-
paratextId: 'resource16char02',
241-
projectRef: 'resource02',
242-
name: 'Resource 02',
243-
shortName: 'R2'
244-
},
245-
alternateTrainingSourceEnabled: true,
246-
alternateTrainingSource: {
247-
paratextId: 'resource16char03',
248-
projectRef: 'resource03',
249-
name: 'Resource 03',
250-
shortName: 'R3'
251-
}
240+
draftingSources: [
241+
{
242+
paratextId: 'resource16char02',
243+
projectRef: 'resource02',
244+
name: 'Resource 02',
245+
shortName: 'R2'
246+
}
247+
],
248+
trainingSources: [
249+
{
250+
paratextId: 'resource16char03',
251+
projectRef: 'resource03',
252+
name: 'Resource 03',
253+
shortName: 'R3'
254+
}
255+
]
252256
},
253257
preTranslate: false,
254258
source: {

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/confirm-sources/confirm-sources.stories.ts

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,31 @@ when(mockActivatedProject.changes$).thenReturn(
3030
paratextId: 'source-project'
3131
},
3232
draftConfig: {
33-
alternateTrainingSourceEnabled: true,
34-
alternateTrainingSource: {
35-
projectRef: 'alternate-training-source',
36-
shortName: 'ALT-TS',
37-
name: 'Alternate Training Source',
38-
paratextId: 'alternate-training-source',
39-
writingSystem: { tag: 'es' }
40-
},
41-
additionalTrainingSourceEnabled: true,
42-
additionalTrainingSource: {
43-
projectRef: 'additional-training-source',
44-
shortName: 'ADD-TS',
45-
name: 'Additional Training Source',
46-
paratextId: 'additional-training-source',
47-
writingSystem: { tag: 'es' }
48-
},
49-
alternateSourceEnabled: true,
50-
alternateSource: {
51-
projectRef: 'alternate-drafting-source',
52-
shortName: 'ADS',
53-
name: 'Alternate Drafting Source',
54-
paratextId: 'alternate-drafting-source',
55-
writingSystem: { tag: 'es' }
56-
}
33+
draftingSources: [
34+
{
35+
projectRef: 'alternate-drafting-source',
36+
shortName: 'ADS',
37+
name: 'Alternate Drafting Source',
38+
paratextId: 'alternate-drafting-source',
39+
writingSystem: { tag: 'es' }
40+
}
41+
],
42+
trainingSources: [
43+
{
44+
projectRef: 'alternate-training-source',
45+
shortName: 'ALT-TS',
46+
name: 'Alternate Training Source',
47+
paratextId: 'alternate-training-source',
48+
writingSystem: { tag: 'es' }
49+
},
50+
{
51+
projectRef: 'additional-training-source',
52+
shortName: 'ADD-TS',
53+
name: 'Additional Training Source',
54+
paratextId: 'additional-training-source',
55+
writingSystem: { tag: 'es' }
56+
}
57+
]
5758
}
5859
}
5960
})

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ describe('DraftGenerationComponent', () => {
438438
});
439439
});
440440

441-
describe('user must have access to training source project (aka alternate training source project)', () => {
441+
describe('user must have access to training source project', () => {
442442
it('should show warning when no access to training source project', () => {
443443
const env = new TestEnvironment(() => {
444444
mockDraftSourcesService.getDraftProjectSources.and.returnValue(
@@ -460,7 +460,7 @@ describe('DraftGenerationComponent', () => {
460460
expect(env.getElementByTestId('warning-training-source-no-access')).not.toBeNull();
461461
});
462462

463-
it('should not show warning when no access to alternate source project and not back translation nor pre-translate approved', () => {
463+
it('should not show warning when no access to training source project and not back translation nor pre-translate approved', () => {
464464
const env = new TestEnvironment(() => {
465465
mockDraftSourcesService.getDraftProjectSources.and.returnValue(
466466
of({
@@ -523,7 +523,7 @@ describe('DraftGenerationComponent', () => {
523523
expect(env.getElementByTestId('warning-training-source-no-access')).toBeNull();
524524
});
525525

526-
it('should show warning even when no access to alternate source project', () => {
526+
it('should show warning even when no access to drafting source project', () => {
527527
const env = new TestEnvironment(() => {
528528
mockDraftSourcesService.getDraftProjectSources.and.returnValue(
529529
of({

0 commit comments

Comments
 (0)