mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-3255] Add basic dialog for create / update rule (#2568)
* [ACS-3255] Add basic dialog for create / update rule * Remove test data * Fix import * Fix linting
This commit is contained in:
@@ -74,6 +74,7 @@ import { forkJoin, Observable, of, zip } from 'rxjs';
|
||||
import { catchError, map, mergeMap, take, tap } from 'rxjs/operators';
|
||||
import { NodeActionsService } from './node-actions.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { EditRuleDialogSmartComponent } from '@alfresco/aca-folder-rules';
|
||||
|
||||
interface RestoredNode {
|
||||
status: number;
|
||||
@@ -1078,4 +1079,13 @@ export class ContentManagementService {
|
||||
.onAction()
|
||||
.subscribe(() => this.undoMoveNodes(moveResponse, initialParentId));
|
||||
}
|
||||
|
||||
manageRules(node: any) {
|
||||
if (node && node.entry) {
|
||||
this.dialogRef.open(EditRuleDialogSmartComponent, {
|
||||
minWidth: '70%',
|
||||
panelClass: 'aca-edit-rule-dialog-container'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,8 @@ import {
|
||||
getAppSelection,
|
||||
ManageAspectsAction,
|
||||
NavigateRouteAction,
|
||||
ExpandInfoDrawerAction
|
||||
ExpandInfoDrawerAction,
|
||||
ManageRulesAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { ViewUtilService } from '@alfresco/adf-core';
|
||||
@@ -420,4 +421,26 @@ export class NodeEffects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
manageRules$ = createEffect(
|
||||
() =>
|
||||
this.actions$.pipe(
|
||||
ofType<ManageRulesAction>(NodeActionTypes.ManageRules),
|
||||
map((action) => {
|
||||
if (action && action.payload) {
|
||||
this.contentService.manageRules(action.payload);
|
||||
} else {
|
||||
this.store
|
||||
.select(getAppSelection)
|
||||
.pipe(take(1))
|
||||
.subscribe((selection) => {
|
||||
if (selection && !selection.isEmpty) {
|
||||
this.contentService.manageRules(selection.nodes[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
),
|
||||
{ dispatch: false }
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user