Visualize Conditions of ProductStates
All checks were successful
E2E Testing / test (push) Successful in 1m33s
All checks were successful
E2E Testing / test (push) Successful in 1m33s
This commit is contained in:
parent
7bb992200f
commit
983542ad3b
@ -12,18 +12,24 @@ export class ScriptaccountConditionEditorComponent implements OnInit{
|
|||||||
|
|
||||||
@Input() conditions: ScriptAccountCondition[] = []
|
@Input() conditions: ScriptAccountCondition[] = []
|
||||||
@Input() scriptAccounts: ScriptAccount[] = []
|
@Input() scriptAccounts: ScriptAccount[] = []
|
||||||
|
@Input() enableEditiong: boolean = false
|
||||||
@Output() onCreateCondition: EventEmitter<ScriptAccountCondition> = new EventEmitter<ScriptAccountCondition>();
|
@Output() onCreateCondition: EventEmitter<ScriptAccountCondition> = new EventEmitter<ScriptAccountCondition>();
|
||||||
@Output() onDeleteCondition: EventEmitter<ScriptAccountCondition> = new EventEmitter<ScriptAccountCondition>();
|
@Output() onDeleteCondition: EventEmitter<ScriptAccountCondition> = new EventEmitter<ScriptAccountCondition>();
|
||||||
|
|
||||||
dataSource: MatTableDataSource<ScriptAccountCondition> = new MatTableDataSource();
|
dataSource: MatTableDataSource<ScriptAccountCondition> = new MatTableDataSource();
|
||||||
displayedColumns = ['scriptAccount', 'minValue', 'maxValue', 'edit', 'delete']
|
displayedColumns = ['scriptAccount', 'minValue', 'maxValue']
|
||||||
|
|
||||||
editedCondition: ScriptAccountCondition | undefined
|
editedCondition: ScriptAccountCondition | undefined
|
||||||
addedCondition: ScriptAccountCondition | undefined
|
addedCondition: ScriptAccountCondition | undefined
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.dataSource.data = this.conditions.concat();
|
this.dataSource.data = this.conditions.concat();
|
||||||
|
|
||||||
|
if(this.enableEditiong) {
|
||||||
|
this.displayedColumns.push( 'edit', 'delete')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
createCondition() {
|
createCondition() {
|
||||||
this.addedCondition = ScriptAccountCondition.constructScriptAccountCondition(new ScriptAccount("", ""), 0,0);
|
this.addedCondition = ScriptAccountCondition.constructScriptAccountCondition(new ScriptAccount("", ""), 0,0);
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<td mat-cell *matCellDef="let element" [attr.colspan]="expandedColumns.length">
|
<td mat-cell *matCellDef="let element" [attr.colspan]="expandedColumns.length">
|
||||||
<div class="example-element-detail"
|
<div class="example-element-detail"
|
||||||
[@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
|
[@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
|
||||||
<p>Expanded Row</p>
|
<app-scriptaccount-condition-editor [conditions]="element.conditions" [enableEditiong]="false"></app-scriptaccount-condition-editor>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div class="long-form">
|
<div class="long-form">
|
||||||
<app-scriptaccount-condition-editor [conditions]="element.conditions" [scriptAccounts]="scriptAccounts"
|
<app-scriptaccount-condition-editor [conditions]="element.conditions" [scriptAccounts]="scriptAccounts" [enableEditiong]="true"
|
||||||
(onCreateCondition)="onCreateCondition(element, $event)" (onDeleteCondition)="deleteCondition(element, $event)"></app-scriptaccount-condition-editor>
|
(onCreateCondition)="onCreateCondition(element, $event)" (onDeleteCondition)="deleteCondition(element, $event)"></app-scriptaccount-condition-editor>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<app-scriptaccount-action-editor [transition]="element" [scriptAccounts]="scriptAccounts" [enableEditing]="true"></app-scriptaccount-action-editor>
|
<app-scriptaccount-action-editor [transition]="element" [scriptAccounts]="scriptAccounts" [enableEditing]="true"></app-scriptaccount-action-editor>
|
||||||
</div>
|
</div>
|
||||||
<div class="condition-container">
|
<div class="condition-container">
|
||||||
<app-scriptaccount-condition-editor [conditions]="element.scriptAccountConditions" [scriptAccounts]="scriptAccounts"
|
<app-scriptaccount-condition-editor [conditions]="element.scriptAccountConditions" [scriptAccounts]="scriptAccounts" [enableEditiong]="true"
|
||||||
(onCreateCondition)="onCreateCondition(element, $event)" (onDeleteCondition)="deleteCondition(element, $event)"></app-scriptaccount-condition-editor>
|
(onCreateCondition)="onCreateCondition(element, $event)" (onDeleteCondition)="deleteCondition(element, $event)"></app-scriptaccount-condition-editor>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user