@@ -13,6 +13,11 @@
{{ 'preferences-screen.form.show-suggestions-in-preview' | translate }}
+
+
+ {{ 'preferences-screen.form.open-structured-view-by-default' | translate }}
+
+
{{ 'preferences-screen.warnings-subtitle' | translate }}
@@ -38,7 +43,6 @@
(action)="save()"
[disabled]="!valid || !changed"
[label]="'preferences-screen.actions.save' | translate"
- [submit]="true"
[type]="iconButtonTypes.primary"
>
diff --git a/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts b/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts
index 765aeeeec..c7fb30560 100644
--- a/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts
+++ b/apps/red-ui/src/app/modules/account/screens/preferences/preferences.component.ts
@@ -10,6 +10,7 @@ interface PreferencesForm {
// preferences
autoExpandFiltersOnActions: boolean;
displaySuggestionsInPreview: boolean;
+ openStructuredComponentManagementDialogByDefault: boolean;
// warnings preferences
unapprovedSuggestionsWarning: boolean;
loadAllAnnotationsWarning: boolean;
@@ -35,6 +36,7 @@ export class PreferencesComponent extends BaseFormComponent {
readonly currentScreen: Screen;
readonly screens = Screens;
initialFormValue: PreferencesForm;
+ readonly roles = Roles;
constructor(
readonly userPreferenceService: UserPreferenceService,
@@ -48,6 +50,9 @@ export class PreferencesComponent extends BaseFormComponent {
// preferences
autoExpandFiltersOnActions: [this.userPreferenceService.getAutoExpandFiltersOnActions()],
displaySuggestionsInPreview: [this.userPreferenceService.getDisplaySuggestionsInPreview()],
+ openStructuredComponentManagementDialogByDefault: [
+ this.userPreferenceService.getOpenStructuredComponentManagementDialogByDefault(),
+ ],
// warnings preferences
unapprovedSuggestionsWarning: [this.userPreferenceService.getUnapprovedSuggestionsWarning()],
loadAllAnnotationsWarning: [this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)],
@@ -68,6 +73,12 @@ export class PreferencesComponent extends BaseFormComponent {
if (this.form.controls.displaySuggestionsInPreview.value !== this.userPreferenceService.getDisplaySuggestionsInPreview()) {
await this.userPreferenceService.toggleDisplaySuggestionsInPreview();
}
+ if (
+ this.form.controls.openStructuredComponentManagementDialogByDefault.value !==
+ this.userPreferenceService.getOpenStructuredComponentManagementDialogByDefault()
+ ) {
+ await this.userPreferenceService.toggleOpenStructuredComponentManagementDialogByDefault();
+ }
if (this.form.controls.unapprovedSuggestionsWarning.value !== this.userPreferenceService.getUnapprovedSuggestionsWarning()) {
await this.userPreferenceService.toggleUnapprovedSuggestionsWarning();
}
@@ -83,12 +94,20 @@ export class PreferencesComponent extends BaseFormComponent {
}
await this.userPreferenceService.reload();
- this.form.patchValue({
- autoExpandFiltersOnActions: this.userPreferenceService.getAutoExpandFiltersOnActions(),
- displaySuggestionsInPreview: this.userPreferenceService.getDisplaySuggestionsInPreview(),
- unapprovedSuggestionsWarning: this.userPreferenceService.getUnapprovedSuggestionsWarning(),
- });
+ this.#patchValues();
+
this.initialFormValue = this.form.getRawValue();
this._changeRef.markForCheck();
}
+
+ #patchValues() {
+ this.form.patchValue({
+ autoExpandFiltersOnActions: this.userPreferenceService.getAutoExpandFiltersOnActions(),
+ displaySuggestionsInPreview: this.userPreferenceService.getDisplaySuggestionsInPreview(),
+ openStructuredComponentManagementDialogByDefault:
+ this.userPreferenceService.getOpenStructuredComponentManagementDialogByDefault(),
+ unapprovedSuggestionsWarning: this.userPreferenceService.getUnapprovedSuggestionsWarning(),
+ loadAllAnnotationsWarning: this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning),
+ });
+ }
}
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html
index f4a705dd6..dbb5374f0 100644
--- a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html
+++ b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.html
@@ -80,6 +80,13 @@
>