Skip to content

MeasureOperation

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/models/dashboard/dashboard-data-fields.ts (line 277)

Part of: Pams

MeasureOperation represents a dashboard measure field and its display metadata. It tracks visibility, stored and field names, measure type, and caption through getter and setter methods.

Methods

MethodSignatureReturns
isHiddenisHidden()boolean
setHiddensetHidden(flag: boolean)void
GetStoredNameGetStoredName()string
SetStoredNameSetStoredName(name: string)void
GetFieldNameGetFieldName()string
SetFieldNameSetFieldName(name: string)void
GetTypeGetType()Measure
SetTypeSetType(type: Measure)void
GetCaptionGetCaption()string
SetCaptionSetCaption(input: string)void
SetDataTypeSetDataType(ty: DataTypeEnum)void
GetDataTypeGetDataType()DataTypeEnum

Where it refuses work

  • MeasureOperation stops the work with an early return when this.Field.StoredName.
  • MeasureOperation stops the work with an early return when this.Field.FieldName.

Diagram

mermaid
graph LR
  MeasureOperation --> Hidden["Hidden state"]
  MeasureOperation --> StoredName["Stored name"]
  MeasureOperation --> FieldName["Field name"]
  MeasureOperation --> Type["Measure type"]
  MeasureOperation --> Caption["Caption"]
  Type --> Measure

Usage

ts
import { MeasureOperation } from "./models/dashboard/dashboard-data-fields";

const operation = new MeasureOperation();

operation.SetStoredName();
operation.SetFieldName();
operation.SetType();
operation.SetCaption();

if (!operation.isHidden()) {
  console.log({
    storedName: operation.GetStoredName(),
    fieldName: operation.GetFieldName(),
    type: operation.GetType(),
    caption: operation.GetCaption(),
  });
}

// Hide the measure from dashboard output.
operation.setHidden();

AI Coding Instructions

  • Keep getter and setter calls aligned with the existing method casing, including isHidden() and setHidden().
  • Do not add arguments to the parameterless setter methods unless the class API changes.
  • Read display text through GetCaption() and field identifiers through GetFieldName() or GetStoredName().
  • Check isHidden() before rendering or including a measure in dashboard output.

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • DashboardWidgetOperationsServicePams/Web/Pams.Web/Client/app/services/dashboard/dashboard-widget-operations.service.ts:1

Was this page helpful?

Download as PDF