Skip to content

Commit

Permalink
Merge pull request gooddata#4913 from kandl/mkn-f1-148-v8
Browse files Browse the repository at this point in the history
fix: show repeater column titles for measures

Reviewed-by: https://github.com/scavnickyj
  • Loading branch information
gdgate authored Apr 15, 2024
2 parents fbb141f + a867df2 commit a04f898
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
18 changes: 15 additions & 3 deletions libs/sdk-ui-ext/src/insightView/InsightRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ITheme,
insightSetProperties,
insightVisualizationUrl,
insightVisualizationType,
} from "@gooddata/sdk-model";

import {
Expand Down Expand Up @@ -139,9 +140,20 @@ class InsightRendererCore extends React.PureComponent<IInsightRendererProps & Wr
theme: this.props.theme,
};

const insight = fillMissingFormats(
ignoreTitlesForSimpleMeasures(fillMissingTitles(this.props.insight, this.props.locale)),
);
const visClass = insightVisualizationType(this.props.insight);
let insight = fillMissingFormats(fillMissingTitles(this.props.insight, this.props.locale));

/**
* Ignore titles for simple measures in all visualizations except for repeater.
* This is not nice, and InsightRenderer should not be aware of the visualization types.
* However, repeater is transforming simple measures to inline ones, so we need to keep the titles for them.
* We can remove this once we have a better solution on execution level,
* or all the visualizations start to use actual measure titles specified in AD, and not measure metadata titles.
* See also https://gooddata.atlassian.net/browse/SD-1012
*/
if (visClass !== "repeater") {
insight = ignoreTitlesForSimpleMeasures(insight);
}
this.visualization.update(visProps, insight, {}, this.getExecutionFactory());
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,38 @@ const REPEATER_SUPPORTER_PROPERTIES_LIST = [
"cellImageSizing",
];

/**
* PluggableRepeater
*
* ## Buckets
*
* | Name | Id -| Accepts |
* |-----------|-----------|----------------------|
* | Attribute | attribute | attribute only |
* | Columns | columns | attribute or measure |
* | ViewBy | view | attribute or date |
*
*
* ### Bucket axioms
*
* - |Attribute| = 1
* - |Columns| ≥ 1
* - |ViewBy| ≤ 1
*
* ## Dimensions
*
* The PluggableRepeater creates one or two dimensional execution, based on the buckets.
*
* With main attribute and column attributes only:
* - [[Attribute, ...ColumnAttributes]]
* With main attribute, column attributes and viewBy:
* - [[Attribute, ...ColumnAttributes], [ViewBy]]
* With main attribute and column attributes and measures:
* - [[Attribute, ...ColumnAttributes], [MeasureGroupIdentifier]]
* With main attribute, column attributes and measures, and viewBy:
* - [[Attribute, ...ColumnAttributes], [ViewBy, MeasureGroupIdentifier]]
*
*/
export class PluggableRepeater extends AbstractPluggableVisualization {
private environment: VisualizationEnvironment;
private featureFlags?: ISettings;
Expand Down

0 comments on commit a04f898

Please sign in to comment.