Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
1.2 KiB

/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { Component, EventEmitter, Input, Output } from '@angular/core';
import {
RoleDto,
WorkflowTransitionValues,
WorkflowTransitionView
} from '@app/shared';
@Component({
selector: 'sqx-workflow-transition',
styleUrls: ['./workflow-transition.component.scss'],
templateUrl: './workflow-transition.component.html'
})
export class WorkflowTransitionComponent {
public readonly onBlur: { updateOn: 'blur' } = { updateOn: 'blur' };
@Output()
public update = new EventEmitter<WorkflowTransitionValues>();
@Output()
public remove = new EventEmitter();
@Input()
public transition: WorkflowTransitionView;
@Input()
public roles: ReadonlyArray<string>;
@Input()
public disabled: boolean;
public changeExpression(expression: string) {
this.update.emit({ expression });
}
public changeRole(roles: ReadonlyArray<string>) {
this.update.emit(({ roles: roles || [] }) as any);
}
public trackByRole(index: number, role: RoleDto) {
return role.name;
}
}