Skip to content

Commit 0ef582e

Browse files
committed
Merge branch 'fix-platform-ui' into 'master'
fix(ui): fix bugs related to latest release See merge request postgres-ai/database-lab!752
2 parents 86848a9 + 27ca2ed commit 0ef582e

File tree

13 files changed

+856
-815
lines changed

13 files changed

+856
-815
lines changed

ui/packages/platform/src/components/AddDbLabInstanceFormWrapper/AddDblabInstanceForm.tsx

Lines changed: 609 additions & 608 deletions
Large diffs are not rendered by default.

ui/packages/platform/src/components/DbLabInstanceForm/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CloudImage } from 'api/cloud/getCloudImages'
22
import { initialState } from '../reducer'
33

44
const API_SERVER = process.env.REACT_APP_API_SERVER
5-
const DEBUG_API_SERVER = 'https://postgres.ai/api/general'
5+
const DEBUG_API_SERVER = 'https://v2.postgres.ai/api/general'
66

77
export const availableTags = ['3.4.0-rc.5', '4.0.0-alpha.5']
88

ui/packages/platform/src/components/DbLabInstanceInstallForm/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { initialState } from '../reducer'
22

33
const API_SERVER = process.env.REACT_APP_API_SERVER
4-
const DEBUG_API_SERVER = 'https://postgres.ai/api/general'
4+
const DEBUG_API_SERVER = 'https://v2.postgres.ai/api/general'
55

66
export const getPlaybookCommand = (
77
state: typeof initialState,

ui/packages/platform/src/components/DbLabInstances/DbLabInstances.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ class DbLabInstances extends Component<
471471
? data.data[index].url
472472
: ''}
473473
{!isHttps(data.data[index].url) &&
474+
data.data[index].url &&
474475
!data.data[index].use_tunnel ? (
475476
<Tooltip
476477
title="The connection to Database Lab API is not secure"
@@ -479,7 +480,9 @@ class DbLabInstances extends Component<
479480
>
480481
<WarningIcon className={classes.warningIcon} />
481482
</Tooltip>
482-
) : null}
483+
) : (
484+
'N/A'
485+
)}
483486
</TableCell>
484487
<TableCell className={classes.cell}>
485488
{data.data[index]?.state?.cloning?.numClones ??

ui/packages/platform/src/components/JoeInstanceForm/JoeInstanceForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ class JoeInstanceForm extends Component<
355355
}}
356356
margin="normal"
357357
helperText={
358-
!isHttps(this.state.url) && !this.state.useTunnel ? (
358+
this.state.url &&
359+
!isHttps(this.state.url) &&
360+
!this.state.useTunnel ? (
359361
<span>
360362
<WarningIcon className={classes.warningIcon} />
361363
<span className={classes.warning}>

ui/packages/platform/src/components/JoeInstances/JoeInstances.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ class JoeInstances extends Component<
404404

405405
<TableCell className={classes.cell}>
406406
{data.data[i].url ? data.data[i].url : ''}
407-
{!isHttps(data.data[i].url) &&
407+
{data.data[i].url &&
408+
!isHttps(data.data[i].url) &&
408409
!data.data[i].use_tunnel ? (
409410
<Tooltip
410411
title="The connection to Joe Bot API is not secure"
@@ -413,7 +414,9 @@ class JoeInstances extends Component<
413414
>
414415
<WarningIcon className={classes.warningIcon} />
415416
</Tooltip>
416-
) : null}
417+
) : (
418+
'N/A'
419+
)}
417420
</TableCell>
418421

419422
<TableCell align={'right'}>

ui/packages/platform/src/config/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
export const NODE_ENV = process.env.NODE_ENV
99
export const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN
10-
export const API_URL_PREFIX = 'https://postgres.ai/api/general' ?? ''
10+
export const API_URL_PREFIX = process.env.REACT_APP_API_SERVER ?? ''
1111
export const WS_URL_PREFIX = process.env.REACT_APP_WS_URL_PREFIX ?? ''
1212
export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP

ui/packages/platform/src/pages/Instance/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export const Instance = () => {
9292

9393
return (
9494
<InstancePage
95+
isPlatform
9596
title={`Database Lab instance #${params.instanceId} ${
9697
params.project ? `(${params.project})` : ''
9798
}`}

ui/packages/shared/pages/Instance/Clones/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const useStyles = makeStyles(
3030
width: 0,
3131
flex: '1 1 100%',
3232
marginRight: '40px',
33-
height: "100%",
33+
height: '100%',
3434

3535
[theme.breakpoints.down('sm')]: {
3636
width: '100%',
@@ -71,7 +71,7 @@ export const Clones = observer(() => {
7171
const goToCloneAddPage = () => history.push(host.routes.createClone())
7272

7373
const showListSizeButton =
74-
instance.state.cloning.clones.length > SHORT_LIST_SIZE && isMobile
74+
instance.state.cloning.clones?.length > SHORT_LIST_SIZE && isMobile
7575

7676
const isLoadingSnapshots = stores.main.snapshots.isLoading
7777
const hasSnapshots = Boolean(stores.main.snapshots.data?.length)

ui/packages/shared/pages/Instance/Tabs/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ type Props = {
4949
value: number
5050
handleChange: (event: React.ChangeEvent<{}>, newValue: number) => void
5151
hasLogs: boolean
52-
hideInstanceTabs?: boolean
52+
isPlatform?: boolean
5353
}
5454

5555
export const Tabs = (props: Props) => {
5656
const classes = useStyles()
5757

58-
const { value, handleChange, hasLogs, hideInstanceTabs } = props
58+
const { value, handleChange, hasLogs } = props
5959

6060
return (
6161
<TabsComponent
@@ -74,14 +74,14 @@ export const Tabs = (props: Props) => {
7474
label="Logs"
7575
disabled={!hasLogs}
7676
classes={{
77-
root: classes.tabRoot,
77+
root: props.isPlatform ? classes.tabHidden : classes.tabRoot,
7878
}}
7979
value={1}
8080
/>
8181
<TabComponent
8282
label="Configuration"
8383
classes={{
84-
root: props.hideInstanceTabs ? classes.tabHidden : classes.tabRoot,
84+
root: props.isPlatform ? classes.tabHidden : classes.tabRoot,
8585
}}
8686
value={2}
8787
/>

0 commit comments

Comments
 (0)