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/components

This commit is contained in:
Sergio Betanzos 2021-07-12 13:52:18 +02:00
parent 9cc5c1d702
commit a70a018bd7
No known key found for this signature in database
GPG Key ID: E3E704F097737136
114 changed files with 177 additions and 228 deletions

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -20,10 +21,6 @@ import { Box } from '@material-ui/core'
import { Alert } from '@material-ui/lab'
import { Tr } from 'client/components/HOC'
/**
* @param root0
* @param root0.children
*/
const AlertError = ({ children, ...props }) => (
<Box pt={3} display="flex" justifyContent="center" {...props}>
<Alert severity="error" icon={false} variant="filled">

View File

@ -42,10 +42,13 @@ const useStyles = makeStyles(theme => ({
}))
/**
* @param root0
* @param root0.legend
* @param root0.data
* @param root0.total
* Represents a chart bar with legend.
*
* @param {object} props - Props
* @param {{ name: string, color: string }[]} props.legend - Legend
* @param {number[]} props.data - Chart data
* @param {number} props.total - Total value of chart, equals to 100% of bar
* @returns {React.JSXElementConstructor} Chart bar component
*/
const SingleBar = ({ legend, data, total }) => {
const fragments = data.map(data => Math.floor(data * 10 / (total || 1)))

View File

@ -61,8 +61,8 @@ const _closeTags = {
/**
* Converts text with ANSI color codes to HTML markup.
*
* @param {string} text
* @returns {*}
* @param {string} text - Text
* @returns {string} HTML as string
*/
export default function ansiHTML (text) {
// Returns the text if the string has no ANSI escape code.
@ -172,7 +172,7 @@ if (Object.defineProperty) {
ansiHTML.tags.close = _closeTags
}
function _setTags (colors) {
const _setTags = (colors) => {
// reset all
_openTags['0'] = 'font-weight:normal;opacity:1;color:#' + colors.reset[0] + ';background:#' + colors.reset[1]
// inverse

View File

@ -13,17 +13,13 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import Message from 'client/components/DebugLog/message'
import { getMessageInfo } from 'client/components/DebugLog/utils'
/**
* @param root0
* @param root0.log
* @param root0.filters
*/
const MessageList = ({ log = {}, filters = {} }) =>
Object.entries(log)?.map(([command, entries]) => (
// filter by command

View File

@ -52,12 +52,12 @@ export const getMessageInfo = (data = '') => {
/**
* Returns a new log with a new message concatenated.
*
* @param {Array} log - Current log data
* @param {object} log - Current log data
* @param {object} message - New message to concat
* @param {string} message.command - Message's command: create, configure, etc
* @param {string} message.commandId - Message's command id
* @param {string} message.data - Message's information data
* @returns {Array} New log
* @returns {object} New log
*/
export const concatNewMessageToLog = (log, message = {}) => {
if (typeof message !== 'object') return log

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import PropTypes from 'prop-types'
@ -34,13 +35,6 @@ const useStyles = makeStyles(theme => ({
}
}))
/**
* @param root0
* @param root0.withTabs
* @param root0.request
* @param root0.dialogProps
* @param root0.children
*/
const DialogRequest = ({ withTabs, request, dialogProps, children }) => {
const classes = useStyles()
const fetchProps = useFetch(request)

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import { Box } from '@material-ui/core'
import AceEditor from 'react-ace'
@ -20,11 +21,6 @@ import PropTypes from 'prop-types'
import 'ace-builds/src-noconflict/mode-json'
import 'ace-builds/src-noconflict/theme-github'
/**
* @param root0
* @param root0.code
* @param root0.language
*/
const InputCode = ({ code, language, ...props }) => {
const handleChange = newValue => {
console.log('change', newValue)

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -45,17 +46,6 @@ const useStyles = makeStyles(theme => ({
stepper: { background: 'transparent' }
}))
/**
* @param root0
* @param root0.steps
* @param root0.totalSteps
* @param root0.activeStep
* @param root0.lastStep
* @param root0.disabledBack
* @param root0.handleNext
* @param root0.handleBack
* @param root0.errors
*/
const CustomMobileStepper = ({
steps,
totalSteps,

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -57,18 +58,6 @@ const useStyles = makeStyles(theme => ({
error: {}
}))
/**
* @param root0
* @param root0.steps
* @param root0.activeStep
* @param root0.lastStep
* @param root0.disabledBack
* @param root0.handleStep
* @param root0.handleNext
* @param root0.handleBack
* @param root0.errors
* @param root0.isSubmitting
*/
const CustomStepper = ({
steps,
activeStep,

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useState, useMemo, useCallback, useEffect } from 'react'
import PropTypes from 'prop-types'
@ -26,12 +27,6 @@ import { groupBy } from 'client/utils'
const FIRST_STEP = 0
/**
* @param root0
* @param root0.steps
* @param root0.schema
* @param root0.onSubmit
*/
const FormStepper = ({ steps, schema, onSubmit }) => {
const isMobile = useMediaQuery(theme => theme.breakpoints.only('xs'))
const { watch, reset, errors, setError } = useFormContext()
@ -48,9 +43,6 @@ const FormStepper = ({ steps, schema, onSubmit }) => {
reset({ ...formData }, { errors: false })
}, [formData])
/**
* @param step
*/
const validateSchema = step => {
const { id, resolver, optionsValidate } = steps[step]
const stepData = watch(id)
@ -61,10 +53,6 @@ const FormStepper = ({ steps, schema, onSubmit }) => {
.then(() => ({ id, data: stepData }))
}
/**
* @param root0
* @param root0.inner
*/
const setErrors = ({ inner = [], ...rest }) => {
const errorsByPath = groupBy(inner, 'path') ?? {}
const totalErrors = Object.keys(errorsByPath).length
@ -81,9 +69,6 @@ const FormStepper = ({ steps, schema, onSubmit }) => {
)
}
/**
* @param stepToAdvance
*/
const handleStep = stepToAdvance => {
const isBackAction = activeStep > stepToAdvance
@ -105,9 +90,6 @@ const FormStepper = ({ steps, schema, onSubmit }) => {
})
}
/**
*
*/
const handleNext = () => {
validateSchema(activeStep)
.then(({ id, data }) => {

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -32,20 +33,10 @@ const InputController = {
[INPUT_TYPES.AUTOCOMPLETE]: FC.AutocompleteController,
[INPUT_TYPES.FILE]: FC.FileController
}
/**
* @param root0
* @param root0.isHidden
* @param root0.children
*/
const HiddenInput = ({ isHidden, children }) =>
isHidden ? <Box display="none">{children}</Box> : children
/**
* @param root0
* @param root0.id
* @param root0.cy
* @param root0.fields
*/
const FormWithSchema = ({ id, cy, fields }) => {
const { control, errors, ...formContext } = useFormContext()

View File

@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
import { cloneElement } from 'react'
import { cloneElement, Component, ReactElement, JSXElementConstructor } from 'react'
/**
* @param root0
* @param root0.condition
* @param root0.children
* @param root0.wrap
* @param {object} props - Props
* @param {boolean} props.condition - Condition
* @param {JSXElementConstructor} props.children - Children
* @param {Component|ReactElement} props.wrap - Wrapper
* @returns {JSXElementConstructor} Returns children with wrapper component
*/
const ConditionalWrap = ({ condition, children, wrap }) =>
condition ? cloneElement(wrap(children)) : children

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import clsx from 'clsx'
@ -25,10 +26,6 @@ import Header from 'client/components/Header'
import Footer from 'client/components/Footer'
import internalStyles from 'client/components/HOC/InternalLayout/styles'
/**
* @param root0
* @param root0.children
*/
const InternalLayout = ({ children }) => {
const classes = internalStyles()
const container = React.useRef()

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useContext, useState, useEffect, createContext } from 'react'
import PropTypes from 'prop-types'
import root from 'window-or-global'
@ -24,10 +25,6 @@ import { DEFAULT_LANGUAGE, LANGUAGES_URL } from 'client/constants'
const TranslateContext = createContext()
let languageScript = root.document?.createElement('script')
/**
* @param language
* @param setHash
*/
const GenerateScript = (
language = DEFAULT_LANGUAGE,
setHash = () => undefined
@ -36,9 +33,6 @@ const GenerateScript = (
const script = root.document.createElement('script')
script.src = `${LANGUAGES_URL}/${language}.js`
script.async = true
/**
*
*/
script.onload = () => {
setHash(root.locale)
}
@ -49,17 +43,10 @@ const GenerateScript = (
}
}
/**
*
*/
const RemoveScript = () => {
root.document.body.removeChild(languageScript)
}
/**
* @param root0
* @param root0.children
*/
const TranslateProvider = ({ children }) => {
const [hash, setHash] = useState({})
const { settings: { lang } = {} } = useAuth()
@ -69,9 +56,6 @@ const TranslateProvider = ({ children }) => {
return () => { RemoveScript() }
}, [lang])
/**
* @param language
*/
const changeLang = (language = DEFAULT_LANGUAGE) => {
RemoveScript()
GenerateScript(language, setHash)
@ -90,11 +74,7 @@ const TranslateProvider = ({ children }) => {
)
}
/**
* @param str
* @param values
*/
const translate = (str = '', values) => {
const translateString = (str = '', values) => {
const context = useContext(TranslateContext)
let key = str
@ -109,9 +89,6 @@ const translate = (str = '', values) => {
return key
}
/**
* @param str
*/
const Tr = (str = '') => {
let key = str
let values
@ -123,17 +100,12 @@ const Tr = (str = '') => {
const valuesTr = !Array.isArray(values) ? [values] : values
return translate(key, valuesTr)
return translateString(key, valuesTr)
}
/**
* @param root0
* @param root0.word
* @param root0.values
*/
const Translate = ({ word = '', values }) => {
const valuesTr = !Array.isArray(values) ? [values] : values
return translate(word, valuesTr)
return translateString(word, valuesTr)
}
TranslateProvider.propTypes = {

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import { Button } from '@material-ui/core'
@ -27,9 +28,6 @@ import headerStyles from 'client/components/Header/styles'
const { ALL_RESOURCES, PRIMARY_GROUP_RESOURCES } = FILTER_POOL
/**
*
*/
const Group = () => {
const classes = headerStyles()
const { user, groups, filterPool } = useAuth()

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import { Button } from '@material-ui/core'
@ -24,9 +25,6 @@ import Search from 'client/components/Search'
import HeaderPopover from 'client/components/Header/Popover'
import headerStyles from 'client/components/Header/styles'
/**
*
*/
const View = () => {
const classes = headerStyles()
const { view, views = {} } = useAuth()
@ -36,10 +34,6 @@ const View = () => {
newView && newView !== view && changeView(newView)
}
/**
* @param viewName
* @param handleClose
*/
const renderResult = (viewName, handleClose) => (
<Button
key={`view-${viewName}`}

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -36,10 +37,6 @@ import Group from 'client/components/Header/Group'
import Zone from 'client/components/Header/Zone'
import headerStyles from 'client/components/Header/styles'
/**
* @param root0
* @param root0.scrollContainer
*/
const Header = ({ scrollContainer }) => {
const { isOneAdmin } = useAuth()
const { title } = useGeneral()

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React from 'react'
import PropTypes from 'prop-types'
import { CSSTransition, TransitionGroup } from 'react-transition-group'
@ -26,20 +27,6 @@ import { EmptyCard } from 'client/components/Cards'
import FloatingActionButton from 'client/components/Fab'
import listCardsStyles from 'client/components/List/ListCards/styles'
/**
* @param root0
* @param root0.list
* @param root0.keyProp
* @param root0.breakpoints
* @param root0.handleCreate
* @param root0.ButtonCreateComponent
* @param root0.CardComponent
* @param root0.cardsProps
* @param root0.EmptyComponent
* @param root0.displayEmpty
* @param root0.isLoading
* @param root0.gridProps
*/
const ListCards = ({
list,
keyProp,

View File

@ -13,17 +13,13 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useRef, useEffect, useCallback, createRef } from 'react'
import PropTypes from 'prop-types'
import { debounce, LinearProgress } from '@material-ui/core'
import { useList, useNearScreen } from 'client/hooks'
/**
* @param root0
* @param root0.list
* @param root0.renderResult
*/
const ListInfiniteScroll = ({ list, renderResult }) => {
const gridRef = createRef()
const { loading, shortList, finish, reset, setLength } = useList({

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -46,15 +47,6 @@ const useStyles = makeStyles(theme => ({
}
}))
/**
* @param root0
* @param root0.canFetchMore
* @param root0.containerProps
* @param root0.data
* @param root0.isLoading
* @param root0.fetchMore
* @param root0.children
*/
const ListVirtualized = ({
canFetchMore,
containerProps,

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import PropTypes from 'prop-types'
@ -22,10 +23,6 @@ import { Cancel as CloseIcon } from 'iconoir-react'
import { useGeneral, useGeneralApi } from 'client/features/General'
/**
* @param root0
* @param root0.handleClick
*/
const CloseButton = ({ handleClick }) => (
<IconButton onClick={handleClick} component="span">
<CloseIcon size='1em' />
@ -34,25 +31,16 @@ const CloseButton = ({ handleClick }) => (
let displayed = []
/**
*
*/
const Notifier = () => {
const { notifications } = useGeneral()
const { deleteSnackbar } = useGeneralApi()
const { enqueueSnackbar, closeSnackbar } = useSnackbar()
/**
* @param id
*/
const storeDisplayed = id => {
displayed = [...displayed, id]
}
/**
* @param id
*/
const removeDisplayed = id => {
displayed = [...displayed.filter(key => id !== key)]
}

View File

@ -20,8 +20,13 @@ import { Redirect, Route } from 'react-router-dom'
import { useAuth } from 'client/features/Auth'
/**
* @param root0
* @param root0.redirectWhenAuth
* Public route.
*
* @param {object} props - Route props
* @param {React.JSXElementConstructor} props.redirectWhenAuth
* - Route to redirect in case of user is authenticated
* @returns {Redirect|Route}
* - If current user is authenticated, then redirect to private route
*/
const NoAuthRoute = ({ redirectWhenAuth, ...props }) => {
const { isLogged, isLoginInProgress, isLoading } = useAuth()

View File

@ -19,7 +19,11 @@ import { Redirect, Route } from 'react-router-dom'
import { useAuth, useAuthApi } from 'client/features/Auth'
/**
* @param props
* Private route.
*
* @param {object} props - Route props
* @returns {Redirect|Route}
* - If current user isn't authenticated, then redirect to landing page
*/
const ProtectedRoute = props => {
const { isLogged, jwt } = useAuth()

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -20,14 +21,6 @@ import { TextField, Box } from '@material-ui/core'
import { useSearch } from 'client/hooks'
import { ListInfiniteScroll } from 'client/components/List'
/**
* @param root0
* @param root0.list
* @param root0.listOptions
* @param root0.renderResult
* @param root0.startAdornment
* @param root0.searchBoxProps
*/
const Search = ({
list,
listOptions,

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import clsx from 'clsx'
@ -32,12 +33,6 @@ import { useGeneral } from 'client/features/General'
import SidebarLink from 'client/components/Sidebar/SidebarLink'
import sidebarStyles from 'client/components/Sidebar/styles'
/**
* @param root0
* @param root0.label
* @param root0.routes
* @param root0.icon
*/
const SidebarCollapseItem = ({ label, routes, icon: Icon }) => {
const classes = sidebarStyles()
const { isFixMenu } = useGeneral()

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import { useHistory, useLocation } from 'react-router-dom'
@ -31,14 +32,6 @@ import { DevTypography } from 'client/components/Typography'
const STATIC_LABEL_PROPS = { 'data-cy': 'main-menu-item-text' }
/**
* @param root0
* @param root0.label
* @param root0.path
* @param root0.icon
* @param root0.devMode
* @param root0.isSubItem
*/
const SidebarLink = ({ label, path, icon: Icon, devMode, isSubItem }) => {
const classes = sidebarStyles()
const isUpLg = useMediaQuery(theme => theme.breakpoints.up('lg'), { noSsr: true })

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useMemo } from 'react'
import PropTypes from 'prop-types'
@ -33,10 +34,6 @@ import SidebarLink from 'client/components/Sidebar/SidebarLink'
import SidebarCollapseItem from 'client/components/Sidebar/SidebarCollapseItem'
import Logo from 'client/icons/logo'
/**
* @param root0
* @param root0.endpoints
*/
const Sidebar = ({ endpoints }) => {
const classes = sidebarStyles()
const isUpLg = useMediaQuery(theme => theme.breakpoints.up('lg'), { noSsr: true })

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
const getTotalOfResources = resources => [resources?.ID ?? []].flat().length || 0
export default [

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useAuth } from 'client/features/Auth'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import CategoryFilter from 'client/components/Tables/Enhanced/Utils/CategoryFilter'
import * as DatastoreModel from 'client/models/Datastore'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useAuth } from 'client/features/Auth'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,16 +13,18 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import { List, ListSubheader, ListItem, Typography, IconButton } from '@material-ui/core'
import { Cancel } from 'iconoir-react'
import { UseFiltersInstanceProps } from 'react-table'
import { Tr } from 'client/components/HOC'
const CategoryFilter = ({ title, column, accessorOption, multiple }) => {
/** @type {import('react-table').UseFiltersInstanceProps} */
/** @type {UseFiltersInstanceProps} */
const {
setFilter,
id,

View File

@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
/* eslint-disable jsdoc/check-types */
/* eslint-disable jsdoc/valid-types */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
/* eslint-disable jsdoc/check-types */
/* eslint-disable jsdoc/valid-types */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -37,9 +40,11 @@ const GlobalSort = ({ useTableProps }) => {
React.useEffect(() => () => setSortBy([]), [])
/**
* @type {import('react-table').UseSortByInstanceProps &
* import('react-table').TableInstance &
* { state: import('react-table').UseSortByState }}
* @type {
* import('react-table').UseSortByInstanceProps &
* import('react-table').TableInstance &
* { state: import('react-table').UseSortByState }
* }
*/
const { headers, setSortBy, state: { sortBy } } = useTableProps

View File

@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import { Cancel } from 'iconoir-react'
import { List, ListSubheader, IconButton } from '@material-ui/core'
import { TreeView, TreeItem } from '@material-ui/lab'
import { UseFiltersInstanceProps } from 'react-table'
import { Tr } from 'client/components/HOC'
@ -57,7 +59,7 @@ const buildTree = (data = [], separator = '/') => {
}
const LabelFilter = ({ title, column }) => {
/** @type {import('react-table').UseFiltersInstanceProps} */
/** @type {UseFiltersInstanceProps} */
const { setFilter, id, preFilteredRows, filterValue = [] } = column
React.useEffect(() => () => setFilter([]), [])
@ -95,8 +97,6 @@ const LabelFilter = ({ title, column }) => {
</TreeItem>
)
console.log({ filterValue })
return (
<List dense disablePadding>
{title && (

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import { CategoryFilter } from 'client/components/Tables/Enhanced/Utils'
export const createColumns = ({ filters = {}, columns = [] }) => {

View File

@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import clsx from 'clsx'
import { makeStyles, useMediaQuery, Card, CardContent } from '@material-ui/core'
import { UseTableInstanceProps } from 'react-table'
import GlobalFilter from 'client/components/Tables/Enhanced/Utils/GlobalFilter'
@ -49,7 +51,7 @@ const Filters = ({ useTableProps }) => {
const classes = useToolbarStyles()
const isMobile = useMediaQuery(theme => theme.breakpoints.down('sm'))
/** @type {import('react-table').UseTableInstanceProps} */
/** @type {UseTableInstanceProps} */
const { rows, columns } = useTableProps
const filters = React.useMemo(() => (

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
@ -24,7 +25,9 @@ import {
usePagination,
useRowSelect,
useSortBy,
useTable
useTable,
// types
UseRowSelectRowProps
} from 'react-table'
import SplitPane from 'client/components/SplitPane'
@ -156,7 +159,7 @@ const EnhancedTable = ({
{page.map(row => {
prepareRow(row)
/** @type {import('react-table').UseRowSelectRowProps} */
/** @type {UseRowSelectRowProps} */
const { getRowProps, original, values, toggleRowSelected, isSelected } = row
const { key, ...rowProps } = getRowProps()

View File

@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React from 'react'
import PropTypes from 'prop-types'
import { Button } from '@material-ui/core'
import { NavArrowLeft, NavArrowRight } from 'iconoir-react'
import { UsePaginationState } from 'react-table'
import { T } from 'client/constants'
@ -27,7 +29,7 @@ const Pagination = ({
useTableProps,
showPageCount = true
}) => {
/** @type {import('react-table').UsePaginationState} */
/** @type {UsePaginationState} */
const { pageIndex, pageSize } = useTableProps.state
const pageCount = React.useMemo(() => Math.ceil(count / pageSize), [count])

View File

@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import { Row as RowType } from 'react-table'
const Row = ({ row, handleClick }) => {
/** @type {import('react-table').Row} */
/** @type {RowType} */
const { getRowProps, cells, isSelected } = row
const renderCell = React.useCallback(cell => (

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
const getTotalOfResources = resources => [resources?.ID ?? []].flat().length || 0
export default [

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useFetch } from 'client/hooks'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import CategoryFilter from 'client/components/Tables/Enhanced/Utils/CategoryFilter'
import * as HostModel from 'client/models/Host'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import PropTypes from 'prop-types'
import { LinearProgress } from '@material-ui/core'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useAuth } from 'client/features/Auth'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import CategoryFilter from 'client/components/Tables/Enhanced/Utils/CategoryFilter'
import * as ImageModel from 'client/models/Image'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import PropTypes from 'prop-types'
import { LinearProgress } from '@material-ui/core'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useAuth } from 'client/features/Auth'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import CategoryFilter from 'client/components/Tables/Enhanced/Utils/CategoryFilter'
import * as MarketplaceAppModel from 'client/models/MarketplaceApp'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useAuth } from 'client/features/Auth'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import CategoryFilter from 'client/components/Tables/Enhanced/Utils/CategoryFilter'
import * as MarketplaceModel from 'client/models/Datastore'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useAuth } from 'client/features/Auth'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useFetch } from 'client/hooks'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
export default [
{ Header: 'ID', accessor: 'ID', sortType: 'number' },
{ Header: 'Name', accessor: 'NAME' },

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useFetch } from 'client/hooks'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as VirtualNetworkModel from 'client/models/VirtualNetwork'
const getTotalOfResources = resources => [resources?.ID ?? []].flat().length || 0

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useFetch } from 'client/hooks'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
const getTotalOfResources = resources => [resources?.ID ?? []].flat().length || 0
export default [

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useFetch } from 'client/hooks'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import { UseTableInstanceProps } from 'react-table'
const Header = ({ useTableProps }) => {
/** @type {import('react-table').UseTableInstanceProps} */
/** @type {UseTableInstanceProps} */
const { headerGroups } = useTableProps
const renderHeaderColumn = React.useCallback(column => (

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,11 +13,14 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import { makeStyles, Box } from '@material-ui/core'
import clsx from 'clsx'
import { makeStyles, Box } from '@material-ui/core'
import { UseTableInstanceProps, UseTableRowProps } from 'react-table'
import { VirtualItem } from 'react-virtual'
const useStyles = makeStyles(() => ({
root: {
@ -34,15 +37,15 @@ const useStyles = makeStyles(() => ({
}))
const Row = ({ virtualRow, useTableProps }) => {
/** @type {import('react-virtual').VirtualItem} */
/** @type {VirtualItem} */
const { index, measureRef, size, start } = virtualRow
const classes = useStyles({ size, start })
/** @type {import('react-table').UseTableInstanceProps} */
/** @type {UseTableInstanceProps} */
const { rows, prepareRow } = useTableProps
/** @type {import('react-table').UseTableRowProps} */
/** @type {UseTableRowProps} */
const row = rows[index]
prepareRow(row)

View File

@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'
import { makeStyles, Button } from '@material-ui/core'
import { Filter as FilterIcon } from 'iconoir-react'
import { UseGlobalFiltersInstanceProps, UseFiltersState } from 'react-table'
import GlobalFilter from 'client/components/Tables/Enhanced/Utils/GlobalFilter'
@ -38,10 +40,10 @@ const useToolbarStyles = makeStyles(theme => ({
const Toolbar = ({ useTableProps }) => {
const classes = useToolbarStyles()
/** @type {import('react-table').UseGlobalFiltersInstanceProps} */
/** @type {UseGlobalFiltersInstanceProps} */
const { preGlobalFilteredRows, setGlobalFilter, state } = useTableProps
/** @type {import('react-table').UseFiltersState} */
/** @type {UseFiltersState} */
const { globalFilter } = state
return (

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import CategoryFilter from 'client/components/Tables/Enhanced/Utils/CategoryFilter'
import * as Helper from 'client/models/Helper'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import PropTypes from 'prop-types'
import { LinearProgress } from '@material-ui/core'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useFetch } from 'client/hooks'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as Icons from 'iconoir-react'
export default [

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as VirtualMachineModel from 'client/models/VirtualMachine'
export default [

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import { useAuth } from 'client/features/Auth'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import CategoryFilter from 'client/components/Tables/Enhanced/Utils/CategoryFilter'
import * as ZoneModel from 'client/models/Zone'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import React, { useEffect } from 'react'
import { useFetch } from 'client/hooks'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import { makeStyles, Paper, Typography } from '@material-ui/core'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import { Accordion, AccordionSummary, AccordionDetails } from '@material-ui/core'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import { StatusChip } from 'client/components/Status'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
const VmLogTab = data => {

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import * as VirtualMachine from 'client/models/VirtualMachine'

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
/* eslint-disable jsdoc/require-jsdoc */
import * as React from 'react'
import PropTypes from 'prop-types'

Some files were not shown because too many files have changed in this diff Show More