Skip to content

Commit

Permalink
Revert "Documented plugin utils (#1621)"
Browse files Browse the repository at this point in the history
This reverts commit 1839f96.
  • Loading branch information
offtherailz authored Mar 22, 2017
1 parent 1839f96 commit a9f81b6
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 102 deletions.
27 changes: 8 additions & 19 deletions docma-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@
"iconClass": "ico-mouse-pointer",
"label": "Reference",
"items": [
{ "label": "Framework", "href": "api/framework"},

{ "label": "Components", "href": "api/components"},
{ "label": "Actions", "href": "api/actions" },
{ "label": "Reducers", "href": "api/reducers" },
{ "label": "Epics", "href": "api/epics" },
{ "separator": true },
{ "label": "Plugins", "href": "api/plugins" }

Expand Down Expand Up @@ -104,24 +106,11 @@
},
"src": [
{
"framework" : [
"web/client/components/index.jsdoc",
"web/client/components/mapcontrols/search/SearchBar.jsx",

"web/client/actions/index.jsdoc",
"web/client/actions/search.js",

"web/client/reducers/index.jsdoc",
"web/client/reducers/search.js",

"web/client/epics/index.jsdoc",
"web/client/epics/search.js",

"web/client/utils/index.jsdoc",
"web/client/utils/PluginsUtils.js"
],
"components" : ["web/client/components/mapcontrols/search/SearchBar.jsx"],
"actions" : ["web/client/actions/search.js"],
"reducers" : ["web/client/reducers/search.js"],
"epics": "web/client/epics/search.js",
"plugins": [
"web/client/plugins/index.jsdoc",
"web/client/plugins/Search.jsx",
"web/client/plugins/BackgroundSwitcher.jsx",
"web/client/plugins/Map.jsx",
Expand Down
1 change: 0 additions & 1 deletion inch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"web/client/plugins/*.jsx",
"web/client/actions/*js",
"web/client/reducers/*js",
"web/client/utils/*.js",
"web/client/epics/*js",
"web/client/jsapi/*js"
]
Expand Down
2 changes: 1 addition & 1 deletion web/client/actions/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ function loadMapInfo(url, mapId) {
}
module.exports = {MAP_CONFIG_LOADED, MAP_CONFIG_LOAD_ERROR,
MAP_INFO_LOAD_START, MAP_INFO_LOADED, MAP_INFO_LOAD_ERROR,
loadMapConfig, loadMapInfo, configureMap, configureError};
loadMapConfig, loadMapInfo, configureMap};
6 changes: 0 additions & 6 deletions web/client/actions/index.jsdoc

This file was deleted.

5 changes: 1 addition & 4 deletions web/client/actions/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

const TEXT_SEARCH_STARTED = 'TEXT_SEARCH_STARTED';
const TEXT_SEARCH_RESULTS_LOADED = 'TEXT_SEARCH_RESULTS_LOADED';
const TEXT_SEARCH_PERFORMED = 'TEXT_SEARCH_PERFORMED';
Expand Down Expand Up @@ -157,10 +158,6 @@ function cancelSelectedItem(item) {
};
}

/**
* Actions for search
* @name actions.search
*/
module.exports = {
TEXT_SEARCH_STARTED,
TEXT_SEARCH_LOADING,
Expand Down
6 changes: 0 additions & 6 deletions web/client/components/index.jsdoc

This file was deleted.

5 changes: 0 additions & 5 deletions web/client/epics/index.jsdoc

This file was deleted.

9 changes: 3 additions & 6 deletions web/client/epics/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const {get} = require('lodash');
* Gets every `TEXT_SEARCH_STARTED` event.
* Dispatches the request to all the services in the action, postprocess them
* and updates every tume the results
* @param {external:Observable} action$ manages `TEXT_SEARCH_STARTED` and `TEXT_SEARCH_RESULTS_PURGE`, `TEXT_SEARCH_RESET`, `TEXT_SEARCH_ITEM_SELECTED` for cancellation
* @param {Observable} action$ manages `TEXT_SEARCH_STARTED` and `TEXT_SEARCH_RESULTS_PURGE`, `TEXT_SEARCH_RESET`, `TEXT_SEARCH_ITEM_SELECTED` for cancellation
* @memberof epics.search
* @return {external:Observable}
* @return {Observable}
*/
const searchEpic = action$ =>
action$.ofType(TEXT_SEARCH_STARTED)
Expand Down Expand Up @@ -130,10 +130,7 @@ const searchItemSelected = action$ =>
}
return Rx.Observable.from(actions);
});
/**
* Actions for search
* @name epics.search
*/

module.exports = {
searchEpic,
searchItemSelected
Expand Down
6 changes: 0 additions & 6 deletions web/client/plugins/index.jsdoc

This file was deleted.

6 changes: 0 additions & 6 deletions web/client/reducers/index.jsdoc

This file was deleted.

39 changes: 2 additions & 37 deletions web/client/utils/PluginsUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* Copyright 2016, GeoSolutions Sas.
* All rights reserved.
*
Expand Down Expand Up @@ -121,29 +121,17 @@ const getReducers = (plugins) => Object.keys(plugins).map((name) => plugins[name
.reduce((previous, current) => assign({}, previous, current), {});
const getEpics = (plugins) => Object.keys(plugins).map((name) => plugins[name].epics)
.reduce((previous, current) => assign({}, previous, current), {});

/**
* Utilities to manage plugins
* @class
* @memberof utils
*/
const PluginsUtils = {
/**
* Produces the reducers from the plugins, combined with other plugins
* @param {array} plugins the plugins
* @param {object} [reducers] other reducers
* @param {array} reducers other plugins
* @returns {function} a reducer made from the plugins' reducers and the reducers passed as 2nd parameter
*/
combineReducers: (plugins, reducers) => {
const pluginsReducers = getReducers(plugins);
return combineReducers(assign({}, reducers, pluginsReducers));
},
/**
* Produces the rootEpic for the plugins, combined with other epics passed as 2nd argument
* @param {array} plugins the plugins
* @param {function[]} [epics] the epics to add to the plugins' ones
* @return {function} the rootEpic, obtained combining plugins' epics and the other epics passed as argument.
*/
combineEpics: (plugins, epics = []) => {
const pluginEpics = getEpics(plugins);
return combineEpics(...[ ...Object.keys(pluginEpics).map(k => pluginEpics[k]), ...epics]);
Expand All @@ -152,29 +140,6 @@ const PluginsUtils = {
filterState,
getPlugins: (plugins) => Object.keys(plugins).map((name) => plugins[name])
.reduce((previous, current) => assign({}, previous, omit(current, 'reducers')), {}),
/**
* provide the pluginDescriptor for a given plugin, with a state and a configuration
* @param {object} state the state. This is required to laod plugins that depend from the state itself
* @param {object} plugins all the plugins, like this:
* ```
* {
* P1Plugin: connectdComponent1,
* P2Plugin: connectdComponent2
* }
* ```
* @param {array} pluginConfig the configurations of the plugins
* @param {object} [loadedPlugins] the plugins loaded with `require.ensure`
* @return {object} a pluginDescriptor like this:
* ```
* {
* id: "P1",
* name: "P1",
* items: // the contained items
* cfg: // the configuration
* impl // the real implementation
* }
* ```
*/
getPluginDescriptor: (state, plugins, pluginsConfig, pluginDef, loadedPlugins = {}) => {
const name = isObject(pluginDef) ? pluginDef.name : pluginDef;
const id = isObject(pluginDef) ? pluginDef.id : null;
Expand Down
5 changes: 0 additions & 5 deletions web/client/utils/index.jsdoc

This file was deleted.

0 comments on commit a9f81b6

Please sign in to comment.