[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:
Thomas Hunter
2022-07-15 16:37:41 +01:00
committed by GitHub
parent 8312bf8d84
commit a9f1946a0a
17 changed files with 692 additions and 4 deletions

View File

@@ -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'
});
}
}
}

View File

@@ -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 }
);
}