Skip to content

Commit 2c2ad2a

Browse files
authored
Merge pull request #105 from tchughesiv/patch4.9support
cherry-picked commits for 0.1.5 ocp 4.9 release
2 parents 8f8789e + 7bdc8a4 commit 2c2ad2a

File tree

12 files changed

+186
-68
lines changed

12 files changed

+186
-68
lines changed

.github/workflows/node.js.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches:
9+
- main
10+
- release-*
11+
912
pull_request:
10-
branches: [ main ]
13+
branches:
14+
- main
15+
- release-*
1116

1217
jobs:
1318
build:
@@ -28,5 +33,5 @@ jobs:
2833
cache: 'npm'
2934
- run: npm install --global [email protected]
3035
- run: yarn install
31-
- run: yarn build-dev
36+
- run: yarn build
3237
- run: git diff --exit-code

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ COPY . /opt/app-root/src/app
66
USER 0
77
RUN npm i -g [email protected]
88
RUN yarn install
9-
RUN yarn build-dev
9+
RUN yarn build
1010

1111
FROM registry.access.redhat.com/ubi8/nodejs-14-minimal:1
1212

console-extensions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"properties": {
1919
"id": "dbaasAddAction",
2020
"href": "/catalog?catalogType=dbaas-new",
21-
"label": "Connected Database",
22-
"description": "Select a cloud database provider to connect",
21+
"label": "Cloud-Hosted Database",
22+
"description": "Connect to a cloud-hosted database provider, such as MongoDB Atlas, Crunchy Data Bridge or CockroachDB",
2323
"icon": {
2424
"$codeRef": "constants.dbaasServicesIcon"
2525
},
@@ -51,7 +51,7 @@
5151
"type": "console.catalog/item-type",
5252
"properties": {
5353
"type": "dbaas-new",
54-
"title": "Connected Database",
54+
"title": "Cloud-Hosted Database",
5555
"catalogDescription": "See a list of connected cloud database provider",
5656
"typeDescription": "DBaaS"
5757
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@console/dbaas-dynamic-plugin",
3-
"version": "0.1.4",
3+
"version": "0.1.5-4.9",
44
"private": true,
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/RHEcosystemAppEng/dbaas-dynamic-plugin.git"
88
},
99
"scripts": {
1010
"clean": "rm -rf ./dist",
11-
"build": "yarn clean && NODE_ENV=production yarn --production ts-node ./node_modules/.bin/webpack",
11+
"build": "yarn clean && NODE_ENV=production yarn ts-node ./node_modules/.bin/webpack --mode=production",
1212
"build-dev": "yarn lint && yarn format && yarn clean && yarn ts-node ./node_modules/.bin/webpack",
1313
"img-build": "docker build -f Dockerfile -t quay.io/$QUAY_USER/dbaas-dynamic-plugin:$npm_package_version .",
1414
"img-push": "docker push quay.io/$QUAY_USER/dbaas-dynamic-plugin:$npm_package_version",
@@ -67,7 +67,7 @@
6767
},
6868
"consolePlugin": {
6969
"name": "dbaas-dynamic-plugin",
70-
"version": "0.1.4",
70+
"version": "0.1.5-4.9",
7171
"displayName": "DBaaS Dynamic Plugin",
7272
"description": "Dynamic Plugin for Openshift Console to provide custom components for DBaaS",
7373
"exposedModules": {

src/components/_dbaas-import-view.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,8 @@
177177
.issue-text {
178178
color: '#2b9af3';
179179
padding-left: '3px';
180+
}
181+
182+
.emptyState-title {
183+
padding-top: 20px;
180184
}

src/components/adminConnectionsTable.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ class AdminConnectionsTable extends React.Component {
5454
this.state = {
5555
currentNS: window.location.pathname.split('/')[3],
5656
columns: [
57-
{ title: 'Instance Name', transforms: [wrappable, cellWidth(30), sortable] },
58-
{ title: 'DB Provider', transforms: [wrappable, cellWidth(30), sortable] },
59-
{ title: 'Provider Account', transforms: [wrappable, cellWidth(30), sortable] },
60-
{ title: 'Alert', transforms: [wrappable, cellWidth(20)] },
61-
{ title: 'Project', transforms: [wrappable, cellWidth(25)] },
62-
{ title: 'Bound', transforms: [wrappable, cellWidth(20)] },
63-
{ title: 'User', transforms: [wrappable, cellWidth(25)] },
64-
{ title: 'Application', transforms: [wrappable, cellWidth(30)] },
57+
{ title: 'Instance Name', transforms: [wrappable, cellWidth(20), sortable] },
58+
{ title: 'DB Provider', transforms: [wrappable, cellWidth(20), sortable] },
59+
{ title: 'Provider Account', transforms: [wrappable, cellWidth(20), sortable] },
60+
{ title: 'Alert', transforms: [wrappable, cellWidth(10)] },
61+
{ title: 'Project', transforms: [wrappable, cellWidth(10)] },
62+
{ title: 'Bound', transforms: [wrappable, cellWidth(10)] },
63+
{ title: 'User', transforms: [wrappable, cellWidth(15)] },
64+
{ title: 'Application', transforms: [wrappable, cellWidth(15)] },
6565
],
6666
rows: [],
6767
dBaaSOperatorNameWithVersion: this.props.dBaaSOperatorNameWithVersion,

src/components/adminDashboard.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ const AdminDashboard = () => {
7878
key="link"
7979
href={`/k8s/ns/${currentNS}/clusterserviceversions/${dBaaSOperatorNameWithVersion}/${DBaaSInventoryCRName}/~new`}
8080
>
81-
Database Provider Account
81+
Import Database Provider Account
8282
</DropdownItem>,
8383
<DropdownItem key="dbinstancelink" href={`/k8s/ns/${currentNS}/rhoda-create-database-instance`}>
84-
Database Instance
84+
Create Database Instance
8585
</DropdownItem>,
8686
]
8787

@@ -291,10 +291,10 @@ const AdminDashboard = () => {
291291
No Database Instances
292292
</Title>
293293
<EmptyStateBody>
294-
Database instances are shown here once you've created your first Provider Account.
294+
Database instances are shown here once you've imported your first Provider Account.
295295
</EmptyStateBody>
296296
<Button variant="primary" onClick={goToCreateProviderPage}>
297-
Create Provider Account
297+
Import Provider Account
298298
</Button>
299299
</EmptyState>
300300
)
@@ -336,7 +336,7 @@ const AdminDashboard = () => {
336336
<SplitItem isFilled>
337337
<FormHeader
338338
title={dbProviderTitle}
339-
helpText="Create database provider account and view your database instances"
339+
helpText="Import database provider account and view your database instances"
340340
marginBottom="lg"
341341
/>
342342
</SplitItem>
@@ -346,7 +346,7 @@ const AdminDashboard = () => {
346346
position={DropdownPosition.right}
347347
toggle={
348348
<DropdownToggle onToggle={onToggle} toggleIndicator={CaretDownIcon} isPrimary id="toggle-id-4">
349-
Create
349+
Configuration
350350
</DropdownToggle>
351351
}
352352
isOpen={isOpen}

src/components/dbaasImportPage.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class DBaasImportPage extends React.Component {
7878
<div>
7979
<div className="section-header-div extra-bottom-margin">
8080
<div className="section-padding-left">&nbsp;</div>
81-
<div className="section-title">Create Provider Account</div>
81+
<div className="section-title">Import Provider Account</div>
8282
<div className="section-subtitle">
83-
Creating a Provider Account resource allows provider cloud instances to be imported
83+
Importing a Provider Account resource allows provider cloud instances to be imported
8484
</div>
8585
</div>
8686
{!isDBaaSServiceUp ? (

src/components/instanceListPage.jsx

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
Split,
1616
SplitItem,
1717
} from '@patternfly/react-core'
18-
import { InfoCircleIcon } from '@patternfly/react-icons'
18+
import { ExclamationTriangleIcon, ExternalLinkAltIcon, InfoCircleIcon } from '@patternfly/react-icons'
1919
import * as _ from 'lodash'
2020
import * as React from 'react'
2121
import { useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk'
@@ -26,6 +26,9 @@ import {
2626
mongoProviderName,
2727
mongoProviderType,
2828
cockroachdbProviderName,
29+
DBaaSInventoryCRName,
30+
DBaaSOperatorName,
31+
providerAcctResourceUrl,
2932
} from '../const.ts'
3033
import { DBAAS_PROVIDER_KIND } from '../catalog/const.ts'
3134
import {
@@ -34,6 +37,7 @@ import {
3437
isDbaasConnectionUsed,
3538
disableNSSelection,
3639
filterInventoriesByConnNS,
40+
fetchDbaasCSV,
3741
} from '../utils.ts'
3842
import FlexForm from './form/flexForm.tsx'
3943
import FormBody from './form/formBody.tsx'
@@ -64,6 +68,7 @@ const InstanceListPage = () => {
6468
const [dbaasConnectionList, setDbaasConnectionList] = React.useState([])
6569
const [serviceBindingList, setServiceBindingList] = React.useState([])
6670
const [connectionAndServiceBindingList, setConnectionAndServiceBindingList] = React.useState([])
71+
const [dBaaSOperatorNameWithVersion, setDBaaSOperatorNameWithVersion] = React.useState()
6772

6873
const currentNS = window.location.pathname.split('/')[3]
6974

@@ -246,6 +251,14 @@ const InstanceListPage = () => {
246251

247252
setShowResults(true)
248253
}
254+
const fetchCSV = async () => {
255+
const dbaasCSV = await fetchDbaasCSV(currentNS, DBaaSOperatorName)
256+
setDBaaSOperatorNameWithVersion(dbaasCSV.metadata?.name)
257+
}
258+
259+
React.useEffect(() => {
260+
fetchCSV()
261+
}, [])
249262

250263
React.useEffect(() => {
251264
parseSelectedDBProvider()
@@ -284,13 +297,50 @@ const InstanceListPage = () => {
284297
{noInstances ? (
285298
<>
286299
<EmptyState>
287-
<EmptyStateIcon variant="container" component={InfoCircleIcon} className="warning-icon" />
288-
<Title headingLevel="h2" size="md">
300+
<ExclamationTriangleIcon className="warning-icon" size="xl" />
301+
<Title headingLevel="h2" size="md" className="emptyState-title">
289302
No Database Instances
290303
</Title>
291304
<EmptyStateBody>
292-
There are no Provider Accounts available. Please work with an administrator to create one first.
305+
You currently have no database Provider Accounts imported. Work with your administrator to &nbsp;
306+
<Button
307+
variant="link"
308+
component="a"
309+
href={`/k8s/ns/${currentNS}/clusterserviceversions/${dBaaSOperatorNameWithVersion}/${DBaaSInventoryCRName}/~new`}
310+
target="_blank"
311+
rel="noopener noreferrer"
312+
icon={<ExternalLinkAltIcon />}
313+
iconPosition="right"
314+
isInline
315+
>
316+
Import a Provider Account
317+
</Button>
318+
&nbsp; from the supported cloud-hosted database providers. If you receive an error message when
319+
trying to import a provider account, then you do not have the required privileges to access this
320+
page.
321+
<br />
322+
<br />
323+
See the &nbsp;
324+
<Button
325+
variant="link"
326+
component="a"
327+
href={providerAcctResourceUrl}
328+
target="_blank"
329+
rel="noopener noreferrer"
330+
icon={<ExternalLinkAltIcon />}
331+
iconPosition="right"
332+
isInline
333+
>
334+
Importing a provider account resource
335+
</Button>
336+
&nbsp; section of the Red Hat OpenShift Database Access Quick Start Guide on the Customer Portal for
337+
more details.
293338
</EmptyStateBody>
339+
<EmptyStateSecondaryActions>
340+
<Button component="a" href={`/add/ns/${currentNS}`} variant="link">
341+
Close
342+
</Button>
343+
</EmptyStateSecondaryActions>
294344
</EmptyState>
295345
</>
296346
) : (

0 commit comments

Comments
 (0)