mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1607][ACA-1985] Leave library action (#824)
* [ACA-1607] leave library action * [ACA-1607] confirm leave action * [ACA-1607] confirm leave action * [ACA-1607] remove comment
This commit is contained in:
committed by
Denys Vuika
parent
62e33efbd0
commit
13db4fb339
@@ -34,7 +34,9 @@ import {
|
||||
NavigateLibraryAction,
|
||||
NAVIGATE_LIBRARY,
|
||||
UpdateLibraryAction,
|
||||
UPDATE_LIBRARY
|
||||
UPDATE_LIBRARY,
|
||||
LeaveLibraryAction,
|
||||
LEAVE_LIBRARY
|
||||
} from '../actions';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { Store } from '@ngrx/store';
|
||||
@@ -73,6 +75,25 @@ export class LibraryEffects {
|
||||
})
|
||||
);
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
leaveLibrary$ = this.actions$.pipe(
|
||||
ofType<LeaveLibraryAction>(LEAVE_LIBRARY),
|
||||
map(action => {
|
||||
if (action.payload) {
|
||||
this.content.leaveLibrary(action.payload);
|
||||
} else {
|
||||
this.store
|
||||
.select(appSelection)
|
||||
.pipe(take(1))
|
||||
.subscribe(selection => {
|
||||
if (selection && selection.library) {
|
||||
this.content.leaveLibrary(selection.library.entry.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
@Effect()
|
||||
createLibrary$ = this.actions$.pipe(
|
||||
ofType<CreateLibraryAction>(CREATE_LIBRARY),
|
||||
|
Reference in New Issue
Block a user