Skip to content

Commit

Permalink
updating stable branch of genova (#9748)
Browse files Browse the repository at this point in the history
* Fix #9624 Point cloud shading options (#9666)

* Fix #9666 Include pointCloudShading option to saved layer config (#9670)

* #9606 Error with circle annotations + radius selection (#9607) (#9727)

Co-authored-by: Diego Vargas <[email protected]>

* Fix #9295 added better handling of format in csw service (#9712) (#9732)

* #9702: Fix - Background selector in contexts won't retain thumbnail in view mode (#9720) (#9744)

* #9567: handle functionality of zoom to record in table widgets (#9608)

* #9567: handle functionality of zoom to record in table widgets

* Fix: Correct failing test cases for zoom records issue in table widgets (#9567)
This commit addresses the failing test cases related to the issue of zoom records in table widgets.
* #9567: implement the new approach in zoom to records in table widgets + writing unit tests
* #9567: handle adding flag into config file to show/hide zoom icon for tblWidget
* #9567: reset flag enableZoomInTblWidget to be true for dashboard and map viewer
* #9567: resolve comments' review:
- put flag of zoomInTblWidget as a default prop
- add translations
- edit zoomToExtent enhancer to use internal zoom
- remove selector "getFlagOfShowingTblWidgetZoom " and use plugin prop instead

* #9683: add Details Panel for MS dashboard (#9689)

* #9683: add Details Panel for MS dashboard
-  The tool have the same options (eg. show as modal, show at startup etc.)
- The tool is defined in the same way of the corresponding one for maps.
- Edit the layout to put add widget & show/hide connection buttons to the sidebar menu

* #9683: resolve the FE test

Update DashboardEditor.jsx

* #9683: resolve review comments
* description:
- remove all dashboard selectors and pieces of code in generic components like sidebar plugin component that relevant to dashboard.
- add missing test for detailsLoaded action
- create new selectors, details uri selector and details settings se;ector that are used in many places in code
- move AddWidgetDashboard, MapConnedctionDashboard plugins to direct plugins folder
- Put global spinner in details plugin and remove it from sidebar plugin
-  edit in handleSave enhancer file to make update attributes of details just implemented for Map and Dashboard
- Add custom style in details.less as the lib of react-dock doesn't allow to override left css property
- remove unused added style from panels.less

* #9683: remove unused comments in dashboard-test file

* #9683: edit in details epics and selectors to fix FE test

* #9683: Resolve review comments
Description:
- Reolve unused loading property from DashoardEditor file
- Add tooltip for save dashboard
- Remove custom style in BorderLayout and leave it with generic style

* #9683: resolve review comments
Description:
- edit navbar.less files to fix going language selector behind body panel
- remove unused z-index in dashboard.less
# Conflicts:
#	web/client/epics/__tests__/config-test.js
#	web/client/epics/config.js

* #9683: resolve test comment (#9730)

- Adding export, import, delete dashboard
- Reorder shown plugins in sidebar for dashboard

* #9683: add Details Panel for MS dashboard [Editing the detail panel tooltip and title]  (#9740)

* #9683: resolve test comment
Description:
- edit the detail panel tooltip and shown title and make it generic one
- Add translations for the new tooltip

* Update web/client/translations/data.it-IT.json

---------

Co-authored-by: Matteo V <[email protected]>

* #9728 fix misalignement issue (#9731) (#9742)

* Fix #9729 fixed formats in catalog used in dashboard (#9733) (#9747)

---------

Co-authored-by: stefano bovio <[email protected]>
Co-authored-by: Diego Vargas <[email protected]>
Co-authored-by: Suren <[email protected]>
Co-authored-by: mahmoud adel <[email protected]>
  • Loading branch information
5 people authored Nov 27, 2023
1 parent e654fba commit e257122
Show file tree
Hide file tree
Showing 96 changed files with 2,358 additions and 555 deletions.
12 changes: 10 additions & 2 deletions web/client/actions/__tests__/details-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ describe('details actions tests', () => {
const a = closeDetailsPanel();
expect(a.type).toBe(CLOSE_DETAILS_PANEL);
});
it('detailsLoaded', () => {
it('detailsLoaded for map', () => {
const mapId = 1;
const detailsUri = "sada/da/";
const a = detailsLoaded(mapId, detailsUri);
expect(a.type).toBe(DETAILS_LOADED);
expect(a.detailsUri).toBe(detailsUri);
expect(a.mapId).toBe(mapId);
expect(a.id).toBe(mapId);
});
it('detailsLoaded for dashboard', () => {
const dashboardId = 1;
const detailsUri = "sada/da/";
const a = detailsLoaded(dashboardId, detailsUri);
expect(a.type).toBe(DETAILS_LOADED);
expect(a.detailsUri).toBe(detailsUri);
expect(a.id).toBe(dashboardId);
});
it('updateDetails', () => {
const a = updateDetails('text');
Expand Down
2 changes: 2 additions & 0 deletions web/client/actions/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const SAVING_SERVICE = 'CATALOG:SAVING_SERVICE';
export const CATALOG_INITED = 'CATALOG:INIT';
export const GET_METADATA_RECORD_BY_ID = 'CATALOG:GET_METADATA_RECORD_BY_ID';
export const SET_LOADING = 'CATALOG:SET_LOADING';
export const SHOW_FORMAT_ERROR = 'CATALOG:SHOW_FORMAT_ERROR';
export const TOGGLE_TEMPLATE = 'CATALOG:TOGGLE_TEMPLATE';
export const TOGGLE_THUMBNAIL = 'CATALOG:TOGGLE_THUMBNAIL';
export const TOGGLE_ADVANCED_SETTINGS = 'CATALOG:TOGGLE_ADVANCED_SETTINGS';
Expand Down Expand Up @@ -285,6 +286,7 @@ export const toggleThumbnail = () => ({type: TOGGLE_THUMBNAIL});
export const formatOptionsFetch = (url, force) => ({type: FORMAT_OPTIONS_FETCH, url, force});
export const formatsLoading = (loading) => ({type: FORMAT_OPTIONS_LOADING, loading});
export const setSupportedFormats = (formats, url) => ({type: SET_FORMAT_OPTIONS, formats, url});
export const showFormatError = (status) => ({type: SHOW_FORMAT_ERROR, status});

import {error} from './notifications';

Expand Down
8 changes: 4 additions & 4 deletions web/client/actions/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ export const NO_DETAILS_AVAILABLE = "NO_DETAILS_AVAILABLE";
* @memberof actions.details
* @return {action} type `UPDATE_DETAILS`
*/
export const updateDetails = (detailsText) => ({
export const updateDetails = (detailsText, resourceId) => ({
type: UPDATE_DETAILS,
detailsText
detailsText, id: resourceId
});

/**
* detailsLoaded
* @memberof actions.details
* @return {action} type `DETAILS_LOADED`
*/
export const detailsLoaded = (mapId, detailsUri, detailsSettings) => ({
export const detailsLoaded = (resourceId, detailsUri, detailsSettings) => ({
type: DETAILS_LOADED,
mapId,
id: resourceId,
detailsUri,
detailsSettings
});
Expand Down
17 changes: 5 additions & 12 deletions web/client/components/TOC/fragments/settings/Display.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ServerTypes } from '../../../../utils/LayersUtils';
import Select from 'react-select';
import { getSupportedFormat } from '../../../../api/WMS';
import WMSCacheOptions from './WMSCacheOptions';
import ThreeDTilesSettings from './ThreeDTilesSettings';
export default class extends React.Component {
static propTypes = {
opacityText: PropTypes.node,
Expand Down Expand Up @@ -206,18 +207,10 @@ export default class extends React.Component {
</Col>
</Row>

{this.props.element.type === "3dtiles" && <Row>
<Col xs={12}>
<FormGroup>
<ControlLabel><Message msgId="layerProperties.heightOffset"/></ControlLabel>
<IntlNumberFormControl
type="number"
name={"heightOffset"}
value={this.props.element.heightOffset || 0}
onChange={(val)=> this.props.onChange("heightOffset", parseFloat(val))}/>
</FormGroup>
</Col>
</Row>}
<ThreeDTilesSettings
layer={this.props.element}
onChange={this.props.onChange}
/>

{this.props.element.type === "wms" &&
<Row>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/*
* Copyright 2023, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/


import React from 'react';
import PropTypes from 'prop-types';
import { FormGroup, ControlLabel, InputGroup, Checkbox } from 'react-bootstrap';
import DebouncedFormControl from '../../../misc/DebouncedFormControl';
import Message from '../../../I18N/Message';
import InfoPopover from '../../../widgets/widget/InfoPopover';

/**
* PointCloudShadingSettings. This component shows the point cloud shading options available
* @prop {object} layer the layer options
* @prop {object} onChange callback on every on change event
*/
function PointCloudShadingSettings({
layer,
onChange
}) {
if (!(layer?.type === '3dtiles' && layer?.format === 'pnts')) {
return null;
}
const { pointCloudShading = {} } = layer || {};
return (
<>
<div style={{ fontWeight: 'bold', padding: 8 }}><Message msgId="layerProperties.3dTiles.pointCloudShading.title"/></div>
<FormGroup className="form-group-flex">
<Checkbox
checked={!!pointCloudShading.attenuation}
onChange={(event) => onChange('pointCloudShading', {
...pointCloudShading,
attenuation: event?.target?.checked,
maximumAttenuation: pointCloudShading?.maximumAttenuation ?? 4,
eyeDomeLighting: pointCloudShading?.eyeDomeLighting ?? true
})}
>
<Message msgId="layerProperties.3dTiles.pointCloudShading.attenuation" />
{' '}<InfoPopover text={<Message msgId="layerProperties.3dTiles.pointCloudShading.attenuationInfo" />} />
</Checkbox>
</FormGroup>
<FormGroup className="form-group-flex">
<ControlLabel>
<Message msgId="layerProperties.3dTiles.pointCloudShading.maximumAttenuation" />
</ControlLabel>
<InputGroup style={{ maxWidth: 90 }}>
<DebouncedFormControl
disabled={!pointCloudShading.attenuation}
type="number"
value={pointCloudShading.maximumAttenuation !== undefined
? pointCloudShading.maximumAttenuation
: 4}
min={0}
fallbackValue={4}
onChange={(value) => {
onChange('pointCloudShading', {
...pointCloudShading,
maximumAttenuation: value !== undefined ? parseFloat(value) : undefined
});
}}
/>
<InputGroup.Addon>
px
</InputGroup.Addon>
</InputGroup>
</FormGroup>
<FormGroup className="form-group-flex">
<Checkbox
disabled={!pointCloudShading.attenuation}
checked={!!pointCloudShading.eyeDomeLighting}
onChange={(event) => onChange('pointCloudShading', {
...pointCloudShading,
eyeDomeLighting: event?.target?.checked
})}
>
<Message msgId="layerProperties.3dTiles.pointCloudShading.eyeDomeLighting" />
{' '}<InfoPopover text={<Message msgId="layerProperties.3dTiles.pointCloudShading.eyeDomeLightingInfo" />} />
</Checkbox>
</FormGroup>
<FormGroup className="form-group-flex">
<ControlLabel>
<Message msgId="layerProperties.3dTiles.pointCloudShading.eyeDomeLightingStrength" />
</ControlLabel>
<InputGroup style={{ maxWidth: 90 }}>
<DebouncedFormControl
disabled={!pointCloudShading.eyeDomeLighting || !pointCloudShading.attenuation}
type="number"
value={pointCloudShading.eyeDomeLightingStrength !== undefined
? pointCloudShading.eyeDomeLightingStrength
: 1.0}
min={0}
fallbackValue={1.0}
onChange={(value) => onChange('pointCloudShading', {
...pointCloudShading,
eyeDomeLightingStrength: value !== undefined ? parseFloat(value) : undefined
})}
/>
</InputGroup>
</FormGroup>
<FormGroup className="form-group-flex">
<ControlLabel>
<Message msgId="layerProperties.3dTiles.pointCloudShading.eyeDomeLightingRadius" />
</ControlLabel>
<InputGroup style={{ maxWidth: 90 }}>
<DebouncedFormControl
disabled={!pointCloudShading.eyeDomeLighting || !pointCloudShading.attenuation}
type="number"
value={pointCloudShading.eyeDomeLightingRadius !== undefined
? pointCloudShading.eyeDomeLightingRadius
: 1.0}
min={0}
step={1}
fallbackValue={1.0}
onChange={(value) => onChange('pointCloudShading', {
...pointCloudShading,
eyeDomeLightingRadius: value !== undefined ? parseFloat(value) : undefined
})}
/>
</InputGroup>
</FormGroup>
</>
);
}

PointCloudShadingSettings.propTypes = {
layer: PropTypes.object,
onChange: PropTypes.func
};

PointCloudShadingSettings.defaultProps = {
layer: {},
onChange: () => {}
};

export default PointCloudShadingSettings;
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Copyright 2023, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/


import React from 'react';
import PropTypes from 'prop-types';
import { FormGroup, ControlLabel, InputGroup } from 'react-bootstrap';
import DebouncedFormControl from '../../../misc/DebouncedFormControl';
import Message from '../../../I18N/Message';
import PointCloudShadingSettings from './PointCloudShadingSettings';
import Select from 'react-select';

/**
* ThreeDTilesSettings. This component shows the 3d tiles options available
* @prop {object} layer the layer options
* @prop {object} onChange callback on every on change event
*/
function ThreeDTilesSettings({
layer,
onChange
}) {
if (layer?.type !== '3dtiles') {
return null;
}
return (
<div style={{ margin: '0 -8px' }}>
<FormGroup className="form-group-flex">
<ControlLabel><Message msgId="layerProperties.3dTiles.format"/></ControlLabel>
<InputGroup>
<Select
value={layer.format === 'pnts' ? 'pnts' : '3dmodel'}
fallbackValue={0}
clearable={false}
options={[
{
value: '3dmodel',
label: <Message msgId="layerProperties.3dTiles.3dModel"/>
},
{
value: 'pnts',
label: <Message msgId="layerProperties.3dTiles.pointCloud"/>
}
]}
onChange={(option)=> {
onChange('format', option?.value);
}}
/>
</InputGroup>
</FormGroup>
<FormGroup className="form-group-flex">
<ControlLabel><Message msgId="layerProperties.heightOffset"/></ControlLabel>
<InputGroup style={{ maxWidth: 120 }}>
<DebouncedFormControl
type="number"
name={"heightOffset"}
value={layer.heightOffset || 0}
fallbackValue={0}
onChange={(val)=> {
onChange('heightOffset', val !== undefined ? parseFloat(val) : undefined);
}}
/>
<InputGroup.Addon>m</InputGroup.Addon>
</InputGroup>
</FormGroup>
<PointCloudShadingSettings
layer={layer}
onChange={onChange}
/>
</div>
);
}

ThreeDTilesSettings.propTypes = {
layer: PropTypes.object,
onChange: PropTypes.func
};

ThreeDTilesSettings.defaultProps = {
layer: {},
onChange: () => {}
};

export default ThreeDTilesSettings;
Loading

0 comments on commit e257122

Please sign in to comment.