RED-8882 - moved help mode dialog preference into iqser-user-preferences.service
This commit is contained in:
parent
bea47cc003
commit
0630b0e078
@ -1,7 +1,7 @@
|
|||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { BaseFormComponent, getConfig, IqserPermissionsService, isIqserDevMode, LoadingService } from '@iqser/common-ui';
|
import { BaseFormComponent, getConfig, IqserPermissionsService, isIqserDevMode, KEYS, LoadingService } from '@iqser/common-ui';
|
||||||
import { AsControl } from '@iqser/common-ui/lib/utils';
|
import { AsControl } from '@iqser/common-ui/lib/utils';
|
||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import { PreferencesKeys, UserPreferenceService } from '@users/user-preference.service';
|
import { PreferencesKeys, UserPreferenceService } from '@users/user-preference.service';
|
||||||
@ -56,7 +56,7 @@ export class PreferencesComponent extends BaseFormComponent implements OnInit {
|
|||||||
tableExtractionType: [this.userPreferenceService.getTableExtractionType()],
|
tableExtractionType: [this.userPreferenceService.getTableExtractionType()],
|
||||||
// warnings preferences
|
// warnings preferences
|
||||||
loadAllAnnotationsWarning: [this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)],
|
loadAllAnnotationsWarning: [this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)],
|
||||||
helpModeDialog: [this.userPreferenceService.getBool(PreferencesKeys.helpModeDialog)],
|
helpModeDialog: [this.userPreferenceService.getBool(KEYS.helpModeDialog)],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this._permissionsService.has(Roles.managePreferences)) {
|
if (!this._permissionsService.has(Roles.managePreferences)) {
|
||||||
@ -97,8 +97,8 @@ export class PreferencesComponent extends BaseFormComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.form.controls.helpModeDialog.value !== this.userPreferenceService.getBool(PreferencesKeys.helpModeDialog)) {
|
if (this.form.controls.helpModeDialog.value !== this.userPreferenceService.getBool(KEYS.helpModeDialog)) {
|
||||||
await this.userPreferenceService.save(PreferencesKeys.helpModeDialog, String(this.form.controls.helpModeDialog.value));
|
await this.userPreferenceService.save(KEYS.helpModeDialog, String(this.form.controls.helpModeDialog.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.userPreferenceService.reload();
|
await this.userPreferenceService.reload();
|
||||||
@ -114,7 +114,7 @@ export class PreferencesComponent extends BaseFormComponent implements OnInit {
|
|||||||
openScmDialogByDefault: this.userPreferenceService.getOpenScmDialogByDefault(),
|
openScmDialogByDefault: this.userPreferenceService.getOpenScmDialogByDefault(),
|
||||||
tableExtractionType: this.userPreferenceService.getTableExtractionType(),
|
tableExtractionType: this.userPreferenceService.getTableExtractionType(),
|
||||||
loadAllAnnotationsWarning: this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning),
|
loadAllAnnotationsWarning: this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning),
|
||||||
helpModeDialog: this.userPreferenceService.getBool(PreferencesKeys.helpModeDialog),
|
helpModeDialog: this.userPreferenceService.getBool(KEYS.helpModeDialog),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,6 @@ export const PreferencesKeys = {
|
|||||||
removeRedactionDefaultExtraOption: 'Remove-Redaction-Default-Extra',
|
removeRedactionDefaultExtraOption: 'Remove-Redaction-Default-Extra',
|
||||||
removeRecommendationDefaultExtraOption: 'Remove-Recommendation-Default-Extra',
|
removeRecommendationDefaultExtraOption: 'Remove-Recommendation-Default-Extra',
|
||||||
removeHintDefaultExtraOption: 'Remove-Hint-Default-Extra',
|
removeHintDefaultExtraOption: 'Remove-Hint-Default-Extra',
|
||||||
helpModeDialog: 'Help-Mode-Dialog',
|
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -180,13 +179,4 @@ export class UserPreferenceService extends IqserUserPreferenceService {
|
|||||||
async saveRemoveRecommendationDefaultExtraOption(defaultOption: boolean | string): Promise<void> {
|
async saveRemoveRecommendationDefaultExtraOption(defaultOption: boolean | string): Promise<void> {
|
||||||
await this.save(PreferencesKeys.removeRecommendationDefaultExtraOption, defaultOption.toString());
|
await this.save(PreferencesKeys.removeRecommendationDefaultExtraOption, defaultOption.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
getHelpModeDialog(): boolean {
|
|
||||||
return this._getAttribute(PreferencesKeys.helpModeDialog, 'false') === 'true';
|
|
||||||
}
|
|
||||||
|
|
||||||
async toggleHelpModeDialog(): Promise<void> {
|
|
||||||
const nextValue = (!this.getHelpModeDialog()).toString();
|
|
||||||
await this.save(PreferencesKeys.helpModeDialog, nextValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 848e46cf6abc9cafbca5158540e34c65e8dde73d
|
Subproject commit 174d77d2eaedb17b2e729efdc29a07e7942e46e5
|
||||||
Loading…
x
Reference in New Issue
Block a user