Skip to content

AddRelationshipComponent

component

Selector: yuv-add-relationship

Standalone: No

Type: RelationshipComponentConfig

Default Value: this.#dialogData.config

Type: DmsObject

Default Value: this.#dialogData.object

Type: unknown

Default Value: computed<string[]>(() => \{ const rel = this.supportedRelationships(); const types = Array.from(new Set(rel.map((r) => r.allowedTargetTypes).flat())); this.targetTypeLabels = types.reduce( (acc, type) => \{ acc[type] = this.#system.getLocalizedLabel(type) || type; return acc; \}, \{\} as Record<string, string> ); this.targetTypeFilterControl.patchValue(types); return types; \})

Type: unknown

Default Value: signal<boolean>(false)

Type: unknown

Default Value: signal<string | null>(null)

Type: unknown

Default Value: computed<Relationship[]>(() => \{ // filter the supported relationships of the object by the allowed target types // if target types are selected const tt = this.targetTypeFilterValue(); return this.supportedRelationships().filter((r) => \{ return !tt || r.allowedTargetTypes.some((t) => tt.includes(t)); \}); \})

Type: unknown

Default Value: new FormGroup( \{ relation: new FormControl<Relationship | null>(null, \{ nonNullable: true, validators: [Validators.required] \}), targetObject: new FormControl<Record<string, unknown> | null>(null, \{ nonNullable: true, validators: [Validators.required] \}) \}, \{ validators: this.#relationMatchesTargetObjectValidator \} )

Type: unknown

Default Value: computed<\{ id: string; label: string \}[]>(() => this.availableTargetTypes().map((t) => (\{ id: t, label: this.targetTypeLabels[t] || t \})) )

Type: unknown

Default Value: computed(() => \{ const obj = this.object(); const config = this.config(); return \{ title: obj.data[config.rootNode.labelField] as string, description: obj.data[config.rootNode.descriptionField || ''] as string | undefined, icon: config.rootNode.icon \}; \})

Type: unknown

Default Value: computed<Relationship[]>(() => \{ const obj = this.object(); return obj ? this.#system.getSupportedRelationships(obj, true) : []; \})

Type: unknown

Default Value: new FormControl<string[]>([])

Type: unknown

Default Value: toSignal(this.targetTypeFilterControl.valueChanges, \{ initialValue: this.targetTypeFilterControl.value || null \})

Type: Record<string | string>

Default Value: \{\}

Type: unknown

Default Value: inject(TranslateService)

close(): void
onRelationSelect(idx: number[]): void
NameTypeDescription
idxnumber[]
optionCompareWith(o1: Relationship | undefined, o2: Relationship | undefined): boolean
NameTypeDescription
o1Relationship | undefined
o2Relationship | undefined
submit(): void