Skip to content

Commit

Permalink
feat(admin-ui): design the layout for api role management #327
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Dec 2, 2021
1 parent aac6eca commit 71de0da
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 125 deletions.
13 changes: 7 additions & 6 deletions app/routes/Dashboards/Reports/ReportCard.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from 'react'
import { Card, CardBody, CardTitle } from './../../../components'
import { Card, CardBody, CardTitle, Badge } from './../../../components'
import ReportPiChartItem from './ReportPiChartItem'
import mystyle from './style'
import GluuRibbon from '../../Apps/Gluu/GluuRibbon'

function ReportCard({ title, data, upValue, downValue }) {
const className = 'mb-3 gluucard'
return (
<Card className={className}>
<Card className="mb-3">
<CardBody>
<CardTitle tag="h6" className="mb-4">
<div style={mystyle.gcard}>{title}</div>
<GluuRibbon title={title} fromLeft />
</CardTitle>
<ReportPiChartItem data={data} />
<div>
Expand All @@ -18,7 +17,9 @@ function ReportCard({ title, data, upValue, downValue }) {
</div>
<div>
<i className="fa fa-caret-down fa-fw text-success"></i>
{downValue}
<Badge pill color="primary">
{downValue}
</Badge>
</div>
</div>
</CardBody>
Expand Down
15 changes: 0 additions & 15 deletions app/routes/Dashboards/Reports/style.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function LicenseDetailsForm({ item, handleSubmit }) {
}
return (
<>
{/* <Container> */}
<Accordion className="mb-2 b-primary" initialOpen>
<Accordion.Header className="text-primary">
{t('fields.licenseDetails').toUpperCase()}
Expand Down
222 changes: 119 additions & 103 deletions plugins/admin/components/Configuration/LicenseDetailsPage.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import React, { useEffect} from 'react'
import React, { useEffect } from 'react'
import { connect } from 'react-redux'
import LicenseDetailsForm from './LicenseDetailsForm'
import GluuLabel from '../../../../app/routes/Apps/Gluu/GluuLabel'
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
import GluuFormDetailRow from '../../../../app/routes/Apps/Gluu/GluuFormDetailRow'
import { LICENSE } from '../../../../app/utils/ApiResources'
import {
getLicenseDetails,
updateLicenseDetails,
} from '../../redux/actions/LicenseDetailsActions'
import { Container, Row, Col } from '../../../../app/components'
import {
Card,
CardBody,
CardTitle,
Container,
Row,
Col,
} from '../../../../app/components'
import GluuLoader from '../../../../app/routes/Apps/Gluu/GluuLoader'
import Alert from '@material-ui/lab/Alert'

Expand All @@ -25,106 +32,115 @@ function LicenseDetailsPage({ item, loading, dispatch }) {

return (
<React.Fragment>
<GluuLabel label="fields.licenseDetails" size={8} />
<GluuLoader blocking={loading}>
{item.licenseEnable ? (
<>
<Container style={{ backgroundColor: '#F5F5F5' }}>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.productName"
value={item.productName}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="productName"
doc_category={LICENSE}
/>
</Col>
<Col sm={6}>
<GluuFormDetailRow
label="fields.productCode"
value={item.productCode}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="productCode"
doc_category={LICENSE}
/>
</Col>
</Row>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.licenseType"
value={item.licenseType}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="licenseType"
doc_category={LICENSE}
/>
</Col>
<Col sm={6}>
<GluuFormDetailRow
label="fields.licenseKey"
value={item.licenseKey}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="licenseKey"
doc_category={LICENSE}
/>
</Col>
</Row>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.customerEmail"
value={item.customerEmail}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="customerEmail"
doc_category={LICENSE}
/>
</Col>
<Col sm={6}>
<GluuFormDetailRow
label="fields.customerName"
value={item.customerFirstName + ' ' + item.customerLastName}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="customerName"
doc_category={LICENSE}
/>
</Col>
</Row>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.companyName"
value={item.companyName}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="companyName"
doc_category={LICENSE}
/>
</Col>
</Row>
</Container>
<hr></hr>
<LicenseDetailsForm item={item} handleSubmit={handleSubmit} />
</>
) : (
<Alert severity="info">
{!loading && 'The License Api is not enabled for this application.'}
</Alert>
)}
</GluuLoader>
<Card className="mb-3">
<CardBody>
<CardTitle tag="h6" className="mb-4">
<GluuRibbon title="fields.licenseDetails" doTranslate fromLeft />
</CardTitle>
<GluuLoader blocking={loading}>
{item.licenseEnable ? (
<>
<Container style={{ backgroundColor: '#F5F5F5' }}>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.productName"
value={item.productName}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="productName"
doc_category={LICENSE}
/>
</Col>
<Col sm={6}>
<GluuFormDetailRow
label="fields.productCode"
value={item.productCode}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="productCode"
doc_category={LICENSE}
/>
</Col>
</Row>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.licenseType"
value={item.licenseType}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="licenseType"
doc_category={LICENSE}
/>
</Col>
<Col sm={6}>
<GluuFormDetailRow
label="fields.licenseKey"
value={item.licenseKey}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="licenseKey"
doc_category={LICENSE}
/>
</Col>
</Row>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.customerEmail"
value={item.customerEmail}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="customerEmail"
doc_category={LICENSE}
/>
</Col>
<Col sm={6}>
<GluuFormDetailRow
label="fields.customerName"
value={
item.customerFirstName + ' ' + item.customerLastName
}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="customerName"
doc_category={LICENSE}
/>
</Col>
</Row>
<Row>
<Col sm={6}>
<GluuFormDetailRow
label="fields.companyName"
value={item.companyName}
isBadge={true}
lsize={3}
rsize={9}
doc_entry="companyName"
doc_category={LICENSE}
/>
</Col>
</Row>
</Container>
<hr></hr>
<LicenseDetailsForm item={item} handleSubmit={handleSubmit} />
</>
) : (
<Alert severity="warning">
{!loading &&
'The License Api is not enabled for this application.'}
</Alert>
)}
</GluuLoader>
</CardBody>
</Card>
</React.Fragment>
)
}
Expand Down

0 comments on commit 71de0da

Please sign in to comment.