1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

F OpenNebula/one#5422: Add doc to client/apps

This commit is contained in:
Sergio Betanzos 2021-07-08 18:36:19 +02:00
parent fbd33f01b8
commit 03d8da58ed
No known key found for this signature in database
GPG Key ID: E3E704F097737136
5 changed files with 23 additions and 10 deletions

View File

@ -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 }) => (
<ReduxProvider store={store}>

View File

@ -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

View File

@ -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 }) => (
<ReduxProvider store={store}>

View File

@ -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())

View File

@ -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