Skip to content

Commit

Permalink
drop PropTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
wduckitt committed May 2, 2024
1 parent fccd071 commit cd1828d
Show file tree
Hide file tree
Showing 27 changed files with 4,115 additions and 2,342 deletions.
1 change: 0 additions & 1 deletion ReactApp/src/components/Administrator/AccessControl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,5 @@ const AccessControl = (props) => {
);
};

AccessControl.propTypes = {};

export default AccessControl;
3 changes: 1 addition & 2 deletions ReactApp/src/components/Administrator/Administrator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const Administrator =(props)=>{
);
}

Administrator.propTypes = {
};


export default Administrator;
3 changes: 0 additions & 3 deletions ReactApp/src/components/Administrator/AllUsers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,4 @@ const AllUsers = (props) => {
);
}

AllUsers.propTypes = {
};

export default AllUsers;
1 change: 0 additions & 1 deletion ReactApp/src/components/AlarmHandler/TextUpdateStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { alpha } from "@mui/material/styles";
import withStyles from "@mui/styles/withStyles";
import Widget from "../SystemComponents/Widgets/Widget";
import { Typography } from "@mui/material";
import PropTypes from "prop-types";
import { grey } from "@mui/material/colors";

const styles = (theme) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { MobileDateTimePicker } from "@mui/x-date-pickers/MobileDateTimePicker";
import Button from "@mui/material/Button";
import Plot from "react-plotly.js";
import Grid from "@mui/material/Grid";
import PropTypes from "prop-types";
import { isMobile } from "react-device-detect";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import TextField from "@mui/material/TextField";
Expand Down
87 changes: 44 additions & 43 deletions ReactApp/src/components/BaseComponents/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { useEffect, useState, useRef } from "react";

import PropTypes from "prop-types";

import { v4 as uuidv4 } from "uuid";

import Widget from "../SystemComponents/Widgets/Widget";

import { FormControlLabel, useTheme } from "@mui/material";
import { styled } from "@mui/material/styles";
import { create, all } from "mathjs";
Expand Down Expand Up @@ -73,7 +68,20 @@ function getTickValues(

return ticks;
}

interface ProgressBarComponentProps {
width: number;
height: number;
units: string;
value: number;
min: number;
max: number;
lockAspectRatio: boolean;
aspectRatio: number;
color: string;
showValue: boolean;
showTicks: boolean;
disabled: boolean;
}
const ProgressBarComponent = (props) => {
const theme = useTheme();
const gradientId = uuidv4();
Expand Down Expand Up @@ -246,11 +254,6 @@ const ProgressBarComponent = (props) => {
);
};

ProgressBarComponent.propTypes = {
height: PropTypes.number,
width: PropTypes.number,
};

const ProgressBarInternalComponent = (props) => {
const theme = useTheme();
const ref = useRef(null);
Expand Down Expand Up @@ -354,37 +357,36 @@ const ProgressBarInternalComponent = (props) => {
/**
* The Progress Bar is an React-Automation-studio component useful fo displaying levels or progress.
*/
const ProgressBar = (
{ debug= false,
alarmSensitive= false,
min= 0,
max= 100,
showValue= true,
showTicks= true,
aspectRatio= 1.75,
lockAspectRatio= true,
labelPlacement= "top",
showTooltip= false,
...props}: ProgressBarProps
) => {
const ProgressBar = ({
debug = false,
alarmSensitive = false,
min = 0,
max = 100,
showValue = true,
showTicks = true,
aspectRatio = 1.75,
lockAspectRatio = true,
labelPlacement = "top",
showTooltip = false,

...props
}: ProgressBarProps) => {
return (

<Widget
{...props}
component={ProgressBarInternalComponent}
debug={debug}
alarmSensitive={alarmSensitive}
min={min}
max={max}
showValue={showValue}
showTicks={showTicks}
aspectRatio={aspectRatio}
lockAspectRatio={lockAspectRatio}
labelPlacement={labelPlacement}
showTooltip={showTooltip}
/>
)
<Widget
{...props}
component={ProgressBarInternalComponent}
debug={debug}
alarmSensitive={alarmSensitive}
min={min}
max={max}
showValue={showValue}
showTicks={showTicks}
aspectRatio={aspectRatio}
lockAspectRatio={lockAspectRatio}
labelPlacement={labelPlacement}
showTooltip={showTooltip}
/>
);
};

interface ProgressBarProps {
Expand Down Expand Up @@ -478,7 +480,7 @@ interface ProgressBarProps {
useMetadata?: boolean;
/** Directive to control location of the label */
labelPlacement?: "top" | "bottom" | "start" | "end";

/**
* Directive to use the pv metadata's HOPR and LOPR fields or the minPv and maxPv values
* to limit the maximum and minimum values
Expand Down Expand Up @@ -528,5 +530,4 @@ interface ProgressBarProps {
tooltipProps?: object;
}


export default ProgressBar;
Loading

0 comments on commit cd1828d

Please sign in to comment.