Skip to content

Commit 2169ac4

Browse files
committed
ensure translation settings button shows when no source if lynx enabled
1 parent 2db3308 commit 2169ac4

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3630,6 +3630,27 @@ describe('EditorComponent', () => {
36303630
expect(env.translatorSettingsButton).toBeTruthy();
36313631
env.dispose();
36323632
}));
3633+
3634+
it('shows translator settings when lynx features are enabled but no source access', fakeAsync(() => {
3635+
const projectConfig = {
3636+
translateConfig: { translationSuggestionsEnabled: false },
3637+
lynxConfig: {
3638+
autoCorrectionsEnabled: true,
3639+
assessmentsEnabled: false
3640+
}
3641+
};
3642+
const navigationParams: Params = { projectId: 'project01', bookId: 'MRK' };
3643+
3644+
const env = new TestEnvironment();
3645+
// Remove source from project to simulate no source access
3646+
delete env.testProjectProfile.translateConfig.source;
3647+
env.setupProject(projectConfig);
3648+
env.setProjectUserConfig();
3649+
env.routeWithParams(navigationParams);
3650+
env.wait();
3651+
expect(env.translatorSettingsButton).toBeTruthy();
3652+
env.dispose();
3653+
}));
36333654
});
36343655

36353656
describe('Translation Suggestions disabled', () => {

src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,7 @@ export class EditorComponent extends DataLoadingComponent implements OnDestroy,
385385
}
386386

387387
get translatorSettingsEnabled(): boolean {
388-
return (
389-
this.hasSource &&
390-
this.hasSourceViewRight &&
391-
(this.translationSuggestionsProjectEnabled || this.lynxProjectEnabled) &&
392-
this.userHasGeneralEditRight
393-
);
388+
return (this.translationSuggestionsProjectEnabled || this.lynxProjectEnabled) && this.userHasGeneralEditRight;
394389
}
395390

396391
get numSuggestions(): number {

0 commit comments

Comments
 (0)