Skip to content

Commit

Permalink
feat(stark-core): update dependencies after angular 15 update
Browse files Browse the repository at this point in the history
Sync dependencies with root `package.json`.

Update following dependencies:
- `@ng-idle/core`: `^13.0.1`
- `@ng-idle/keepalive`: `^13.0.1`
- `@ngrx/effects`: `^15.4.0`
- `@ngrx/store`: `^15.4.0`
- `@ngrx/store-devtools`: `^15.4.0`
- `@ngx-translate/core`: `^14.0.0`
- `@uirouter/angular`: `^11.1.0`

Refactor `StarkSettingsEffects` class due to change in `typescript` configuration:
- `"useDefineForClassFields": true`
  • Loading branch information
mhenkens committed May 8, 2024
1 parent 9d025e1 commit 898aa00
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 28 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"@mdi/angular-material": "^4.0.96",
"@nationalbankbelgium/code-style": "^1.10.0",
"@nationalbankbelgium/eslint-config": "^15.0.0",
"@ng-idle/core": "^11.0.3",
"@ng-idle/keepalive": "^11.0.3",
"@ngrx/effects": "^14.3.3",
"@ngrx/store": "^14.3.3",
"@ngrx/store-devtools": "^14.3.3",
"@ng-idle/core": "^13.0.1",
"@ng-idle/keepalive": "^13.0.1",
"@ngrx/effects": "^15.4.0",
"@ngrx/store-devtools": "^15.4.0",
"@ngrx/store": "^15.4.0",
"@ngtools/json-schema": "^1.1.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/core": "^14.0.0",
"@npmcli/ci-detect": "^1.3.0",
"@release-it/conventional-changelog": "^8.0.1",
"@sqltools/formatter": "^1.2.3",
Expand Down
5 changes: 4 additions & 1 deletion packages/stark-core/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@
}
}
},
"defaultProject": "stark-core"
"defaultProject": "stark-core",
"cli": {
"analytics": false
}
}
22 changes: 11 additions & 11 deletions packages/stark-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
},
"dependencies": {
"@angularclass/hmr": "^3.0.0",
"@ng-idle/core": "^11.0.3",
"@ng-idle/keepalive": "^11.0.3",
"@ngrx/effects": "^14.3.3",
"@ngrx/store": "^14.3.3",
"@ngrx/store-devtools": "^14.3.3",
"@ngx-translate/core": "^13.0.0",
"@ng-idle/core": "^13.0.1",
"@ng-idle/keepalive": "^13.0.1",
"@ngrx/effects": "^15.4.0",
"@ngrx/store": "^15.4.0",
"@ngrx/store-devtools": "^15.4.0",
"@ngx-translate/core": "^14.0.0",
"@types/lodash-es": "^4.17.4",
"@types/uuid": "^9.0.8",
"@uirouter/angular": "^9.0.1",
"@uirouter/angular": "^11.0.0",
"@uirouter/core": "^6.0.8",
"@uirouter/rx": "~0.6.0",
"cerialize": "^0.1.18",
Expand All @@ -40,10 +40,10 @@
"uuid": "^9.0.1"
},
"peerDependencies": {
"@angular/common": "^14.3.0",
"@angular/compiler": "^14.3.0",
"@angular/core": "^14.3.0",
"@angular/router": "^14.3.0"
"@angular/common": "^15.2.10",
"@angular/compiler": "^15.2.10",
"@angular/core": "^15.2.10",
"@angular/router": "^15.2.10"
},
"scripts": {
"clean": "npx rimraf dist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { map } from "rxjs/operators";

import { StarkSettingsActions } from "../actions";
import { STARK_SESSION_SERVICE, StarkSessionService } from "../../session/services";
import { Observable } from "rxjs";
import { CreateEffectMetadata } from "@ngrx/effects/src/models";

/**
* Effects definition to modify the session's settings.
Expand All @@ -18,19 +20,21 @@ export class StarkSettingsEffects {
public constructor(
private actions$: Actions,
@Inject(STARK_SESSION_SERVICE) public sessionService: StarkSessionService
) {}
) {
this.setPreferredLanguage$ = createEffect(
() =>
this.actions$.pipe(
ofType(StarkSettingsActions.setPreferredLanguage),
map((action) => this.sessionService.setCurrentLanguage(action.language))
),
{ dispatch: false }
);
}

/**
* Sets the language of the current session via the `StarkSessionService` whenever the preferred language changes in the settings.
*
* `dispatch: false` => because this effect does not dispatch an action
*/
public setPreferredLanguage$ = createEffect(
() =>
this.actions$.pipe(
ofType(StarkSettingsActions.setPreferredLanguage),
map((action) => this.sessionService.setCurrentLanguage(action.language))
),
{ dispatch: false }
);
public setPreferredLanguage$: Observable<void> & CreateEffectMetadata;
}
2 changes: 1 addition & 1 deletion packages/stark-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@nationalbankbelgium/code-style/tsconfig/4.6.x/ng14",
"extends": "@nationalbankbelgium/code-style/tsconfig/4.9.x/ng15",
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
Expand Down

0 comments on commit 898aa00

Please sign in to comment.