Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(admin-ui): getting error pop up on asset page #1859

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions admin-ui/app/routes/Apps/Gluu/GluuBlockUI.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
function GluuBlockUI(blocking) {
function GluuBlockUI(blocking=false) {
if (blocking) {
return (
<div className="block-ui-container" style={{ minHeight: '100px' }}>
Expand All @@ -19,9 +19,4 @@ function GluuBlockUI(blocking) {
return ''
}
}

GluuBlockUI.defaultProps = {
blocking: false,
}

export default GluuBlockUI
16 changes: 4 additions & 12 deletions admin-ui/app/routes/Apps/Gluu/GluuCheckBoxRow.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import React from 'react'
import { Col, FormGroup, Input } from 'Components'
import GluuLabel from './GluuLabel'
import GluuTooltip from './GluuTooltip'

function GluuCheckBoxRow({
label,
name,
value,
required,
lsize,
rsize,
required = false,
lsize = 3,
rsize = 9,
handleOnChange,
doc_category,
}) {
return (
<FormGroup row>
<GluuLabel label={label} size={lsize} required={required} doc_category={doc_category} doc_entry={name}/>
<GluuLabel label={label} size={lsize} required={required} doc_category={doc_category} doc_entry={name} />
<Col sm={rsize}>
<Input
id={name}
Expand All @@ -29,11 +28,4 @@ function GluuCheckBoxRow({
</FormGroup>
)
}

GluuCheckBoxRow.defaultProps = {
type: 'checkbox',
lsize: 3,
rsize: 9,
required: false,
}
export default GluuCheckBoxRow
4 changes: 2 additions & 2 deletions admin-ui/app/routes/Apps/Gluu/GluuFormDetailRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function GluuFormDetailRow({
value,
isBadge,
badgeColor,
lsize,
rsize,
lsize = 6,
rsize = 6,
doc_category,
doc_entry,
isDirect = false,
Expand Down
84 changes: 39 additions & 45 deletions admin-ui/app/routes/Apps/Gluu/GluuInlineInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import PropTypes from 'prop-types'
function GluuInlineInput({
label,
name,
type,
type = 'text',
value,
required,
lsize,
rsize,
required = false,
lsize = 3,
rsize = 9,
isBoolean,
isArray,
handler,
Expand All @@ -38,23 +38,23 @@ function GluuInlineInput({
const [correctValue, setCorrectValue] = useState([])
const [data, setData] = useState(value)
const onValueChanged = (e) => {
if(isBoolean){
if (isBoolean) {
setData(e.target.checked)
}else{
} else {
setData(e.target.value)
}
setShow(true)
}
const handleTypeAheadChange = (selectedOptions) => {
const object = selectedOptions.filter((data) => typeof data == 'object')
const arrayItems = selectedOptions.filter((data) => typeof data != 'object')
for (const i in object) {
if (!object[i]['tokenEndpointAuthMethodsSupported']) {
arrayItems.push(object[i][name])
} else {
arrayItems.push(object[i]['tokenEndpointAuthMethodsSupported'])
}
for (const i in object) {
if (!object[i]['tokenEndpointAuthMethodsSupported']) {
arrayItems.push(object[i][name])
} else {
arrayItems.push(object[i]['tokenEndpointAuthMethodsSupported'])
}
}
setCorrectValue(arrayItems)
setShow(true)
}
Expand Down Expand Up @@ -87,37 +87,37 @@ function GluuInlineInput({
/>
<Col sm={rsize}>
{!isBoolean && !isArray && (
<Input
id={name}
data-testid={name}
name={name}
type={type}
defaultValue={data}
onChange={onValueChanged}
/>
<Input
id={name}
data-testid={name}
name={name}
type={type}
defaultValue={data}
onChange={onValueChanged}
/>
)}
{isBoolean && (
<GluuToogle
id={name}
data-testid={name}
name={name}
handler={onValueChanged}
value={value}
/>
<GluuToogle
id={name}
data-testid={name}
name={name}
handler={onValueChanged}
value={value}
/>
)}
{isArray && (
<Typeahead
id={name}
data-testid={name}
name={name}
allowNew
emptyLabel=""
labelKey={name}
onChange={handleTypeAheadChange}
multiple={true}
defaultSelected={value}
options={options || []}
/>
<Typeahead
id={name}
data-testid={name}
name={name}
allowNew
emptyLabel=""
labelKey={name}
onChange={handleTypeAheadChange}
multiple={true}
defaultSelected={value}
options={options || []}
/>
)}
</Col>
</FormGroup>
Expand All @@ -143,12 +143,6 @@ function GluuInlineInput({
)
}

GluuInlineInput.defaultProps = {
type: 'text',
lsize: 3,
rsize: 9,
required: false,
}
GluuInlineInput.propTypes = {
doc_category: PropTypes.string,
label: PropTypes.string,
Expand Down
16 changes: 4 additions & 12 deletions admin-ui/app/routes/Apps/Gluu/GluuInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import GluuTooltip from './GluuTooltip'
function GluuInput({
label,
name,
type,
type = 'text',
value,
required,
lsize,
rsize,
required = false,
lsize = 3,
rsize = 9,
doc_category,
}) {
return (
Expand All @@ -23,12 +23,4 @@ function GluuInput({
</GluuTooltip>
)
}

GluuInput.defaultProps = {
type: 'text',
lsize: 3,
rsize: 9,
required: false,
}

export default GluuInput
22 changes: 6 additions & 16 deletions admin-ui/app/routes/Apps/Gluu/GluuInputRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import PropTypes from 'prop-types';
function GluuInputRow({
label,
name,
type,
type = 'text',
value,
formik,
required,
lsize,
rsize,
required = false,
lsize = 3,
rsize = 9,
doc_category,
disabled,
disabled = false,
showError = false,
errorMessage = '',
handleChange = null,
Expand Down Expand Up @@ -50,7 +50,7 @@ function GluuInputRow({
onFocus={onFocus}
onKeyDown={(evt) => evt.key === 'e' && type === "number" && evt.preventDefault()}
disabled={disabled}
rows={rows}
rows={rows}
cols={cols}
/>
{shortcode}
Expand All @@ -68,16 +68,6 @@ function GluuInputRow({
</FormGroup>
)
}

GluuInputRow.defaultProps = {
type: 'text',
lsize: 3,
rsize: 9,
required: false,
disabled: false,
doc_entry: undefined
}

export default GluuInputRow

GluuInputRow.propTypes = {
Expand Down
7 changes: 1 addition & 6 deletions admin-ui/app/routes/Apps/Gluu/GluuInumInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Col, FormGroup, Input } from 'Components'
import GluuLabel from './GluuLabel'
import GluuTooltip from './GluuTooltip'

function GluuInumInput({ label, name, value, lsize, rsize, doc_category }) {
function GluuInumInput({ label, name, value, lsize = 4, rsize = 8, doc_category }) {
return (
<GluuTooltip doc_category={doc_category} doc_entry={name}>
<FormGroup row>
Expand All @@ -22,9 +22,4 @@ function GluuInumInput({ label, name, value, lsize, rsize, doc_category }) {
</GluuTooltip>
)
}
GluuInumInput.defaultProps = {
lsize: 4,
rsize: 8,
}

export default GluuInumInput
10 changes: 0 additions & 10 deletions admin-ui/app/routes/Apps/Gluu/GluuLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ function GluuLabel({ label, required, size, doc_category, doc_entry, style }) {
}
:
</h5>
{/* {doc_category && (
<ReactTooltip
html={true}
type="success"
id={doc_entry}
data-testid={doc_entry}
>
{t('documentation.' + doc_category + '.' + doc_entry)}
</ReactTooltip>
)} */}
</Label>
)
}
Expand Down
14 changes: 4 additions & 10 deletions admin-ui/app/routes/Apps/Gluu/GluuRemovableInputRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import PropTypes from 'prop-types'
function GluuRemovableInputRow({
label,
name,
type,
type = 'text',
value,
formik,
required,
lsize,
rsize,
required = false,
lsize = 3,
rsize = 9,
handler,
doc_category,
isDirect,
Expand Down Expand Up @@ -62,12 +62,6 @@ function GluuRemovableInputRow({
)
}

GluuRemovableInputRow.defaultProps = {
type: 'text',
lsize: 3,
rsize: 9,
required: false,
}
GluuRemovableInputRow.propTypes = {
label: PropTypes.string,
name: PropTypes.string,
Expand Down
13 changes: 3 additions & 10 deletions admin-ui/app/routes/Apps/Gluu/GluuRemovableSelectRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ function GluuRemovableSelectRow({
name,
value,
formik,
values,
lsize,
rsize,
values = [],
lsize = 3,
rsize = 9,
handler,
doc_category,
isDirect,
Expand Down Expand Up @@ -52,11 +52,4 @@ function GluuRemovableSelectRow({
</GluuTooltip>
)
}

GluuRemovableSelectRow.defaultProps = {
values: [],
lsize: 3,
rsize: 9,
}

export default GluuRemovableSelectRow
13 changes: 3 additions & 10 deletions admin-ui/app/routes/Apps/Gluu/GluuRemovableTypeAhead.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ function GluuRemovableTypeAhead({
name,
value,
formik,
lsize,
rsize,
lsize = 3,
rsize = 9,
handler,
doc_category,
options,
options = [],
isDirect,
allowNew = true,
}) {
Expand Down Expand Up @@ -58,11 +58,4 @@ function GluuRemovableTypeAhead({
</GluuTooltip>
)
}

GluuRemovableTypeAhead.defaultProps = {
values: [],
lsize: 3,
rsize: 9,
}

export default GluuRemovableTypeAhead
Loading