From e02e663ce1aed94d42db00dcdb2e42bdd625f0dc Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 12 Nov 2021 05:59:01 +1000 Subject: [PATCH] [Linked Fields] Fix QA feedback (#542) * Fix bug overwriting custom field types * Add linkedId to export model for CLI --- angular/src/components/add-edit-custom-fields.component.ts | 2 +- common/src/models/export/field.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/angular/src/components/add-edit-custom-fields.component.ts b/angular/src/components/add-edit-custom-fields.component.ts index e1e4d14916..71040ac4a8 100644 --- a/angular/src/components/add-edit-custom-fields.component.ts +++ b/angular/src/components/add-edit-custom-fields.component.ts @@ -118,7 +118,7 @@ export class AddEditCustomFieldsComponent implements OnChanges { } this.cipher.fields - .filter(f => f.type = FieldType.Linked) + .filter(f => f.type === FieldType.Linked) .forEach(f => f.linkedId = this.linkedFieldOptions[0].value); } } diff --git a/common/src/models/export/field.ts b/common/src/models/export/field.ts index 2e98c1bd4f..0804c1233d 100644 --- a/common/src/models/export/field.ts +++ b/common/src/models/export/field.ts @@ -1,4 +1,5 @@ import { FieldType } from '../../enums/fieldType'; +import { LinkedIdType } from '../../enums/linkedIdType'; import { FieldView } from '../view/fieldView'; @@ -18,6 +19,7 @@ export class Field { view.type = req.type; view.value = req.value; view.name = req.name; + view.linkedId = req.linkedId; return view; } @@ -25,12 +27,14 @@ export class Field { domain.type = req.type; domain.value = req.value != null ? new EncString(req.value) : null; domain.name = req.name != null ? new EncString(req.name) : null; + domain.linkedId = req.linkedId; return domain; } name: string; value: string; type: FieldType; + linkedId: LinkedIdType; constructor(o?: FieldView | FieldDomain) { if (o == null) { @@ -45,5 +49,6 @@ export class Field { this.value = o.value?.encryptedString; } this.type = o.type; + this.linkedId = o.linkedId; } }