Skip to content

Commit 9a5b3f5

Browse files
committed
Merge branch 'branching-ui-polishes' into 'dle-4-0'
fix(ui): branch page polishes See merge request postgres-ai/database-lab!862
2 parents 9772eb4 + e3c278d commit 9a5b3f5

File tree

9 files changed

+26
-12
lines changed

9 files changed

+26
-12
lines changed

ui/packages/ce/src/App/Menu/Header/styles.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
height: 32px;
2121
color: inherit;
2222
text-decoration: none;
23+
align-items: center;
2324

2425
&.collapsed {
2526
justify-content: center;

ui/packages/ce/src/components/NavPath/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const NavPath = (props: Props) => {
1919
<nav className={cn(styles.root, props.className)}>
2020
{props.routes.map((route, i) => {
2121
const isLast = (i + 1) === props.routes.length
22+
const nameWithIndent = route.name.replace('/', ' / ')
2223

2324
return (
2425
<React.Fragment key={i}>
@@ -28,7 +29,7 @@ export const NavPath = (props: Props) => {
2829
className={styles.link}
2930
activeClassName={styles.active}
3031
>
31-
{route.name}
32+
{nameWithIndent}
3233
</NavLink>
3334
{ !isLast && <span className={styles.divider}>/</span> }
3435
</React.Fragment>

ui/packages/shared/pages/Branches/components/BranchesTable/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import cn from 'classnames'
9-
import { useState } from 'react'
9+
import { useEffect, useState } from 'react'
1010
import copy from 'copy-to-clipboard'
1111
import { makeStyles } from '@material-ui/core'
1212
import { useHistory } from 'react-router-dom'
@@ -72,7 +72,7 @@ export const BranchesTable = ({
7272

7373
const [state, setState] = useState({
7474
sortByParent: 'desc',
75-
branches: branchesData ?? [],
75+
branches: [] as GetBranchesResponseType[],
7676
})
7777
const [branchId, setBranchId] = useState('')
7878
const [isOpenDestroyModal, setIsOpenDestroyModal] = useState(false)
@@ -94,6 +94,13 @@ export const BranchesTable = ({
9494
})
9595
}
9696

97+
useEffect(() => {
98+
setState({
99+
sortByParent: 'desc',
100+
branches: branchesData ?? [],
101+
})
102+
}, [branchesData])
103+
97104
if (!state.branches.length) {
98105
return <p className={classes.marginTop}>{emptyTableText}</p>
99106
}

ui/packages/shared/pages/Branches/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const Branches = observer((): React.ReactElement => {
102102

103103
{!branchesList.length && (
104104
<Tooltip content="No existing branch">
105-
<div>
105+
<div style={{ display: 'flex' }}>
106106
<InfoIcon className={classes.infoIcon} />
107107
</div>
108108
</Tooltip>

ui/packages/shared/pages/CreateBranch/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export const CreateBranchPage = observer(
252252
form, copy the command below and paste it into your terminal.
253253
</p>
254254
<SyntaxHighlight
255-
content={getCliCreateBranchCommand(formik.values.branchName)}
255+
content={getCliCreateBranchCommand(formik.values.branchName, formik.values.baseBranch)}
256256
/>
257257
<SectionTitle
258258
className={classes.marginTop}

ui/packages/shared/pages/CreateBranch/utils/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
export const getCliCreateBranchCommand = (branchName: string) => {
2-
return `dblab branch create ${branchName ? branchName : `<BRANCH_NAME>`}`
1+
export const getCliCreateBranchCommand = (
2+
branchName: string,
3+
parentBranchName: string,
4+
) => {
5+
return `dblab branch create ${branchName ? branchName : `<BRANCH_NAME>`} ${
6+
parentBranchName !== `master` ? parentBranchName : ``
7+
}`
38
}
49

510
export const getCliBranchListCommand = () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const Clones = observer((props: ClonesProps) => {
110110

111111
{!hasSnapshots && (
112112
<Tooltip content="No snapshots">
113-
<div>
113+
<div style={{ display: 'flex' }}>
114114
<InfoIcon className={classes.infoIcon} />
115115
</div>
116116
</Tooltip>

ui/packages/shared/pages/Instance/Info/Status/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export const Status = observer(() => {
6262
)}
6363
{uiVersion && <Property name="UI version">{`v${uiVersion}`}</Property>}
6464
{version && <Property name="Engine version">{version}</Property>}
65-
{config?.dockerImage && (
66-
<Property name="Docker image">{config?.dockerImage}</Property>
67-
)}
65+
{config?.dockerPath && (
66+
<Property name="Docker image">{config?.dockerPath}</Property>
67+
)}
6868

6969
{!isStatusOk && (
7070
<div className={styles.controls}>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const Snapshots = observer(() => {
9898

9999
{!hasClones && (
100100
<Tooltip content="No clones">
101-
<div>
101+
<div style={{ display: 'flex' }}>
102102
<InfoIcon className={classes.infoIcon} />
103103
</div>
104104
</Tooltip>

0 commit comments

Comments
 (0)