mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
remove unused logout action (#3987)
This commit is contained in:
@@ -25,14 +25,12 @@
|
|||||||
import { Actions, ofType, createEffect } from '@ngrx/effects';
|
import { Actions, ofType, createEffect } from '@ngrx/effects';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { AppActionTypes, LogoutAction, ReloadDocumentListAction, ResetSelectionAction } from '@alfresco/aca-shared/store';
|
import { AppActionTypes, ReloadDocumentListAction, ResetSelectionAction } from '@alfresco/aca-shared/store';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { AppHookService } from '@alfresco/aca-shared';
|
import { AppHookService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppEffects {
|
export class AppEffects {
|
||||||
constructor(private actions$: Actions, private auth: AuthenticationService, private router: Router, private appHookService: AppHookService) {}
|
constructor(private actions$: Actions, private appHookService: AppHookService) {}
|
||||||
|
|
||||||
reload = createEffect(
|
reload = createEffect(
|
||||||
() =>
|
() =>
|
||||||
@@ -55,22 +53,4 @@ export class AppEffects {
|
|||||||
),
|
),
|
||||||
{ dispatch: false }
|
{ dispatch: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
logout$ = createEffect(
|
|
||||||
() =>
|
|
||||||
this.actions$.pipe(
|
|
||||||
ofType<LogoutAction>(AppActionTypes.Logout),
|
|
||||||
map(() => {
|
|
||||||
this.auth.logout().subscribe(
|
|
||||||
() => this.redirectToLogin(),
|
|
||||||
() => this.redirectToLogin()
|
|
||||||
);
|
|
||||||
})
|
|
||||||
),
|
|
||||||
{ dispatch: false }
|
|
||||||
);
|
|
||||||
|
|
||||||
private redirectToLogin(): Promise<boolean> {
|
|
||||||
return this.router.navigate(['login']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -29,12 +29,10 @@ export enum AppActionTypes {
|
|||||||
SetUserProfile = 'SET_USER_PROFILE',
|
SetUserProfile = 'SET_USER_PROFILE',
|
||||||
SetRepositoryInfo = 'SET_REPOSITORY_INFO',
|
SetRepositoryInfo = 'SET_REPOSITORY_INFO',
|
||||||
ToggleInfoDrawer = 'TOGGLE_INFO_DRAWER',
|
ToggleInfoDrawer = 'TOGGLE_INFO_DRAWER',
|
||||||
Logout = 'LOGOUT',
|
|
||||||
ReloadDocumentList = 'RELOAD_DOCUMENT_LIST',
|
ReloadDocumentList = 'RELOAD_DOCUMENT_LIST',
|
||||||
ResetSelection = 'RESET_SELECTION',
|
ResetSelection = 'RESET_SELECTION',
|
||||||
SetInfoDrawerState = 'SET_INFO_DRAWER_STATE',
|
SetInfoDrawerState = 'SET_INFO_DRAWER_STATE',
|
||||||
SetInfoDrawerMetadataAspect = 'SET_INFO_DRAWER_METADATA_ASPECT',
|
SetInfoDrawerMetadataAspect = 'SET_INFO_DRAWER_METADATA_ASPECT',
|
||||||
CloseModalDialogs = 'CLOSE_MODAL_DIALOGS',
|
|
||||||
SetFileUploadingDialog = 'SET_FILE_UPLOADING_DIALOG',
|
SetFileUploadingDialog = 'SET_FILE_UPLOADING_DIALOG',
|
||||||
ShowInfoDrawerPreview = 'SHOW_INFO_DRAWER_PREVIEW',
|
ShowInfoDrawerPreview = 'SHOW_INFO_DRAWER_PREVIEW',
|
||||||
SetInfoDrawerPreviewState = 'SET_INFO_DRAWER_PREVIEW_STATE',
|
SetInfoDrawerPreviewState = 'SET_INFO_DRAWER_PREVIEW_STATE',
|
||||||
|
@@ -55,10 +55,6 @@ export class ToggleInfoDrawerAction implements Action {
|
|||||||
readonly type = AppActionTypes.ToggleInfoDrawer;
|
readonly type = AppActionTypes.ToggleInfoDrawer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LogoutAction implements Action {
|
|
||||||
readonly type = AppActionTypes.Logout;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ReloadDocumentListAction implements Action {
|
export class ReloadDocumentListAction implements Action {
|
||||||
readonly type = AppActionTypes.ReloadDocumentList;
|
readonly type = AppActionTypes.ReloadDocumentList;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user