Commit 109dd4ed authored by Alexander Philipp Nowosad's avatar Alexander Philipp Nowosad
Browse files

Add context domains to decision configuration form component

parent 1b987935
......@@ -3,6 +3,7 @@ import { FormGroup } from '@angular/forms';
import { CompanyModel } from '../../../canvas-meta-model/company-model';
import { CompanyModelService } from '../../../canvas-meta-model/company-model.service';
import { DecisionConfigurationFormComponent } from '../../../development-process-registry/module-api/decision-configuration-form-component';
import { Domain } from '../../../development-process-registry/knowledge/domain';
@Component({
selector: 'app-create-canvas-configuration',
......@@ -13,6 +14,7 @@ export class CreateCanvasConfigurationComponent implements OnInit, DecisionConfi
formGroup: FormGroup;
predefinedInput: any;
contextDomains: Domain[];
companyModels: CompanyModel[];
......
import { ConfigurationFormComponent } from './configuration-form-component';
import { Domain } from '../knowledge/domain';
export interface DecisionConfigurationFormComponent extends ConfigurationFormComponent {
predefinedInput: any;
contextDomains: Domain[];
}
......@@ -104,7 +104,7 @@
</button>
</div>
<div class="modal-body">
<app-method-info [contextSituationalFactors]="bmProcess.situationalFactors"
<app-method-info [contextDomains]="bmProcess.domains" [contextSituationalFactors]="bmProcess.situationalFactors"
[developmentMethod]="modalDevelopmentMethod" [decision]="bmProcess.decisions[modalElement.id]"
(updateDecisions)="updateDecisions($event)"></app-method-info>
</div>
......
......@@ -3,6 +3,7 @@ import { ExecutionStep } from '../../development-process-registry/development-me
import { ModuleService } from '../../development-process-registry/module-api/module.service';
import { ConfigurationFormPlaceholderDirective } from '../configuration-form-placeholder.directive';
import { ControlContainer, FormGroup } from '@angular/forms';
import { Domain } from '../../development-process-registry/knowledge/domain';
@Component({
selector: 'app-method-info-step',
......@@ -11,6 +12,7 @@ import { ControlContainer, FormGroup } from '@angular/forms';
})
export class MethodInfoStepComponent implements OnChanges {
@Input() contextDomains: Domain[];
@Input() step: ExecutionStep;
@ViewChild(ConfigurationFormPlaceholderDirective, {static: true}) configurationFormHost: ConfigurationFormPlaceholderDirective;
......@@ -23,7 +25,7 @@ export class MethodInfoStepComponent implements OnChanges {
}
ngOnChanges(changes: SimpleChanges) {
if (changes.step) {
if (changes.bmProcess || changes.step) {
this.initConfiguration(changes.step.currentValue);
}
}
......@@ -38,6 +40,7 @@ export class MethodInfoStepComponent implements OnChanges {
const componentRef = viewContainerRef.createComponent(configurationFormComponentFactory);
componentRef.instance.formGroup = this.formGroup;
componentRef.instance.predefinedInput = this.step.predefinedInput;
componentRef.instance.contextDomains = this.contextDomains;
}
}
......
<form [formGroup]="form" (ngSubmit)="submitForm()">
<ul formArrayName="steps" class="list-group">
<li *ngFor="let step of steps; let index = index" class="list-group-item">
<app-method-info-step [formGroupName]="index.toString()" [step]="step"></app-method-info-step>
<app-method-info-step [formGroupName]="index.toString()"
[contextDomains]="contextDomains"
[step]="step"></app-method-info-step>
</li>
</ul>
<div *ngIf="steps.length > 0" class="form-group row mt-3">
......
......@@ -2,6 +2,7 @@ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
import { ExecutionStep } from '../../development-process-registry/development-method/execution-step';
import { MethodInfoStepsFormService } from '../shared/method-info-steps-form.service';
import { Domain } from '../../development-process-registry/knowledge/domain';
@Component({
selector: 'app-method-info-steps',
......@@ -10,6 +11,7 @@ import { MethodInfoStepsFormService } from '../shared/method-info-steps-form.ser
})
export class MethodInfoStepsComponent implements OnChanges {
@Input() contextDomains: Domain[];
@Input() steps: ExecutionStep[];
@Input() stepDecisions: any[];
......
......@@ -55,7 +55,7 @@
<tr>
<th scope="row">Steps</th>
<td>
<app-method-info-steps [steps]="decision.method.executionSteps"
<app-method-info-steps [contextDomains]="contextDomains" [steps]="decision.method.executionSteps"
[stepDecisions]="decision.stepDecisions"
(submitStepsForm)="updateDecisions.emit({stepDecisions: $event})"></app-method-info-steps>
</td>
......
......@@ -2,6 +2,7 @@ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from
import { DevelopmentMethod } from '../../development-process-registry/development-method/development-method';
import { Decision } from '../../development-process-registry/bm-process/decision';
import { SituationalFactor } from '../../development-process-registry/method-elements/situational-factor/situational-factor';
import { Domain } from '../../development-process-registry/knowledge/domain';
@Component({
selector: 'app-method-info',
......@@ -12,6 +13,7 @@ export class MethodInfoComponent implements OnChanges {
@Input() developmentMethod: DevelopmentMethod;
@Input() decision: Decision;
@Input() contextDomains: Domain[];
@Input() contextSituationalFactors: { list: string, element: SituationalFactor }[] = [];
@Output() updateDecisions = new EventEmitter<any>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment