Skip to content
Open
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 @@ -10,7 +10,7 @@ export function createTestProjectUserConfig(overrides?: RecursivePartial<SFProje
isTargetTextRight: false,
confidenceThreshold: 0.2,
transliterateBiblicalTerms: false,
translationSuggestionsEnabled: true,
translationSuggestionsEnabled: false,
numSuggestions: 1,
selectedSegment: '',
questionRefsRead: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,7 @@ class TestEnvironment {
getSFProjectUserConfigDocId('project01', this.commenterId),
createTestProjectUserConfig({
projectRef: 'project01',
ownerRef: this.commenterId,
translationSuggestionsEnabled: false
ownerRef: this.commenterId
})
);

Expand Down
1 change: 0 additions & 1 deletion src/SIL.XForge.Scripture/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@sillsdev/lynx": "^0.3.5",
"@sillsdev/lynx-delta": "^0.2.4",
"@sillsdev/lynx-punctuation-checker": "^0.2.0",
"@sillsdev/machine": "^2.4.2",
"@sillsdev/scripture": "1.4.1",
"angular-file": "^4.0.2",
"angular-split": "^16.2.1",
Expand Down
16,081 changes: 9,011 additions & 7,070 deletions src/SIL.XForge.Scripture/ClientApp/pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const query: RealtimeQuery<TextAudioDoc> = mock(RealtimeQuery<TextAudioDoc>);
const projectUserConfigDoc: SFProjectUserConfigDoc = mock(SFProjectUserConfigDoc);
const projectUserConfig: SFProjectUserConfig = createTestProjectUserConfig({
projectRef: 'project01',
ownerRef: 'user01',
translationSuggestionsEnabled: false
ownerRef: 'user01'
});
const textAudioDoc: TextAudioDoc = mock(TextAudioDoc);
const textAudio: TextAudio = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { QuestionDoc } from '../../../core/models/question-doc';
import { SFProjectProfileDoc } from '../../../core/models/sf-project-profile-doc';
import { SFProjectUserConfigDoc } from '../../../core/models/sf-project-user-config-doc';
import { SFProjectService } from '../../../core/sf-project.service';
import { TranslationEngineService } from '../../../core/translation-engine.service';
import { BookChapter, bookChapterMatchesVerseRef, CheckingUtils } from '../../checking.utils';
import { CheckingQuestionsService } from '../checking-questions.service';

Expand Down Expand Up @@ -155,7 +154,6 @@ export class CheckingQuestionsComponent implements OnInit, OnChanges {
constructor(
private readonly questionsService: CheckingQuestionsService,
private readonly userService: UserService,
private readonly translationEngineService: TranslationEngineService,
private readonly changeDetector: ChangeDetectorRef,
private readonly projectService: SFProjectService,
private readonly i18n: I18nService,
Expand Down Expand Up @@ -472,16 +470,6 @@ export class CheckingQuestionsComponent implements OnInit, OnChanges {
if (this._projectUserConfigDoc != null && this._projectUserConfigDoc.data != null) {
const activeQuestionDoc = this.activeQuestionDoc;
if (activeQuestionDoc != null && activeQuestionDoc.data != null) {
if (
this.project != null &&
this.project.translateConfig.translationSuggestionsEnabled &&
this.project.translateConfig.source !== undefined
) {
await this.translationEngineService.trainSelectedSegment(
this._projectUserConfigDoc.data,
this.project.translateConfig.source.projectRef
);
}
await this._projectUserConfigDoc.submitJson0Op(op => {
op.set(puc => puc.selectedQuestionRef!, activeQuestionDoc.id);
op.unset(puc => puc.selectedSegment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
import { TextAudioDoc } from '../../core/models/text-audio-doc';
import { TextDoc } from '../../core/models/text-doc';
import { SFProjectService } from '../../core/sf-project.service';
import { TranslationEngineService } from '../../core/translation-engine.service';
import { AudioRecorderDialogComponent } from '../../shared/audio-recorder-dialog/audio-recorder-dialog.component';
import { AudioPlayerComponent } from '../../shared/audio/audio-player/audio-player.component';
import { AudioTimePipe } from '../../shared/audio/audio-time-pipe';
Expand Down Expand Up @@ -103,7 +102,6 @@

const mockedUserService = mock(UserService);
const mockedProjectService = mock(SFProjectService);
const mockedTranslationEngineService = mock(TranslationEngineService);
const mockedNoticeService = mock(NoticeService);
const mockedActivatedRoute = mock(ActivatedRoute);
const mockedDialogService = mock(DialogService);
Expand Down Expand Up @@ -175,14 +173,13 @@
{ provide: ActivatedRoute, useMock: mockedActivatedRoute },
{ provide: UserService, useMock: mockedUserService },
{ provide: SFProjectService, useMock: mockedProjectService },
{ provide: TranslationEngineService, useMock: mockedTranslationEngineService },
{ provide: NoticeService, useMock: mockedNoticeService },
{ provide: DialogService, useMock: mockedDialogService },
{ provide: QuestionDialogService, useMock: mockedQuestionDialogService },
{ provide: ChapterAudioDialogService, useMock: mockedChapterAudioDialogService },
{ provide: FileService, useMock: mockedFileService },
{ provide: OnlineStatusService, useClass: TestOnlineStatusService },
provideNoopAnimations()

Check warning on line 182 in src/SIL.XForge.Scripture/ClientApp/src/app/checking/checking/checking.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 @@ -1392,15 +1389,10 @@
it('saves the last visited question', fakeAsync(() => {
const env = new TestEnvironment({ user: CHECKER_USER });
const projectUserConfigDoc = env.component.projectUserConfigDoc!.data!;
verify(mockedTranslationEngineService.trainSelectedSegment(anything(), anything())).once();
expect(projectUserConfigDoc.selectedQuestionRef).toBe('project01:q5Id');
env.component.projectDoc!.submitJson0Op(op => {
op.set<boolean>(p => p.translateConfig.translationSuggestionsEnabled, false);
});
env.waitForSliderUpdate();
env.selectQuestion(4);
expect(projectUserConfigDoc.selectedQuestionRef).toBe('project01:q4Id');
verify(mockedTranslationEngineService.trainSelectedSegment(anything(), anything())).once();
}));

it('saves the last visited question in all question context', fakeAsync(() => {
Expand All @@ -1411,11 +1403,9 @@
questionScope: 'all'
});
const projectUserConfigDoc = env.component.projectUserConfigDoc!.data!;
verify(mockedTranslationEngineService.trainSelectedSegment(anything(), anything())).once();
expect(projectUserConfigDoc.selectedQuestionRef).toBe('project01:q5Id');
env.selectQuestion(4);
expect(projectUserConfigDoc.selectedQuestionRef).toBe('project01:q3Id');
verify(mockedTranslationEngineService.trainSelectedSegment(anything(), anything())).twice();
}));

it('can cancel answering a question', fakeAsync(() => {
Expand Down Expand Up @@ -3215,7 +3205,6 @@
tag: TestEnvironment.project01WritingSystemTag
},
translateConfig: {
translationSuggestionsEnabled: true,
source: {
paratextId: 'project02',
projectRef: 'project02',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ class TestEnvironment {
const newProject: SFProject = createTestProject({
paratextId: settings.paratextId,
translateConfig: {
translationSuggestionsEnabled: false,
source:
settings.sourceParatextId == null
? undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { CheckingAnswerExport } from 'realtime-server/lib/esm/scriptureforge/mod
* This interface represents the project settings that can be updated using "SFProjectService.onlineUpdateSettings()".
*/
export interface SFProjectSettings {
translationSuggestionsEnabled?: boolean | null;
sourceParatextId?: string | null;
biblicalTermsEnabled?: boolean | null;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading