Skip to content

Commit

Permalink
Fixes for review
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed Apr 5, 2018
1 parent 1df36f7 commit 06ac8f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions web/client/components/widgets/widget/InfoPopover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ const {

const Overlay = require('../../misc/Overlay');
const OverlayTrigger = require('../../misc/OverlayTrigger');

/**
* InfoPopover. A component that renders a icon with a Popover.
* @prop {string} title the title of popover
* @prop {string} text the text of popover
* @prop {string} glyph glyph id for the icon
* @prop {number} left left prop of popover
* @prop {number} right right prop of popover
* @prop {string} placement position of popover
* @prop {boolean|String[]} trigger ['hover', 'focus'] by default. false always show the popover. Array with hover, focus and/or click string to specify events that trigger popover to show.
*/
class InfoPopover extends React.Component {

static propTypes = {
Expand All @@ -28,8 +37,7 @@ class InfoPopover extends React.Component {
placement: PropTypes.string,
left: PropTypes.number,
top: PropTypes.number,
trigger: PropTypes.array,
target: PropTypes.any
trigger: PropTypes.oneOf([PropTypes.array, PropTypes.bool])
};

static defaultProps = {
Expand Down Expand Up @@ -65,10 +73,11 @@ class InfoPopover extends React.Component {
glyph={this.props.glyph} />);
}
render() {
const trigger = this.props.trigger === true ? ['hover', 'focus'] : this.props.trigger;
return (
<span className="mapstore-info-popover">
{this.props.trigger
? (<OverlayTrigger trigger={this.props.trigger} placement={this.props.placement} overlay={this.renderPopover()}>
? (<OverlayTrigger trigger={trigger} placement={this.props.placement} overlay={this.renderPopover()}>
{this.renderContent()}
</OverlayTrigger>)
: [
Expand Down
2 changes: 1 addition & 1 deletion web/client/translations/data.en-US
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@
"clearConnection": "Clear connection"
},
"errors": {
"noWidgetsAvailableTitle": "Das Widget für die ausgewählte Ebene kann nicht erstellt werden",
"noWidgetsAvailableTitle": "Can not create the widget for the selected layer",
"noWidgetsAvailableDescription": "<p><strong>Please try to select another layer or widget type</strong></p><p>The server doesn't provide the needed services for the layer and the widget type selected</p><p>Possible causes are: <ul><li>The selected layer is a raster layer</li><li>WFS service is not available</li><li>The WPS process <code>gs:aggregate</code> is not available</li></ul></p>",
"checkAtLeastOneAttribute": "You must select at least one column"
},
Expand Down

0 comments on commit 06ac8f9

Please sign in to comment.