Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="identifier-search-group">
<app-search-records
[searchControl]="searchControl"
[infoText]="'Search builds by project ID, name, books, user ID, name, email.'"
[infoText]="'Search builds by project ID, name, language code, books, user ID, name, email.'"
(clearSearch)="clearSearch()"
></app-search-records>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{ provide: UserService, useMock: mockUserService },
{ provide: I18nService, useMock: mockI18nService },
{ provide: ActivatedRoute, useMock: mockedActivatedRoute },
provideNoopAnimations()

Check warning on line 70 in src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.spec.ts

View workflow job for this annotation

GitHub Actions / Lint and Prettier (22.13.0, 11.11.0, 11.10.0)

`provideNoopAnimations` is deprecated. 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23
]
}));

Expand Down Expand Up @@ -128,6 +128,32 @@
expect(env.component['rows']).toEqual([matchingRow]);
}));

it('filters rows by target language code', fakeAsync(() => {
const env = new TestEnvironment();
const matchingRow: ServalBuildRow = env.createRow({ targetLanguageTag: 'abc' });
const otherRow: ServalBuildRow = env.createRow({ targetLanguageTag: 'def' });
env.component['allRows'] = [matchingRow, otherRow];

// SUT
env.component['searchControl'].setValue('abc');
env.waitForRowUpdate();

expect(env.component['rows']).toEqual([matchingRow]);
}));

it('filters rows by source language code', fakeAsync(() => {
const env = new TestEnvironment();
const matchingRow: ServalBuildRow = env.createRow({ sourceLanguageTag: 'cba' });
const otherRow: ServalBuildRow = env.createRow({ sourceLanguageTag: 'fed' });
env.component['allRows'] = [matchingRow, otherRow];

// SUT
env.component['searchControl'].setValue('cba');
env.waitForRowUpdate();

expect(env.component['rows']).toEqual([matchingRow]);
}));

it('filters rows by Serval build ID', fakeAsync(() => {
// Suppose a user searches for a Serval build ID. It should match. And the matching
// for this and any other searchable fields is both case insensitive and partial,
Expand Down Expand Up @@ -2220,7 +2246,9 @@
projectDeleted = false,
hasServalBuild = true,
hasEvents = true,
buildConfidences = undefined
buildConfidences = undefined,
sourceLanguageTag = undefined,
targetLanguageTag = undefined
}: {
projectId?: string | null;
ptProjectId?: string;
Expand All @@ -2238,6 +2266,8 @@
status?: DraftGenerationBuildStatus;
problems?: BuildReportProblem[];
projectDeleted?: boolean;
sourceLanguageTag?: string;
targetLanguageTag?: string;
/** Whether or not there is a Serval build that this row is based on. Records that correspond to no Serval build
* aren't able to have certain kinds of data. */
hasServalBuild?: boolean;
Expand Down Expand Up @@ -2296,7 +2326,17 @@
trainingDataFileIds: [],
canDenormalizeQuotes: true,
requestedByUserId: requesterId ?? undefined
}
},
executionData:
sourceLanguageTag != null || targetLanguageTag != null
? {
trainCount: 0,
pretranslateCount: 0,
diagnostics: [],
sourceLanguageTag: sourceLanguageTag,
targetLanguageTag: targetLanguageTag
}
: undefined
}
: undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ export class ServalBuildsComponent extends DataLoadingComponent implements OnIni
row.report.project?.shortName,
row.report.project?.name,
row.report.project?.ptProjectId,
row.report.build?.executionData?.sourceLanguageTag,
row.report.build?.executionData?.targetLanguageTag,
requesterId,
requesterIdentity?.name,
requesterIdentity?.displayName,
Expand Down
Loading