mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Use ADF Notification Service instead of NgRx store (#3991)
This commit is contained in:
@@ -22,21 +22,21 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Actions, ofType, createEffect } from '@ngrx/effects';
|
||||
import { Node, PathInfo } from '@alfresco/js-api';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../states/app.state';
|
||||
import { Location } from '@angular/common';
|
||||
import { NavigateUrlAction, NavigateRouteAction, NavigateToFolder, NavigateToParentFolder, NavigateToPreviousPage } from '../actions/router.actions';
|
||||
import { SnackbarErrorAction } from '../actions/snackbar.actions';
|
||||
import { RouterActionTypes } from '../actions/router-action-types';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
|
||||
@Injectable()
|
||||
export class RouterEffects {
|
||||
constructor(private store: Store<AppStore>, private actions$: Actions, private router: Router, private location: Location) {}
|
||||
private notificationService = inject(NotificationService);
|
||||
|
||||
constructor(private actions$: Actions, private router: Router, private location: Location) {}
|
||||
|
||||
navigateUrl$ = createEffect(
|
||||
() =>
|
||||
@@ -143,7 +143,7 @@ export class RouterEffects {
|
||||
this.router.navigate(link);
|
||||
}, 10);
|
||||
} else {
|
||||
this.store.dispatch(new SnackbarErrorAction('APP.MESSAGES.ERRORS.CANNOT_NAVIGATE_LOCATION'));
|
||||
this.notificationService.showError('APP.MESSAGES.ERRORS.CANNOT_NAVIGATE_LOCATION');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user