Skip to content

Commit

Permalink
fix(admin-ui): code smells
Browse files Browse the repository at this point in the history
Signed-off-by: Jeet Viramgama <jviramgama5@gmail.com>
  • Loading branch information
jv18creator committed Nov 3, 2023
1 parent ef0508c commit 3d4f9d3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 15 deletions.
10 changes: 8 additions & 2 deletions admin-ui/app/components/SVG/menu/Scim.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'

const Fido = ({ fill = '', className, style }) => {
const Scim = ({ className, style }) => {
return (
<div className={className} style={style}>
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'>
Expand All @@ -10,4 +11,9 @@ const Fido = ({ fill = '', className, style }) => {
)
}

export default Fido
Scim.propTypes = {
className: PropTypes.any,
style: PropTypes.any
}

export default Scim
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import GluuInumInput from 'Routes/Apps/Gluu/GluuInumInput'
import GluuProperties from 'Routes/Apps/Gluu/GluuProperties'
import GluuCommitFooter from 'Routes/Apps/Gluu/GluuCommitFooter'
import GluuCommitDialog from 'Routes/Apps/Gluu/GluuCommitDialog'
import GluuTooltip from 'Routes/Apps/Gluu/GluuTooltip'
import { SCRIPT } from 'Utils/ApiResources'
import { useTranslation } from 'react-i18next'
import { Alert, Button } from "reactstrap";
import ErrorIcon from '@mui/icons-material/Error';
import GluuSuspenseLoader from 'Routes/Apps/Gluu/GluuSuspenseLoader'
import { useSelector } from 'react-redux'
import { Skeleton } from '@mui/material'
import PropTypes from 'prop-types'

const GluuScriptErrorModal = lazy(() => import('Routes/Apps/Gluu/GluuScriptErrorModal'))
const Counter = lazy(() => import('Components/Widgets/GroupedButtons/Counter'))
Expand Down Expand Up @@ -625,4 +625,16 @@ function CustomScriptForm({ item, handleSubmit, viewOnly }) {
)
}

CustomScriptForm.propTypes = {
item: PropTypes.any,
handleSubmit: PropTypes.oneOfType([
PropTypes.func,
PropTypes.any
]),
viewOnly: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.any
])
}

export default CustomScriptForm
5 changes: 5 additions & 0 deletions admin-ui/plugins/scim/components/ScimConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import GluuCommitDialog from 'Routes/Apps/Gluu/GluuCommitDialog'
import GluuCommitFooter from 'Routes/Apps/Gluu/GluuCommitFooter'
import GluuSelectRow from 'Routes/Apps/Gluu/GluuSelectRow'
import GluuToogleRow from 'Routes/Apps/Gluu/GluuToogleRow'
import PropTypes from 'prop-types'

const ScimConfiguration = ({ handleSubmit }) => {
const scimConfigs = useSelector((state) => state.scimReducer.scim)
Expand Down Expand Up @@ -336,4 +337,8 @@ const ScimConfiguration = ({ handleSubmit }) => {
)
}

ScimConfiguration.propTypes = {
handleSubmit: PropTypes.func
}

export default ScimConfiguration
25 changes: 13 additions & 12 deletions admin-ui/plugins/scim/components/ScimPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import GluuLoader from 'Routes/Apps/Gluu/GluuLoader'
import { Card, CardBody } from 'Components'
import ScimConfiguration from './ScimConfiguration'
import { getScimConfiguration, putScimConfiguration } from '../redux/features/ScimSlice'
import {
getScimConfiguration,
putScimConfiguration,
} from '../redux/features/ScimSlice'
import { buildPayload } from 'Utils/PermChecker'

const ScimPage = () => {
Expand All @@ -27,17 +30,15 @@ const ScimPage = () => {
}

return (
<React.Fragment>
<GluuLoader blocking={scimConfiguration?.loading}>
<Card className='mb-3' style={applicationStyle.mainCard}>
<CardBody>
{!scimConfiguration?.loading && (
<ScimConfiguration handleSubmit={handleSubmit} />
)}
</CardBody>
</Card>
</GluuLoader>
</React.Fragment>
<GluuLoader blocking={scimConfiguration?.loading}>
<Card className='mb-3' style={applicationStyle.mainCard}>
<CardBody>
{!scimConfiguration?.loading && (
<ScimConfiguration handleSubmit={handleSubmit} />
)}
</CardBody>
</Card>
</GluuLoader>
)
}

Expand Down

0 comments on commit 3d4f9d3

Please sign in to comment.