Skip to content

DatatableColumnMeta cleanup #78747

@ppisljar

Description

@ppisljar

DatatableColumnMeta currently has the following type:

export interface DatatableColumnMeta {
  type: DatatableColumnType;	 
  field?: string;	  
  index?: string;	  
  params?: SerializedFieldFormat;	 
  source?: string;	  ;
  sourceParams?: SerializableState;	  
}	

two things are a bit unclear here:

  • meta.type vs meta.params.id ... both somehow represent the type, KBN_FIELD_TYPE vs field format type so its not clear which to use. on top of that they can also become out of sync and incompatible, (for example meta.type is string and meta.params.id is number
  • params/sourceParams

there are two options for the cleanup:

  1. replace meta.type with meta.params.id and replace meta.params with meta.params.params
    we would remove fieldType information (which is currently on meta.type) and replace it with field format id. This way its clear what the actual format is, and current fieldTypes in use are subset of available field formatters. The structure gets simplified and fieldType information is anyway redundant as we already have meta.field and meta.index with which we can find out the actual fieldType.

the new DatatableColumnMeta would become:

export interface DatatableColumnMeta {
  type: string;	 // fieldFormatId
  field?: string;	  
  index?: string;	  
  params?: SerializableState; // fieldFormatParams	 
  source?: string;	  ;
  sourceParams?: SerializableState;	  
}	
  1. rename meta.params to meta.format and meta.sourceParams to meta.params
    we would keep the redundant fieldType information (meta.type) but rather rename meta.params to be more semantic into meta.format which would still be whole SerializedFieldFormat. There is still unclear which type to use (meta.type or meta.format.id) and they may still be incompatible, but at least we have a bit more semantic naming.

Metadata

Metadata

Assignees

Labels

Feature:ExpressionLanguageInterpreter expression language (aka canvas pipeline)impact:lowAddressing this issue will have a low level of impact on the quality/strength of our product.loe:smallSmall Level of Effortv7.11.0v8.0.0

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions