mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-09-10 07:39:25 +00:00
remove output from route
This commit is contained in:
@@ -30,25 +30,6 @@
|
|||||||
<div class="ml-2 text-red-500">{{ formGroup.controls['input'].errors | json }}</div>
|
<div class="ml-2 text-red-500">{{ formGroup.controls['input'].errors | json }}</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center m-1">
|
|
||||||
<label class="mr-2 text-gray-300"> output: </label>
|
|
||||||
<select
|
|
||||||
class="pl-1 border-2 border-gray-200 text-gray-200 border-solid rounded-sm w-full"
|
|
||||||
formControlName="output"
|
|
||||||
>
|
|
||||||
@for (option of moduleIds(); track option) {
|
|
||||||
<option [value]="option">
|
|
||||||
{{ option }}
|
|
||||||
</option>
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
@if (!formGroup.controls['output'].valid) {
|
|
||||||
<!-- TODO(jwetzell): better error displaying -->
|
|
||||||
<div class="ml-2 text-red-500">
|
|
||||||
{{ formGroup.controls['output'].errors | json }}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ export class RouteComponent {
|
|||||||
|
|
||||||
formGroup: FormGroup = new FormGroup({
|
formGroup: FormGroup = new FormGroup({
|
||||||
input: new FormControl('', [Validators.required]),
|
input: new FormControl('', [Validators.required]),
|
||||||
output: new FormControl('', [Validators.required]),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
public schemaService = inject(SchemaService);
|
public schemaService = inject(SchemaService);
|
||||||
@@ -47,18 +46,15 @@ export class RouteComponent {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.formGroup.patchValue({
|
this.formGroup.patchValue({
|
||||||
input: this.route()?.input,
|
input: this.route()?.input,
|
||||||
output: this.route()?.output,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.formGroup.valueChanges.subscribe((value) => {
|
this.formGroup.valueChanges.subscribe((value) => {
|
||||||
this.route.update((route) => {
|
this.route.update((route) => {
|
||||||
if (route) {
|
if (route) {
|
||||||
route.input = value.input;
|
route.input = value.input;
|
||||||
route.output = value.output;
|
|
||||||
return {
|
return {
|
||||||
...route,
|
...route,
|
||||||
input: route.input,
|
input: route.input,
|
||||||
output: route.output,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user