mirror of https://github.com/Squidex/squidex.git
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.
42 lines
1.0 KiB
42 lines
1.0 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
import { SimulatedRuleEventDto } from '@app/shared';
|
|
|
|
@Component({
|
|
selector: 'sqx-rule-transition',
|
|
styleUrls: ['./rule-transition.component.scss'],
|
|
templateUrl: './rule-transition.component.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
})
|
|
export class RuleTransitionComponent {
|
|
@Input()
|
|
public event: SimulatedRuleEventDto | undefined | null;
|
|
|
|
@Input()
|
|
public errors: ReadonlyArray<string> | undefined | null;
|
|
|
|
@Input()
|
|
public text: string | undefined | null;
|
|
|
|
public get filteredErrors() {
|
|
const errors = this.errors;
|
|
|
|
if (!errors) {
|
|
return null;
|
|
}
|
|
|
|
const result = this.event?.skipReasons.filter(x => errors.indexOf(x) >= 0).map(x => `rules.simulation.error${x}`);
|
|
|
|
if (result?.length === 0) {
|
|
return null;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
|