feat(console): actions and flows (#2559)

* features, page, table, create dialog, i18n

* trigger actions service, add action dialog

* display flows, add flow dialog, duration pipe, i18n

* optim flow layout, action presets

* delete actions, flows, layout

* drag drop list, fix update

* lint

* stylelint

* fix template rest

* actions, drag, fix hasrole

* stylelint

* toast, i18n

* missing italian translations

* it

* fix ActionSearchQueries

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Max Peintner
2021-11-16 08:18:03 +01:00
committed by GitHub
co-authored by Livio Amstutz
parent b80751d7f7
commit 06e1af4f78
36 changed files with 2271 additions and 914 deletions
@@ -14,11 +14,11 @@ export class HasFeatureDirective {
if (isAllowed && !this.hasView) {
this.viewContainerRef.clear();
this.viewContainerRef.createEmbeddedView(this.templateRef);
} else if (this.hasView) {
} else {
this.viewContainerRef.clear();
this.hasView = false;
}
});
})
}
}
@@ -1,20 +1,18 @@
import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
@Directive({
selector: '[cnslHasRole]',
})
export class HasRoleDirective {
private hasView: boolean = false;
@Input() public set hasRole(roles: string[] | RegExp[]) {
if (roles && roles.length > 0) {
this.authService.isAllowed(roles).subscribe(isAllowed => {
this.authService.isAllowed(roles).subscribe((isAllowed) => {
if (isAllowed && !this.hasView) {
this.viewContainerRef.clear();
this.viewContainerRef.createEmbeddedView(this.templateRef);
} else if (this.hasView) {
} else {
this.viewContainerRef.clear();
this.hasView = false;
}
@@ -26,5 +24,5 @@ export class HasRoleDirective {
private authService: GrpcAuthService,
protected templateRef: TemplateRef<any>,
protected viewContainerRef: ViewContainerRef,
) { }
) {}
}