diff --git a/docma-config.json b/docma-config.json index 855584b94b..848891deb7 100644 --- a/docma-config.json +++ b/docma-config.json @@ -111,6 +111,7 @@ "web/client/components/buttons/GoFullButton.jsx", "web/client/components/mapcontrols/search/SearchBar.jsx", "web/client/components/buttons/ToggleButton.jsx", + "web/client/components/plugins/PluginsContainer.jsx", "web/client/actions/index.jsdoc", "web/client/actions/controls.js", @@ -132,6 +133,7 @@ "plugins": [ "web/client/plugins/index.jsdoc", "web/client/plugins/BackgroundSwitcher.jsx", + "web/client/plugins/DrawerMenu.jsx", "web/client/plugins/GoFull.jsx", "web/client/plugins/Map.jsx", "web/client/plugins/FullScreen.jsx", diff --git a/web/client/components/plugins/PluginsContainer.jsx b/web/client/components/plugins/PluginsContainer.jsx index c4d3a54139..67de15e09f 100644 --- a/web/client/components/plugins/PluginsContainer.jsx +++ b/web/client/components/plugins/PluginsContainer.jsx @@ -12,7 +12,20 @@ const PluginsUtils = require('../../utils/PluginsUtils'); const assign = require('object-assign'); const {get} = require('lodash'); - +/** + * Container for plugins. Get's the plugin definitions (`plugins`) and configuration (`pluginsConfig`) + * to render the configured plugins. + * The plugins to render will come from the `mode` entry of the `pluginsConfig` + * @class + * @memberof components.plugins + * @prop {string} mode key of the pluginsConfig object to get the plugins to render + * @prop {string} defaultMode mode to use if mode is not defined + * @prop {object} params params of the current page, usually from react router. Used as state to get plugins descriptor if monitored state is not present. + * @prop {object} plugins the Plugins definitions + * @prop {object} pluginsConfig the configuration for the plugins. a map of [mode]: [{pluginCfg1}...] + * @prop {object} pluginsState a piece of state to use. usually controls. + * @prop {object} monitoredState the piece of state to monitor Used as state to get plugins descriptor. + */ const PluginsContainer = React.createClass({ propTypes: { mode: React.PropTypes.string, @@ -60,7 +73,7 @@ const PluginsContainer = React.createClass({ }, renderPlugins(plugins) { return plugins - .filter((Plugin) => !Plugin.hide) + .filter((Plugin) => !PluginsUtils.handleExpression(this.props.pluginsState, this.props.plugins && this.props.plugins.requires, Plugin.hide)) .map(this.getPluginDescriptor) .filter((Plugin) => Plugin && !Plugin.impl.loadPlugin) .filter(this.filterPlugins) diff --git a/web/client/components/share/ShareEmbed.jsx b/web/client/components/share/ShareEmbed.jsx index 0df7bc398c..5ee585fb4a 100644 --- a/web/client/components/share/ShareEmbed.jsx +++ b/web/client/components/share/ShareEmbed.jsx @@ -15,10 +15,10 @@ const React = require('react'); const CopyToClipboard = require('react-copy-to-clipboard'); const Message = require('../../components/I18N/Message'); -const {Glyphicon, Col, Grid, Row, Tooltip, Button} = require('react-bootstrap'); +const {Glyphicon, Col, Grid, Row, Tooltip, Button, Checkbox} = require('react-bootstrap'); const OverlayTrigger = require('../misc/OverlayTrigger'); - +const url = require('url'); // css required require('./share.css'); @@ -27,11 +27,11 @@ const ShareEmbed = React.createClass({ shareUrl: React.PropTypes.string }, getInitialState() { - return {copied: false}; + return {copied: false, forceDrawer: false}; }, render() { - const codeEmbedded = ""; + const codeEmbedded = ""; const tooltip = ( {this.state.copied ? : } ); @@ -44,11 +44,16 @@ const ShareEmbed = React.createClass({ ); return (
+ +

+ this.setState({forceDrawer: !this.state.forceDrawer})}> + +