@evergis/react 4.0.107 → 4.0.108

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.
@@ -383,6 +383,7 @@ export interface ConfigDataSourceAttribute {
383
383
  attributeName: string;
384
384
  alias?: string;
385
385
  type?: AttributeType;
386
+ description?: string;
386
387
  stringFormat?: AttributeFormatConfigurationDc;
387
388
  }
388
389
  export interface ConfigDataSource {
package/dist/index.js CHANGED
@@ -7665,17 +7665,17 @@ const useHideIfEmptyDataSource = (type = exports.WidgetType.Dashboard) => {
7665
7665
  };
7666
7666
 
7667
7667
  const useProjectDashboardInit = () => {
7668
+ const { currentPage } = useWidgetPage();
7668
7669
  const { projectInfo, updateProject } = useWidgetContext();
7669
7670
  return React.useCallback(() => {
7670
- if (!lodash.isEmpty(projectInfo?.content?.dashboardConfiguration) || !projectInfo?.content?.items?.length) {
7671
+ if (!projectInfo || !lodash.isEmpty(projectInfo.content?.dashboardConfiguration)) {
7671
7672
  return;
7672
7673
  }
7673
- const { alias, name, content } = projectInfo || {};
7674
- const { items } = content || {};
7674
+ const { alias, name } = projectInfo;
7675
7675
  const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
7676
- newProjectInfo.content.dashboardConfiguration = getDefaultConfig({ title: alias || name, items });
7676
+ newProjectInfo.content.dashboardConfiguration = getDefaultConfig({ title: alias || name, items: currentPage?.layers });
7677
7677
  updateProject(newProjectInfo);
7678
- }, [projectInfo, updateProject]);
7678
+ }, [currentPage?.layers, projectInfo, updateProject]);
7679
7679
  };
7680
7680
 
7681
7681
  const useRelatedDataSourceAttributes = ({ type = exports.WidgetType.Dashboard, elementConfig, dataSources, feature, }) => {
@@ -9357,7 +9357,7 @@ const useLayerGroupMenu = () => {
9357
9357
 
9358
9358
  const LayerGroup = ({ group, onlyMainTools }) => {
9359
9359
  const { projectInfo, updateProject } = useWidgetContext();
9360
- const { pageIndex } = useWidgetPage();
9360
+ const { pageIndex, currentPage } = useWidgetPage();
9361
9361
  const { isMenuOpen, toggleMenu, options, selectOption } = useLayerGroupMenu();
9362
9362
  const onToggleExpand = React.useCallback((name, isExpanded) => {
9363
9363
  if (!projectInfo) {
@@ -9365,18 +9365,18 @@ const LayerGroup = ({ group, onlyMainTools }) => {
9365
9365
  }
9366
9366
  const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
9367
9367
  const page = getPagesFromProjectInfo(newProjectInfo)?.[pageIndex - 1];
9368
- page.layers = findAnd.changeProps(projectInfo.content.items, { name }, { isExpanded });
9368
+ page.layers = findAnd.changeProps(currentPage?.layers, { name }, { isExpanded });
9369
9369
  updateProject(newProjectInfo);
9370
- }, [pageIndex, projectInfo, updateProject]);
9370
+ }, [currentPage?.layers, pageIndex, projectInfo, updateProject]);
9371
9371
  const onToggleVisibility = React.useCallback((name, isVisible) => {
9372
9372
  if (!projectInfo) {
9373
9373
  return;
9374
9374
  }
9375
9375
  const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
9376
9376
  const page = getPagesFromProjectInfo(newProjectInfo)?.[pageIndex - 1];
9377
- page.layers = findAnd.changeProps(projectInfo.content.items, { name }, { isVisible });
9377
+ page.layers = findAnd.changeProps(currentPage?.layers, { name }, { isVisible });
9378
9378
  updateProject(newProjectInfo);
9379
- }, [pageIndex, projectInfo, updateProject]);
9379
+ }, [currentPage?.layers, pageIndex, projectInfo, updateProject]);
9380
9380
  if (!group) {
9381
9381
  return null;
9382
9382
  }
package/dist/react.esm.js CHANGED
@@ -7663,17 +7663,17 @@ const useHideIfEmptyDataSource = (type = WidgetType.Dashboard) => {
7663
7663
  };
7664
7664
 
7665
7665
  const useProjectDashboardInit = () => {
7666
+ const { currentPage } = useWidgetPage();
7666
7667
  const { projectInfo, updateProject } = useWidgetContext();
7667
7668
  return useCallback(() => {
7668
- if (!isEmpty(projectInfo?.content?.dashboardConfiguration) || !projectInfo?.content?.items?.length) {
7669
+ if (!projectInfo || !isEmpty(projectInfo.content?.dashboardConfiguration)) {
7669
7670
  return;
7670
7671
  }
7671
- const { alias, name, content } = projectInfo || {};
7672
- const { items } = content || {};
7672
+ const { alias, name } = projectInfo;
7673
7673
  const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
7674
- newProjectInfo.content.dashboardConfiguration = getDefaultConfig({ title: alias || name, items });
7674
+ newProjectInfo.content.dashboardConfiguration = getDefaultConfig({ title: alias || name, items: currentPage?.layers });
7675
7675
  updateProject(newProjectInfo);
7676
- }, [projectInfo, updateProject]);
7676
+ }, [currentPage?.layers, projectInfo, updateProject]);
7677
7677
  };
7678
7678
 
7679
7679
  const useRelatedDataSourceAttributes = ({ type = WidgetType.Dashboard, elementConfig, dataSources, feature, }) => {
@@ -9355,7 +9355,7 @@ const useLayerGroupMenu = () => {
9355
9355
 
9356
9356
  const LayerGroup = ({ group, onlyMainTools }) => {
9357
9357
  const { projectInfo, updateProject } = useWidgetContext();
9358
- const { pageIndex } = useWidgetPage();
9358
+ const { pageIndex, currentPage } = useWidgetPage();
9359
9359
  const { isMenuOpen, toggleMenu, options, selectOption } = useLayerGroupMenu();
9360
9360
  const onToggleExpand = useCallback((name, isExpanded) => {
9361
9361
  if (!projectInfo) {
@@ -9363,18 +9363,18 @@ const LayerGroup = ({ group, onlyMainTools }) => {
9363
9363
  }
9364
9364
  const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
9365
9365
  const page = getPagesFromProjectInfo(newProjectInfo)?.[pageIndex - 1];
9366
- page.layers = changeProps(projectInfo.content.items, { name }, { isExpanded });
9366
+ page.layers = changeProps(currentPage?.layers, { name }, { isExpanded });
9367
9367
  updateProject(newProjectInfo);
9368
- }, [pageIndex, projectInfo, updateProject]);
9368
+ }, [currentPage?.layers, pageIndex, projectInfo, updateProject]);
9369
9369
  const onToggleVisibility = useCallback((name, isVisible) => {
9370
9370
  if (!projectInfo) {
9371
9371
  return;
9372
9372
  }
9373
9373
  const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
9374
9374
  const page = getPagesFromProjectInfo(newProjectInfo)?.[pageIndex - 1];
9375
- page.layers = changeProps(projectInfo.content.items, { name }, { isVisible });
9375
+ page.layers = changeProps(currentPage?.layers, { name }, { isVisible });
9376
9376
  updateProject(newProjectInfo);
9377
- }, [pageIndex, projectInfo, updateProject]);
9377
+ }, [currentPage?.layers, pageIndex, projectInfo, updateProject]);
9378
9378
  if (!group) {
9379
9379
  return null;
9380
9380
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.107",
2
+ "version": "4.0.108",
3
3
  "name": "@evergis/react",
4
4
  "author": "Everpoint",
5
5
  "license": "MIT",
@@ -89,5 +89,5 @@
89
89
  "uuid": "^13.0.0",
90
90
  "wkt": "^0.1.1"
91
91
  },
92
- "gitHead": "0563bce1f9ce03299ba1feb23a2088c5c8f0ad99"
92
+ "gitHead": "a8b6008350fab6a9dc3a0689587583f90ba0f67c"
93
93
  }