Skip to content

Commit 0113d69

Browse files
committed
fix(admin-ui): getting error pop up on asset page #1856
1 parent 980ed5f commit 0113d69

19 files changed

+102
-202
lines changed

admin-ui/app/routes/Apps/Gluu/GluuBlockUI.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
function GluuBlockUI(blocking) {
2+
function GluuBlockUI(blocking=false) {
33
if (blocking) {
44
return (
55
<div className="block-ui-container" style={{ minHeight: '100px' }}>
@@ -19,9 +19,4 @@ function GluuBlockUI(blocking) {
1919
return ''
2020
}
2121
}
22-
23-
GluuBlockUI.defaultProps = {
24-
blocking: false,
25-
}
26-
2722
export default GluuBlockUI
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import React from 'react'
22
import { Col, FormGroup, Input } from 'Components'
33
import GluuLabel from './GluuLabel'
4-
import GluuTooltip from './GluuTooltip'
54

65
function GluuCheckBoxRow({
76
label,
87
name,
98
value,
10-
required,
11-
lsize,
12-
rsize,
9+
required = false,
10+
lsize = 3,
11+
rsize = 9,
1312
handleOnChange,
1413
doc_category,
1514
}) {
1615
return (
1716
<FormGroup row>
18-
<GluuLabel label={label} size={lsize} required={required} doc_category={doc_category} doc_entry={name}/>
17+
<GluuLabel label={label} size={lsize} required={required} doc_category={doc_category} doc_entry={name} />
1918
<Col sm={rsize}>
2019
<Input
2120
id={name}
@@ -29,11 +28,4 @@ function GluuCheckBoxRow({
2928
</FormGroup>
3029
)
3130
}
32-
33-
GluuCheckBoxRow.defaultProps = {
34-
type: 'checkbox',
35-
lsize: 3,
36-
rsize: 9,
37-
required: false,
38-
}
3931
export default GluuCheckBoxRow

admin-ui/app/routes/Apps/Gluu/GluuFormDetailRow.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ function GluuFormDetailRow({
99
value,
1010
isBadge,
1111
badgeColor,
12-
lsize,
13-
rsize,
12+
lsize = 6,
13+
rsize = 6,
1414
doc_category,
1515
doc_entry,
1616
isDirect = false,

admin-ui/app/routes/Apps/Gluu/GluuInlineInput.js

+39-45
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import PropTypes from 'prop-types'
1717
function GluuInlineInput({
1818
label,
1919
name,
20-
type,
20+
type = 'text',
2121
value,
22-
required,
23-
lsize,
24-
rsize,
22+
required = false,
23+
lsize = 3,
24+
rsize = 9,
2525
isBoolean,
2626
isArray,
2727
handler,
@@ -38,23 +38,23 @@ function GluuInlineInput({
3838
const [correctValue, setCorrectValue] = useState([])
3939
const [data, setData] = useState(value)
4040
const onValueChanged = (e) => {
41-
if(isBoolean){
41+
if (isBoolean) {
4242
setData(e.target.checked)
43-
}else{
43+
} else {
4444
setData(e.target.value)
4545
}
4646
setShow(true)
4747
}
4848
const handleTypeAheadChange = (selectedOptions) => {
4949
const object = selectedOptions.filter((data) => typeof data == 'object')
5050
const arrayItems = selectedOptions.filter((data) => typeof data != 'object')
51-
for (const i in object) {
52-
if (!object[i]['tokenEndpointAuthMethodsSupported']) {
53-
arrayItems.push(object[i][name])
54-
} else {
55-
arrayItems.push(object[i]['tokenEndpointAuthMethodsSupported'])
56-
}
51+
for (const i in object) {
52+
if (!object[i]['tokenEndpointAuthMethodsSupported']) {
53+
arrayItems.push(object[i][name])
54+
} else {
55+
arrayItems.push(object[i]['tokenEndpointAuthMethodsSupported'])
5756
}
57+
}
5858
setCorrectValue(arrayItems)
5959
setShow(true)
6060
}
@@ -87,37 +87,37 @@ function GluuInlineInput({
8787
/>
8888
<Col sm={rsize}>
8989
{!isBoolean && !isArray && (
90-
<Input
91-
id={name}
92-
data-testid={name}
93-
name={name}
94-
type={type}
95-
defaultValue={data}
96-
onChange={onValueChanged}
97-
/>
90+
<Input
91+
id={name}
92+
data-testid={name}
93+
name={name}
94+
type={type}
95+
defaultValue={data}
96+
onChange={onValueChanged}
97+
/>
9898
)}
9999
{isBoolean && (
100-
<GluuToogle
101-
id={name}
102-
data-testid={name}
103-
name={name}
104-
handler={onValueChanged}
105-
value={value}
106-
/>
100+
<GluuToogle
101+
id={name}
102+
data-testid={name}
103+
name={name}
104+
handler={onValueChanged}
105+
value={value}
106+
/>
107107
)}
108108
{isArray && (
109-
<Typeahead
110-
id={name}
111-
data-testid={name}
112-
name={name}
113-
allowNew
114-
emptyLabel=""
115-
labelKey={name}
116-
onChange={handleTypeAheadChange}
117-
multiple={true}
118-
defaultSelected={value}
119-
options={options || []}
120-
/>
109+
<Typeahead
110+
id={name}
111+
data-testid={name}
112+
name={name}
113+
allowNew
114+
emptyLabel=""
115+
labelKey={name}
116+
onChange={handleTypeAheadChange}
117+
multiple={true}
118+
defaultSelected={value}
119+
options={options || []}
120+
/>
121121
)}
122122
</Col>
123123
</FormGroup>
@@ -143,12 +143,6 @@ function GluuInlineInput({
143143
)
144144
}
145145

146-
GluuInlineInput.defaultProps = {
147-
type: 'text',
148-
lsize: 3,
149-
rsize: 9,
150-
required: false,
151-
}
152146
GluuInlineInput.propTypes = {
153147
doc_category: PropTypes.string,
154148
label: PropTypes.string,

admin-ui/app/routes/Apps/Gluu/GluuInput.js

+4-12
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import GluuTooltip from './GluuTooltip'
55
function GluuInput({
66
label,
77
name,
8-
type,
8+
type = 'text',
99
value,
10-
required,
11-
lsize,
12-
rsize,
10+
required = false,
11+
lsize = 3,
12+
rsize = 9,
1313
doc_category,
1414
}) {
1515
return (
@@ -23,12 +23,4 @@ function GluuInput({
2323
</GluuTooltip>
2424
)
2525
}
26-
27-
GluuInput.defaultProps = {
28-
type: 'text',
29-
lsize: 3,
30-
rsize: 9,
31-
required: false,
32-
}
33-
3426
export default GluuInput

admin-ui/app/routes/Apps/Gluu/GluuInputRow.js

+6-16
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import PropTypes from 'prop-types';
77
function GluuInputRow({
88
label,
99
name,
10-
type,
10+
type = 'text',
1111
value,
1212
formik,
13-
required,
14-
lsize,
15-
rsize,
13+
required = false,
14+
lsize = 3,
15+
rsize = 9,
1616
doc_category,
17-
disabled,
17+
disabled = false,
1818
showError = false,
1919
errorMessage = '',
2020
handleChange = null,
@@ -50,7 +50,7 @@ function GluuInputRow({
5050
onFocus={onFocus}
5151
onKeyDown={(evt) => evt.key === 'e' && type === "number" && evt.preventDefault()}
5252
disabled={disabled}
53-
rows={rows}
53+
rows={rows}
5454
cols={cols}
5555
/>
5656
{shortcode}
@@ -68,16 +68,6 @@ function GluuInputRow({
6868
</FormGroup>
6969
)
7070
}
71-
72-
GluuInputRow.defaultProps = {
73-
type: 'text',
74-
lsize: 3,
75-
rsize: 9,
76-
required: false,
77-
disabled: false,
78-
doc_entry: undefined
79-
}
80-
8171
export default GluuInputRow
8272

8373
GluuInputRow.propTypes = {

admin-ui/app/routes/Apps/Gluu/GluuInumInput.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Col, FormGroup, Input } from 'Components'
33
import GluuLabel from './GluuLabel'
44
import GluuTooltip from './GluuTooltip'
55

6-
function GluuInumInput({ label, name, value, lsize, rsize, doc_category }) {
6+
function GluuInumInput({ label, name, value, lsize = 4, rsize = 8, doc_category }) {
77
return (
88
<GluuTooltip doc_category={doc_category} doc_entry={name}>
99
<FormGroup row>
@@ -22,9 +22,4 @@ function GluuInumInput({ label, name, value, lsize, rsize, doc_category }) {
2222
</GluuTooltip>
2323
)
2424
}
25-
GluuInumInput.defaultProps = {
26-
lsize: 4,
27-
rsize: 8,
28-
}
29-
3025
export default GluuInumInput

admin-ui/app/routes/Apps/Gluu/GluuLabel.js

-10
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ function GluuLabel({ label, required, size, doc_category, doc_entry, style }) {
3636
}
3737
:
3838
</h5>
39-
{/* {doc_category && (
40-
<ReactTooltip
41-
html={true}
42-
type="success"
43-
id={doc_entry}
44-
data-testid={doc_entry}
45-
>
46-
{t('documentation.' + doc_category + '.' + doc_entry)}
47-
</ReactTooltip>
48-
)} */}
4939
</Label>
5040
)
5141
}

admin-ui/app/routes/Apps/Gluu/GluuRemovableInputRow.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import PropTypes from 'prop-types'
99
function GluuRemovableInputRow({
1010
label,
1111
name,
12-
type,
12+
type = 'text',
1313
value,
1414
formik,
15-
required,
16-
lsize,
17-
rsize,
15+
required = false,
16+
lsize = 3,
17+
rsize = 9,
1818
handler,
1919
doc_category,
2020
isDirect,
@@ -62,12 +62,6 @@ function GluuRemovableInputRow({
6262
)
6363
}
6464

65-
GluuRemovableInputRow.defaultProps = {
66-
type: 'text',
67-
lsize: 3,
68-
rsize: 9,
69-
required: false,
70-
}
7165
GluuRemovableInputRow.propTypes = {
7266
label: PropTypes.string,
7367
name: PropTypes.string,

admin-ui/app/routes/Apps/Gluu/GluuRemovableSelectRow.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ function GluuRemovableSelectRow({
1010
name,
1111
value,
1212
formik,
13-
values,
14-
lsize,
15-
rsize,
13+
values = [],
14+
lsize = 3,
15+
rsize = 9,
1616
handler,
1717
doc_category,
1818
isDirect,
@@ -52,11 +52,4 @@ function GluuRemovableSelectRow({
5252
</GluuTooltip>
5353
)
5454
}
55-
56-
GluuRemovableSelectRow.defaultProps = {
57-
values: [],
58-
lsize: 3,
59-
rsize: 9,
60-
}
61-
6255
export default GluuRemovableSelectRow

admin-ui/app/routes/Apps/Gluu/GluuRemovableTypeAhead.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ function GluuRemovableTypeAhead({
1111
name,
1212
value,
1313
formik,
14-
lsize,
15-
rsize,
14+
lsize = 3,
15+
rsize = 9,
1616
handler,
1717
doc_category,
18-
options,
18+
options = [],
1919
isDirect,
2020
allowNew = true,
2121
}) {
@@ -58,11 +58,4 @@ function GluuRemovableTypeAhead({
5858
</GluuTooltip>
5959
)
6060
}
61-
62-
GluuRemovableTypeAhead.defaultProps = {
63-
values: [],
64-
lsize: 3,
65-
rsize: 9,
66-
}
67-
6861
export default GluuRemovableTypeAhead

0 commit comments

Comments
 (0)