From 44f08b286932d967cca389f3e7f40c8ac15861dc Mon Sep 17 00:00:00 2001 From: Paulo Andre Azevedo Quirino Date: Tue, 1 Oct 2024 09:31:23 +0100 Subject: [PATCH] Fix sonar issues about prop validation --- .../ConfigurationSelector/ConfigurationSelector.jsx | 11 +++++++++++ .../_shared/KeyValueTable/KeyValueEditorDialog.jsx | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/editors/_shared/ConfigurationSelector/ConfigurationSelector.jsx b/src/editors/_shared/ConfigurationSelector/ConfigurationSelector.jsx index 0c06feef..c0b6449a 100644 --- a/src/editors/_shared/ConfigurationSelector/ConfigurationSelector.jsx +++ b/src/editors/_shared/ConfigurationSelector/ConfigurationSelector.jsx @@ -1,4 +1,5 @@ import React, { useState, useRef } from "react"; +import PropTypes from "prop-types"; import { IconButton, InputAdornment, TextField } from "@material-ui/core"; import { SCOPES } from "../../../utils/Constants"; import { SelectScopeModal } from "@mov-ai/mov-fe-lib-react"; @@ -81,4 +82,14 @@ const ConfigurationSelector = props => { ); }; +ConfigurationSelector.propTypes = { + rowProps: { + disabled: PropTypes.bool, + onChange: PropTypes.func, + rowData: PropTypes.shape({ + value: PropTypes.string, + }), + }, +} + export default ConfigurationSelector; diff --git a/src/editors/_shared/KeyValueTable/KeyValueEditorDialog.jsx b/src/editors/_shared/KeyValueTable/KeyValueEditorDialog.jsx index 7c836274..c035ef60 100644 --- a/src/editors/_shared/KeyValueTable/KeyValueEditorDialog.jsx +++ b/src/editors/_shared/KeyValueTable/KeyValueEditorDialog.jsx @@ -282,7 +282,14 @@ KeyValueEditorDialog.propTypes = { renderValueEditor: PropTypes.func, renderCustomContent: PropTypes.func, nameValidation: PropTypes.func, - valueValidation: PropTypes.func + valueValidation: PropTypes.func, + setData: PropTypes.func, + data: PropTypes.shape({ + name: PropTypes.string, + description: PropTypes.string, + value: PropTypes.string, + defaultValue: PropTypes.string, + }), }; //The function returns true when the compared props equal, preventing the component from re-rendering