aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/services/user-settings.service.ts
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-09-23 13:39:16 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-09-24 11:46:57 +0200
commite964f1c1be44ef74877531870c119aa110555ca1 (patch)
treeeed038ca967edd10309ef527ceac9cbf9fd5e9d0 /src/app/services/user-settings.service.ts
parent143be69ed4d2353349f5b7030c3bb1ce1a166a99 (diff)
Upgrade packages to current Angular 13 level
- upgrade angular-oauth2-oidc (12.1.0 -> 13.0.1) - upgrade ngx-translate (13.0.0 -> 14.0.0) - upgrade rxjs (6.6.7 -> 7.4.0) - remove ng-bootstrap - bump version to 0.1.1 Issue-ID: PORTALNG-120 Change-Id: I0672a7e794e965677ef5d818163ec080734e11e0 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'src/app/services/user-settings.service.ts')
-rw-r--r--src/app/services/user-settings.service.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/app/services/user-settings.service.ts b/src/app/services/user-settings.service.ts
index cbaa992..2f7e578 100644
--- a/src/app/services/user-settings.service.ts
+++ b/src/app/services/user-settings.service.ts
@@ -49,14 +49,14 @@ export class UserSettingsService {
}
selectDashboard = () =>
- this.getPreferences$().pipe(selectDistinctState<UserPreferencesModel, DashboardModel>(STATE_KEYS.DASHBOARD));
+ this.getPreferences$().pipe(selectDistinctState<UserPreferencesModel, DashboardModel>(STATE_KEYS.DASHBOARD as keyof UserPreferencesModel));
selectDashboardApps = () =>
- this.selectDashboard().pipe(selectDistinctState<DashboardModel, DashboardAppsModel>(STATE_KEYS.APPS));
+ this.selectDashboard().pipe(selectDistinctState<DashboardModel, DashboardAppsModel>(STATE_KEYS.APPS as keyof DashboardModel));
selectDashboardAvailableTiles = () =>
- this.selectDashboardApps().pipe(selectDistinctState<DashboardAppsModel, DashboardTileSettings[]>(STATE_KEYS.TILES));
+ this.selectDashboardApps().pipe(selectDistinctState<DashboardAppsModel, DashboardTileSettings[]>(STATE_KEYS.TILES as keyof DashboardAppsModel));
selectLastUserAction = () =>
this.selectDashboardApps().pipe(
- selectDistinctState<DashboardAppsModel, LastUserActionSettings>(STATE_KEYS.USER_ACTIONS),
+ selectDistinctState<DashboardAppsModel, LastUserActionSettings>(STATE_KEYS.USER_ACTIONS as keyof DashboardAppsModel),
);
getPreferences(): void {
@@ -106,6 +106,8 @@ export class UserSettingsService {
}
}
-export function selectDistinctState<T, I>(key: string): UnaryFunction<Observable<T>, Observable<I>> {
- return pipe(pluck<T, I>(key), distinctUntilChanged<I>());
+export function selectDistinctState<T, I>(key: keyof T): UnaryFunction<Observable<T>, Observable<I>> {
+ // return pipe(map(x => x[key] as I), distinctUntilChanged<I>());
+ return pipe(pluck(key), map(value => value as unknown as I), distinctUntilChanged());
+ // return pipe(pluck<T, I>(key), distinctUntilChanged<I>());
}