1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00
Files
browser/libs/common/src/vault/models/view/field.view.ts
Oscar Hinton a5e3432f85 Assign ownership to many libs files (#6928)
Assign ownership to many of the remaining libs/common files.

Criteria for ownership:
* Files used by a single team, is now owned by that team.
* Files related to a domain owned by a team is now owned by that team.
* Where ownership is unclear the "lowest level" service takes ownership.
2023-11-27 20:59:44 +00:00

33 lines
790 B
TypeScript

import { Jsonify } from "type-fest";
import { View } from "../../../models/view/view";
import { FieldType, LinkedIdType } from "../../enums";
import { Field } from "../domain/field";
export class FieldView implements View {
name: string = null;
value: string = null;
type: FieldType = null;
newField = false; // Marks if the field is new and hasn't been saved
showValue = false;
showCount = false;
linkedId: LinkedIdType = null;
constructor(f?: Field) {
if (!f) {
return;
}
this.type = f.type;
this.linkedId = f.linkedId;
}
get maskedValue(): string {
return this.value != null ? "••••••••" : null;
}
static fromJSON(obj: Partial<Jsonify<FieldView>>): FieldView {
return Object.assign(new FieldView(), obj);
}
}