Kind: Class
Source: Pams/Web/Pams.WebApp/Client/app/core/models/dashboard-data-fields.ts (line 172)
Part of: Pams
expectationOperation holds metadata for an expected dashboard data field, including its stored name, field name, caption, expected field type, and data type. Dashboard code can read this metadata through getters and check isHidden() when deciding whether to display the field.
Methods
| Method | Signature | Returns |
|---|---|---|
SetStoredName | SetStoredName(name: string) | void |
GetFieldName | GetFieldName() | string |
SetFieldName | SetFieldName(name: string) | void |
GetType | GetType() | expectedFieldType |
SetType | SetType(type: expectedFieldType) | void |
GetCaption | GetCaption() | string |
SetCaption | SetCaption(input: string) | void |
SetDataType | SetDataType(ty: DataTypeEnum) | void |
GetDataType | GetDataType() | DataTypeEnum |
isHidden | isHidden() | boolean |
setHidden | setHidden(flag: boolean) | void |
Properties
| Property | Type |
|---|---|
callback | callbackPRAny |
CertainYear | number |
GetStoredName | any |
Where it refuses work
expectationOperationstops the work with an early return whenthis.Field.StoredName.expectationOperationstops the work with an early return whenthis.Field.FieldName.
Diagram
mermaidgraph LR Dashboard[Dashboard data consumer] --> Operation[expectationOperation] Operation --> StoredName[Stored name] Operation --> FieldName[Field name] Operation --> Caption[Caption] Operation --> FieldType[expectedFieldType] Operation --> DataType[DataTypeEnum] Operation --> Visibility[isHidden()]
Usage
tsimport {
expectationOperation,
expectedFieldType,
DataTypeEnum,
} from "./core/models/dashboard-data-fields";
function configureExpectedField(
type: expectedFieldType,
dataType: DataTypeEnum,
): expectationOperation {
const field = new expectationOperation();
field.SetFieldName("customerName");
field.SetCaption("Customer name");
field.SetType(type);
field.SetDataType(dataType);
field.SetStoredName();
if (!field.isHidden()) {
console.log(`${field.GetCaption()}: ${field.GetFieldName()}`);
}
return field;
}
AI Coding Instructions
- Set the field name, caption, expected field type, and data type before passing an
expectationOperationinstance to dashboard consumers. - Pass values from
expectedFieldTypeandDataTypeEnumrather than raw strings when callingSetType()andSetDataType(). - Read metadata through
GetFieldName(),GetCaption(),GetType(), andGetDataType()instead of duplicating field configuration elsewhere. - Check
isHidden()in rendering or filtering code instead of assuming every configured field should be displayed.
Was this page helpful?