Skip to content

Spark

reference
1 min readUpdated

Kind: Class

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

Part of: Pams

Spark stores dashboard field metadata, including hidden state, stored name, field name, measure type, and caption. Dashboard code updates these values through setter methods and reads them through matching getter methods.

Methods

MethodSignatureReturns
isHiddenisHidden()boolean
setHiddensetHidden(flag: boolean)void
GetStoredNameGetStoredName()string
SetStoredNameSetStoredName(name: string)void
GetFieldNameGetFieldName()string
SetFieldNameSetFieldName(name: string)void
GetTypeGetType()Measure
SetTypeSetType(ty: Measure)void
GetCaptionGetCaption()string
SetCaptionSetCaption(input: string)void
SetDataTypeSetDataType(ty: DataTypeEnum)void
GetDataTypeGetDataType()DataTypeEnum
GetFieldNameAgruGetFieldNameAgru()string
SetFieldNameAgruSetFieldNameAgru(name: string)void
GetStoredNameAgruGetStoredNameAgru()string
SetStoredNameAgruSetStoredNameAgru(name: string)void
GetTypeAgruGetTypeAgru()DateGroupEnum
SetTypeAgruSetTypeAgru(dt: DateGroupEnum)void

Diagram

mermaid
graph LR
  Spark --> Visibility[Visibility state]
  Spark --> Names[Field names]
  Spark --> Type[Measure type]
  Spark --> Caption[Caption]

  Visibility --> isHidden
  Visibility --> setHidden

  Names --> GetStoredName
  Names --> SetStoredName
  Names --> GetFieldName
  Names --> SetFieldName

  Type --> GetType
  Type --> SetType

  Caption --> GetCaption
  Caption --> SetCaption

Usage

ts
const spark = new Spark();

spark.SetStoredName("sales_amount");
spark.SetFieldName("SalesAmount");
spark.SetCaption("Sales Amount");

declare const selectedMeasure: Measure;
spark.SetType(selectedMeasure);

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

AI Coding Instructions

  • Match the existing method casing, including Get... and Set... method names.
  • Read names through GetStoredName() and GetFieldName() rather than duplicating field metadata elsewhere.
  • Treat the value returned by GetType() as a Measure.
  • Call isHidden() to inspect visibility; do not pass a Boolean to setHidden() because its declared signature has no argument.

Was this page helpful?

Download as PDF