diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html index 6f49442a25..3400a4bd5c 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html @@ -7,7 +7,8 @@ [ngClass]="[getClass('element', 'label'), getClass('grid', 'label')]"> -
+
+ [relationshipOptions]="model.relationship" + >
+ diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index 2eeeba86de..567e8b387f 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts @@ -395,7 +395,7 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo const arrayContext: DynamicFormArrayModel = (this.context as DynamicFormArrayGroupModel).context; const path = this.formBuilderService.getPath(arrayContext); const formArrayControl = this.group.root.get(path) as FormArray; - + console.log('this.listId', this.listId); this.formBuilderService.removeFormArrayGroup(this.context.index, formArrayControl, arrayContext); } diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.html index 6312b59002..e791c41d6e 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts index af2a253ee1..2a9be531e1 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts @@ -1,4 +1,12 @@ -import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; +import { + Component, + Input, + OnChanges, + OnDestroy, + OnInit, + Output, + EventEmitter +} from '@angular/core'; import { FormControl } from '@angular/forms'; import { DynamicFormArrayGroupModel } from '@ng-dynamic-forms/core'; import { Store } from '@ngrx/store'; @@ -53,51 +61,6 @@ export abstract class Reorderable { } } -/** - * A Reorderable representation of a FormFieldMetadataValue - */ -export class ReorderableFormFieldMetadataValue extends Reorderable { - - constructor( - public metadataValue: FormFieldMetadataValueObject, - public model: DynamicConcatModel, - public control: FormControl, - public group: DynamicFormArrayGroupModel, - oldIndex?: number, - newIndex?: number - ) { - super(oldIndex, newIndex); - this.metadataValue = metadataValue; - } - - /** - * Return the id for this Reorderable - */ - getId(): string { - if (hasValue(this.metadataValue.authority)) { - return this.metadataValue.authority; - } else { - // can't use UUIDs, they're generated client side - return this.metadataValue.value; - } - } - - /** - * Return the place metadata for this Reorderable - */ - getPlace(): number { - return this.metadataValue.place; - } - - /** - * Update the Reorderable - */ - update(): Observable { - this.oldIndex = this.newIndex; - return observableOf(this.metadataValue); - } - -} /** * Represents a single existing relationship value as metadata in submission @@ -116,6 +79,7 @@ export class ExistingRelationListElementComponent implements OnInit, OnChanges, @Input() submissionId: string; relatedItem: Item; viewType = ViewMode.ListElement; + @Output() remove: EventEmitter = new EventEmitter(); /** * List of subscriptions to unsubscribe from diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.html index 6c8537e77f..845e123894 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.html @@ -11,7 +11,10 @@
-
+