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
@@ -1,6 +1,8 @@
import { LynxInsightFilter, LynxInsightSortOrder } from './lynx-insight';

export interface LynxInsightUserData {
autoCorrectionsEnabled?: boolean;
assessmentsEnabled?: boolean;
panelData?: LynxInsightPanelUserData;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,26 @@ describe('SFProjectMigrations', () => {
});
});

describe('version 25', () => {
it('adds lynxConfig with default values', async () => {
const env = new TestEnvironment(24);
const conn = env.server.connect();
await createDoc(conn, SF_PROJECTS_COLLECTION, 'project01', {});
let projectDoc = await fetchDoc(conn, SF_PROJECTS_COLLECTION, 'project01');
expect(projectDoc.data.lynxConfig).toBeUndefined();

await env.server.migrateIfNecessary();

projectDoc = await fetchDoc(conn, SF_PROJECTS_COLLECTION, 'project01');
expect(projectDoc.data.lynxConfig).toEqual({
autoCorrectionsEnabled: false,
assessmentsEnabled: false,
punctuationCheckerEnabled: false,
allowedCharacterCheckerEnabled: false
});
});
});

describe('version 26', () => {
it('removes lastSelectedTrainingBooks from draftConfig', async () => {
const env = new TestEnvironment(25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ describe('SFProjectUserConfigMigrations', () => {
expect(userConfigDoc.version).toBe(1);
});
});

describe('version 8', () => {
it('adds lynxInsightState property', async () => {
const env = new TestEnvironment(7);
const conn = env.server.connect();
await createDoc(conn, SF_PROJECT_USER_CONFIGS_COLLECTION, 'project01:user01', {});
let userConfigDoc = await fetchDoc(conn, SF_PROJECT_USER_CONFIGS_COLLECTION, 'project01:user01');
expect(userConfigDoc.data.lynxInsightState).not.toBeDefined();

await env.server.migrateIfNecessary();

userConfigDoc = await fetchDoc(conn, SF_PROJECT_USER_CONFIGS_COLLECTION, 'project01:user01');
expect(userConfigDoc.data.lynxInsightState).toEqual({});
});
});
});

class TestEnvironment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ export class SFProjectUserConfigService extends SFProjectDataService<SFProjectUs
bsonType: 'string'
}
}
},
assessmentsEnabled: {
bsonType: 'bool'
},
autoCorrectionsEnabled: {
bsonType: 'bool'
}
},
additionalProperties: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
[(chapter)]="chapter"
[chapters]="chapters"
></app-book-chapter-chooser>
@if (showSource || suggestionsSettingsEnabled) {
<div class="toolbar-separator" [ngClass]="{ 'hide-lt-sm': !suggestionsSettingsEnabled }">&nbsp;</div>
@if (showSource || translatorSettingsEnabled) {
<div class="toolbar-separator" [ngClass]="{ 'hide-lt-sm': !translatorSettingsEnabled }">&nbsp;</div>
@if (showSource) {
<button
mat-icon-button
Expand All @@ -27,13 +27,13 @@
<mat-icon>swap_horiz</mat-icon>
</button>
}
@if (suggestionsSettingsEnabled) {
@if (translatorSettingsEnabled) {
<button
mat-icon-button
appBlurOnClick
type="button"
id="settings-btn"
(click)="openSuggestionsSettings()"
(click)="openTranslatorSettings()"
[title]="t('configure_translation_suggestions')"
>
<mat-icon>settings</mat-icon>
Expand Down
Loading
Loading