diff --git a/src/fireedge/src/client/components/Alerts/Error.js b/src/fireedge/src/client/components/Alerts/Error.js index e6bed55e63..302196a007 100644 --- a/src/fireedge/src/client/components/Alerts/Error.js +++ b/src/fireedge/src/client/components/Alerts/Error.js @@ -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 }) => ( diff --git a/src/fireedge/src/client/components/Charts/SingleBar.js b/src/fireedge/src/client/components/Charts/SingleBar.js index 7f5c765b58..f901198854 100644 --- a/src/fireedge/src/client/components/Charts/SingleBar.js +++ b/src/fireedge/src/client/components/Charts/SingleBar.js @@ -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))) diff --git a/src/fireedge/src/client/components/DebugLog/ansiHtml.js b/src/fireedge/src/client/components/DebugLog/ansiHtml.js index e6781a8a8a..f8a3dce6d8 100644 --- a/src/fireedge/src/client/components/DebugLog/ansiHtml.js +++ b/src/fireedge/src/client/components/DebugLog/ansiHtml.js @@ -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 diff --git a/src/fireedge/src/client/components/DebugLog/messagelist.js b/src/fireedge/src/client/components/DebugLog/messagelist.js index 791b72af11..7b0e7d72ad 100644 --- a/src/fireedge/src/client/components/DebugLog/messagelist.js +++ b/src/fireedge/src/client/components/DebugLog/messagelist.js @@ -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 diff --git a/src/fireedge/src/client/components/DebugLog/utils.js b/src/fireedge/src/client/components/DebugLog/utils.js index e0ab69a0bf..41f2d4621d 100644 --- a/src/fireedge/src/client/components/DebugLog/utils.js +++ b/src/fireedge/src/client/components/DebugLog/utils.js @@ -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 diff --git a/src/fireedge/src/client/components/Dialogs/DialogRequest.js b/src/fireedge/src/client/components/Dialogs/DialogRequest.js index 33fbc57874..58776bc508 100644 --- a/src/fireedge/src/client/components/Dialogs/DialogRequest.js +++ b/src/fireedge/src/client/components/Dialogs/DialogRequest.js @@ -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) diff --git a/src/fireedge/src/client/components/FormControl/InputCode.js b/src/fireedge/src/client/components/FormControl/InputCode.js index 28c587d33b..5595503477 100644 --- a/src/fireedge/src/client/components/FormControl/InputCode.js +++ b/src/fireedge/src/client/components/FormControl/InputCode.js @@ -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) diff --git a/src/fireedge/src/client/components/FormStepper/MobileStepper.js b/src/fireedge/src/client/components/FormStepper/MobileStepper.js index 5df483d95f..f2565ec72e 100644 --- a/src/fireedge/src/client/components/FormStepper/MobileStepper.js +++ b/src/fireedge/src/client/components/FormStepper/MobileStepper.js @@ -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, diff --git a/src/fireedge/src/client/components/FormStepper/Stepper.js b/src/fireedge/src/client/components/FormStepper/Stepper.js index 19c11af6ec..d4f60381e5 100644 --- a/src/fireedge/src/client/components/FormStepper/Stepper.js +++ b/src/fireedge/src/client/components/FormStepper/Stepper.js @@ -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, diff --git a/src/fireedge/src/client/components/FormStepper/index.js b/src/fireedge/src/client/components/FormStepper/index.js index 94f8a5d3ca..400764ce2c 100644 --- a/src/fireedge/src/client/components/FormStepper/index.js +++ b/src/fireedge/src/client/components/FormStepper/index.js @@ -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 }) => { diff --git a/src/fireedge/src/client/components/Forms/FormWithSchema.js b/src/fireedge/src/client/components/Forms/FormWithSchema.js index 3a42108f14..6c29f18c03 100644 --- a/src/fireedge/src/client/components/Forms/FormWithSchema.js +++ b/src/fireedge/src/client/components/Forms/FormWithSchema.js @@ -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 ? {children} : children -/** - * @param root0 - * @param root0.id - * @param root0.cy - * @param root0.fields - */ const FormWithSchema = ({ id, cy, fields }) => { const { control, errors, ...formContext } = useFormContext() diff --git a/src/fireedge/src/client/components/HOC/ConditionalWrap.js b/src/fireedge/src/client/components/HOC/ConditionalWrap.js index 05bee2dcb5..f80579ebc2 100644 --- a/src/fireedge/src/client/components/HOC/ConditionalWrap.js +++ b/src/fireedge/src/client/components/HOC/ConditionalWrap.js @@ -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 diff --git a/src/fireedge/src/client/components/HOC/InternalLayout/index.js b/src/fireedge/src/client/components/HOC/InternalLayout/index.js index cc5625b769..7c27f410c5 100644 --- a/src/fireedge/src/client/components/HOC/InternalLayout/index.js +++ b/src/fireedge/src/client/components/HOC/InternalLayout/index.js @@ -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() diff --git a/src/fireedge/src/client/components/HOC/Translate.js b/src/fireedge/src/client/components/HOC/Translate.js index 9465d316fe..7afae85045 100644 --- a/src/fireedge/src/client/components/HOC/Translate.js +++ b/src/fireedge/src/client/components/HOC/Translate.js @@ -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 = { diff --git a/src/fireedge/src/client/components/Header/Group.js b/src/fireedge/src/client/components/Header/Group.js index f54467e88c..166682c9a2 100644 --- a/src/fireedge/src/client/components/Header/Group.js +++ b/src/fireedge/src/client/components/Header/Group.js @@ -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() diff --git a/src/fireedge/src/client/components/Header/Popover.js b/src/fireedge/src/client/components/Header/Popover.js index 46a785f933..25d3e1d4ea 100644 --- a/src/fireedge/src/client/components/Header/Popover.js +++ b/src/fireedge/src/client/components/Header/Popover.js @@ -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' diff --git a/src/fireedge/src/client/components/Header/View.js b/src/fireedge/src/client/components/Header/View.js index 6405cbfe59..e5bd1411d9 100644 --- a/src/fireedge/src/client/components/Header/View.js +++ b/src/fireedge/src/client/components/Header/View.js @@ -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) => (