Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refac: move to pivot for tdd #5757

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function createColumnDefinitionForDimensions(
* Get formatted value for row dimension values. Format
* time dimension values if present.
*/
function formatRowDimensionValue(
export function formatRowDimensionValue(
value: string,
depth: number,
timeConfig: PivotTimeConfig,
Expand Down Expand Up @@ -201,7 +201,7 @@ export function getMeasureColumnProps(config: PivotDataStoreConfig) {
});
}

function getDimensionColumnProps(
export function getDimensionColumnProps(
dimensionNames: string[],
config: PivotDataStoreConfig,
) {
Expand Down
30 changes: 30 additions & 0 deletions web-common/src/features/dashboards/stores/dashboard-stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,36 @@ const metricsViewReducers = {
});
},

setTddSort(name: string, sorting: SortingState) {
updateMetricsExplorerByName(name, (metricsExplorer) => {
metricsExplorer.tdd = {
...metricsExplorer.tdd,
sorting,
rowPage: 1,
columnPage: 1,
expanded: {},
};
});
},

setTddColumnPage(name: string, pageNumber: number) {
updateMetricsExplorerByName(name, (metricsExplorer) => {
metricsExplorer.tdd = {
...metricsExplorer.tdd,
columnPage: pageNumber,
};
});
},

setTddRowPage(name: string, pageNumber: number) {
updateMetricsExplorerByName(name, (metricsExplorer) => {
metricsExplorer.tdd = {
...metricsExplorer.tdd,
rowPage: pageNumber,
};
});
},

setTDDChartType(name: string, type: TDDChart) {
updateMetricsExplorerByName(name, (metricsExplorer) => {
metricsExplorer.tdd.chartType = type;
Expand Down
Loading
Loading