@@ -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'
1919import * as _ from 'lodash'
2020import * as React from 'react'
2121import { 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'
3033import { DBAAS_PROVIDER_KIND } from '../catalog/const.ts'
3134import {
@@ -34,6 +37,7 @@ import {
3437 isDbaasConnectionUsed ,
3538 disableNSSelection ,
3639 filterInventoriesByConnNS ,
40+ fetchDbaasCSV ,
3741} from '../utils.ts'
3842import FlexForm from './form/flexForm.tsx'
3943import 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
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+ 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
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+ 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