remove object type from array-form

This commit is contained in:
Joel Wetzell
2026-02-13 20:30:17 -06:00
parent 0f35a69b4a
commit 0bad241845
2 changed files with 6 additions and 7 deletions
+3 -3
View File
@@ -1,19 +1,19 @@
@if (paramFormControl && paramInfo?.schema) { @if (paramFormControl && paramInfo?.schema) {
@if (arrayValue) { @if (arrayValue) {
<div cdkDropList (cdkDropListDropped)="dropItem($event)" [cdkDropListData]="arrayValue"> <div cdkDropList (cdkDropListDropped)="dropItem($event)" [cdkDropListData]="arrayValue">
<!-- <div *ngIf="arrayValue.length === 0" class="w-full h-6"></div> -->
@for (item of arrayValue; track trackByIndex(i, item); let i = $index) { @for (item of arrayValue; track trackByIndex(i, item); let i = $index) {
<div cdkDrag class="flex my-2 mr-2 items-center"> <div cdkDrag class="flex my-2 mr-2 items-center">
<label for="item-{{ i }}" class="text-gray-300 mr-1 hover:cursor-move" cdkDragHandle <label for="item-{{ i }}" class="text-gray-300 mr-1 hover:cursor-move" cdkDragHandle
>{{ i }}:</label >{{ i }}:</label
> >
@if (paramInfo?.schema.items.type === 'object') { <!-- @if (paramInfo?.schema.items.type === 'object') {
<app-params-form <app-params-form
[paramsSchema]="paramInfo?.schema.items" [paramsSchema]="paramInfo?.schema.items"
[data]="item" [data]="item"
(updated)="updateItem(i, $event)" (updated)="updateItem(i, $event)"
></app-params-form> ></app-params-form>
} @else { } -->
@if (paramInfo?.schema.items.type !== 'object') {
<!-- TODO(jwetzell): add input validation using info from schema --> <!-- TODO(jwetzell): add input validation using info from schema -->
<input <input
id="item-{{ i }}" id="item-{{ i }}"
+3 -4
View File
@@ -1,17 +1,16 @@
import { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop'; import { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
import { Component, inject, Input, OnInit } from '@angular/core'; import { Component, inject, Input, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatIconModule } from '@angular/material/icon';
import { ParamInfo } from '../../models/form.model'; import { ParamInfo } from '../../models/form.model';
import { ListsService } from '../../services/lists.service'; import { ListsService } from '../../services/lists.service';
import { SchemaService } from '../../services/schema.service'; import { SchemaService } from '../../services/schema.service';
import { MatIconModule } from '@angular/material/icon';
import { FormsModule } from '@angular/forms';
import { ParamsFormComponent } from '../params-form/params-form.component';
@Component({ @Component({
selector: 'app-array-form', selector: 'app-array-form',
templateUrl: './array-form.component.html', templateUrl: './array-form.component.html',
styleUrl: './array-form.component.css', styleUrl: './array-form.component.css',
imports: [MatIconModule, FormsModule, ParamsFormComponent, CdkDrag, CdkDropList], imports: [MatIconModule, FormsModule, CdkDrag, CdkDropList],
standalone: true, standalone: true,
}) })
export class ArrayFormComponent implements OnInit { export class ArrayFormComponent implements OnInit {