Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
[Linked Fields] Fix QA feedback (#542)
Browse files Browse the repository at this point in the history
* Fix bug overwriting custom field types

* Add linkedId to export model for CLI
  • Loading branch information
eliykat committed Nov 11, 2021
1 parent b99103d commit e02e663
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion angular/src/components/add-edit-custom-fields.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
5 changes: 5 additions & 0 deletions common/src/models/export/field.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FieldType } from '../../enums/fieldType';
import { LinkedIdType } from '../../enums/linkedIdType';

import { FieldView } from '../view/fieldView';

Expand All @@ -18,19 +19,22 @@ export class Field {
view.type = req.type;
view.value = req.value;
view.name = req.name;
view.linkedId = req.linkedId;
return view;
}

static toDomain(req: Field, domain = new FieldDomain()) {
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) {
Expand All @@ -45,5 +49,6 @@ export class Field {
this.value = o.value?.encryptedString;
}
this.type = o.type;
this.linkedId = o.linkedId;
}
}

0 comments on commit e02e663

Please sign in to comment.