Skip to content

Commit cbd171f

Browse files
committed
Merge branch 'add-missing-project-label-in-ui' into 'master'
fix(ui): add missing project label to pages See merge request postgres-ai/database-lab!709
2 parents 4e678d0 + 5f32cc7 commit cbd171f

File tree

3 files changed

+48
-14
lines changed

3 files changed

+48
-14
lines changed

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

+11-2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ interface CommandDataProps {
8080
username: string
8181
useremail: string
8282
project_name: string
83+
project_label: string
84+
project_label_or_name: string
8385
joe_session_id: number
8486
id: number
8587
}
@@ -499,7 +501,11 @@ class JoeHistory extends Component<JoeHistoryWithStylesProps, JoeHistoryState> {
499501
}
500502

501503
getProject(command: CommandDataProps) {
502-
return command['project_name']
504+
return (
505+
command['project_label_or_name'] ||
506+
command['project_label'] ||
507+
command['project_name']
508+
)
503509
}
504510

505511
getChannel(command: CommandDataProps) {
@@ -1027,7 +1033,10 @@ class JoeHistory extends Component<JoeHistoryWithStylesProps, JoeHistoryState> {
10271033
provisioned and seconds, behaves as production (same execution
10281034
plans, same data volumes), writable and isolated for safe
10291035
"what if" experiments to check various optimization ideas (
1030-
<GatewayLink href="https://postgres.ai/docs/joe" target="_blank">
1036+
<GatewayLink
1037+
href="https://postgres.ai/docs/joe"
1038+
target="_blank"
1039+
>
10311040
Learn more
10321041
</GatewayLink>
10331042
).

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

+12-3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ interface JoeInstancesState {
6262
[instance: string]: {
6363
id: number
6464
project_name: string
65+
project_label: string
66+
project_label_or_name: string
6567
url: string
6668
use_tunnel: boolean
6769
}
@@ -79,6 +81,8 @@ interface JoeInstancesState {
7981
data: {
8082
id: number
8183
name: string
84+
label: string
85+
project_label_or_name: string
8286
}[]
8387
} | null
8488
} | null
@@ -274,7 +278,7 @@ class JoeInstances extends Component<
274278
{projects.data.map((p) => {
275279
return (
276280
<MenuItem value={p.id} key={p.id}>
277-
{p.name}
281+
{p.project_label_or_name || p.label || p.name}
278282
</MenuItem>
279283
)
280284
})}
@@ -356,7 +360,10 @@ class JoeInstances extends Component<
356360
Joe Bot is a virtual DBA for SQL Optimization. Joe helps engineers
357361
quickly troubleshoot and optimize SQL. Joe runs on top of the
358362
Database Lab Engine. (
359-
<GatewayLink href="https://postgres.ai/docs/joe-bot" target="_blank">
363+
<GatewayLink
364+
href="https://postgres.ai/docs/joe-bot"
365+
target="_blank"
366+
>
360367
Learn more
361368
</GatewayLink>
362369
).
@@ -390,7 +397,9 @@ class JoeInstances extends Component<
390397
style={{ cursor: 'pointer' }}
391398
>
392399
<TableCell className={classes.cell}>
393-
{data.data[i].project_name}
400+
{data.data[i].project_label_or_name ||
401+
data.data[i].project_label ||
402+
data.data[i].project_name}
394403
</TableCell>
395404

396405
<TableCell className={classes.cell}>

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

+25-9
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ interface ReportsType {
6060
project_id: string
6161
created_formatted: string
6262
project_name: string
63+
project_label_or_name: string
64+
project_label: string
6365
epoch: string
6466
}[]
6567
}
@@ -342,13 +344,20 @@ class Reports extends Component<ReportsWithStylesProps, ReportsState> {
342344
>
343345
<MenuItem value={0}>All</MenuItem>
344346

345-
{projects.data.map((p: { id: number; name: string }) => {
346-
return (
347-
<MenuItem value={p.id} key={p.id}>
348-
{p.name}
349-
</MenuItem>
350-
)
351-
})}
347+
{projects.data.map(
348+
(p: {
349+
id: number
350+
name: string
351+
label: string
352+
project_label_or_name: string
353+
}) => {
354+
return (
355+
<MenuItem value={p.id} key={p.id}>
356+
{p.project_label_or_name || p.label || p.name}
357+
</MenuItem>
358+
)
359+
},
360+
)}
352361
</TextField>
353362
</div>
354363
)
@@ -410,7 +419,10 @@ class Reports extends Component<ReportsWithStylesProps, ReportsState> {
410419
<p>
411420
Automated routine checkup for your PostgreSQL databases. Configure
412421
Checkup agent to start collecting reports (
413-
<GatewayLink href="https://postgres.ai/docs/checkup" target="_blank">
422+
<GatewayLink
423+
href="https://postgres.ai/docs/checkup"
424+
target="_blank"
425+
>
414426
Learn more
415427
</GatewayLink>
416428
).
@@ -496,6 +508,8 @@ class Reports extends Component<ReportsWithStylesProps, ReportsState> {
496508
created_formatted: string
497509
project_name: string
498510
epoch: string
511+
project_label_or_name: string
512+
project_label: string
499513
}) => {
500514
return (
501515
<TableRow
@@ -533,7 +547,9 @@ class Reports extends Component<ReportsWithStylesProps, ReportsState> {
533547
</NavLink>
534548
</TableCell>
535549
<TableCell className={classes.cell}>
536-
{r.project_name}
550+
{r.project_label_or_name ||
551+
r.project_label ||
552+
r.project_name}
537553
</TableCell>
538554
<TableCell className={classes.cell}>
539555
{r.created_formatted}

0 commit comments

Comments
 (0)