File

src/app/core/basic-datatypes/boolean/boolean.datatype.ts

Extends

DiscreteDatatype

Index

Properties
Methods

Methods

transformToDatabaseFormat
transformToDatabaseFormat(value: boolean)
Inherited from DefaultDatatype
Defined in DefaultDatatype:12
Parameters :
Name Type Optional
value boolean No
Returns : boolean
transformToObjectFormat
transformToObjectFormat(value: boolean)
Inherited from DefaultDatatype
Defined in DefaultDatatype:16
Parameters :
Name Type Optional
value boolean No
Returns : boolean
importIncompleteAdditionalConfigBadge
importIncompleteAdditionalConfigBadge(col: ColumnMapping)
Inherited from DefaultDatatype
Defined in DefaultDatatype:51
Parameters :
Name Type Optional
col ColumnMapping No
Returns : string
Async importMapFunction
importMapFunction(val: unknown, schemaField: EntitySchemaField, additional: DiscreteColumnMappingAdditional)
Inherited from DefaultDatatype
Defined in DefaultDatatype:29
Parameters :
Name Type Optional
val unknown No
schemaField EntitySchemaField No
additional DiscreteColumnMappingAdditional No
Returns : unknown
Async anonymize
anonymize(value: EntityType, schemaField: EntitySchemaField, parent: any)
Inherited from DefaultDatatype

(Partially) anonymize to "retain-anonymized" for reporting purposes without personal identifiable information.

Parameters :
Name Type Optional Description
value EntityType No

The original value to be anonymized

schemaField EntitySchemaField No
parent any No
Returns : Promise<any>
Static detectFieldInEntity
detectFieldInEntity(entityOrType: Entity | EntityConstructor, dataTypes: string | string[])
Inherited from DefaultDatatype
Defined in DefaultDatatype:57

Detect the first field of the given datatype(s) in an entity's schema.

Scans the schema for a field whose dataType matches one of the provided strings and returns its property name.

Subclasses typically override this without the extra dataTypes parameter, forwarding their own relevant datatype identifiers.

Parameters :
Name Type Optional Description
entityOrType Entity | EntityConstructor No

An entity instance or entity constructor to inspect.

dataTypes string | string[] No

One or more datatype identifiers to match against.

Returns : string | undefined

The field name of the first matching field, or undefined if none is found.

normalizeSchemaField
normalizeSchemaField(schemaField: EntitySchemaField)
Inherited from DefaultDatatype

Return the (potentially adjusted) schema field for this datatype.

Called when schema fields are set up (e.g. from config), allowing the datatype to normalize or fill in required settings.

Override this in a subclass to enforce constraints (e.g. always setting isArray: true).

Parameters :
Name Type Optional Description
schemaField EntitySchemaField No

The current schema field definition

Returns : EntitySchemaField

The schema field to use (default: unchanged)

Properties

Static dataType
Type : string
Default value : "boolean"
Inherited from DefaultDatatype
Defined in DefaultDatatype:6
editComponent
Type : string
Default value : "EditBoolean"
Inherited from DefaultDatatype
Defined in DefaultDatatype:9
Static label
Type : string
Default value : $localize`:datatype-label:checkbox`
Inherited from DefaultDatatype
Defined in DefaultDatatype:7
viewComponent
Type : string
Default value : "DisplayCheckmark"
Inherited from DefaultDatatype
Defined in DefaultDatatype:10
importConfigComponent
Type : string
Default value : "DiscreteImportConfig"
Inherited from DefaultDatatype
Defined in DefaultDatatype:15
Readonly importAllowsMultiMapping
Type : boolean
Default value : false
Inherited from DefaultDatatype
Defined in DefaultDatatype:80

Whether this datatype allows multiple values to be mapped to the same entity field during import.

import { Injectable } from "@angular/core";
import { DiscreteDatatype } from "../discrete/discrete.datatype";

@Injectable()
export class BooleanDatatype extends DiscreteDatatype<boolean, boolean> {
  static override dataType = "boolean";
  static override label: string = $localize`:datatype-label:checkbox`;

  override editComponent = "EditBoolean";
  override viewComponent = "DisplayCheckmark";

  override transformToDatabaseFormat(value: boolean) {
    return value;
  }

  override transformToObjectFormat(value: boolean) {
    return value;
  }
}

results matching ""

    No results matching ""