Skip to content

Commit a7cd306

Browse files
committed
Various UI fixes
Now gets only tenants in the `onboarded` state Added "deleted" to the terminal states for onboarding list Moved from reactstrap to react-bootstrap in a few comps Fixed onboarding tenant name Fixed button CSS
1 parent f9beeb5 commit a7cd306

File tree

6 files changed

+45
-38
lines changed

6 files changed

+45
-38
lines changed

client/web/src/onboarding/OnboardingDetailComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const showError = (error, clearError) => {
4949

5050
export const OnboardingDetailComponent = (props) => {
5151
const { onboarding, error, clearError, refresh, showTenant } = props
52-
const terminus = ['deployed', 'updated', 'failed']
52+
const terminus = ['deployed', 'deleted', 'updated', 'failed']
5353

5454
const [isRefreshing, setIsRefreshing] = useState(null)
5555
const [timeoutId, setTimeoutId] = useState(null)

client/web/src/onboarding/OnboardingListComponent.js

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@
1515
*/
1616
import { PropTypes } from 'prop-types'
1717
import React, { useEffect, useState } from 'react'
18-
import {
19-
Row,
20-
Col,
21-
Card,
22-
CardHeader,
23-
CardBody,
24-
Button,
25-
Table,
26-
Spinner,
27-
Alert,
28-
} from 'reactstrap'
18+
import { Row, Col, Card, Button, Table, Spinner, Alert } from 'react-bootstrap'
2919
import CIcon from '@coreui/icons-react'
3020
import { cilReload, cilListRich } from '@coreui/icons'
3121
import OnboardingListItemComponent from './OnboardingListItemComponent'
@@ -60,7 +50,10 @@ export const OnboardingListComponent = (props) => {
6050
const terminus = ['deployed', 'updated', 'failed']
6151

6252
const checkRefresh = (refreshFn) => {
63-
if (!isRefreshing && onboardingRequests.some((ob) => !terminus.includes(ob?.status))) {
53+
if (
54+
!isRefreshing &&
55+
onboardingRequests.some((ob) => !terminus.includes(ob?.status))
56+
) {
6457
setIsRefreshing(true)
6558
const id = setTimeout(() => {
6659
refreshFn()
@@ -85,23 +78,27 @@ export const OnboardingListComponent = (props) => {
8578
<Col>{!!error && showError(error, dismissError)}</Col>
8679
</Row>
8780
<Row className="mb-3">
88-
<Col sm={{ size: 12 }} md={{ size: 8 }} lg={{ size: 9 }}>
81+
<Col sm={12} md={8} lg={9}>
8982
<Alert color="light">
90-
Onboarding tenants requires an application image to be uploaded. For more detail, click{' '}
91-
<ECRInstructions awsAccount={awsAccount} awsRegion={awsRegion} ecrRepo={ecrRepository}>
83+
Onboarding tenants requires an application image to be uploaded. For
84+
more detail, click
85+
<ECRInstructions
86+
awsAccount={awsAccount}
87+
awsRegion={awsRegion}
88+
ecrRepo={ecrRepository}
89+
>
9290
<span>here.</span>
9391
</ECRInstructions>
9492
</Alert>
9593
</Col>
96-
<Col sm={{ size: 12 }} md={{ size: 4 }} lg={{ size: 3 }}>
94+
<Col sm={12} md={4} lg={3}>
9795
<div className="float-right">
98-
<Button color="secondary" className="mr-2" onClick={doRefresh}>
96+
<Button variant="secondary" className="mr-2" onClick={doRefresh}>
9997
<span>
100-
{' '}
10198
<CIcon icon={cilReload} />
10299
</span>
103100
</Button>
104-
<Button color="primary" onClick={showOnboardRequestForm}>
101+
<Button variant="info" onClick={showOnboardRequestForm}>
105102
Provision Tenant
106103
</Button>
107104
</div>
@@ -110,10 +107,10 @@ export const OnboardingListComponent = (props) => {
110107
<Row>
111108
<Col lg={12}>
112109
<Card>
113-
<CardHeader>
110+
<Card.Header>
114111
<CIcon icon={cilListRich} /> Onboarding Requests
115-
</CardHeader>
116-
<CardBody>
112+
</Card.Header>
113+
<Card.Body>
117114
<Table>
118115
<thead>
119116
<tr>
@@ -147,15 +144,13 @@ export const OnboardingListComponent = (props) => {
147144
{loading === 'pending' && (
148145
<tr>
149146
<td colSpan="5">
150-
<Spinner animation="border" role="status">
151-
Loading...
152-
</Spinner>
147+
<Spinner animation="border" role="status"></Spinner>
153148
</td>
154149
</tr>
155150
)}
156151
</tbody>
157152
</Table>
158-
</CardBody>
153+
</Card.Body>
159154
</Card>
160155
</Col>
161156
</Row>

client/web/src/onboarding/OnboardingListItemComponent.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ export default function OnboardingListItemComponent(props) {
3333
return (
3434
<tr>
3535
<th scope="row">
36-
<Button className="pl-0" color="link" onClick={() => clickOnboardingRequest(onboarding.id)}>
36+
<Button
37+
className="pl-0"
38+
color="link"
39+
onClick={() => clickOnboardingRequest(onboarding.id)}
40+
>
3741
{onboarding.id}
3842
</Button>
3943
</th>
4044
<td>
4145
<OnboardingTenantLink
42-
tenantName={onboarding.tenantName}
46+
tenantName={onboarding.request?.name}
4347
tenantId={onboarding.tenantId}
4448
clickTenantDetails={clickTenantDetails}
4549
/>

client/web/src/settings/ApplicationComponent.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useDispatch } from 'react-redux'
2020
import { Formik, Form } from 'formik'
2121
import { PropTypes } from 'prop-types'
2222
import * as Yup from 'yup'
23-
import { Button, Row, Col, Card, CardBody, Alert } from 'reactstrap'
23+
import { Button, Row, Col, Card, Alert } from 'react-bootstrap'
2424
import LoadingOverlay from '@ronchalant/react-loading-overlay'
2525

2626
import AppSettingsSubform from './AppSettingsSubform'
@@ -472,15 +472,15 @@ export function ApplicationComponent(props) {
472472
<Row>
473473
<Col xs={12}>
474474
<Card>
475-
<CardBody>
475+
<Card.Body>
476476
<Button
477477
type="Submit"
478-
color="primary"
478+
variant="info"
479479
disabled={isSubmitting()}
480480
>
481481
{isSubmitting() ? 'Saving...' : 'Submit'}
482482
</Button>
483-
</CardBody>
483+
</Card.Body>
484484
</Card>
485485
</Col>
486486
</Row>

client/web/src/settings/ServicesComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const ServicesComponent = (props) => {
6060
<Row>
6161
<Col className="d-flex align-items-center">Services</Col>
6262
<Col className="d-flex justify-content-end">
63-
<Button type="button" onClick={toggleModal}>
63+
<Button variant="info" type="button" onClick={toggleModal}>
6464
New Service
6565
</Button>
6666
</Col>

client/web/src/tenant/api/index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const tenantAPI = {
7979
const { signal } = ops
8080

8181
try {
82-
const response = await apiServer.get('/', { signal })
82+
const response = await apiServer.get('?status=onboarded', { signal })
8383
return response.data
8484
} catch (err) {
8585
if (axios.isCancel(err)) {
@@ -136,7 +136,11 @@ const tenantAPI = {
136136
const { signal } = ops
137137

138138
try {
139-
const response = await apiServer.patch(`/${tenantId}/enable`, { id: tenantId }, { signal })
139+
const response = await apiServer.patch(
140+
`/${tenantId}/enable`,
141+
{ id: tenantId },
142+
{ signal }
143+
)
140144
return response.data
141145
} catch (err) {
142146
if (axios.isCancel(err)) {
@@ -151,7 +155,11 @@ const tenantAPI = {
151155
const { signal } = ops
152156

153157
try {
154-
const response = await apiServer.patch(`/${tenantId}/disable`, { id: tenantId }, { signal })
158+
const response = await apiServer.patch(
159+
`/${tenantId}/disable`,
160+
{ id: tenantId },
161+
{ signal }
162+
)
155163
return response.data
156164
} catch (err) {
157165
if (axios.isCancel(err)) {
@@ -171,7 +179,7 @@ const tenantAPI = {
171179
{
172180
data: { id: tenantId },
173181
},
174-
{ signal },
182+
{ signal }
175183
)
176184
return response.data
177185
} catch (err) {

0 commit comments

Comments
 (0)