diff --git a/packages/web/src/components/AccountDropdownMenu/index.jsx b/packages/web/src/components/AccountDropdownMenu/index.jsx
index e4889c89..4c69a8be 100644
--- a/packages/web/src/components/AccountDropdownMenu/index.jsx
+++ b/packages/web/src/components/AccountDropdownMenu/index.jsx
@@ -68,7 +68,10 @@ function AccountDropdownMenu(props) {
AccountDropdownMenu.propTypes = {
open: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
- anchorEl: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
+ anchorEl: PropTypes.oneOfType([
+ PropTypes.func,
+ PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
+ ]),
id: PropTypes.string.isRequired,
};
diff --git a/packages/web/src/components/ControlledCustomAutocomplete/CustomOptions.jsx b/packages/web/src/components/ControlledCustomAutocomplete/CustomOptions.jsx
index bf3c3748..3de84a9a 100644
--- a/packages/web/src/components/ControlledCustomAutocomplete/CustomOptions.jsx
+++ b/packages/web/src/components/ControlledCustomAutocomplete/CustomOptions.jsx
@@ -76,7 +76,10 @@ const CustomOptions = (props) => {
CustomOptions.propTypes = {
open: PropTypes.bool.isRequired,
- anchorEl: PropTypes.oneOfType([PropTypes.element, PropTypes.func]).isRequired,
+ anchorEl: PropTypes.oneOfType([
+ PropTypes.func,
+ PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
+ ]),
data: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
diff --git a/packages/web/src/components/ControlledCustomAutocomplete/Options.jsx b/packages/web/src/components/ControlledCustomAutocomplete/Options.jsx
index 2d1cb3c8..c5d1321a 100644
--- a/packages/web/src/components/ControlledCustomAutocomplete/Options.jsx
+++ b/packages/web/src/components/ControlledCustomAutocomplete/Options.jsx
@@ -18,36 +18,47 @@ const computeListHeight = (currentLength) => {
return LIST_ITEM_HEIGHT * numberOfRenderedItems;
};
+const Item = (props) => {
+ const { index, style, data, onOptionClick } = props;
+ const suboption = data[index];
+ return (
+ onOptionClick(event, suboption)}
+ data-test="power-input-suggestion-item"
+ key={index}
+ style={style}
+ >
+
+
+ );
+};
+
+Item.propTypes = {
+ index: PropTypes.number.isRequired,
+ style: PropTypes.object,
+ data: PropTypes.array.isRequired,
+ onOptionClick: PropTypes.func.isRequired,
+};
+
const renderItemFactory =
({ onOptionClick }) =>
(props) => {
- const { index, style, data } = props;
- const suboption = data[index];
- return (
- onOptionClick(event, suboption)}
- data-test="power-input-suggestion-item"
- key={index}
- style={style}
- >
-
-
- );
+ ;
};
const Options = (props) => {
diff --git a/packages/web/src/components/FlowStep/index.jsx b/packages/web/src/components/FlowStep/index.jsx
index 853c24bb..200d0fec 100644
--- a/packages/web/src/components/FlowStep/index.jsx
+++ b/packages/web/src/components/FlowStep/index.jsx
@@ -364,6 +364,7 @@ FlowStep.propTypes = {
onClose: PropTypes.func,
onChange: PropTypes.func.isRequired,
onContinue: PropTypes.func,
+ flowId: PropTypes.string.isRequired,
};
export default FlowStep;
diff --git a/packages/web/src/components/FlowStepContextMenu/index.jsx b/packages/web/src/components/FlowStepContextMenu/index.jsx
index 9fedb469..23a40970 100644
--- a/packages/web/src/components/FlowStepContextMenu/index.jsx
+++ b/packages/web/src/components/FlowStepContextMenu/index.jsx
@@ -43,8 +43,12 @@ function FlowStepContextMenu(props) {
FlowStepContextMenu.propTypes = {
stepId: PropTypes.string.isRequired,
onClose: PropTypes.func.isRequired,
- anchorEl: PropTypes.element.isRequired,
+ anchorEl: PropTypes.oneOfType([
+ PropTypes.func,
+ PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
+ ]),
deletable: PropTypes.bool.isRequired,
+ flowId: PropTypes.string.isRequired,
};
export default FlowStepContextMenu;
diff --git a/packages/web/src/components/Form/index.jsx b/packages/web/src/components/Form/index.jsx
index 061e10d8..68a1b1db 100644
--- a/packages/web/src/components/Form/index.jsx
+++ b/packages/web/src/components/Form/index.jsx
@@ -1,7 +1,10 @@
import * as React from 'react';
import { FormProvider, useForm, useWatch } from 'react-hook-form';
+import PropTypes from 'prop-types';
+
const noop = () => null;
-export default function Form(props) {
+
+function Form(props) {
const {
children,
onSubmit = noop,
@@ -11,22 +14,27 @@ export default function Form(props) {
mode = 'all',
...formProps
} = props;
+
const methods = useForm({
defaultValues,
reValidateMode: 'onBlur',
resolver,
mode,
});
+
const form = useWatch({ control: methods.control });
+
/**
* For fields having `dependsOn` fields, we need to re-validate the form.
*/
React.useEffect(() => {
methods.trigger();
}, [methods.trigger, form]);
+
React.useEffect(() => {
methods.reset(defaultValues);
}, [defaultValues]);
+
return (
);
}
+
+Form.propTypes = {
+ children: PropTypes.node,
+ defaultValues: PropTypes.object,
+ onSubmit: PropTypes.func,
+ render: PropTypes.func,
+ resolver: PropTypes.func,
+ mode: PropTypes.oneOf(['onChange', 'onBlur', 'onSubmit', 'onTouched', 'all']),
+};
+
+export default Form;
diff --git a/packages/web/src/components/HideOnScroll/index.jsx b/packages/web/src/components/HideOnScroll/index.jsx
index b93f91da..4c8a103e 100644
--- a/packages/web/src/components/HideOnScroll/index.jsx
+++ b/packages/web/src/components/HideOnScroll/index.jsx
@@ -1,7 +1,9 @@
import * as React from 'react';
import Slide from '@mui/material/Slide';
import useScrollTrigger from '@mui/material/useScrollTrigger';
+
export default function HideOnScroll(props) {
const trigger = useScrollTrigger();
+
return ;
}
diff --git a/packages/web/src/components/InputCreator/index.jsx b/packages/web/src/components/InputCreator/index.jsx
index 613244cf..cb9a4f0f 100644
--- a/packages/web/src/components/InputCreator/index.jsx
+++ b/packages/web/src/components/InputCreator/index.jsx
@@ -1,6 +1,7 @@
import * as React from 'react';
import MuiTextField from '@mui/material/TextField';
import CircularProgress from '@mui/material/CircularProgress';
+import PropTypes from 'prop-types';
import useDynamicFields from 'hooks/useDynamicFields';
import useDynamicData from 'hooks/useDynamicData';
@@ -9,11 +10,11 @@ import TextField from 'components/TextField';
import ControlledAutocomplete from 'components/ControlledAutocomplete';
import ControlledCustomAutocomplete from 'components/ControlledCustomAutocomplete';
import DynamicField from 'components/DynamicField';
+import { FieldPropType } from 'propTypes/propTypes';
const optionGenerator = (options) =>
options?.map(({ name, value }) => ({ label: name, value: value }));
-
-export default function InputCreator(props) {
+function InputCreator(props) {
const {
onChange,
onBlur,
@@ -131,7 +132,8 @@ export default function InputCreator(props) {
;
}
+
+InputCreator.propTypes = {
+ onChange: PropTypes.func,
+ onBlur: PropTypes.func,
+ schema: FieldPropType.isRequired,
+ namePrefix: PropTypes.string,
+ stepId: PropTypes.string,
+ disabled: PropTypes.bool,
+ showOptionValue: PropTypes.bool,
+ shouldUnregister: PropTypes.bool,
+};
+
+export default InputCreator;
diff --git a/packages/web/src/components/IntermediateStepCount/index.jsx b/packages/web/src/components/IntermediateStepCount/index.jsx
index eae814cb..01e6cfbd 100644
--- a/packages/web/src/components/IntermediateStepCount/index.jsx
+++ b/packages/web/src/components/IntermediateStepCount/index.jsx
@@ -1,8 +1,12 @@
import * as React from 'react';
import Typography from '@mui/material/Typography';
+import PropTypes from 'prop-types';
+
import { Container } from './style';
-export default function IntermediateStepCount(props) {
+
+function IntermediateStepCount(props) {
const { count } = props;
+
return (
@@ -11,3 +15,9 @@ export default function IntermediateStepCount(props) {
);
}
+
+IntermediateStepCount.propTypes = {
+ count: PropTypes.number.isRequired,
+};
+
+export default IntermediateStepCount;
diff --git a/packages/web/src/components/IntlProvider/index.jsx b/packages/web/src/components/IntlProvider/index.jsx
index e3a1a35f..bb33a89a 100644
--- a/packages/web/src/components/IntlProvider/index.jsx
+++ b/packages/web/src/components/IntlProvider/index.jsx
@@ -1,5 +1,8 @@
import { IntlProvider as BaseIntlProvider } from 'react-intl';
+import PropTypes from 'prop-types';
+
import englishMessages from 'locales/en.json';
+
const IntlProvider = ({ children }) => {
return (
{
);
};
+
+IntlProvider.propTypes = {
+ children: PropTypes.node.isRequired,
+};
+
export default IntlProvider;
diff --git a/packages/web/src/components/JSONViewer/index.jsx b/packages/web/src/components/JSONViewer/index.jsx
index bde7a28c..89ed2878 100644
--- a/packages/web/src/components/JSONViewer/index.jsx
+++ b/packages/web/src/components/JSONViewer/index.jsx
@@ -1,5 +1,7 @@
import * as React from 'react';
import { JSONTree } from 'react-json-tree';
+import PropTypes from 'prop-types';
+
const theme = {
scheme: 'inspector',
author: 'Alexander Kuznetsov (alexkuz@gmail.com)',
@@ -36,8 +38,10 @@ const theme = {
// base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g.
base0F: '#a16946',
};
+
function JSONViewer(props) {
const { data } = props;
+
return (
);
}
+
+JSONViewer.propTypes = {
+ data: PropTypes.object.isRequired,
+};
+
export default JSONViewer;
diff --git a/packages/web/src/components/Layout/index.jsx b/packages/web/src/components/Layout/index.jsx
index 8f0532de..c36026d8 100644
--- a/packages/web/src/components/Layout/index.jsx
+++ b/packages/web/src/components/Layout/index.jsx
@@ -9,6 +9,7 @@ import SwapCallsIcon from '@mui/icons-material/SwapCalls';
import HistoryIcon from '@mui/icons-material/History';
import NotificationsIcon from '@mui/icons-material/Notifications';
import ArrowBackIosNew from '@mui/icons-material/ArrowBackIosNew';
+import PropTypes from 'prop-types';
import * as URLS from 'config/urls';
import useFormatMessage from 'hooks/useFormatMessage';
@@ -75,7 +76,7 @@ const generateDrawerBottomLinks = async ({
return links;
};
-export default function PublicLayout({ children }) {
+function PublicLayout({ children }) {
const version = useVersion();
const { data: configData, isLoading } = useAutomatischConfig();
const config = configData?.data;
@@ -135,3 +136,9 @@ export default function PublicLayout({ children }) {
>
);
}
+
+PublicLayout.propTypes = {
+ children: PropTypes.node.isRequired,
+};
+
+export default PublicLayout;
diff --git a/packages/web/src/components/ListItemLink/index.jsx b/packages/web/src/components/ListItemLink/index.jsx
index 0e4e6b6e..9cfd15bc 100644
--- a/packages/web/src/components/ListItemLink/index.jsx
+++ b/packages/web/src/components/ListItemLink/index.jsx
@@ -4,9 +4,12 @@ import ListItem from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import { Link } from 'react-router-dom';
-export default function ListItemLink(props) {
+import PropTypes from 'prop-types';
+
+function ListItemLink(props) {
const { icon, primary, to, onClick, 'data-test': dataTest, target } = props;
const selected = useMatch({ path: to, end: true });
+
const CustomLink = React.useMemo(
() =>
React.forwardRef(function InLineLink(linkProps, ref) {
@@ -28,6 +31,7 @@ export default function ListItemLink(props) {
}),
[to],
);
+
return (
);
}
+
+ListItemLink.propTypes = {
+ icon: PropTypes.node.isRequired,
+ primary: PropTypes.string.isRequired,
+ to: PropTypes.string.isRequired,
+ target: PropTypes.oneOf(['_blank']),
+ onClick: PropTypes.func,
+ 'data-test': PropTypes.string,
+};
+
+export default ListItemLink;
diff --git a/packages/web/src/components/ListLoader/index.jsx b/packages/web/src/components/ListLoader/index.jsx
index ddc64728..2001d22e 100644
--- a/packages/web/src/components/ListLoader/index.jsx
+++ b/packages/web/src/components/ListLoader/index.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import {
IconButton,
Skeleton,
@@ -7,6 +8,7 @@ import {
} from '@mui/material';
import EditIcon from '@mui/icons-material/Edit';
import DeleteIcon from '@mui/icons-material/Delete';
+
const ListLoader = ({ rowsNumber, columnsNumber, 'data-test': dataTest }) => {
return (
<>
@@ -38,4 +40,11 @@ const ListLoader = ({ rowsNumber, columnsNumber, 'data-test': dataTest }) => {
>
);
};
+
+ListLoader.propTypes = {
+ rowsNumber: PropTypes.number.isRequired,
+ columnsNumber: PropTypes.number.isRequired,
+ 'data-test': PropTypes.string,
+};
+
export default ListLoader;
diff --git a/packages/web/src/components/MationLogo/index.jsx b/packages/web/src/components/MationLogo/index.jsx
index 34240749..c83b91a6 100644
--- a/packages/web/src/components/MationLogo/index.jsx
+++ b/packages/web/src/components/MationLogo/index.jsx
@@ -1,6 +1,8 @@
import * as React from 'react';
import { ReactComponent as MationLogoSvg } from './assets/mation-logo.svg';
+
const MationLogo = () => {
return ;
};
+
export default MationLogo;
diff --git a/packages/web/src/components/MetadataProvider/index.jsx b/packages/web/src/components/MetadataProvider/index.jsx
index b6453492..85e47914 100644
--- a/packages/web/src/components/MetadataProvider/index.jsx
+++ b/packages/web/src/components/MetadataProvider/index.jsx
@@ -1,4 +1,5 @@
import * as React from 'react';
+import PropTypes from 'prop-types';
import useAutomatischConfig from 'hooks/useAutomatischConfig';
@@ -27,10 +28,13 @@ const MetadataProvider = ({ children }) => {
newFaviconElement.href = '/browser-tab.ico';
}
}
-
}, [config?.disableFavicon]);
return <>{children}>;
};
+MetadataProvider.propTypes = {
+ children: PropTypes.node.isRequired,
+};
+
export default MetadataProvider;
diff --git a/packages/web/src/components/NoResultFound/index.jsx b/packages/web/src/components/NoResultFound/index.jsx
index c2c47fa1..be634bdc 100644
--- a/packages/web/src/components/NoResultFound/index.jsx
+++ b/packages/web/src/components/NoResultFound/index.jsx
@@ -4,9 +4,11 @@ import Card from '@mui/material/Card';
import AddCircleIcon from '@mui/icons-material/AddCircle';
import CardActionArea from '@mui/material/CardActionArea';
import Typography from '@mui/material/Typography';
+import PropTypes from 'prop-types';
+
import { CardContent } from './style';
-export default function NoResultFound(props) {
+function NoResultFound(props) {
const { text, to } = props;
const ActionAreaLink = React.useMemo(
@@ -29,3 +31,10 @@ export default function NoResultFound(props) {
);
}
+
+NoResultFound.propTypes = {
+ text: PropTypes.string,
+ to: PropTypes.string,
+};
+
+export default NoResultFound;
diff --git a/packages/web/src/components/NotificationCard/index.jsx b/packages/web/src/components/NotificationCard/index.jsx
index 727d80bd..49f5bb6e 100644
--- a/packages/web/src/components/NotificationCard/index.jsx
+++ b/packages/web/src/components/NotificationCard/index.jsx
@@ -5,16 +5,21 @@ import CardActionArea from '@mui/material/CardActionArea';
import CardContent from '@mui/material/CardContent';
import Typography from '@mui/material/Typography';
import { DateTime } from 'luxon';
+import PropTypes from 'prop-types';
+
import useFormatMessage from 'hooks/useFormatMessage';
+
const getHumanlyDate = (timestamp) =>
DateTime.fromMillis(timestamp).toRelative();
-export default function NotificationCard(props) {
+
+function NotificationCard(props) {
const { name, createdAt, documentationUrl, description } = props;
const formatMessage = useFormatMessage();
const relativeCreatedAt = getHumanlyDate(new Date(createdAt).getTime());
const subheader = formatMessage('notification.releasedAt', {
relativeDate: relativeCreatedAt,
});
+
return (
@@ -36,3 +41,12 @@ export default function NotificationCard(props) {
);
}
+
+NotificationCard.propTypes = {
+ name: PropTypes.string.isRequired,
+ createdAt: PropTypes.string.isRequired,
+ documentationUrl: PropTypes.string.isRequired,
+ description: PropTypes.string.isRequired,
+};
+
+export default NotificationCard;
diff --git a/packages/web/src/components/PageTitle/index.jsx b/packages/web/src/components/PageTitle/index.jsx
index ab34a0be..1ddc0895 100644
--- a/packages/web/src/components/PageTitle/index.jsx
+++ b/packages/web/src/components/PageTitle/index.jsx
@@ -1,5 +1,6 @@
import * as React from 'react';
import Typography from '@mui/material/Typography';
+
export default function PageTitle(props) {
return ;
}
diff --git a/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx b/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx
index 1eca4b15..50903dbf 100644
--- a/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx
+++ b/packages/web/src/components/PermissionCatalogField/PermissionCatalogFieldLoader/index.jsx
@@ -11,7 +11,9 @@ import {
Typography,
} from '@mui/material';
import SettingsIcon from '@mui/icons-material/Settings';
+
import ControlledCheckbox from 'components/ControlledCheckbox';
+
const PermissionCatalogFieldLoader = () => {
return (
@@ -56,4 +58,5 @@ const PermissionCatalogFieldLoader = () => {
);
};
+
export default PermissionCatalogFieldLoader;
diff --git a/packages/web/src/components/PermissionCatalogField/PermissionSettings.ee.jsx b/packages/web/src/components/PermissionCatalogField/PermissionSettings.ee.jsx
index 4ff1f43b..14237a20 100644
--- a/packages/web/src/components/PermissionCatalogField/PermissionSettings.ee.jsx
+++ b/packages/web/src/components/PermissionCatalogField/PermissionSettings.ee.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import Button from '@mui/material/Button';
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
@@ -15,7 +16,8 @@ import * as React from 'react';
import { useFormContext } from 'react-hook-form';
import ControlledCheckbox from 'components/ControlledCheckbox';
import useFormatMessage from 'hooks/useFormatMessage';
-export default function PermissionSettings(props) {
+
+function PermissionSettings(props) {
const {
onClose,
open = false,
@@ -27,6 +29,7 @@ export default function PermissionSettings(props) {
} = props;
const formatMessage = useFormatMessage();
const { getValues, resetField } = useFormContext();
+
const cancel = () => {
for (const action of actions) {
for (const condition of conditions) {
@@ -36,6 +39,7 @@ export default function PermissionSettings(props) {
}
onClose();
};
+
const apply = () => {
for (const action of actions) {
for (const condition of conditions) {
@@ -46,6 +50,7 @@ export default function PermissionSettings(props) {
}
onClose();
};
+
return (
);
}
+
+TestSubstep.propTypes = {
+ substep: SubstepPropType.isRequired,
+ expanded: PropTypes.bool,
+ showWebhookUrl: PropTypes.bool,
+ onExpand: PropTypes.func.isRequired,
+ onCollapse: PropTypes.func.isRequired,
+ onChange: PropTypes.func,
+ onSubmit: PropTypes.func,
+ onContinue: PropTypes.func,
+ step: StepPropType.isRequired,
+ flowId: PropTypes.string.isRequired,
+};
+
export default TestSubstep;
diff --git a/packages/web/src/components/TextField/index.jsx b/packages/web/src/components/TextField/index.jsx
index cd62889a..20ec3aeb 100644
--- a/packages/web/src/components/TextField/index.jsx
+++ b/packages/web/src/components/TextField/index.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import * as React from 'react';
import { Controller, useFormContext } from 'react-hook-form';
import MuiTextField from '@mui/material/TextField';
@@ -5,6 +6,7 @@ import IconButton from '@mui/material/IconButton';
import InputAdornment from '@mui/material/InputAdornment';
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
import copyInputValue from 'helpers/copyInputValue';
+
const createCopyAdornment = (ref) => {
return (
@@ -14,7 +16,8 @@ const createCopyAdornment = (ref) => {
);
};
-export default function TextField(props) {
+
+function TextField(props) {
const { control } = useFormContext();
const inputRef = React.useRef(null);
const {
@@ -74,3 +77,18 @@ export default function TextField(props) {
/>
);
}
+
+TextField.propTypes = {
+ required: PropTypes.bool,
+ defaultValue: PropTypes.string,
+ shouldUnregister: PropTypes.bool,
+ name: PropTypes.string.isRequired,
+ clickToCopy: PropTypes.bool,
+ readOnly: PropTypes.bool,
+ 'data-test': PropTypes.string,
+ disabled: PropTypes.bool,
+ onBlur: PropTypes.func,
+ onChange: PropTypes.func,
+};
+
+export default TextField;
diff --git a/packages/web/src/components/ThemeProvider/index.jsx b/packages/web/src/components/ThemeProvider/index.jsx
index ebdb882a..cb9fca12 100644
--- a/packages/web/src/components/ThemeProvider/index.jsx
+++ b/packages/web/src/components/ThemeProvider/index.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import CssBaseline from '@mui/material/CssBaseline';
import { ThemeProvider as BaseThemeProvider } from '@mui/material/styles';
import clone from 'lodash/clone';
@@ -24,6 +25,7 @@ const customizeTheme = (theme, config) => {
return shallowDefaultTheme;
};
+
const ThemeProvider = ({ children, ...props }) => {
const { data: automatischInfo, isPending: isAutomatischInfoPending } =
useAutomatischInfo();
@@ -53,4 +55,8 @@ const ThemeProvider = ({ children, ...props }) => {
);
};
+ThemeProvider.propTypes = {
+ children: PropTypes.node.isRequired,
+};
+
export default ThemeProvider;
diff --git a/packages/web/src/components/TrialStatusBadge/style.ee.jsx b/packages/web/src/components/TrialStatusBadge/style.ee.jsx
index 98f82b2b..d1dfa0a7 100644
--- a/packages/web/src/components/TrialStatusBadge/style.ee.jsx
+++ b/packages/web/src/components/TrialStatusBadge/style.ee.jsx
@@ -1,5 +1,6 @@
import { styled } from '@mui/material/styles';
import MuiChip, { chipClasses } from '@mui/material/Chip';
+
export const Chip = styled(MuiChip)`
&.${chipClasses.root} {
font-weight: 500;
diff --git a/packages/web/src/components/UsageDataInformation/index.ee.jsx b/packages/web/src/components/UsageDataInformation/index.ee.jsx
index 5d0cf661..300c1482 100644
--- a/packages/web/src/components/UsageDataInformation/index.ee.jsx
+++ b/packages/web/src/components/UsageDataInformation/index.ee.jsx
@@ -10,6 +10,7 @@ import CardContent from '@mui/material/CardContent';
import Divider from '@mui/material/Divider';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';
+import PropTypes from 'prop-types';
import TrialOverAlert from 'components/TrialOverAlert/index.ee';
import SubscriptionCancelledAlert from 'components/SubscriptionCancelledAlert/index.ee';
@@ -54,6 +55,13 @@ function BillingCard(props) {
);
}
+BillingCard.propTypes = {
+ name: PropTypes.string.isRequired,
+ title: PropTypes.string,
+ action: PropTypes.string,
+ text: PropTypes.string,
+};
+
function Action(props) {
const { action, text } = props;
@@ -80,6 +88,11 @@ function Action(props) {
);
}
+Action.propTypes = {
+ action: PropTypes.string,
+ text: PropTypes.string,
+};
+
export default function UsageDataInformation() {
const formatMessage = useFormatMessage();
const queryClient = useQueryClient();
diff --git a/packages/web/src/components/UserList/TablePaginationActions/index.jsx b/packages/web/src/components/UserList/TablePaginationActions/index.jsx
index c611d005..96930182 100644
--- a/packages/web/src/components/UserList/TablePaginationActions/index.jsx
+++ b/packages/web/src/components/UserList/TablePaginationActions/index.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import { useTheme } from '@mui/material';
import IconButton from '@mui/material/IconButton';
import FirstPageIcon from '@mui/icons-material/FirstPage';
@@ -5,21 +6,27 @@ import KeyboardArrowLeft from '@mui/icons-material/KeyboardArrowLeft';
import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight';
import LastPageIcon from '@mui/icons-material/LastPage';
import Box from '@mui/material/Box';
-export default function TablePaginationActions(props) {
+
+function TablePaginationActions(props) {
const theme = useTheme();
const { count, page, rowsPerPage, onPageChange } = props;
+
const handleFirstPageButtonClick = (event) => {
onPageChange(event, 0);
};
+
const handleBackButtonClick = (event) => {
onPageChange(event, page - 1);
};
+
const handleNextButtonClick = (event) => {
onPageChange(event, page + 1);
};
+
const handleLastPageButtonClick = (event) => {
onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
};
+
return (
);
}
+
+TablePaginationActions.propTypes = {
+ count: PropTypes.number.isRequired,
+ page: PropTypes.number.isRequired,
+ rowsPerPage: PropTypes.number.isRequired,
+ onPageChange: PropTypes.func.isRequired,
+};
+
+export default TablePaginationActions;
diff --git a/packages/web/src/components/WebhookUrlInfo/index.jsx b/packages/web/src/components/WebhookUrlInfo/index.jsx
index 6cb98b5d..7740c203 100644
--- a/packages/web/src/components/WebhookUrlInfo/index.jsx
+++ b/packages/web/src/components/WebhookUrlInfo/index.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import Typography from '@mui/material/Typography';
@@ -5,6 +6,7 @@ import { generateExternalLink } from '../../helpers/translationValues';
import { WEBHOOK_DOCS } from '../../config/urls';
import TextField from '../TextField';
import { Alert } from './style';
+
function WebhookUrlInfo(props) {
const { webhookUrl, ...alertProps } = props;
return (
@@ -33,4 +35,8 @@ function WebhookUrlInfo(props) {
);
}
+
+WebhookUrlInfo.propTypes = {
+ webhookUrl: PropTypes.string.isRequired,
+};
export default WebhookUrlInfo;
diff --git a/packages/web/src/contexts/Authentication.jsx b/packages/web/src/contexts/Authentication.jsx
index f4bd4a23..611de0b4 100644
--- a/packages/web/src/contexts/Authentication.jsx
+++ b/packages/web/src/contexts/Authentication.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import * as React from 'react';
import { getItem, removeItem, setItem } from 'helpers/storage';
import api from 'helpers/api.js';
@@ -36,3 +37,7 @@ export const AuthenticationProvider = (props) => {
);
};
+
+AuthenticationProvider.propTypes = {
+ children: PropTypes.node.isRequired,
+};
diff --git a/packages/web/src/contexts/Editor.jsx b/packages/web/src/contexts/Editor.jsx
index edc600cb..bb554fb8 100644
--- a/packages/web/src/contexts/Editor.jsx
+++ b/packages/web/src/contexts/Editor.jsx
@@ -1,10 +1,18 @@
import * as React from 'react';
+import PropTypes from 'prop-types';
+
export const EditorContext = React.createContext({
readOnly: false,
});
+
export const EditorProvider = (props) => {
const { children, value } = props;
return (
{children}
);
};
+
+EditorProvider.propTypes = {
+ children: PropTypes.node.isRequired,
+ value: PropTypes.shape({ readOnly: PropTypes.bool.isRequired }).isRequired,
+};
diff --git a/packages/web/src/contexts/Paddle.ee.jsx b/packages/web/src/contexts/Paddle.ee.jsx
index b37b5d13..b4cad62e 100644
--- a/packages/web/src/contexts/Paddle.ee.jsx
+++ b/packages/web/src/contexts/Paddle.ee.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import * as React from 'react';
import { useNavigate } from 'react-router-dom';
@@ -100,3 +101,7 @@ export const PaddleProvider = (props) => {
{children}
);
};
+
+PaddleProvider.propTypes = {
+ children: PropTypes.node.isRequired,
+};
diff --git a/packages/web/src/contexts/StepExecutions.jsx b/packages/web/src/contexts/StepExecutions.jsx
index d8ae1fc2..2664c0ea 100644
--- a/packages/web/src/contexts/StepExecutions.jsx
+++ b/packages/web/src/contexts/StepExecutions.jsx
@@ -1,5 +1,9 @@
import * as React from 'react';
+import PropTypes from 'prop-types';
+import { StepPropType } from 'propTypes/propTypes';
+
export const StepExecutionsContext = React.createContext([]);
+
export const StepExecutionsProvider = (props) => {
const { children, value } = props;
return (
@@ -8,3 +12,8 @@ export const StepExecutionsProvider = (props) => {
);
};
+
+StepExecutionsProvider.propTypes = {
+ children: PropTypes.node.isRequired,
+ value: PropTypes.arrayOf(StepPropType),
+};
diff --git a/packages/web/src/pages/Application/index.jsx b/packages/web/src/pages/Application/index.jsx
index e8c4ec5e..9c6818f9 100644
--- a/packages/web/src/pages/Application/index.jsx
+++ b/packages/web/src/pages/Application/index.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import * as React from 'react';
import {
Link,
@@ -31,6 +32,7 @@ import Container from 'components/Container';
import PageTitle from 'components/PageTitle';
import useApp from 'hooks/useApp';
import Can from 'components/Can';
+import { AppPropType } from 'propTypes/propTypes';
const ReconnectConnection = (props) => {
const { application, onClose } = props;
@@ -45,6 +47,11 @@ const ReconnectConnection = (props) => {
);
};
+ReconnectConnection.propTypes = {
+ application: AppPropType.isRequired,
+ onClose: PropTypes.func.isRequired,
+};
+
export default function Application() {
const theme = useTheme();
const matchSmallScreens = useMediaQuery(theme.breakpoints.down('md'));
diff --git a/packages/web/src/pages/Authentication/RoleMappings.jsx b/packages/web/src/pages/Authentication/RoleMappings.jsx
index 78ee244e..a2605eef 100644
--- a/packages/web/src/pages/Authentication/RoleMappings.jsx
+++ b/packages/web/src/pages/Authentication/RoleMappings.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import { useMutation } from '@apollo/client';
import LoadingButton from '@mui/lab/LoadingButton';
import Divider from '@mui/material/Divider';
@@ -105,4 +106,12 @@ function RoleMappings({ provider, providerLoading }) {
>
);
}
+
+RoleMappings.propTypes = {
+ provider: PropTypes.shape({
+ id: PropTypes.oneOf([PropTypes.number, PropTypes.string]).isRequired,
+ }),
+ providerLoading: PropTypes.bool,
+};
+
export default RoleMappings;
diff --git a/packages/web/src/pages/Authentication/SamlConfiguration.jsx b/packages/web/src/pages/Authentication/SamlConfiguration.jsx
index 30bef0a0..6a99b6bb 100644
--- a/packages/web/src/pages/Authentication/SamlConfiguration.jsx
+++ b/packages/web/src/pages/Authentication/SamlConfiguration.jsx
@@ -1,3 +1,4 @@
+import PropTypes from 'prop-types';
import { useMutation } from '@apollo/client';
import LoadingButton from '@mui/lab/LoadingButton';
import Stack from '@mui/material/Stack';
@@ -192,4 +193,22 @@ function SamlConfiguration({ provider, providerLoading }) {
);
}
+
+SamlConfiguration.propTypes = {
+ provider: PropTypes.shape({
+ active: PropTypes.bool,
+ name: PropTypes.string,
+ certificate: PropTypes.string,
+ signatureAlgorithm: PropTypes.oneOf(['sha1', 'sha256', 'sha512']),
+ issuer: PropTypes.string,
+ entryPoint: PropTypes.string,
+ firstnameAttributeName: PropTypes.string,
+ surnameAttributeName: PropTypes.string,
+ emailAttributeName: PropTypes.string,
+ roleAttributeName: PropTypes.string,
+ defaultRoleId: PropTypes.string,
+ }),
+ providerLoading: PropTypes.bool,
+};
+
export default SamlConfiguration;