diff --git a/src/fireedge/src/client/apps/provision/index.js b/src/fireedge/src/client/apps/provision/index.js index 818a742f82..53fbc98d74 100644 --- a/src/fireedge/src/client/apps/provision/index.js +++ b/src/fireedge/src/client/apps/provision/index.js @@ -18,6 +18,7 @@ import PropTypes from 'prop-types' import { StaticRouter, BrowserRouter } from 'react-router-dom' import { Provider as ReduxProvider } from 'react-redux' +import { Store } from 'redux' import SocketProvider from 'client/providers/socketProvider' import MuiProvider from 'client/providers/muiProvider' @@ -31,10 +32,11 @@ import { _APPS, APP_URL } from 'client/constants' const APP_NAME = _APPS.provision.name /** - * @param root0 - * @param root0.store - * @param root0.location - * @param root0.context + * @param {object} props - Props + * @param {Store} props.store - Redux store + * @param {string|object} props.location - The URL the server received + * @param {object} props.context - Context object contains the results of the render + * @returns {React.JSXElementConstructor} Provision App */ const Provision = ({ store, location, context }) => ( diff --git a/src/fireedge/src/client/apps/provision/theme.js b/src/fireedge/src/client/apps/provision/theme.js index 31f02d2eb8..2026623d10 100644 --- a/src/fireedge/src/client/apps/provision/theme.js +++ b/src/fireedge/src/client/apps/provision/theme.js @@ -19,7 +19,7 @@ import Color from 'client/constants/color' * @param {string} scheme - Scheme type: 'dark' or 'light' * @returns {object} Provision theme */ -export default (scheme = 'dark') => ({ +const theme = (scheme = 'dark') => ({ palette: { type: scheme, common: { @@ -45,3 +45,5 @@ export default (scheme = 'dark') => ({ ...Color } }) + +export default theme diff --git a/src/fireedge/src/client/apps/sunstone/index.js b/src/fireedge/src/client/apps/sunstone/index.js index 07fc1cdd02..a802be1851 100644 --- a/src/fireedge/src/client/apps/sunstone/index.js +++ b/src/fireedge/src/client/apps/sunstone/index.js @@ -18,6 +18,7 @@ import PropTypes from 'prop-types' import { StaticRouter, BrowserRouter } from 'react-router-dom' import { Provider as ReduxProvider } from 'react-redux' +import { Store } from 'redux' import MuiProvider from 'client/providers/muiProvider' import NotistackProvider from 'client/providers/notistackProvider' @@ -30,10 +31,11 @@ import { _APPS, APP_URL } from 'client/constants' const APP_NAME = _APPS.sunstone.name /** - * @param root0 - * @param root0.store - * @param root0.location - * @param root0.context + * @param {object} props - Props + * @param {Store} props.store - Redux store + * @param {string|object} props.location - The URL the server received + * @param {object} props.context - Context object contains the results of the render + * @returns {React.JSXElementConstructor} Sunstone App */ const Provision = ({ store, location, context }) => ( diff --git a/src/fireedge/src/client/apps/sunstone/routes.js b/src/fireedge/src/client/apps/sunstone/routes.js index 0c9eeea636..fb662fea6f 100644 --- a/src/fireedge/src/client/apps/sunstone/routes.js +++ b/src/fireedge/src/client/apps/sunstone/routes.js @@ -51,6 +51,11 @@ export const ENDPOINTS = [ * @returns {Array} Returns all endpoints available. */ export const getEndpointsByView = (view, endpoints = []) => { + /** + * @param {object} route - Route from view yaml. + * @param {string} [route.path] - Pathname route. + * @returns {boolean | object} If user view yaml contains the route, return it. + */ const hasRoutePermission = route => view?.some(({ resource_name: name }) => route?.path.toLowerCase().endsWith(name.toLowerCase()) diff --git a/src/fireedge/src/client/apps/sunstone/theme.js b/src/fireedge/src/client/apps/sunstone/theme.js index f22c1ecf20..da83dbd69a 100644 --- a/src/fireedge/src/client/apps/sunstone/theme.js +++ b/src/fireedge/src/client/apps/sunstone/theme.js @@ -19,7 +19,7 @@ import Color from 'client/constants/color' * @param {string} scheme - Scheme type: 'dark' or 'light' * @returns {object} Sunstone theme */ -export default (scheme = 'dark') => ({ +const theme = (scheme = 'dark') => ({ palette: { type: scheme, common: { @@ -45,3 +45,5 @@ export default (scheme = 'dark') => ({ ...Color } }) + +export default theme