@evergis/react 4.0.22-alpha.4 → 4.0.23-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.esm.js CHANGED
@@ -9732,7 +9732,7 @@ const useBarChartFilter = ({ type, filter, elementConfig }) => {
9732
9732
  layerInfo: {
9733
9733
  configuration: {
9734
9734
  attributesConfiguration: {
9735
- attributes: dataSource?.attributeDefinition,
9735
+ attributes: dataSource?.attributes,
9736
9736
  },
9737
9737
  },
9738
9738
  },
@@ -10642,11 +10642,18 @@ const useChartData = ({ element, type }) => {
10642
10642
  .map(relatedAxis => {
10643
10643
  const { dataSourceName, axisColor, attributeName, attributeUnits } = relatedAxis;
10644
10644
  const dataSource = configDataSources.find(({ name }) => name === dataSourceName);
10645
- const layerInfo = layerInfos?.find(item => item?.name === dataSource?.layerName);
10646
10645
  const featureDataSource = getDataSource(dataSourceName, dataSources);
10647
- const hasLayerInfo = !!layerInfo ||
10648
- !!featureDataSource?.attributeDefinition ||
10649
- !!featureDataSource?.features?.length;
10646
+ const layerInfo = layerInfos?.find(item => item?.name === dataSource?.layerName) ||
10647
+ (featureDataSource?.attributes
10648
+ ? {
10649
+ configuration: {
10650
+ attributesConfiguration: {
10651
+ attributes: featureDataSource.attributes,
10652
+ },
10653
+ },
10654
+ }
10655
+ : null);
10656
+ const hasLayerInfo = !!layerInfo || !!featureDataSource?.features?.length;
10650
10657
  return {
10651
10658
  items: hasLayerInfo
10652
10659
  ? getDataFromRelatedFeatures({
@@ -10655,14 +10662,7 @@ const useChartData = ({ element, type }) => {
10655
10662
  filters: currentPage?.filters,
10656
10663
  relatedConfig: relatedAxis,
10657
10664
  dataSource: featureDataSource,
10658
- layerInfo: layerInfo ||
10659
- {
10660
- configuration: {
10661
- attributesConfiguration: {
10662
- attributes: featureDataSource.attributeDefinition,
10663
- },
10664
- },
10665
- },
10665
+ layerInfo,
10666
10666
  })
10667
10667
  : null,
10668
10668
  color: axisColor,
@@ -10815,7 +10815,7 @@ const useDataSources = ({ type: widgetType, config, attributes, filters, layerPa
10815
10815
  const json = await response.json();
10816
10816
  return {
10817
10817
  items: json.result.items,
10818
- attributeDefinition: json.result.attributeDefinition,
10818
+ attributes: json.result.attributeDefinition,
10819
10819
  };
10820
10820
  }
10821
10821
  catch (error) {
@@ -10834,10 +10834,7 @@ const useDataSources = ({ type: widgetType, config, attributes, filters, layerPa
10834
10834
  const descriptionResponse = await api.eql.getQueryDescription(getProps);
10835
10835
  return {
10836
10836
  items: queryResponse.features,
10837
- attributeDefinition: descriptionResponse.reduce((acc, curr) => ({
10838
- ...acc,
10839
- [curr.attributeName]: curr,
10840
- }), {}),
10837
+ attributes: descriptionResponse,
10841
10838
  };
10842
10839
  }
10843
10840
  return api.layers.getFeatures(layerName, {
@@ -10915,7 +10912,7 @@ const useDataSources = ({ type: widgetType, config, attributes, filters, layerPa
10915
10912
  (!isQueryDataSource && !isPythonDataSource)
10916
10913
  ? null
10917
10914
  : response.value
10918
- ?.attributeDefinition ||
10915
+ ?.attributes ||
10919
10916
  (isPythonDataSource && items?.[0]?.properties
10920
10917
  ? Object.fromEntries(Object.entries(items[0].properties).map(([key, val]) => [
10921
10918
  key,
@@ -11195,10 +11192,10 @@ const useRelatedDataSourceAttributes = ({ type = WidgetType.Dashboard, elementCo
11195
11192
  {
11196
11193
  configuration: {
11197
11194
  attributesConfiguration: {
11198
- attributes: dataSource?.attributeDefinition || {},
11195
+ attributes: dataSource?.attributes || {},
11199
11196
  },
11200
11197
  },
11201
- }, [currentPage?.dataSources, dataSource?.attributeDefinition, layerInfos, relatedDataSource]);
11198
+ }, [currentPage?.dataSources, dataSource?.attributes, layerInfos, relatedDataSource]);
11202
11199
  const attributes = useMemo(() => getFeatureAttributes(feature, layerInfo, dataSource), [dataSource, feature, layerInfo]);
11203
11200
  return { layerInfo, attributes, dataSource };
11204
11201
  };