diff --git a/packages/sdk-ui/src/common/hooks/use-has-changed.ts b/packages/sdk-ui/src/common/hooks/use-has-changed.ts
index 35a6c177..7ae2e146 100644
--- a/packages/sdk-ui/src/common/hooks/use-has-changed.ts
+++ b/packages/sdk-ui/src/common/hooks/use-has-changed.ts
@@ -1,4 +1,4 @@
-import isEqual from 'lodash/isEqual';
+import isEqual from 'lodash-es/isEqual';
import { usePrevious } from './use-previous';
/**
diff --git a/packages/sdk-ui/src/dashboard-widget/dashboard-widget.tsx b/packages/sdk-ui/src/dashboard-widget/dashboard-widget.tsx
index b994de67..1466ad5f 100644
--- a/packages/sdk-ui/src/dashboard-widget/dashboard-widget.tsx
+++ b/packages/sdk-ui/src/dashboard-widget/dashboard-widget.tsx
@@ -117,6 +117,7 @@ export const DashboardWidget: FunctionComponent
= asSisens
}
const filterRelations = getFilterRelationsFromJaql(
filters,
+ highlights,
convertFilterRelationsModelToJaql(
fetchedDashboard?.filterRelations?.length
? fetchedDashboard?.filterRelations[0].filterRelations
@@ -138,7 +139,6 @@ export const DashboardWidget: FunctionComponent = asSisens
/>
);
}
-
return (
{
- let dummyDashboard: DashboardDto;
- let dummyWidget: WidgetDto;
-
- beforeEach(() => {
- dummyDashboard = {
- filters: [
- {
- jaql: {
- dim: '[Commerce.Age Range]',
- filter: {
- members: ['0-18', '19-24', '65+'],
- },
+import {
+ extractCombinedFilters,
+ extractDashboardFiltersForWidget,
+} from './translate-dashboard-filters';
+import { PanelItem, WidgetDashboardFilterMode, WidgetDto } from './types';
+
+let dummyDashboard: DashboardDto;
+let dummyWidget: WidgetDto;
+
+beforeEach(() => {
+ dummyDashboard = {
+ filters: [
+ {
+ jaql: {
+ dim: '[Commerce.Age Range]',
+ filter: {
+ members: ['0-18', '19-24', '65+'],
},
- instanceid: 'filter-1',
},
- {
- jaql: {
- dim: '[Commerce.Gender]',
- filter: {
- members: ['Male', 'Female'],
- },
+ instanceid: 'filter-1',
+ },
+ {
+ jaql: {
+ dim: '[Commerce.Gender]',
+ filter: {
+ members: ['Male', 'Female'],
},
- instanceid: 'filter-2',
},
- ],
- } as DashboardDto;
-
- dummyWidget = {
- type: 'chart/column',
- metadata: {
- ignore: {
- all: false,
- ids: ['not existed filter id'],
- },
- panels: [
- {
- name: 'categories',
- items: [
- {
- jaql: {
- dim: '[Commerce.Age Range]',
- },
+ instanceid: 'filter-2',
+ },
+ ],
+ } as DashboardDto;
+
+ dummyWidget = {
+ type: 'chart/column',
+ metadata: {
+ ignore: {
+ all: false,
+ ids: ['not existed filter id'],
+ },
+ panels: [
+ {
+ name: 'categories',
+ items: [
+ {
+ jaql: {
+ dim: '[Commerce.Age Range]',
},
- {
- jaql: {
- dim: '[Commerce.Gender]',
- },
+ },
+ {
+ jaql: {
+ dim: '[Commerce.Gender]',
},
- ],
- },
- ],
- },
- options: {
- dashboardFiltersMode: WidgetDashboardFilterMode.SELECT,
+ },
+ ],
+ },
+ ],
+ },
+ options: {
+ dashboardFiltersMode: WidgetDashboardFilterMode.SELECT,
+ },
+ } as WidgetDto;
+});
+
+describe('extractCombinedFilters', () => {
+ it('should extract and merge dashboard and widget filters', () => {
+ const widgetFilterJaql = {
+ dim: '[Commerce.Brand]',
+ filter: {
+ members: ['ABC'],
},
- } as WidgetDto;
+ } as FilterJaql;
+
+ dummyWidget.metadata.panels.push({
+ name: 'filters',
+ items: [
+ {
+ jaql: widgetFilterJaql,
+ } as PanelItem,
+ ],
+ });
+
+ const { filters, highlights } = extractCombinedFilters(dummyDashboard, dummyWidget);
+ expect(filters).toHaveLength(1);
+ expect(highlights).toHaveLength(2);
+ expect(filters[0].jaql().jaql).toMatchObject({
+ dim: widgetFilterJaql.dim,
+ filter: widgetFilterJaql.filter,
+ });
+ expect(highlights[0].jaql().jaql).toMatchObject({
+ dim: (dummyDashboard.filters![0] as FilterDto).jaql.dim,
+ filter: (dummyDashboard.filters![0] as FilterDto).jaql.filter,
+ });
+ expect(highlights[1].jaql().jaql).toMatchObject({
+ dim: (dummyDashboard.filters![1] as FilterDto).jaql.dim,
+ filter: (dummyDashboard.filters![1] as FilterDto).jaql.filter,
+ });
});
+});
+describe('extractDashboardFiltersForWidget', () => {
it('should extract all "highlight" filters', () => {
const { filters, highlights } = extractDashboardFiltersForWidget(dummyDashboard, dummyWidget);
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-dashboard-filters.ts b/packages/sdk-ui/src/dashboard-widget/translate-dashboard-filters.ts
index ba546f43..2726b6af 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-dashboard-filters.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-dashboard-filters.ts
@@ -1,5 +1,5 @@
import { DashboardDto, FilterDto, CascadingFilterDto } from '../api/types/dashboard-dto';
-import { extractFilterModelFromJaql } from './translate-widget-filters';
+import { extractFilterModelFromJaql, extractWidgetFilters } from './translate-widget-filters';
import {
FiltersIgnoringRules,
PanelItem,
@@ -7,7 +7,7 @@ import {
WidgetDto,
WidgetType,
} from './types';
-import { getEnabledPanelItems } from './utils';
+import { getEnabledPanelItems, mergeFilters } from './utils';
import {
BackgroundFilter,
@@ -16,6 +16,28 @@ import {
IncludeAllFilter,
} from '@sisense/sdk-data';
+/**
+ * Extracts and merges dashboard and widget filters. This consolidates all
+ * filters applicable for a widget.
+ *
+ * @param dashboard - The dashboard containing the filters.
+ * @param widget - The widget containing the filters.
+ * @returns An object containing an array of filters and an array of highlights.
+ * @internal
+ */
+export function extractCombinedFilters(dashboard: DashboardDto, widget: WidgetDto) {
+ const { filters: dashboardFilters, highlights } = extractDashboardFiltersForWidget(
+ dashboard,
+ widget,
+ );
+ const widgetFilters = extractWidgetFilters(widget.metadata.panels);
+ const filters = mergeFilters(dashboardFilters, widgetFilters);
+ return {
+ filters,
+ highlights,
+ };
+}
+
/**
* Extracts dashboard filters applicable to a widget.
*
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.test.ts b/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.test.ts
index d86c0e5e..fb048ee5 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.test.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.test.ts
@@ -28,7 +28,7 @@ import {
import { Panel, WidgetStyle } from './types';
import { createDataOptionsFromPanels, extractDataOptions } from './translate-widget-data-options';
import { jaqlMock } from './__mocks__/jaql-mock';
-import { isObject } from 'lodash';
+import isObject from 'lodash-es/isObject';
const styleMock = {} as WidgetStyle;
@@ -532,7 +532,7 @@ describe('translate widget plugin data options from pluginPanels', () => {
const dataOptions: any = createDataOptionsFromPanels(panels, ['red', 'blue', 'green']);
verifyColumn(dataOptions.categories[0], panels[0].items[0]);
verifyColumn(dataOptions.values[0], panels[1].items[0]);
- verifyColumn(dataOptions['break by'][0], panels[2].items[0]);
+ verifyColumn(dataOptions.breakBy[0], panels[2].items[0]);
});
});
});
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.ts b/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.ts
index ff864b21..1e376701 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-widget-data-options.ts
@@ -1,4 +1,4 @@
-import mapValues from 'lodash/mapValues';
+import mapValues from 'lodash-es/mapValues';
import {
MetadataTypes,
DimensionalBaseMeasure,
@@ -13,6 +13,8 @@ import {
createFilterFromJaql,
PivotJaql,
Attribute,
+ ForecastFormulaOptions,
+ TrendFormulaOptions,
} from '@sisense/sdk-data';
import {
CartesianChartDataOptions,
@@ -58,7 +60,8 @@ import {
} from '../chart-data-options/types';
import { WidgetDataOptions } from '../models';
import { TranslatableError } from '../translation/translatable-error';
-import findKey from 'lodash/findKey';
+import findKey from 'lodash-es/findKey';
+import camelCase from 'lodash-es/camelCase';
export function createDimensionalElementFromJaql(jaql: Jaql, format?: PanelItem['format']) {
const isFormulaJaql = 'formula' in jaql;
@@ -150,7 +153,7 @@ function extractNumberFormat(item: PanelItem): NumberFormatConfig | null {
million: numberFormat.abbreviations?.m,
billion: numberFormat.abbreviations?.b,
trillion: numberFormat.abbreviations?.t,
- thousandSeparator: numberFormat.number?.separated,
+ thousandSeparator: numberFormat.number?.separated ?? numberFormat.separated,
prefix: numberFormat.currency?.position === CurrencyPosition.PRE,
symbol: numberFormat.currency?.symbol,
name: getNumberFormatName(numberFormat),
@@ -160,6 +163,51 @@ function extractNumberFormat(item: PanelItem): NumberFormatConfig | null {
return null;
}
+/** @internal */
+export function applyStatisticalModels(
+ dataOption: StyledMeasureColumn,
+ statisticalModels?: {
+ forecast?: {
+ isEnabled: boolean;
+ isViewerDisabled: boolean;
+ confidence: number;
+ forecastPeriod: number;
+ };
+ trend?: {
+ isEnabled: boolean;
+ isViewerDisabled: boolean;
+ trendType: string;
+ };
+ },
+): StyledMeasureColumn {
+ if (!statisticalModels) return dataOption;
+
+ const { forecast, trend } = statisticalModels;
+ let newDataOption = { ...dataOption }; // Create a shallow copy to avoid mutation
+
+ if (forecast && !forecast.isViewerDisabled && forecast.isEnabled) {
+ newDataOption = {
+ ...newDataOption,
+ forecast: {
+ confidenceInterval: forecast.confidence / 100,
+ forecastHorizon: forecast.forecastPeriod,
+ modelType: 'auto',
+ } as ForecastFormulaOptions,
+ };
+ }
+
+ if (trend && !trend.isViewerDisabled && trend.isEnabled) {
+ newDataOption = {
+ ...newDataOption,
+ trend: {
+ modelType: trend.trendType as TrendFormulaOptions['modelType'],
+ },
+ };
+ }
+
+ return newDataOption;
+}
+
export function createDataColumn(item: PanelItem, customPaletteColors?: Color[]) {
const element = createDimensionalElementFromJaql(item.jaql, item.format);
const sortType = getSortType(item.jaql.sort ?? item.categoriesSorting);
@@ -186,7 +234,7 @@ export function createDataColumn(item: PanelItem, customPaletteColors?: Color[])
const totalsCalculation = 'subtotalAgg' in item.jaql && item.jaql.subtotalAgg;
const dataBars = item.format?.databars;
- return {
+ const dataOption = {
column: element,
...(color && { color }),
...(showOnRightAxis && { showOnRightAxis }),
@@ -197,6 +245,8 @@ export function createDataColumn(item: PanelItem, customPaletteColors?: Color[])
...(dataBars && { dataBars }),
...(width && { width }),
} as StyledMeasureColumn;
+
+ return applyStatisticalModels(dataOption, item.statisticalModels);
}
return {
@@ -215,7 +265,7 @@ export const createDataOptionsFromPanels = (panels: Panel[], variantColors: Colo
const dataOptions: { [key: string]: any[] } = {};
panels.forEach((panel) => {
if (panel.name !== 'filters') {
- dataOptions[panel.name.toLowerCase()] = createColumnsFromPanelItems(
+ dataOptions[camelCase(panel.name)] = createColumnsFromPanelItems(
panels,
panel.name,
variantColors,
@@ -522,13 +572,11 @@ function extractAreamapChartDataOptions(
const geo: [StyledColumn] = [
createColumnsFromPanelItems(panels, 'geo', paletteColors)[0],
];
- const color: [StyledMeasureColumn] = [
- createColumnsFromPanelItems(panels, 'color', paletteColors)[0],
- ];
+ const color = createColumnsFromPanelItems(panels, 'color', paletteColors)[0];
return {
geo,
- color,
+ ...(color && { color: [color] }),
};
}
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-widget-drilldown-options.ts b/packages/sdk-ui/src/dashboard-widget/translate-widget-drilldown-options.ts
index f8c63c13..64c87c9c 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-widget-drilldown-options.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-widget-drilldown-options.ts
@@ -5,7 +5,7 @@ import { getEnabledPanelItems } from './utils';
import { DataPoint, DrilldownOptions } from '../types';
import { applyDateFormat } from '../query/date-formats/apply-date-format';
import parseISO from 'date-fns/parseISO';
-import uniqBy from 'lodash/uniqBy';
+import uniqBy from 'lodash-es/uniqBy';
const getAvailableDrilldowns = (item: PanelItem): Attribute[] =>
item?.parent
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.test.ts b/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.test.ts
index 4ea39cb0..46fa6e47 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.test.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.test.ts
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { MetadataTypes } from '@sisense/sdk-data';
-import { extractFilters } from './translate-widget-filters';
+import { extractWidgetFilters } from './translate-widget-filters';
import { Panel } from './types';
describe('extractFilters', () => {
@@ -26,7 +26,7 @@ describe('extractFilters', () => {
},
] as Panel[];
- const filters = extractFilters(panels);
+ const filters = extractWidgetFilters(panels);
expect(filters).toHaveLength(1);
expect(filters[0].jaql().jaql).toEqual(panels[0].items[0].jaql);
@@ -57,7 +57,7 @@ describe('extractFilters', () => {
},
] as Panel[];
- const filters = extractFilters(panels);
+ const filters = extractWidgetFilters(panels);
// verifies filter
expect(filters[0].jaql().jaql).toEqual({
@@ -95,7 +95,7 @@ describe('extractFilters', () => {
},
] as Panel[];
- const filters = extractFilters(panels);
+ const filters = extractWidgetFilters(panels);
expect(filters[0].jaql().jaql).toEqual(panels[0].items[0].jaql);
});
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.ts b/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.ts
index 315738cf..9d5bc238 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-widget-filters.ts
@@ -83,13 +83,14 @@ function getEnabledFilterPanelItems(panels: Panel[]): PanelItem[] {
return filterItems;
}
+
/**
* Extracts filters from the widget panel.
*
* @param panels - The array of panels.
* @returns The extracted filters.
*/
-export function extractFilters(panels: Panel[]) {
+export function extractWidgetFilters(panels: Panel[]) {
return getEnabledFilterPanelItems(panels).map((filterItem) =>
createFilterFromJaql(filterItem.jaql as FilterJaql, filterItem.instanceid),
);
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.test.ts b/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.test.ts
index 9ac682e9..4d6f9620 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.test.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.test.ts
@@ -1,5 +1,5 @@
-import merge from 'lodash/merge';
-import cloneDeep from 'lodash/cloneDeep';
+import merge from 'lodash-es/merge';
+import cloneDeep from 'lodash-es/cloneDeep';
import {
extractStyleOptions,
getIndicatorTypeSpecificOptions,
@@ -13,6 +13,7 @@ import {
PolarWidgetStyle,
ScatterWidgetStyle,
TreemapWidgetStyle,
+ WidgetDto,
WidgetSubtype,
} from './types';
import { jaqlMock } from './__mocks__/jaql-mock';
@@ -37,6 +38,16 @@ function generateWidgetAxisOptions(options = {}) {
return merge(cloneDeep(defaultOptions), options);
}
+const mockWidgetDto = (subtype: WidgetSubtype | string, style: any, panels: any): WidgetDto => {
+ return {
+ subtype,
+ style,
+ metadata: {
+ panels,
+ },
+ } as WidgetDto;
+};
+
describe('translate widget style options', () => {
describe('axes style options for cartesian chart', () => {
const widgetPanels = [
@@ -91,9 +102,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/column',
- '' as WidgetSubtype,
- widgetStyle,
- widgetPanels,
+ mockWidgetDto('', widgetStyle, widgetPanels),
) as BaseStyleOptionsWithAxes;
expect(styleOptions.xAxis).toEqual({
@@ -114,9 +123,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/column',
- '' as WidgetSubtype,
- widgetStyle,
- widgetPanels,
+ mockWidgetDto('', widgetStyle, widgetPanels),
) as BaseStyleOptionsWithAxes;
expect(styleOptions.xAxis?.title?.text).toEqual(widgetPanels[0].items[1].jaql.title);
@@ -132,9 +139,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/area',
- '' as WidgetSubtype,
- widgetStyle,
- [],
+ mockWidgetDto('', widgetStyle, []),
) as AreaStyleOptions;
expect(styleOptions.markers).toEqual(widgetStyle.markers);
@@ -147,9 +152,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/area',
- '' as WidgetSubtype,
- widgetStyle,
- [],
+ mockWidgetDto('', widgetStyle, []),
) as AreaStyleOptions;
expect(styleOptions.lineWidth).toEqual(widgetStyle.lineWidth);
@@ -180,9 +183,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/polar',
- '' as WidgetSubtype,
- widgetStyle,
- widgetPanels,
+ mockWidgetDto('', widgetStyle, widgetPanels),
) as BaseStyleOptionsWithAxes;
expect(styleOptions.xAxis).toEqual(widgetStyle.categories);
@@ -203,9 +204,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/polar',
- '' as WidgetSubtype,
- widgetStyle,
- widgetPanels,
+ mockWidgetDto('', widgetStyle, widgetPanels),
) as BaseStyleOptionsWithAxes;
expect(styleOptions.xAxis?.title?.text).toEqual(widgetPanels[0].items[0].jaql.title);
@@ -240,9 +239,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/scatter',
- '' as WidgetSubtype,
- widgetStyle,
- widgetPanels,
+ mockWidgetDto('', widgetStyle, widgetPanels),
) as BaseStyleOptionsWithAxes;
expect(styleOptions.xAxis).toEqual(widgetStyle.xAxis);
@@ -257,9 +254,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/scatter',
- '' as WidgetSubtype,
- widgetStyle,
- widgetPanels,
+ mockWidgetDto('', widgetStyle, widgetPanels),
) as BaseStyleOptionsWithAxes;
expect(styleOptions.xAxis?.title?.text).toEqual(widgetPanels[0].items[0].jaql.title);
@@ -288,9 +283,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'chart/funnel',
- '' as WidgetSubtype,
- widgetStyle,
- [],
+ mockWidgetDto('', widgetStyle, []),
) as BaseStyleOptions;
expect(styleOptions).toEqual({
@@ -316,10 +309,10 @@ describe('translate widget style options', () => {
header: { color: { enabled: true } },
};
- expect(extractStyleOptions('tablewidget', '' as WidgetSubtype, widgetStyle, [])).toEqual(
+ expect(extractStyleOptions('tablewidget', mockWidgetDto('', widgetStyle, []))).toEqual(
expectedOptions,
);
- expect(extractStyleOptions('tablewidgetagg', '' as WidgetSubtype, widgetStyle, [])).toEqual(
+ expect(extractStyleOptions('tablewidgetagg', mockWidgetDto('', widgetStyle, []))).toEqual(
expectedOptions,
);
});
@@ -344,9 +337,7 @@ describe('translate widget style options', () => {
const styleOptions = extractStyleOptions(
'indicator',
- 'indicator/numeric' as WidgetSubtype,
- widgetStyle,
- [
+ mockWidgetDto('indicator/numeric', widgetStyle, [
{
name: 'value',
items: [
@@ -367,7 +358,7 @@ describe('translate widget style options', () => {
} as PanelItem,
],
},
- ],
+ ]),
) as BaseStyleOptions;
expect(styleOptions).toStrictEqual({
@@ -460,7 +451,7 @@ describe('translate widget style options', () => {
mode: 'value',
},
};
- const result = extractStyleOptions('treemap', 'treemap', widgetStyle, []);
+ const result = extractStyleOptions('treemap', mockWidgetDto('treemap', widgetStyle, []));
expect(result).toEqual(expected);
});
@@ -481,7 +472,7 @@ describe('translate widget style options', () => {
mode: 'contribution',
},
};
- const result = extractStyleOptions('treemap', 'treemap', widgetStyle, []);
+ const result = extractStyleOptions('treemap', mockWidgetDto('treemap', widgetStyle, []));
expect(result).toEqual(expected);
});
@@ -497,7 +488,7 @@ describe('translate widget style options', () => {
mode: 'value',
},
};
- const result = extractStyleOptions('treemap', 'treemap', widgetStyle, []);
+ const result = extractStyleOptions('treemap', mockWidgetDto('treemap', widgetStyle, []));
expect(result).toEqual(expected);
});
diff --git a/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.ts b/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.ts
index 83b530fa..3497fb5e 100644
--- a/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.ts
+++ b/packages/sdk-ui/src/dashboard-widget/translate-widget-style-options.ts
@@ -47,6 +47,7 @@ import {
ScattermapWidgetStyle,
PivotWidgetStyle,
WidgetDesign,
+ WidgetDto,
} from './types';
import { getEnabledPanelItems, getChartSubtype } from './utils';
@@ -251,7 +252,13 @@ function prepareBoxplotChartAxisOptions(
return axisOptions;
}
-type CartesianChartStyleOptions = LineStyleOptions | AreaStyleOptions | StackableStyleOptions;
+/**
+ * @internal
+ */
+export type CartesianChartStyleOptions =
+ | LineStyleOptions
+ | AreaStyleOptions
+ | StackableStyleOptions;
function extractCartesianChartStyleOptions(
widgetType: WidgetType,
@@ -473,21 +480,29 @@ export function extractPivotTableStyleOptions(
export function extractStyleOptions(
widgetType: WType,
- widgetSubtype: WidgetSubtype,
- style: WidgetStyle,
- panels: Panel[],
+ widget: WidgetDto,
): ChartStyleOptions | TableStyleOptions {
+ const {
+ subtype: widgetSubtype,
+ style,
+ metadata: { panels },
+ } = widget as WidgetDto & { subtype: WidgetSubtype };
switch (widgetType) {
case 'chart/line':
case 'chart/area':
case 'chart/bar':
- case 'chart/column':
- return extractCartesianChartStyleOptions(
+ case 'chart/column': {
+ const styleOptions = extractCartesianChartStyleOptions(
widgetType,
widgetSubtype,
style as CartesianWidgetStyle,
panels,
);
+ if (styleOptions.navigator) {
+ styleOptions.navigator.scrollerLocation = widget.options?.previousScrollerLocation;
+ }
+ return styleOptions;
+ }
case 'chart/polar':
return extractPolarChartStyleOptions(widgetSubtype, style as PolarWidgetStyle, panels);
case 'chart/scatter':
@@ -512,8 +527,17 @@ export function extractStyleOptions(
style as IndicatorWidgetStyle,
panels,
);
- case 'chart/boxplot':
- return extractBoxplotChartStyleOptions(widgetSubtype, style as BoxplotWidgetStyle, panels);
+ case 'chart/boxplot': {
+ const boxplotStyleOptions = extractBoxplotChartStyleOptions(
+ widgetSubtype,
+ style as BoxplotWidgetStyle,
+ panels,
+ );
+ if (boxplotStyleOptions.navigator) {
+ boxplotStyleOptions.navigator.scrollerLocation = widget.options?.previousScrollerLocation;
+ }
+ return boxplotStyleOptions;
+ }
case 'map/scatter':
return extractScattermapChartStyleOptions(widgetSubtype, style as ScattermapWidgetStyle);
case 'map/area':
diff --git a/packages/sdk-ui/src/dashboard-widget/types.ts b/packages/sdk-ui/src/dashboard-widget/types.ts
index 470ea137..297ce120 100644
--- a/packages/sdk-ui/src/dashboard-widget/types.ts
+++ b/packages/sdk-ui/src/dashboard-widget/types.ts
@@ -87,6 +87,8 @@ export type Datasource = {
*
* This is the (not-comprehensive) structure of the response from the
* `/api/v1/dashboards/${dashboardOid}/widgets/${widgetOid}` endpoint.
+ *
+ * @internal
*/
export interface WidgetDto {
oid: string;
@@ -105,8 +107,16 @@ export interface WidgetDto {
dashboardFiltersMode: `${WidgetDashboardFilterMode}`;
selector: boolean;
drillToAnywhere?: boolean;
+ previousScrollerLocation?: AutoZoomNavigatorScrollerLocation;
};
}
+/**
+ * @description the scroll location of the navigator scroller / auto zoom feature
+ */
+export type AutoZoomNavigatorScrollerLocation = {
+ min: number;
+ max: number;
+};
export type WidgetDesign = {
widgetBackgroundColor: string;
@@ -170,6 +180,47 @@ export type DatetimeMask = {
dateAndTime?: string;
};
+export type StatisticalModels = {
+ forecast?: {
+ isEnabled: boolean;
+ isViewerDisabled: boolean;
+ explainVariable: null;
+ evaluation: {
+ type: string;
+ numLastPointsForEvaluation: number;
+ ignoreLast: number;
+ };
+ forecastPeriod: number;
+ confidence: number;
+ modelType: string;
+ boundaries: {
+ upper: {
+ isEnabled: boolean;
+ value: null;
+ };
+ lower: {
+ isEnabled: boolean;
+ value: null;
+ };
+ isInt: {
+ isEnabled: boolean;
+ };
+ };
+ };
+ trend?: {
+ isEnabled: boolean;
+ isViewerDisabled: boolean;
+ trendType: string;
+ ignoreAnomalies: boolean;
+ trendOnForecast: boolean;
+ compare: {
+ isEnabled: boolean;
+ period: string;
+ };
+ isAccessible: boolean;
+ };
+};
+
export type PanelItem = {
instanceid?: string;
format?: {
@@ -190,6 +241,7 @@ export type PanelItem = {
categoriesSorting?: JaqlSortDirection;
isColored?: boolean;
geoLevel?: 'country' | 'state' | 'city';
+ statisticalModels?: StatisticalModels;
field?: {
id: string;
index: number;
diff --git a/packages/sdk-ui/src/dashboard-widget/utils.test.ts b/packages/sdk-ui/src/dashboard-widget/utils.test.ts
index eb8c2d17..17bb9c75 100644
--- a/packages/sdk-ui/src/dashboard-widget/utils.test.ts
+++ b/packages/sdk-ui/src/dashboard-widget/utils.test.ts
@@ -110,19 +110,27 @@ describe('getFilterRelationsFromJaql', () => {
it('should return filters if relations are undefined', () => {
const filters = [mockFilter1, mockFilter2];
- expect(getFilterRelationsFromJaql(filters, undefined)).toEqual(filters);
+ expect(getFilterRelationsFromJaql(filters, [], undefined)).toEqual(filters);
});
it('should replace filter relations nodes with filters', () => {
const filters = [mockFilter1, mockFilter2, mockFilter3, mockFilter4];
- expect(getFilterRelationsFromJaql(filters, incomingFilterRelationsJaql)).toEqual(
+ expect(getFilterRelationsFromJaql(filters, [], incomingFilterRelationsJaql)).toEqual(
expectedFilterRelations,
);
});
it('should throw an error if filter relations contain unknown filter', () => {
const filters = [mockFilter1, mockFilter2];
- expect(() => getFilterRelationsFromJaql(filters, incomingFilterRelationsJaql)).toThrow();
+ expect(() => getFilterRelationsFromJaql(filters, [], incomingFilterRelationsJaql)).toThrow();
+ });
+
+ it('should return filters if filter relations and highlights exist', () => {
+ const filters = [mockFilter1, mockFilter2];
+ const highlights = [mockFilter3, mockFilter4];
+ expect(getFilterRelationsFromJaql(filters, highlights, incomingFilterRelationsJaql)).toEqual(
+ filters,
+ );
});
});
diff --git a/packages/sdk-ui/src/dashboard-widget/utils.ts b/packages/sdk-ui/src/dashboard-widget/utils.ts
index c307ce77..b88de3ad 100644
--- a/packages/sdk-ui/src/dashboard-widget/utils.ts
+++ b/packages/sdk-ui/src/dashboard-widget/utils.ts
@@ -19,7 +19,7 @@ import {
WidgetSubtype,
WidgetType,
} from './types';
-import cloneDeep from 'lodash/cloneDeep';
+import cloneDeep from 'lodash-es/cloneDeep';
import { TranslatableError } from '../translation/translatable-error';
import { isCascadingFilter } from '@/utils/filters';
@@ -228,18 +228,26 @@ export function mergeFiltersByStrategy(
* Replaces nodes of filter reations tree with fetched filters by instance id.
*
* @param filters - The filters from the dashboard.
+ * @param highlights - The highlights from the dashboard
* @param filterRelations - Fetched filter relations.
* @returns {FilterRelations} Filter relations with filters in nodes.
*/
/* eslint-disable-next-line sonarjs/cognitive-complexity */
export function getFilterRelationsFromJaql(
filters: Filter[],
+ highlights: Filter[],
filterRelations: FilterRelationsJaql | undefined,
): FilterRelations | Filter[] {
if (!filterRelations) {
return filters;
}
+ // If highlights are present, nodes in filter relations reference both filters and highlights
+ // and thus cannot be replaced with filters. Return filters in this case.
+ if (highlights.length) {
+ return filters;
+ }
+
const mergedFilterRelations = cloneDeep(filterRelations);
function traverse(
diff --git a/packages/sdk-ui/src/dashboard/dashboard-by-id.tsx b/packages/sdk-ui/src/dashboard/dashboard-by-id.tsx
index 76dc7478..74ab6045 100644
--- a/packages/sdk-ui/src/dashboard/dashboard-by-id.tsx
+++ b/packages/sdk-ui/src/dashboard/dashboard-by-id.tsx
@@ -10,6 +10,24 @@ import { asSisenseComponent } from '@/decorators/component-decorators/as-sisense
*
* **Note:** Dashboard extensions based on JS scripts and add-ons in Fusion are not supported.
*
+ * @example
+ *
+ * ```ts
+ * import { DashboardById } from '@sisense/sdk-ui';
+
+ const CodeExample = () => {
+ return (
+ <>
+
+ >
+ );
+ };
+
+ export default CodeExample;
+ * ```
+ *
* @group Fusion Embed
* @fusionEmbed
* @alpha
diff --git a/packages/sdk-ui/src/dashboard/dashboard.tsx b/packages/sdk-ui/src/dashboard/dashboard.tsx
index a416df74..286a089b 100644
--- a/packages/sdk-ui/src/dashboard/dashboard.tsx
+++ b/packages/sdk-ui/src/dashboard/dashboard.tsx
@@ -12,6 +12,40 @@ import { asSisenseComponent } from '@/decorators/component-decorators/as-sisense
*
* **Note:** Dashboard extensions based on JS scripts and add-ons in Fusion are not supported.
*
+ * @example
+ *
+ * ```ts
+ * import { Dashboard, useGetDashboardModel } from '@sisense/sdk-ui';
+
+const CodeExample = () => {
+ const { dashboard } = useGetDashboardModel({
+ dashboardOid: '65a82171719e7f004018691c',
+ includeFilters: true,
+ includeWidgets: true,
+ });
+
+ return (
+ <>
+ {dashboard && (
+
+ )}
+ >
+ );
+};
+
+export default CodeExample;
+ * ```
+ *
* @group Fusion Embed
* @fusionEmbed
* @alpha
diff --git a/packages/sdk-ui/src/decorators/component-decorators/as-sisense-component.tsx b/packages/sdk-ui/src/decorators/component-decorators/as-sisense-component.tsx
index c1b40093..9261694a 100644
--- a/packages/sdk-ui/src/decorators/component-decorators/as-sisense-component.tsx
+++ b/packages/sdk-ui/src/decorators/component-decorators/as-sisense-component.tsx
@@ -1,5 +1,5 @@
import type { FunctionComponent } from 'react';
-import flow from 'lodash/flow';
+import flow from 'lodash-es/flow';
import { withTracking } from './with-tracking';
import { withErrorBoundary } from './with-error-boundary';
import { withSisenseContextValidation } from './with-sisense-context-validation';
diff --git a/packages/sdk-ui/src/decorators/component-decorators/with-sisense-context-validation.tsx b/packages/sdk-ui/src/decorators/component-decorators/with-sisense-context-validation.tsx
index 0238588f..d53c59f0 100644
--- a/packages/sdk-ui/src/decorators/component-decorators/with-sisense-context-validation.tsx
+++ b/packages/sdk-ui/src/decorators/component-decorators/with-sisense-context-validation.tsx
@@ -1,5 +1,5 @@
-import isBoolean from 'lodash/isBoolean';
-import isFunction from 'lodash/isFunction';
+import isBoolean from 'lodash-es/isBoolean';
+import isFunction from 'lodash-es/isFunction';
import { ComponentDecorator, SisenseComponentConfig } from './as-sisense-component';
import { TranslatableError } from '../../translation/translatable-error';
import { useSisenseContext } from '../../sisense-context/sisense-context';
diff --git a/packages/sdk-ui/src/decorators/component-decorators/with-tracking/with-tracking.tsx b/packages/sdk-ui/src/decorators/component-decorators/with-tracking/with-tracking.tsx
index aa7f2d27..4cc0aa78 100644
--- a/packages/sdk-ui/src/decorators/component-decorators/with-tracking/with-tracking.tsx
+++ b/packages/sdk-ui/src/decorators/component-decorators/with-tracking/with-tracking.tsx
@@ -1,7 +1,7 @@
import { useTrackComponentInit, TrackingContextProvider } from './use-track-component-init';
import { ComponentDecorator } from '../as-sisense-component';
-import isBoolean from 'lodash/isBoolean';
-import isFunction from 'lodash/isFunction';
+import isBoolean from 'lodash-es/isBoolean';
+import isFunction from 'lodash-es/isFunction';
import { ErrorTracker } from './error-tracker';
import { useTracking } from '@/common/hooks/use-tracking';
diff --git a/packages/sdk-ui/src/dynamic-size-container/dynamic-size-container.tsx b/packages/sdk-ui/src/dynamic-size-container/dynamic-size-container.tsx
index cf5f460b..85d09927 100644
--- a/packages/sdk-ui/src/dynamic-size-container/dynamic-size-container.tsx
+++ b/packages/sdk-ui/src/dynamic-size-container/dynamic-size-container.tsx
@@ -1,6 +1,6 @@
/* eslint-disable complexity */
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
-import isEqual from 'lodash/isEqual';
+import isEqual from 'lodash-es/isEqual';
export type ContainerSize = {
width: number;
diff --git a/packages/sdk-ui/src/filters/components/custom-filter-tile.tsx b/packages/sdk-ui/src/filters/components/custom-filter-tile.tsx
index 90c80291..f3731462 100644
--- a/packages/sdk-ui/src/filters/components/custom-filter-tile.tsx
+++ b/packages/sdk-ui/src/filters/components/custom-filter-tile.tsx
@@ -1,6 +1,6 @@
import { Filter } from '@sisense/sdk-data';
import { FilterTile, FilterTileDesignOptions } from './filter-tile';
-import cloneDeep from 'lodash/cloneDeep';
+import cloneDeep from 'lodash-es/cloneDeep';
import { useTranslation } from 'react-i18next';
import { asSisenseComponent } from '@/decorators/component-decorators/as-sisense-component';
diff --git a/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.tsx b/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.tsx
index 566bec21..f8baa7d7 100644
--- a/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.tsx
+++ b/packages/sdk-ui/src/filters/components/filters-panel/filters-panel.tsx
@@ -6,7 +6,7 @@ import { useThemeContext } from '@/theme-provider';
import { asSisenseComponent } from '@/decorators/component-decorators/as-sisense-component';
const PanelWrapper = styled.div`
- background-color: ${({ theme }) => theme.chart.backgroundColor};
+ background-color: ${({ theme }) => theme.filter.panel.backgroundColor};
border: 1px solid #dadada;
width: fit-content;
min-width: 240px;
@@ -20,7 +20,7 @@ const PanelBody = styled.div`
const PanelHeader = styled.div`
background-color: transparent;
- color: ${({ theme }) => theme.typography.primaryTextColor};
+ color: ${({ theme }) => theme.filter.panel.titleColor};
margin: 0 9px;
height: 48px;
border-bottom: 1px solid #dadada;
diff --git a/packages/sdk-ui/src/filters/components/member-filter-tile/basic-member-filter-tile.tsx b/packages/sdk-ui/src/filters/components/member-filter-tile/basic-member-filter-tile.tsx
index fcb28045..46476b75 100644
--- a/packages/sdk-ui/src/filters/components/member-filter-tile/basic-member-filter-tile.tsx
+++ b/packages/sdk-ui/src/filters/components/member-filter-tile/basic-member-filter-tile.tsx
@@ -5,7 +5,7 @@ import { useMembers } from './use-members';
import { FilterTile } from '../filter-tile';
import { Member, SelectedMember } from './members-reducer';
import { useValidatedMembers } from './use-validate-members';
-import isEqual from 'lodash/isEqual';
+import isEqual from 'lodash-es/isEqual';
/**
* Props for {@link BasicMemberFilterTile}
diff --git a/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.tsx b/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.tsx
index 58a9eab5..c6512d73 100644
--- a/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.tsx
+++ b/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.tsx
@@ -7,7 +7,7 @@ import { FilterTile, FilterTileDesignOptions } from '../filter-tile';
import { useSynchronizedFilter } from '@/filters/hooks/use-synchronized-filter';
import { PillSection } from './pill-section';
import { MemberList } from './member-list';
-import merge from 'lodash/merge';
+import merge from 'lodash-es/merge';
import { cloneFilterAndToggleDisabled } from '@/utils/filters';
/**
diff --git a/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.tsx b/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.tsx
index 21989b4c..a539e554 100644
--- a/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.tsx
+++ b/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.tsx
@@ -1,4 +1,4 @@
-import debounce from 'lodash/debounce';
+import debounce from 'lodash-es/debounce';
import { FunctionComponent, useMemo, useState } from 'react';
import { Checkbox } from '../common';
import { Member, SelectedMember } from './members-reducer';
diff --git a/packages/sdk-ui/src/filters/components/member-filter-tile/use-members.ts b/packages/sdk-ui/src/filters/components/member-filter-tile/use-members.ts
index db694c33..e39df672 100644
--- a/packages/sdk-ui/src/filters/components/member-filter-tile/use-members.ts
+++ b/packages/sdk-ui/src/filters/components/member-filter-tile/use-members.ts
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useReducer, useRef } from 'react';
-import isEqual from 'lodash/isEqual';
+import isEqual from 'lodash-es/isEqual';
import { Member, membersReducer } from './members-reducer';
interface Props {
diff --git a/packages/sdk-ui/src/highcharts-memorized.tsx b/packages/sdk-ui/src/highcharts-memorized.tsx
index e904fada..6e994f60 100644
--- a/packages/sdk-ui/src/highcharts-memorized.tsx
+++ b/packages/sdk-ui/src/highcharts-memorized.tsx
@@ -1,7 +1,7 @@
import { memo, useCallback } from 'react';
-import isEqualWith from 'lodash/isEqualWith';
-import isFunction from 'lodash/isFunction';
-import cloneDeep from 'lodash/cloneDeep';
+import isEqualWith from 'lodash-es/isEqualWith';
+import isFunction from 'lodash-es/isFunction';
+import cloneDeep from 'lodash-es/cloneDeep';
import Highcharts from '@sisense/sisense-charts';
import HighchartsReact from 'highcharts-react-official';
import { HighchartsEventOptions } from './chart-options-processor/apply-event-handlers';
diff --git a/packages/sdk-ui/src/index.ts b/packages/sdk-ui/src/index.ts
index 595085d8..112fa346 100644
--- a/packages/sdk-ui/src/index.ts
+++ b/packages/sdk-ui/src/index.ts
@@ -79,6 +79,7 @@ export {
type CommonFiltersApplyMode,
type FiltersIgnoringRules,
} from './models';
+export type { AutoZoomNavigatorScrollerLocation } from './dashboard-widget/types';
export { boxWhiskerProcessResult } from './boxplot-utils';
export { queryStateReducer } from './query-execution/query-state-reducer';
@@ -90,6 +91,9 @@ export * from './formulas';
export { trackHook } from './decorators/hook-decorators';
export * from './common/hooks/data-load-state-reducer';
export { createDataOptionsFromPanels } from './dashboard-widget/translate-widget-data-options';
+export { type DashboardDto } from './api/types/dashboard-dto';
+export { type WidgetDto } from './dashboard-widget/types';
+export { extractCombinedFilters } from './dashboard-widget/translate-dashboard-filters';
export { useThemeContext } from './theme-provider';
export { LoadingIndicator } from './common/components/loading-indicator';
export { LoadingOverlay } from './common/components/loading-overlay';
diff --git a/packages/sdk-ui/src/models/dashboard/__snapshots__/dashboard-model.test.ts.snap b/packages/sdk-ui/src/models/dashboard/__snapshots__/dashboard-model.test.ts.snap
index 29d906ba..20b2c68e 100644
--- a/packages/sdk-ui/src/models/dashboard/__snapshots__/dashboard-model.test.ts.snap
+++ b/packages/sdk-ui/src/models/dashboard/__snapshots__/dashboard-model.test.ts.snap
@@ -21,7 +21,7 @@ DashboardModel {
"members": [
"member",
],
- "name": "aa97e8bdf02f3f25dda80a630616a17230ecb913",
+ "name": "e8e9681675b",
"type": "filter",
},
],
diff --git a/packages/sdk-ui/src/models/dashboard/get-dashboard-model.test.ts b/packages/sdk-ui/src/models/dashboard/get-dashboard-model.test.ts
index 5122aa51..a55bdc86 100644
--- a/packages/sdk-ui/src/models/dashboard/get-dashboard-model.test.ts
+++ b/packages/sdk-ui/src/models/dashboard/get-dashboard-model.test.ts
@@ -7,7 +7,7 @@ import { type HttpClient } from '@sisense/sdk-rest-client';
import { sampleEcommerceDashboard as dashboardMock } from '../__mocks__/sample-ecommerce-dashboard';
import { type RestApi } from '../../api/rest-api';
import { WidgetModel } from '../widget';
-import zipObject from 'lodash/zipObject';
+import zipObject from 'lodash-es/zipObject';
const getDashboardMock = vi.fn>(() => {
// eslint-disable-next-line no-unused-vars
diff --git a/packages/sdk-ui/src/models/dashboard/get-dashboard-models.test.ts b/packages/sdk-ui/src/models/dashboard/get-dashboard-models.test.ts
index b2df44a2..a928e9dc 100644
--- a/packages/sdk-ui/src/models/dashboard/get-dashboard-models.test.ts
+++ b/packages/sdk-ui/src/models/dashboard/get-dashboard-models.test.ts
@@ -10,7 +10,7 @@ import { sampleEcommerceDashboard } from '../__mocks__/sample-ecommerce-dashboar
import { sampleHealthcareDashboard } from '../__mocks__/sample-healthcare-dashboard.js';
import { samplePivotDashboard } from '../__mocks__/sample-pivot-dashboard.js';
import { WidgetModel } from '../widget/widget-model.js';
-import zipObject from 'lodash/zipObject';
+import zipObject from 'lodash-es/zipObject';
const dashboardsMock: DashboardDto[] = [
sampleEcommerceDashboard,
diff --git a/packages/sdk-ui/src/models/widget/__snapshots__/widget-model.test.ts.snap b/packages/sdk-ui/src/models/widget/__snapshots__/widget-model.test.ts.snap
index ff8fb86c..55385b8a 100644
--- a/packages/sdk-ui/src/models/widget/__snapshots__/widget-model.test.ts.snap
+++ b/packages/sdk-ui/src/models/widget/__snapshots__/widget-model.test.ts.snap
@@ -40,7 +40,7 @@ exports[`WidgetModel > getExecutePivotQueryParams > getChartProps > should retur
"name": "Numbers",
"prefix": false,
"symbol": undefined,
- "thousandSeparator": undefined,
+ "thousandSeparator": true,
"trillion": false,
},
"sortType": "sortNone",
@@ -107,7 +107,7 @@ exports[`WidgetModel > getExecutePivotQueryParams > getChartProps > should retur
"sort": 0,
"type": "basemeasure",
},
- "name": "c4385b7c5e5cd228df086d36ae458779e1a7a768",
+ "name": "f1b3d268f61",
"operator": "top",
"type": "filter",
},
diff --git a/packages/sdk-ui/src/models/widget/widget-model.ts b/packages/sdk-ui/src/models/widget/widget-model.ts
index ee6d054f..f9de1106 100644
--- a/packages/sdk-ui/src/models/widget/widget-model.ts
+++ b/packages/sdk-ui/src/models/widget/widget-model.ts
@@ -1,6 +1,6 @@
import { getPivotQueryOptions } from '@/pivot-table/hooks/use-get-pivot-table-query';
import { Attribute, Filter, Measure } from '@sisense/sdk-data';
-import { over } from 'lodash';
+import over from 'lodash-es/over';
import { getTranslatedDataOptions } from '../../chart-data-options/get-translated-data-options';
import {
translatePivotTableDataOptions,
@@ -13,12 +13,12 @@ import {
} from '../../chart-data-options/types';
import { extractDataOptions } from '../../dashboard-widget/translate-widget-data-options';
import { extractDrilldownOptions } from '../../dashboard-widget/translate-widget-drilldown-options';
-import { extractFilters } from '../../dashboard-widget/translate-widget-filters';
+import { extractWidgetFilters } from '../../dashboard-widget/translate-widget-filters';
import {
extractStyleOptions,
getStyleWithWigetDesign,
} from '../../dashboard-widget/translate-widget-style-options';
-import { Panel, WidgetDto, WidgetSubtype, WidgetType } from '../../dashboard-widget/types';
+import { Panel, WidgetDto, WidgetType } from '../../dashboard-widget/types';
import {
getChartType,
isChartWidget,
@@ -176,12 +176,7 @@ export class WidgetModel {
themeSettings?.palette.variantColors,
);
- const styleOptions = extractStyleOptions(
- widgetType,
- widgetDto.subtype as WidgetSubtype,
- widgetDto.style,
- widgetDto.metadata.panels,
- );
+ const styleOptions = extractStyleOptions(widgetType, widgetDto);
// take into account widget design style feature flag
const isWidgetDesignStyleEnabled =
@@ -196,7 +191,7 @@ export class WidgetModel {
// does not handle widget type plugin
this.drilldownOptions = extractDrilldownOptions(this.widgetType, widgetDto.metadata.panels);
- this.filters = extractFilters(widgetDto.metadata.panels);
+ this.filters = extractWidgetFilters(widgetDto.metadata.panels);
this.chartType = isChartWidget(widgetType) ? getChartType(this.widgetType) : undefined;
}
diff --git a/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-formatting.ts b/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-formatting.ts
index fc854aba..10bf802e 100644
--- a/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-formatting.ts
+++ b/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-formatting.ts
@@ -5,7 +5,7 @@ import {
EVENT_DATA_CELL_FORMAT,
EVENT_HEADER_CELL_FORMAT,
} from '@sisense/sdk-pivot-client';
-import over from 'lodash/over';
+import over from 'lodash-es/over';
import { type PivotTableDataOptions } from '@/chart-data-options/types';
import { applyDateFormat } from '@/query/date-formats';
import { useSisenseContext } from '@/sisense-context/sisense-context';
diff --git a/packages/sdk-ui/src/pivot-table/hooks/use-get-pivot-table-query.ts b/packages/sdk-ui/src/pivot-table/hooks/use-get-pivot-table-query.ts
index 20ac15ac..0c047985 100644
--- a/packages/sdk-ui/src/pivot-table/hooks/use-get-pivot-table-query.ts
+++ b/packages/sdk-ui/src/pivot-table/hooks/use-get-pivot-table-query.ts
@@ -3,7 +3,7 @@ import { type JaqlRequest } from '@sisense/sdk-pivot-client';
import type { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
import { normalizePivotSort } from '../sorting-utils';
-import isEqual from 'lodash/isEqual';
+import isEqual from 'lodash-es/isEqual';
import { ExecutePivotQueryParams } from '@/query-execution';
import { translateCategoryToAttribute, translateValueToMeasure } from '@/chart-data-options/utils';
import { Category, PivotTableDataOptionsInternal, Value } from '@/chart-data-options/types';
diff --git a/packages/sdk-ui/src/pivot-table/sorting-utils.ts b/packages/sdk-ui/src/pivot-table/sorting-utils.ts
index 0668f443..f3fb4487 100644
--- a/packages/sdk-ui/src/pivot-table/sorting-utils.ts
+++ b/packages/sdk-ui/src/pivot-table/sorting-utils.ts
@@ -1,8 +1,8 @@
import { getSortType } from '@/dashboard-widget/utils';
import { JaqlSortDirection } from '@sisense/sdk-data';
import { type SortingSettingsChangePayload } from '@sisense/sdk-pivot-client';
-import isEqual from 'lodash/isEqual';
-import isString from 'lodash/isString';
+import isEqual from 'lodash-es/isEqual';
+import isString from 'lodash-es/isString';
import { PivotTableDataOptionsInternal } from '..';
import type { SortDirection, PivotRowsSort } from '../types';
diff --git a/packages/sdk-ui/src/props.tsx b/packages/sdk-ui/src/props.tsx
index e79579c7..3e407c1c 100644
--- a/packages/sdk-ui/src/props.tsx
+++ b/packages/sdk-ui/src/props.tsx
@@ -125,6 +125,15 @@ export interface SisenseContextProviderProps {
*/
wat?: string | null;
+ /**
+ * Flag to delegate authentication to Fusion.
+ *
+ * Defaults to `false`.
+ *
+ * @category Sisense Authentication
+ */
+ useFusionAuth?: boolean;
+
/**
* Application specific configurations such as locale and date formats.
*
@@ -151,7 +160,6 @@ export interface SisenseContextProviderProps {
* such as incorrect configuration, invalid authentication, or network-related issues.
*
* @param error - The error object containing details about the issue.
- *
* @category Sisense App Error Handling
*/
onError?: (error: Error) => void;
diff --git a/packages/sdk-ui/src/query-execution/use-execute-pivot-query.test.ts b/packages/sdk-ui/src/query-execution/use-execute-pivot-query.test.ts
index 160f8bf0..dd7e2ea8 100644
--- a/packages/sdk-ui/src/query-execution/use-execute-pivot-query.test.ts
+++ b/packages/sdk-ui/src/query-execution/use-execute-pivot-query.test.ts
@@ -1,7 +1,7 @@
/** @vitest-environment jsdom */
import { renderHook, waitFor } from '@testing-library/react';
-import cloneDeep from 'lodash/cloneDeep';
+import cloneDeep from 'lodash-es/cloneDeep';
import { trackProductEvent } from '@sisense/sdk-tracking';
import { executePivotQueryMock } from '../query/__mocks__/execute-query';
import type { Mock } from 'vitest';
diff --git a/packages/sdk-ui/src/query-execution/use-execute-query-by-widget-id.test.ts b/packages/sdk-ui/src/query-execution/use-execute-query-by-widget-id.test.ts
index e9cedc41..3079965a 100644
--- a/packages/sdk-ui/src/query-execution/use-execute-query-by-widget-id.test.ts
+++ b/packages/sdk-ui/src/query-execution/use-execute-query-by-widget-id.test.ts
@@ -1,7 +1,7 @@
/** @vitest-environment jsdom */
import { renderHook, waitFor } from '@testing-library/react';
import type { Mock } from 'vitest';
-import cloneDeep from 'lodash/cloneDeep';
+import cloneDeep from 'lodash-es/cloneDeep';
import {
QueryResultData,
filterFactory,
diff --git a/packages/sdk-ui/src/query/query-result-date-formatting.test.ts b/packages/sdk-ui/src/query/query-result-date-formatting.test.ts
index 4d0bb0e3..78a78992 100644
--- a/packages/sdk-ui/src/query/query-result-date-formatting.test.ts
+++ b/packages/sdk-ui/src/query/query-result-date-formatting.test.ts
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { applyDateFormats } from './query-result-date-formatting';
-import cloneDeep from 'lodash/cloneDeep';
+import cloneDeep from 'lodash-es/cloneDeep';
import type { Cell, QueryResultData } from '@sisense/sdk-data';
describe('applyDateFormats', () => {
diff --git a/packages/sdk-ui/src/sisense-context/sisense-context-provider.tsx b/packages/sdk-ui/src/sisense-context/sisense-context-provider.tsx
index 523a4e76..2e328c2f 100644
--- a/packages/sdk-ui/src/sisense-context/sisense-context-provider.tsx
+++ b/packages/sdk-ui/src/sisense-context/sisense-context-provider.tsx
@@ -55,6 +55,7 @@ export const SisenseContextProvider: FunctionComponent<
enableTracking = true,
showRuntimeErrors = true,
enableSilentPreAuth = false,
+ useFusionAuth = false,
onError,
}) => {
const tracking = {
@@ -89,6 +90,7 @@ export const SisenseContextProvider: FunctionComponent<
ssoEnabled,
appConfig,
enableSilentPreAuth,
+ useFusionAuth,
})
.then((newApp) => {
if (!ignore) {
@@ -104,7 +106,17 @@ export const SisenseContextProvider: FunctionComponent<
return () => {
ignore = true;
};
- }, [defaultDataSource, url, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, onError]);
+ }, [
+ defaultDataSource,
+ url,
+ token,
+ wat,
+ ssoEnabled,
+ appConfig,
+ enableSilentPreAuth,
+ useFusionAuth,
+ onError,
+ ]);
return (
diff --git a/packages/sdk-ui/src/theme-provider/default-theme-settings.ts b/packages/sdk-ui/src/theme-provider/default-theme-settings.ts
index 48befb79..000be815 100644
--- a/packages/sdk-ui/src/theme-provider/default-theme-settings.ts
+++ b/packages/sdk-ui/src/theme-provider/default-theme-settings.ts
@@ -1,6 +1,6 @@
/* eslint-disable sonarjs/no-duplicate-string */
import { CompleteThemeSettings } from '@/types';
-import cloneDeep from 'lodash/cloneDeep';
+import cloneDeep from 'lodash-es/cloneDeep';
export const DEFAULT_DIVIDER_COLOR = '#F2F2F2';
export const DEFAULT_DIVIDER_WIDTH = 4;
@@ -53,6 +53,12 @@ const DEFAULT_THEME_SETTINGS_LIGHT: CompleteThemeSettings = {
dividerLineWidth: DEFAULT_DIVIDER_WIDTH,
dividerLineColor: DEFAULT_DIVIDER_COLOR,
},
+ filter: {
+ panel: {
+ titleColor: '#5B6372',
+ backgroundColor: '#F6F6F6',
+ },
+ },
aiChat: {
backgroundColor: 'rgba(244, 244, 248, 1)',
primaryTextColor: 'rgba(38, 46, 61, 0.8)',
@@ -198,6 +204,12 @@ const DEFAULT_THEME_SETTINGS_DARK: CompleteThemeSettings = {
dividerLineWidth: DEFAULT_DIVIDER_WIDTH,
dividerLineColor: DEFAULT_DIVIDER_COLOR,
},
+ filter: {
+ panel: {
+ titleColor: '#FFFFFF',
+ backgroundColor: '#313138',
+ },
+ },
aiChat: {
backgroundColor: 'rgba(23, 28, 38, 1)',
primaryTextColor: 'rgba(242, 247, 255, 0.9)',
diff --git a/packages/sdk-ui/src/theme-provider/use-theme-settings.ts b/packages/sdk-ui/src/theme-provider/use-theme-settings.ts
index 0fa50234..9b4e1b0e 100644
--- a/packages/sdk-ui/src/theme-provider/use-theme-settings.ts
+++ b/packages/sdk-ui/src/theme-provider/use-theme-settings.ts
@@ -1,4 +1,4 @@
-import isEqual from 'lodash/isEqual';
+import isEqual from 'lodash-es/isEqual';
import merge from 'ts-deepmerge';
import { useState, useEffect } from 'react';
import { ThemeOid, ThemeSettings, isThemeOid, CompleteThemeSettings } from '../types';
diff --git a/packages/sdk-ui/src/themes/__mocks__/legacy-design-settings.mock.ts b/packages/sdk-ui/src/themes/__mocks__/legacy-design-settings.mock.ts
index 77b0ad71..ca4bbc80 100644
--- a/packages/sdk-ui/src/themes/__mocks__/legacy-design-settings.mock.ts
+++ b/packages/sdk-ui/src/themes/__mocks__/legacy-design-settings.mock.ts
@@ -60,7 +60,7 @@ export const redThemeSettings: CompleteThemeSettings = {
textColor: '#FFFFFF',
backgroundColor: '#ec4646',
secondaryTextColor: '#C5C8CF',
- panelBackgroundColor: '#313138',
+ panelBackgroundColor: '#ec4646',
animation: {
init: {
duration: 'auto',
@@ -103,6 +103,12 @@ export const redThemeSettings: CompleteThemeSettings = {
dividerLineColor: '#F2F2F2',
dividerLineWidth: 4,
},
+ filter: {
+ panel: {
+ backgroundColor: '#313138',
+ titleColor: '#FFFFFF',
+ },
+ },
aiChat: {
backgroundColor: 'rgba(244, 244, 248, 1)',
primaryTextColor: 'rgba(38, 46, 61, 0.8)',
diff --git a/packages/sdk-ui/src/themes/legacy-design-settings.ts b/packages/sdk-ui/src/themes/legacy-design-settings.ts
index 36a7175f..1002efa4 100644
--- a/packages/sdk-ui/src/themes/legacy-design-settings.ts
+++ b/packages/sdk-ui/src/themes/legacy-design-settings.ts
@@ -123,7 +123,7 @@ export function convertToThemeSettings(
textColor: legacyDesignSettings.dashboards.widgetTextColor,
backgroundColor: legacyDesignSettings.dashboards.widgetBackgroundColor,
secondaryTextColor: legacyDesignSettings.dashboards.widgetSecondaryTextColor,
- panelBackgroundColor: legacyDesignSettings.dashboards.panelBackgroundColor,
+ panelBackgroundColor: legacyDesignSettings.dashboards.widgetBackgroundColor,
animation: {
init: {
duration: 'auto',
@@ -170,6 +170,12 @@ export function convertToThemeSettings(
dividerLineWidth: DEFAULT_DIVIDER_WIDTH,
dividerLineColor: DEFAULT_DIVIDER_COLOR,
},
+ filter: {
+ panel: {
+ titleColor: legacyDesignSettings.dashboards.panelTitleTextColor,
+ backgroundColor: legacyDesignSettings.dashboards.panelBackgroundColor,
+ },
+ },
};
return merge.withOptions({ mergeArrays: false }, getDefaultThemeSettings(), themeSettings);
}
diff --git a/packages/sdk-ui/src/translation/resources/en.ts b/packages/sdk-ui/src/translation/resources/en.ts
index 1d406500..e890890d 100644
--- a/packages/sdk-ui/src/translation/resources/en.ts
+++ b/packages/sdk-ui/src/translation/resources/en.ts
@@ -105,6 +105,16 @@ export const translation = {
forecastValue: 'Forecast Value',
forecast: 'Forecast',
trend: 'Trend',
+ trendLocalValue: 'Local Value',
+ confidenceInterval: 'Confidence Interval',
+ trendType: 'Type',
+ trendDataKey: 'Trend Data',
+ trendData: {
+ min: 'Min',
+ max: 'Max',
+ median: 'Median',
+ average: 'Average',
+ },
},
},
arearange: {
diff --git a/packages/sdk-ui/src/translation/resources/uk.ts b/packages/sdk-ui/src/translation/resources/uk.ts
index e0ac4ac1..373f0694 100644
--- a/packages/sdk-ui/src/translation/resources/uk.ts
+++ b/packages/sdk-ui/src/translation/resources/uk.ts
@@ -106,6 +106,16 @@ export const translation: TranslationDictionary = {
forecastValue: 'Forecast Value',
forecast: 'Forecast',
trend: 'Trend',
+ trendLocalValue: 'Local Value',
+ confidenceInterval: 'Confidence Interval',
+ trendType: 'Type',
+ trendDataKey: 'Trend Data',
+ trendData: {
+ min: 'Min',
+ max: 'Max',
+ median: 'Median',
+ average: 'Average',
+ },
},
},
arearange: {
diff --git a/packages/sdk-ui/src/types.ts b/packages/sdk-ui/src/types.ts
index 1d0a88b9..3bee4909 100644
--- a/packages/sdk-ui/src/types.ts
+++ b/packages/sdk-ui/src/types.ts
@@ -1,3 +1,4 @@
+import { AutoZoomNavigatorScrollerLocation } from './dashboard-widget/types';
/* eslint-disable max-lines */
import type { Attribute, MembersFilter } from '@sisense/sdk-data';
import { DeepRequired } from 'ts-essentials';
@@ -100,6 +101,7 @@ export type Components = {
export type Navigator = {
/** Boolean flag that defines if navigator should be shown on the chart */
enabled: boolean;
+ scrollerLocation?: AutoZoomNavigatorScrollerLocation;
};
/** Configuration that defines line width */
@@ -798,7 +800,11 @@ export interface ChartThemeSettings {
secondaryTextColor?: string;
/** Background color */
backgroundColor?: string;
- /** Toolbar Background color, can be used as a secondary background color */
+ /**
+ * Toolbar Background color, can be used as a secondary background color
+ *
+ * @deprecated
+ * */
panelBackgroundColor?: string;
/** Animation options */
animation?: {
@@ -1081,6 +1087,18 @@ export type DashboardThemeSettings = {
dividerLineColor?: string;
};
+/**
+ * Filter theme settings
+ */
+export type FilterThemeSettings = {
+ panel: {
+ /** Title color */
+ titleColor?: string;
+ /** Background color */
+ backgroundColor?: string;
+ };
+};
+
/** Theme settings defining the look and feel of components. */
export interface ThemeSettings {
/** Chart theme settings */
@@ -1105,6 +1123,9 @@ export interface ThemeSettings {
*/
dashboard?: DashboardThemeSettings;
+ /** Filter theme settings */
+ filter?: FilterThemeSettings;
+
/**
* Theme settings specific to the AI Chatbot component
*/
diff --git a/packages/sdk-ui/src/utils/check-and-notify-about-deprecated-prop.ts b/packages/sdk-ui/src/utils/check-and-notify-about-deprecated-prop.ts
index ac84b2a7..f3dcd6c0 100644
--- a/packages/sdk-ui/src/utils/check-and-notify-about-deprecated-prop.ts
+++ b/packages/sdk-ui/src/utils/check-and-notify-about-deprecated-prop.ts
@@ -1,4 +1,4 @@
-import has from 'lodash/has';
+import has from 'lodash-es/has';
export function checkAndNotifyAboutDeprecatedProp(props: any, deprecatedProps: string[]): void {
for (const deprecatedProp of deprecatedProps) {
diff --git a/packages/sdk-ui/src/utils/combine-handlers.ts b/packages/sdk-ui/src/utils/combine-handlers.ts
index 55dfbe07..0bd1d791 100644
--- a/packages/sdk-ui/src/utils/combine-handlers.ts
+++ b/packages/sdk-ui/src/utils/combine-handlers.ts
@@ -1,6 +1,6 @@
-import isFunction from 'lodash/isFunction';
-import flow from 'lodash/flow';
-import over from 'lodash/over';
+import isFunction from 'lodash-es/isFunction';
+import flow from 'lodash-es/flow';
+import over from 'lodash-es/over';
type AnyFunction = (...args: any[]) => any;
diff --git a/packages/sdk-ui/src/utils/filters-comparator.ts b/packages/sdk-ui/src/utils/filters-comparator.ts
index 342736c5..9065e9b5 100644
--- a/packages/sdk-ui/src/utils/filters-comparator.ts
+++ b/packages/sdk-ui/src/utils/filters-comparator.ts
@@ -6,8 +6,8 @@ import {
FilterRelationsJaqlIdNode,
FilterRelationsJaqlNode,
} from '@sisense/sdk-data';
-import isEqual from 'lodash/isEqual';
-import isEqualWith from 'lodash/isEqualWith';
+import isEqual from 'lodash-es/isEqual';
+import isEqualWith from 'lodash-es/isEqualWith';
/**
* Checks if the filters have changed by deep comparison.
diff --git a/packages/sdk-ui/src/utils/filters.ts b/packages/sdk-ui/src/utils/filters.ts
index 216ece27..917d3c81 100644
--- a/packages/sdk-ui/src/utils/filters.ts
+++ b/packages/sdk-ui/src/utils/filters.ts
@@ -6,7 +6,7 @@ import {
filterFactory,
MembersFilter,
} from '@sisense/sdk-data';
-import { cloneDeep } from 'lodash';
+import cloneDeep from 'lodash-es/cloneDeep.js';
export function isCascadingFilter(filter: Filter): filter is CascadingFilter {
return filter instanceof CascadingFilter;
diff --git a/packages/sdk-ui/src/widgets/chart-widget.test.tsx b/packages/sdk-ui/src/widgets/chart-widget.test.tsx
index 6359f610..7aad56af 100644
--- a/packages/sdk-ui/src/widgets/chart-widget.test.tsx
+++ b/packages/sdk-ui/src/widgets/chart-widget.test.tsx
@@ -1,7 +1,7 @@
/** @vitest-environment jsdom */
import { render } from '@testing-library/react';
import { measureFactory } from '@sisense/sdk-data';
-import cloneDeep from 'lodash/cloneDeep';
+import cloneDeep from 'lodash-es/cloneDeep';
import { mockChartWidgetPropsForTable, mockResolvedQuery } from './__mocks__/mocks';
import { useSisenseContextMock } from '../sisense-context/__mocks__/sisense-context';
import { ClientApplication } from '../app/client-application';
diff --git a/packages/sdk-ui/src/widgets/chart-widget.tsx b/packages/sdk-ui/src/widgets/chart-widget.tsx
index d0f57c58..6e5f6518 100644
--- a/packages/sdk-ui/src/widgets/chart-widget.tsx
+++ b/packages/sdk-ui/src/widgets/chart-widget.tsx
@@ -60,7 +60,6 @@ export const ChartWidget: FunctionComponent = asSisenseCompone
const defaultSize = getWidgetDefaultSize(chartType, {
hasHeader: !styleOptions?.header?.hidden,
});
-
const [refreshCounter, setRefreshCounter] = useState(0);
const isDrilldownEnabled = useMemo(() => {
diff --git a/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/use-theme-for-breadcrumbs.tsx b/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/use-theme-for-breadcrumbs.tsx
index cfb27ad7..482fe1c6 100644
--- a/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/use-theme-for-breadcrumbs.tsx
+++ b/packages/sdk-ui/src/widgets/common/drilldown-breadcrumbs/use-theme-for-breadcrumbs.tsx
@@ -6,14 +6,11 @@ export const useThemeForBreadcrumbs = () => {
themeSettings: {
typography: { primaryTextColor, secondaryTextColor, fontFamily },
general: { backgroundColor, brandColor, primaryButtonTextColor },
- chart: { backgroundColor: chartBackgroundColor, panelBackgroundColor },
+ chart: { backgroundColor: chartBackgroundColor },
},
} = useThemeContext();
- const activeDrillBackgroundColor: string =
- panelBackgroundColor != chartBackgroundColor
- ? panelBackgroundColor
- : darken(panelBackgroundColor, 0.3);
- const activeDrillHoverBackgroundColor = darken(activeDrillBackgroundColor, 0.1);
+ const activeDrillBackgroundColor: string = darken(chartBackgroundColor, 0.02);
+ const activeDrillHoverBackgroundColor = darken(activeDrillBackgroundColor, 0.05);
return {
primaryTextColor,
secondaryTextColor,
diff --git a/packages/sdk-ui/src/widgets/common/drilldown-connector.ts b/packages/sdk-ui/src/widgets/common/drilldown-connector.ts
index 85d0a725..43fb7895 100644
--- a/packages/sdk-ui/src/widgets/common/drilldown-connector.ts
+++ b/packages/sdk-ui/src/widgets/common/drilldown-connector.ts
@@ -18,7 +18,7 @@ import { getSelectableWidgetAttributes } from '@/common-filters/selection-utils'
import { ChartProps, CustomDrilldownResult, ScatterDataPoint, isMeasureColumn } from '../..';
import { PointClickEventObject } from '@sisense/sisense-charts';
import { ScatterCustomPointOptions } from '@/chart-options-processor/translations/scatter-tooltip';
-import camelCase from 'lodash/camelCase';
+import camelCase from 'lodash-es/camelCase';
export function getDrilldownInitialDimension(chartType: ChartType, dataOptions: ChartDataOptions) {
return getSelectableWidgetAttributes(chartType, dataOptions)[0];
diff --git a/packages/sdk-ui/src/widgets/common/widget-container.tsx b/packages/sdk-ui/src/widgets/common/widget-container.tsx
index b720b849..3c700d2d 100644
--- a/packages/sdk-ui/src/widgets/common/widget-container.tsx
+++ b/packages/sdk-ui/src/widgets/common/widget-container.tsx
@@ -3,7 +3,7 @@ import { ThemeProvider, useThemeContext } from '../../theme-provider';
import { WidgetContainerStyleOptions } from '../../types';
import { getShadowValue, WidgetCornerRadius, WidgetSpaceAround } from './widget-style-utils';
import { WidgetHeader } from './widget-header';
-import get from 'lodash/get';
+import get from 'lodash-es/get';
interface WidgetContainerProps {
dataSetName?: string;
diff --git a/packages/sdk-ui/src/widgets/common/widget-header.tsx b/packages/sdk-ui/src/widgets/common/widget-header.tsx
index ad9515d8..712ce9d4 100644
--- a/packages/sdk-ui/src/widgets/common/widget-header.tsx
+++ b/packages/sdk-ui/src/widgets/common/widget-header.tsx
@@ -2,7 +2,7 @@ import Divider from '@mui/material/Divider';
import { useThemeContext } from '../../theme-provider';
import { AlignmentTypes, WidgetContainerStyleOptions } from '../../types';
import WidgetHeaderInfoButton from './widget-header-info-button';
-import get from 'lodash/get';
+import get from 'lodash-es/get';
interface WidgetHeaderProps {
onRefresh: () => void;
diff --git a/packages/sdk-ui/src/widgets/common/widget-style-utils.ts b/packages/sdk-ui/src/widgets/common/widget-style-utils.ts
index 8346170c..79efb19e 100644
--- a/packages/sdk-ui/src/widgets/common/widget-style-utils.ts
+++ b/packages/sdk-ui/src/widgets/common/widget-style-utils.ts
@@ -1,4 +1,4 @@
-import get from 'lodash/get';
+import get from 'lodash-es/get';
import { CompleteThemeSettings, WidgetContainerStyleOptions } from '../../types';
export enum WidgetCornerRadius {
diff --git a/yarn.lock b/yarn.lock
index 6ff30249..b98b1aa7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5513,12 +5513,12 @@ __metadata:
resolution: "@sisense/sdk-cli@workspace:packages/sdk-cli"
dependencies:
"@babel/preset-env": ^7.20.2
- "@sisense/sdk-common": ^1.17.1
- "@sisense/sdk-data": ^1.17.1
- "@sisense/sdk-modeling": ^1.17.1
- "@sisense/sdk-query-client": ^1.17.1
- "@sisense/sdk-rest-client": ^1.17.1
- "@sisense/sdk-tracking": ^1.17.1
+ "@sisense/sdk-common": ^1.18.0
+ "@sisense/sdk-data": ^1.18.0
+ "@sisense/sdk-modeling": ^1.18.0
+ "@sisense/sdk-query-client": ^1.18.0
+ "@sisense/sdk-rest-client": ^1.18.0
+ "@sisense/sdk-tracking": ^1.18.0
"@types/inquirer": 8.2.6
"@types/js-levenshtein": ^1.1.3
"@types/yargs": ^17.0.22
@@ -5536,7 +5536,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@sisense/sdk-common@^1.17.1, @sisense/sdk-common@workspace:packages/sdk-common":
+"@sisense/sdk-common@^1.18.0, @sisense/sdk-common@workspace:packages/sdk-common":
version: 0.0.0-use.local
resolution: "@sisense/sdk-common@workspace:packages/sdk-common"
dependencies:
@@ -5546,39 +5546,38 @@ __metadata:
languageName: unknown
linkType: soft
-"@sisense/sdk-data@^1.17.1, @sisense/sdk-data@workspace:^, @sisense/sdk-data@workspace:packages/sdk-data":
+"@sisense/sdk-data@^1.18.0, @sisense/sdk-data@workspace:^, @sisense/sdk-data@workspace:packages/sdk-data":
version: 0.0.0-use.local
resolution: "@sisense/sdk-data@workspace:packages/sdk-data"
dependencies:
"@babel/preset-env": ^7.20.2
- "@sisense/sdk-common": ^1.17.1
- "@sisense/sdk-rest-client": ^1.17.1
+ "@sisense/sdk-common": ^1.18.0
+ "@sisense/sdk-rest-client": ^1.18.0
"@types/lodash": ^4.14.201
"@types/numeral": 2.0.2
- "@types/object-hash": ^3.0.5
eslint: ^8.40.0
guid-typescript: ^1.0.9
- lodash: ^4.17.21
+ hash-it: ^6.0.0
+ lodash-es: ^4.17.21
numeral: ^2.0.6
- object-hash: ^3.0.0
prettier: 2.8.4
typescript: 4.8.4
languageName: unknown
linkType: soft
-"@sisense/sdk-modeling@^1.17.1, @sisense/sdk-modeling@workspace:packages/sdk-modeling":
+"@sisense/sdk-modeling@^1.18.0, @sisense/sdk-modeling@workspace:packages/sdk-modeling":
version: 0.0.0-use.local
resolution: "@sisense/sdk-modeling@workspace:packages/sdk-modeling"
dependencies:
"@babel/preset-env": ^7.20.2
- "@sisense/sdk-data": ^1.17.1
+ "@sisense/sdk-data": ^1.18.0
eslint: ^8.40.0
prettier: ^3.2.5
typescript: 4.8.4
languageName: unknown
linkType: soft
-"@sisense/sdk-pivot-client@^1.17.1, @sisense/sdk-pivot-client@workspace:packages/sdk-pivot-client":
+"@sisense/sdk-pivot-client@^1.18.0, @sisense/sdk-pivot-client@workspace:packages/sdk-pivot-client":
version: 0.0.0-use.local
resolution: "@sisense/sdk-pivot-client@workspace:packages/sdk-pivot-client"
dependencies:
@@ -5586,9 +5585,9 @@ __metadata:
"@emotion/react": ^11.11.4
"@emotion/styled": ^11.11.5
"@mui/material": ^5.11.6
- "@sisense/sdk-data": ^1.17.1
- "@sisense/sdk-rest-client": ^1.17.1
- "@types/lodash": ^4.14.200
+ "@sisense/sdk-data": ^1.18.0
+ "@sisense/sdk-rest-client": ^1.18.0
+ "@types/lodash-es": ^4.17.12
"@types/react": ^18.3.1
"@types/react-custom-scrollbars": ^4.0.13
"@types/react-dom": ^18.3.0
@@ -5598,7 +5597,7 @@ __metadata:
dom-css: 2.1.0
eslint: ^8.40.0
immer: ^10.0.2
- lodash: ^4.17.21
+ lodash-es: ^4.17.21
prettier: 2.8.4
raf: 3.4.0
rc-tooltip: ^6.2.0
@@ -5622,14 +5621,14 @@ __metadata:
languageName: unknown
linkType: soft
-"@sisense/sdk-query-client@^1.17.1, @sisense/sdk-query-client@workspace:packages/sdk-query-client":
+"@sisense/sdk-query-client@^1.18.0, @sisense/sdk-query-client@workspace:packages/sdk-query-client":
version: 0.0.0-use.local
resolution: "@sisense/sdk-query-client@workspace:packages/sdk-query-client"
dependencies:
- "@sisense/sdk-common": ^1.17.1
- "@sisense/sdk-data": ^1.17.1
- "@sisense/sdk-pivot-client": ^1.17.1
- "@sisense/sdk-rest-client": ^1.17.1
+ "@sisense/sdk-common": ^1.18.0
+ "@sisense/sdk-data": ^1.18.0
+ "@sisense/sdk-pivot-client": ^1.18.0
+ "@sisense/sdk-rest-client": ^1.18.0
"@sisense/task-manager": ^0.1.0
"@types/tar": ^6.1.4
"@types/uuid": ^9.0.0
@@ -5646,12 +5645,12 @@ __metadata:
languageName: unknown
linkType: soft
-"@sisense/sdk-rest-client@^1.17.1, @sisense/sdk-rest-client@workspace:^, @sisense/sdk-rest-client@workspace:packages/sdk-rest-client":
+"@sisense/sdk-rest-client@^1.18.0, @sisense/sdk-rest-client@workspace:^, @sisense/sdk-rest-client@workspace:packages/sdk-rest-client":
version: 0.0.0-use.local
resolution: "@sisense/sdk-rest-client@workspace:packages/sdk-rest-client"
dependencies:
"@babel/preset-env": ^7.20.2
- "@sisense/sdk-common": ^1.17.1
+ "@sisense/sdk-common": ^1.18.0
eslint: ^8.40.0
fetch-intercept: ^2.4.0
prettier: 2.8.4
@@ -5659,7 +5658,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@sisense/sdk-tracking@^1.17.1, @sisense/sdk-tracking@workspace:^, @sisense/sdk-tracking@workspace:packages/sdk-tracking":
+"@sisense/sdk-tracking@^1.18.0, @sisense/sdk-tracking@workspace:^, @sisense/sdk-tracking@workspace:packages/sdk-tracking":
version: 0.0.0-use.local
resolution: "@sisense/sdk-tracking@workspace:packages/sdk-tracking"
dependencies:
@@ -5704,7 +5703,7 @@ __metadata:
dependencies:
"@preact/preset-vite": 2.5.0
"@sisense/sdk-data": "workspace:^"
- "@sisense/sdk-ui": ^1.17.1
+ "@sisense/sdk-ui": ^1.18.0
"@types/node": ^18.16.0
eslint: ^8.40.0
preact: ^10.13.2
@@ -5722,7 +5721,7 @@ __metadata:
dependencies:
"@rushstack/eslint-patch": ^1.2.0
"@sisense/sdk-ui-preact": "workspace:^"
- "@types/lodash": ^4.14.194
+ "@types/lodash-es": ^4.17.12
"@types/node": ^18.14.2
"@vitejs/plugin-vue": ^4.0.0
"@vue/eslint-config-prettier": ^7.1.0
@@ -5731,7 +5730,7 @@ __metadata:
deepmerge: ^4.3.1
eslint: ^8.40.0
eslint-plugin-vue: ^9.9.0
- lodash: ^4.17.21
+ lodash-es: ^4.17.21
npm-run-all: ^4.1.5
prettier: ^2.8.4
typescript: ~4.8.4
@@ -5742,7 +5741,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@sisense/sdk-ui@^1.17.1, @sisense/sdk-ui@workspace:^, @sisense/sdk-ui@workspace:packages/sdk-ui":
+"@sisense/sdk-ui@^1.18.0, @sisense/sdk-ui@workspace:^, @sisense/sdk-ui@workspace:packages/sdk-ui":
version: 0.0.0-use.local
resolution: "@sisense/sdk-ui@workspace:packages/sdk-ui"
dependencies:
@@ -5753,12 +5752,12 @@ __metadata:
"@mui/material": ^5.15.16
"@mui/system": ^5.15.15
"@mui/x-data-grid": ^6.16.0
- "@sisense/sdk-common": ^1.17.1
- "@sisense/sdk-data": ^1.17.1
- "@sisense/sdk-pivot-client": ^1.17.1
- "@sisense/sdk-query-client": ^1.17.1
- "@sisense/sdk-rest-client": ^1.17.1
- "@sisense/sdk-tracking": ^1.17.1
+ "@sisense/sdk-common": ^1.18.0
+ "@sisense/sdk-data": ^1.18.0
+ "@sisense/sdk-pivot-client": ^1.18.0
+ "@sisense/sdk-query-client": ^1.18.0
+ "@sisense/sdk-rest-client": ^1.18.0
+ "@sisense/sdk-tracking": ^1.18.0
"@sisense/sisense-charts": 5.1.1
"@storybook/addon-actions": 7.0.24
"@storybook/addon-docs": 7.0.24
@@ -5798,7 +5797,7 @@ __metadata:
immer: ^10.0.2
jsdom: ^22.1.0
leaflet: ^1.9.4
- lodash: ^4.17.21
+ lodash-es: ^4.17.21
merge-deep: ^3.0.3
msw: 2.2.1
plotly.js: ^2.25.2
@@ -7559,7 +7558,23 @@ __metadata:
languageName: node
linkType: hard
-"@types/lodash@npm:^4.14.167, @types/lodash@npm:^4.14.194, @types/lodash@npm:^4.14.200, @types/lodash@npm:^4.14.201":
+"@types/lodash-es@npm:^4.17.12":
+ version: 4.17.12
+ resolution: "@types/lodash-es@npm:4.17.12"
+ dependencies:
+ "@types/lodash": "*"
+ checksum: 990a99e2243bebe9505cb5ad19fbc172beb4a8e00f9075c99fc06c46c2801ffdb40bc2867271cf580d5f48994fc9fb076ec92cd60a20e621603bf22114e5b077
+ languageName: node
+ linkType: hard
+
+"@types/lodash@npm:*":
+ version: 4.17.7
+ resolution: "@types/lodash@npm:4.17.7"
+ checksum: 09e58a119cd8a70acfb33f8623dc2fc54f74cdce3b3429b879fc2daac4807fe376190a04b9e024dd300f9a3ee1876d6623979cefe619f70654ca0fe0c47679a7
+ languageName: node
+ linkType: hard
+
+"@types/lodash@npm:^4.14.167, @types/lodash@npm:^4.14.194, @types/lodash@npm:^4.14.201":
version: 4.17.1
resolution: "@types/lodash@npm:4.17.1"
checksum: 01984d5b44c09ef45258f8ac6d0cf926900624064722d51a020ba179e5d4a293da0068fb278d87dc695586afe7ebd3362ec57f5c0e7c4f6c1fab9d04a80e77f5
@@ -7684,13 +7699,6 @@ __metadata:
languageName: node
linkType: hard
-"@types/object-hash@npm:^3.0.5":
- version: 3.0.6
- resolution: "@types/object-hash@npm:3.0.6"
- checksum: 2c7979d4e540af817b99c09fb4c2fed1c0b0e14342df474d8dcde4165a82c440b038341fd66fe998d9f86acdd5cccc65ba8092315e39e7c2114f945fa70aaa56
- languageName: node
- linkType: hard
-
"@types/parse-json@npm:^4.0.0":
version: 4.0.2
resolution: "@types/parse-json@npm:4.0.2"
@@ -15072,6 +15080,13 @@ __metadata:
languageName: node
linkType: hard
+"hash-it@npm:^6.0.0":
+ version: 6.0.0
+ resolution: "hash-it@npm:6.0.0"
+ checksum: 10ca948ff7902a752344c3975c1a5c76ba9e4aa0363032f347a7235cce98473dce60fe4399b05979596aedf649adaf5b3f792a55b9b64ad59ae686e43300c2d1
+ languageName: node
+ linkType: hard
+
"hasha@npm:^5.0.0":
version: 5.2.2
resolution: "hasha@npm:5.2.2"