"private": true,
"dependencies": {
"@angular/animations": "13.3.10",
- "@angular/cdk": "13.3.8",
+ "@angular/cdk": "13.3.9",
"@angular/common": "13.3.10",
"@angular/compiler": "13.3.10",
"@angular/core": "13.3.10",
"@angular/platform-browser-dynamic": "13.3.10",
"@angular/router": "13.3.10",
"@ng-bootstrap/ng-bootstrap": "12.1.2",
- "@ngx-translate/core": "13.0.0",
- "@ngx-translate/http-loader": "6.0.0",
+ "@ngx-translate/core": "14.0.0",
+ "@ngx-translate/http-loader": "7.0.0",
"@popperjs/core": "2.11.5",
- "angular-oauth2-oidc": "12.1.0",
+ "angular-oauth2-oidc": "13.0.1",
"bootstrap": "5.1.3",
"license-report": "5.0.2",
"lodash": "4.17.21",
- "ng-bootstrap": "1.6.3",
- "rxjs": "6.6.7",
- "tslib": "2.2.0",
+ "rxjs": "~7.4.0",
+ "tslib": "2.3.0",
"zone.js": "0.11.5"
},
"devDependencies": {
- "@angular-devkit/build-angular": "13.3.7",
- "@angular-eslint/builder": "13.2.1",
- "@angular-eslint/eslint-plugin": "13.2.1",
- "@angular-eslint/eslint-plugin-template": "13.2.1",
- "@angular-eslint/schematics": "13.2.1",
- "@angular-eslint/template-parser": "13.2.1",
- "@angular/cli": "13.3.7",
+ "@angular-devkit/build-angular": "13.3.10",
+ "@angular-eslint/builder": "13.5.0",
+ "@angular-eslint/eslint-plugin": "13.5.0",
+ "@angular-eslint/eslint-plugin-template": "13.5.0",
+ "@angular-eslint/schematics": "13.5.0",
+ "@angular-eslint/template-parser": "13.5.0",
+ "@angular/cli": "13.3.10",
"@angular/compiler-cli": "13.3.10",
"@openapitools/openapi-generator-cli": "^2.6.0",
"@types/jasmine": "~3.6.0",
.pipe(shareReplay({ refCount: true, bufferSize: 1 }));
public actionFilterType$ = this.userActionsSettings$.pipe(
- selectDistinctState<LastUserActionSettings, ActionFilter>(STATE_KEYS.FILTER_TYPE),
+ selectDistinctState<LastUserActionSettings, ActionFilter>(STATE_KEYS.FILTER_TYPE as keyof LastUserActionSettings),
shareReplay({ refCount: true, bufferSize: 1 }),
);
public actionIntervalType$ = this.userActionsSettings$.pipe(
- selectDistinctState<LastUserActionSettings, ActionInterval>(STATE_KEYS.INTERVAL),
+ selectDistinctState<LastUserActionSettings, ActionInterval>(STATE_KEYS.INTERVAL as keyof LastUserActionSettings),
shareReplay({ refCount: true, bufferSize: 1 }),
);
export class I18nModule {
constructor(translate: TranslateService) {
translate.addLangs(['en', 'de']);
- const browserLang = translate.getBrowserLang();
+ const browserLang = translate.getBrowserLang() ?? 'en';
translate.use(browserLang.match(/en|de/) ? browserLang : 'en');
}
}
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
-import { Observable } from 'rxjs';
+import { firstValueFrom, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { Tile, TilesListResponse } from '../../model/tile';
import { map } from 'rxjs/operators';
* GET tile by id
* @param id to get specific tile
*/
- getTileById(id: number): Promise<Tile> {
- return this.httpClient.get<Tile>(urlTileApi + '/' + id).toPromise();
+ getTileById(id: number): Promise<Tile | undefined> {
+ return firstValueFrom(this.httpClient.get<Tile>(urlTileApi + '/' + id));
}
/**
* @param tile
* @returns the new saved tile
*/
- saveTiles(tile: Tile): Promise<Tile> {
+ saveTiles(tile: Tile): Promise<Tile | undefined> {
const options = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
};
- return this.httpClient.post<Tile>(urlTileApi, tile, options).toPromise();
+ return firstValueFrom(this.httpClient.post<Tile>(urlTileApi, tile, options));
}
/**
* @returns the updated hero
* @param tile
*/
- updateTiles(tile: Tile): Promise<Tile> {
+ updateTiles(tile: Tile): Promise<Tile | undefined> {
const options = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
};
- return this.httpClient.put<Tile>(urlTileApi + '/' + tile.id, tile, options).toPromise();
+ return firstValueFrom(this.httpClient.put<Tile>(urlTileApi + '/' + tile.id, tile, options));
}
/**
}
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 {
}
}
-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>());
}
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
- "lib": ["es2018", "dom"],
+ "lib": ["es2020", "dom"],
"resolveJsonModule": true,
"esModuleInterop": true
},
\r
major=0\r
minor=1\r
-patch=1\r
+patch=2\r
\r
base_version=${major}.${minor}.${patch}\r
\r