From 0e52785dfc5e99f48718530976083cfbd1507651 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 5 Jul 2021 15:36:23 +0200 Subject: ui: Fix linting errors --- opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js | 1 + .../components/app/sidebars/project/PortfolioListComponent.js | 2 +- .../components/app/sidebars/project/ProjectSidebarComponent.js | 5 +++++ .../src/components/app/sidebars/project/ScenarioListComponent.js | 1 + .../src/components/app/sidebars/topology/NameComponent.js | 6 ++++++ .../components/app/sidebars/topology/TopologySidebarComponent.js | 5 +++++ .../sidebars/topology/building/NewRoomConstructionComponent.js | 8 ++++++++ .../app/sidebars/topology/machine/BackToRackComponent.js | 5 +++++ .../app/sidebars/topology/machine/MachineSidebarComponent.js | 5 +++++ .../components/app/sidebars/topology/machine/UnitComponent.js | 9 +++++++++ .../app/sidebars/topology/machine/UnitListComponent.js | 6 ++++++ .../components/app/sidebars/topology/rack/AddPrefabComponent.js | 5 +++++ .../components/app/sidebars/topology/rack/BackToRoomComponent.js | 5 +++++ .../components/app/sidebars/topology/rack/EmptySlotComponent.js | 6 ++++++ .../components/app/sidebars/topology/rack/MachineComponent.js | 8 ++++++++ .../app/sidebars/topology/rack/MachineListComponent.js | 5 +++++ .../app/sidebars/topology/room/BackToBuildingComponent.js | 5 +++++ .../components/app/sidebars/topology/room/DeleteRoomComponent.js | 5 +++++ .../app/sidebars/topology/room/RackConstructionComponent.js | 8 ++++++++ 19 files changed, 99 insertions(+), 1 deletion(-) (limited to 'opendc-web/opendc-web-ui/src/components/app/sidebars') diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js index ccaa4144..56fa799f 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js @@ -42,6 +42,7 @@ function Sidebar({ isRight, collapsible = true, children }) { Sidebar.propTypes = { isRight: PropTypes.bool.isRequired, collapsible: PropTypes.bool, + children: PropTypes.node, } export default Sidebar diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/project/PortfolioListComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/project/PortfolioListComponent.js index 9dd36d5e..ce271819 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/project/PortfolioListComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/project/PortfolioListComponent.js @@ -37,7 +37,7 @@ function PortfolioListComponent({ {portfolio.name} - + ) +AddPrefabComponent.propTypes = { + onClick: PropTypes.func, +} + export default AddPrefabComponent diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/BackToRoomComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/BackToRoomComponent.js index f6a6f79b..e0eb5979 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/BackToRoomComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/BackToRoomComponent.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types' import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faAngleLeft } from '@fortawesome/free-solid-svg-icons' @@ -10,4 +11,8 @@ const BackToRoomComponent = ({ onClick }) => ( ) +BackToRoomComponent.propTypes = { + onClick: PropTypes.func, +} + export default BackToRoomComponent diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/EmptySlotComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/EmptySlotComponent.js index d6fa9dc9..63b319e0 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/EmptySlotComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/EmptySlotComponent.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types' import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faPlus } from '@fortawesome/free-solid-svg-icons' @@ -15,4 +16,9 @@ const EmptySlotComponent = ({ position, onAdd }) => ( ) +EmptySlotComponent.propTypes = { + position: PropTypes.number, + onAdd: PropTypes.func, +} + export default EmptySlotComponent diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js index 36b15c71..f91202ba 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineComponent.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types' import React from 'react' import Image from 'next/image' import { Machine } from '../../../../../shapes' @@ -15,6 +16,11 @@ const UnitIcon = ({ id, type }) => ( ) +UnitIcon.propTypes = { + id: PropTypes.string, + type: PropTypes.string, +} + const MachineComponent = ({ position, machine, onClick }) => { const hasNoUnits = machine.cpuIds.length + machine.gpuIds.length + machine.memoryIds.length + machine.storageIds.length === 0 @@ -42,6 +48,8 @@ const MachineComponent = ({ position, machine, onClick }) => { MachineComponent.propTypes = { machine: Machine, + position: PropTypes.number, + onClick: PropTypes.func, } export default MachineComponent diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineListComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineListComponent.js index 1c07d237..d0958c28 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineListComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/rack/MachineListComponent.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types' import React from 'react' import EmptySlotContainer from '../../../../../containers/app/sidebars/topology/rack/EmptySlotContainer' import MachineContainer from '../../../../../containers/app/sidebars/topology/rack/MachineContainer' @@ -17,4 +18,8 @@ const MachineListComponent = ({ machineIds }) => { ) } +MachineListComponent.propTypes = { + machineIds: PropTypes.array, +} + export default MachineListComponent diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/BackToBuildingComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/BackToBuildingComponent.js index 696b345b..043cc713 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/BackToBuildingComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/BackToBuildingComponent.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types' import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faAngleLeft } from '@fortawesome/free-solid-svg-icons' @@ -9,4 +10,8 @@ const BackToBuildingComponent = ({ onClick }) => ( ) +BackToBuildingComponent.propTypes = { + onClick: PropTypes.func, +} + export default BackToBuildingComponent diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/DeleteRoomComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/DeleteRoomComponent.js index 242f7a2b..d81bad0f 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/DeleteRoomComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/DeleteRoomComponent.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types' import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faTrash } from '@fortawesome/free-solid-svg-icons' @@ -10,4 +11,8 @@ const DeleteRoomComponent = ({ onClick }) => ( ) +DeleteRoomComponent.propTypes = { + onClick: PropTypes.func, +} + export default DeleteRoomComponent diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RackConstructionComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RackConstructionComponent.js index 19d6b309..0a27910c 100644 --- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RackConstructionComponent.js +++ b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RackConstructionComponent.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types' import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faTimes, faPlus } from '@fortawesome/free-solid-svg-icons' @@ -27,4 +28,11 @@ const RackConstructionComponent = ({ onStart, onStop, inRackConstructionMode, is ) } +RackConstructionComponent.propTypes = { + onStart: PropTypes.func, + onStop: PropTypes.func, + inRackConstructionMode: PropTypes.bool, + isEditingRoom: PropTypes.bool, +} + export default RackConstructionComponent -- cgit v1.2.3