mirror of
https://github.com/bitwarden/jslib
synced 2025-12-17 16:53:20 +00:00
Add Linked Field as custom field type (#431)
* Basic proof of concept of Linked custom fields * Linked Fields for all cipher types, use dropdown * Move linkedFieldOptions to view models * Move add-edit custom fields to own component * Fix change handling if cipherType changes * Use Field.LinkedId to store linked field info * Refactor accessors in cipherView for type safety * Use map for linkedFieldOptions * Refactor: use decorators to record linkable info * Add ItemView * Use enums for linked field ids * Add union type for linkedId enums, add jsdoc comment * Use parameter properties for linkedFieldOption Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Fix type casting Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
This commit is contained in:
@@ -226,6 +226,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
async encryptField(fieldModel: FieldView, key: SymmetricCryptoKey): Promise<Field> {
|
||||
const field = new Field();
|
||||
field.type = fieldModel.type;
|
||||
field.linkedId = fieldModel.linkedId;
|
||||
// normalize boolean type field values
|
||||
if (fieldModel.type === FieldType.Boolean && fieldModel.value !== 'true') {
|
||||
fieldModel.value = 'false';
|
||||
|
||||
Reference in New Issue
Block a user