1
1
import React , { useEffect , useState } from 'react'
2
- import { useTranslation } from "react-i18next" ;
3
2
import { connect } from 'react-redux'
4
- import LicenseDetailsForm from './LicenseDetailsForm'
3
+ import LicenseDetailsForm from './LicenseDetailsForm'
5
4
import GluuLabel from '../../../../app/routes/Apps/Gluu/GluuLabel'
6
5
import GluuFormDetailRow from '../../../../app/routes/Apps/Gluu/GluuFormDetailRow'
7
6
import { LICENSE } from '../../../../app/utils/ApiResources'
8
- import { getLicenseDetails , updateLicenseDetails } from '../../redux/actions/LicenseDetailsActions'
9
- import { Container , Row , Col , Form , FormGroup , Input , Accordion } from '../../../../app/components'
7
+ import {
8
+ getLicenseDetails ,
9
+ updateLicenseDetails ,
10
+ } from '../../redux/actions/LicenseDetailsActions'
11
+ import { Container , Row , Col } from '../../../../app/components'
10
12
import GluuLoader from '../../../../app/routes/Apps/Gluu/GluuLoader'
11
- import Alert from '@material-ui/lab/Alert' ;
12
- import { Formik } from 'formik'
13
+ import Alert from '@material-ui/lab/Alert'
13
14
14
15
function LicenseDetailsPage ( { item, loading, dispatch } ) {
15
- const { t } = useTranslation ( ) ;
16
- const [ validityPeriod , setValidityPeriod ] = useState ( ! ! item . validityPeriod ? new Date ( item . validityPeriod ) : new Date ( ) )
17
- const [ init , setInit ] = useState ( false )
18
- const [ modal , setModal ] = useState ( false )
16
+ const [ validityPeriod , setValidityPeriod ] = useState (
17
+ ! ! item . validityPeriod ? new Date ( item . validityPeriod ) : new Date ( ) ,
18
+ )
19
19
useEffect ( ( ) => {
20
20
dispatch ( getLicenseDetails ( ) )
21
- } , [ ] ) ;
21
+ } , [ ] )
22
22
useEffect ( ( ) => {
23
23
setValidityPeriod ( new Date ( item . validityPeriod ) )
24
- } , [ item . validityPeriod ] ) ;
25
-
26
- function activate ( ) {
27
- if ( ! init ) {
28
- setInit ( true )
29
- }
30
- }
31
- function toggle ( ) {
32
- setModal ( ! modal )
33
- }
34
-
35
- function submitForm ( ) {
36
- toggle ( )
37
- document . getElementsByClassName ( 'UserActionSubmitButton' ) [ 0 ] . click ( )
38
- }
24
+ } , [ item . validityPeriod ] )
39
25
40
26
function handleSubmit ( data ) {
41
27
if ( data ) {
@@ -48,8 +34,8 @@ function LicenseDetailsPage({ item, loading, dispatch }) {
48
34
{ /* <Container> */ }
49
35
< GluuLabel label = "fields.licenseDetails" size = { 8 } />
50
36
< GluuLoader blocking = { loading } >
51
- { item . licenseEnable ?
52
- ( < >
37
+ { item . licenseEnable ? (
38
+ < >
53
39
< Container style = { { backgroundColor : '#F5F5F5' } } >
54
40
< Row >
55
41
< Col sm = { 6 } >
@@ -61,7 +47,6 @@ function LicenseDetailsPage({ item, loading, dispatch }) {
61
47
rsize = { 9 }
62
48
doc_entry = "productName"
63
49
doc_category = { LICENSE }
64
-
65
50
/>
66
51
</ Col >
67
52
< Col sm = { 6 } >
@@ -115,7 +100,7 @@ function LicenseDetailsPage({ item, loading, dispatch }) {
115
100
< Col sm = { 6 } >
116
101
< GluuFormDetailRow
117
102
label = "fields.customerName"
118
- value = { item . customerFirstName + " " + item . customerLastName }
103
+ value = { item . customerFirstName + ' ' + item . customerLastName }
119
104
isBadge = { true }
120
105
lsize = { 3 }
121
106
rsize = { 9 }
@@ -140,8 +125,12 @@ function LicenseDetailsPage({ item, loading, dispatch }) {
140
125
</ Container >
141
126
< hr > </ hr >
142
127
< LicenseDetailsForm item = { item } handleSubmit = { handleSubmit } />
143
- </ > ) :
144
- ( < Alert severity = "info" > { ! loading && 'The License Api is not enabled for this application.' } </ Alert > ) }
128
+ </ >
129
+ ) : (
130
+ < Alert severity = "info" >
131
+ { ! loading && 'The License Api is not enabled for this application.' }
132
+ </ Alert >
133
+ ) }
145
134
</ GluuLoader >
146
135
</ React . Fragment >
147
136
)
0 commit comments