Skip to content

Commit

Permalink
fix: reslove sonar qube issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Jan 24, 2025
1 parent f00d33a commit 81fb541
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 23 deletions.
13 changes: 13 additions & 0 deletions admin-ui/app/routes/Apps/Gluu/GluuAutoCompleteWithAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GluuLabel from '../Gluu/GluuLabel'
import GluuTooltip from './GluuTooltip'
import { useTranslation } from 'react-i18next'
import { ThemeContext } from 'Context/theme/themeContext'
import PropTypes from "prop-types";

function GluuAutoCompleteWithAdd({
label,
Expand Down Expand Up @@ -89,4 +90,16 @@ function GluuAutoCompleteWithAdd({
)
}

GluuAutoCompleteWithAdd.propTypes = {
label: PropTypes.string,
name: PropTypes.string,
value: PropTypes.array,
options: PropTypes.array,
validator: PropTypes.func,
inputId: PropTypes.string,
formik: PropTypes.object,
placeholder: PropTypes.string,
doc_category: PropTypes.string,
handler: PropTypes.func
}
export default GluuAutoCompleteWithAdd
2 changes: 1 addition & 1 deletion admin-ui/app/routes/Apps/Gluu/GluuCommitDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const GluuCommitDialog = ({
<Col sm={12}>
<Input
id={USER_MESSAGE}
type={inputType ? inputType : "textarea"}
type={inputType || "textarea"}
name={USER_MESSAGE}
onChange={(e) => setUserMessage(e.target.value)}
placeholder={
Expand Down
17 changes: 17 additions & 0 deletions admin-ui/app/routes/Apps/Gluu/GluuTypeAheadWithAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GluuLabel from "../Gluu/GluuLabel";
import applicationStyle from "./styles/applicationstyle";
import { useTranslation } from "react-i18next";
import { ThemeContext } from "Context/theme/themeContext";
import PropTypes from "prop-types";

function GluuTypeAheadWithAdd({
label,
Expand Down Expand Up @@ -114,4 +115,20 @@ function GluuTypeAheadWithAdd({
</FormGroup>
);
}

GluuTypeAheadWithAdd.protoTypes ={
label: PropTypes.string,
name: PropTypes.string,
value: PropTypes.array,
placeholder: PropTypes.string,
options: PropTypes.array,
formik: PropTypes.object,
validator: PropTypes.func,
inputId: PropTypes.string,
doc_category: PropTypes.string,
lsize: PropTypes.number,
rsize: PropTypes.number,
disabled: PropTypes.bool,
handler: PropTypes.func,
}
export default GluuTypeAheadWithAdd;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { DateTimePicker, LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import dayjs from "dayjs";
import PropTypes from "prop-types";
import { set } from "lodash";
const DOC_CATEGORY = "openid_client";

function ClientAdvancedPanel({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ const ClientBasicPanel = ({
const scopeOptions = client?.scopes?.length ? clientScopeOptions : scopes;
const { t } = useTranslation();

const tokenEndpointAuthMethod =
!!oidcConfiguration?.tokenEndpointAuthMethodsSupported
? oidcConfiguration.tokenEndpointAuthMethodsSupported
: [];
const tokenEndpointAuthMethod = oidcConfiguration?.tokenEndpointAuthMethodsSupported || [];

const [showClientSecret, setShowClientSecret] = useState(false);
const [userScopeAction] = useState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,7 @@ ClientCibaParUmaPanel.propTypes = {
setCurrentStep: PropTypes.any,
sequence: PropTypes.any,
umaResources: PropTypes.any,
dispatch: PropTypes.func,
modifiedFields: PropTypes.any,
setModifiedFields: PropTypes.func,
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,52 @@ function ClientEncryptionSigningPanel({
}) {
const { t } = useTranslation();
const accessTokenSigningAlg =
!!oidcConfiguration.tokenEndpointAuthSigningAlgValuesSupported
oidcConfiguration.tokenEndpointAuthSigningAlgValuesSupported
? oidcConfiguration.tokenEndpointAuthSigningAlgValuesSupported
: [];
//id_token
const idTokenSignedResponseAlg =
!!oidcConfiguration.idTokenSigningAlgValuesSupported
oidcConfiguration.idTokenSigningAlgValuesSupported
? oidcConfiguration.idTokenSigningAlgValuesSupported
: [];

const idTokenEncryptedResponseAlg =
!!oidcConfiguration.idTokenEncryptionAlgValuesSupported
oidcConfiguration.idTokenEncryptionAlgValuesSupported
? oidcConfiguration.idTokenEncryptionAlgValuesSupported
: [];

const idTokenEncryptedResponseEnc =
!!oidcConfiguration.idTokenEncryptionEncValuesSupported
oidcConfiguration.idTokenEncryptionEncValuesSupported
? oidcConfiguration.idTokenEncryptionEncValuesSupported
: [];
//request-object
const requestObjectSignedResponseAlg =
!!oidcConfiguration.requestObjectSigningAlgValuesSupported
oidcConfiguration.requestObjectSigningAlgValuesSupported
? oidcConfiguration.requestObjectSigningAlgValuesSupported
: [];

const requestObjectEncryptedResponseAlg =
!!oidcConfiguration.requestObjectEncryptionAlgValuesSupported
oidcConfiguration.requestObjectEncryptionAlgValuesSupported
? oidcConfiguration.requestObjectEncryptionAlgValuesSupported
: [];

const requestObjectEncryptedResponseEnc =
!!oidcConfiguration.requestObjectEncryptionEncValuesSupported
oidcConfiguration.requestObjectEncryptionEncValuesSupported
? oidcConfiguration.requestObjectEncryptionEncValuesSupported
: [];
//user-info
const userInfoSignedResponseAlg =
!!oidcConfiguration.userInfoSigningAlgValuesSupported
oidcConfiguration.userInfoSigningAlgValuesSupported
? oidcConfiguration.userInfoSigningAlgValuesSupported
: [];

const userInfoEncryptedResponseAlg =
!!oidcConfiguration.userInfoEncryptionAlgValuesSupported
oidcConfiguration.userInfoEncryptionAlgValuesSupported
? oidcConfiguration.userInfoEncryptionAlgValuesSupported
: [];

const userInfoEncryptedResponseEnc =
!!oidcConfiguration.userInfoEncryptionEncValuesSupported
oidcConfiguration.userInfoEncryptionEncValuesSupported
? oidcConfiguration.userInfoEncryptionEncValuesSupported
: [];

Expand Down Expand Up @@ -409,9 +409,11 @@ function ClientEncryptionSigningPanel({
}

ClientEncryptionSigningPanel.propTypes = {
formik: PropTypes.shape({
values: PropTypes.any,
}),
formik: PropTypes.object,
oidcConfiguration: PropTypes.object,
viewOnly: PropTypes.bool,
modifiedFields: PropTypes.object,
setModifiedFields: PropTypes.func,
};

export default ClientEncryptionSigningPanel;
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@ export default ClientLogoutPanel;
ClientLogoutPanel.propTypes = {
formik: PropTypes.any,
viewOnly: PropTypes.bool,
modifiedFields: PropTypes.object,
setModifiedFields: PropTypes.func,

};
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import GluuInputRow from "Routes/Apps/Gluu/GluuInputRow";
import GluuTypeAheadWithAdd from "Routes/Apps/Gluu/GluuTypeAheadWithAdd";
import { useTranslation } from "react-i18next";
import isEmpty from "lodash/isEmpty";
import PropTypes from "prop-types";
const DOC_CATEGORY = "openid_client";

const EMPTY = "";
Expand Down Expand Up @@ -181,4 +182,10 @@ function ClientSoftwarePanel({
);
}

ClientSoftwarePanel.propTypes = {
formik: PropTypes.object,
viewOnly: PropTypes.bool,
modifiedFields: PropTypes.object,
setModifiedFields: PropTypes.func,
}
export default ClientSoftwarePanel;
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import ClientCibaParUmaPanel from "./ClientCibaParUmaPanel";
import ClientEncryptionSigningPanel from "./ClientEncryptionSigningPanel";
import { toast } from "react-toastify";
import { setClientSelectedScopes } from "Plugins/auth-server/redux/features/scopeSlice";
import { cloneDeep, set } from "lodash";
import { useDispatch, useSelector } from "react-redux";
import { cloneDeep } from "lodash";
import { useDispatch } from "react-redux";
import PropTypes from "prop-types";
import { adminUiFeatures } from "Plugins/admin/helper/utils";

Expand Down Expand Up @@ -56,7 +56,6 @@ function ClientWizardForm({
const [modal, setModal] = useState(false);
const [currentStep, setCurrentStep] = useState(sequence[0]);
const dispatch = useDispatch();
const userDetails = useSelector((state) => state.authReducer.userinfo);


const initialValues = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function ScopeForm({
const client = scope.clients || [];

const authReducer = useSelector((state) => state.authReducer);
const userDetails = useSelector((state) => state.authReducer.userinfo);
let claims = [];
scripts = scripts || [];
attributes = attributes || [];
Expand Down

0 comments on commit 81fb541

Please sign in to comment.