Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0531e86

Browse files
committed
Merge branch 'project-label-enhancements' into 'master'
fix(ui): project label enhancements, redirect on editing project See merge request postgres-ai/database-lab!710
2 parents cbd171f + cc115a7 commit 0531e86

File tree

5 files changed

+59
-3
lines changed

5 files changed

+59
-3
lines changed

‎ui/packages/platform/src/components/DbLabInstanceForm/DbLabInstanceForm.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import BlockIcon from '@material-ui/icons/Block'
1818
import WarningIcon from '@material-ui/icons/Warning'
1919

2020
import { styles } from '@postgres.ai/shared/styles/styles'
21+
import { Spinner } from '@postgres.ai/shared/components/Spinner'
2122
import { PageSpinner } from '@postgres.ai/shared/components/PageSpinner'
2223
import {
2324
ClassesType,
@@ -594,6 +595,9 @@ class DbLabInstanceForm extends Component<
594595
onClick={this.buttonHandler}
595596
>
596597
{this.props.edit ? 'Update' : 'Add'}
598+
{isDataUpdating && (
599+
<Spinner size="sm" className={classes.spinner} />
600+
)}
597601
</Button>
598602
&nbsp;&nbsp;
599603
<Button

‎ui/packages/platform/src/components/DbLabInstanceForm/DbLabInstanceFormWrapper.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export const DbLabInstanceFormWrapper = (props: DbLabInstanceFormProps) => {
5252
position: 'relative',
5353
marginBottom: -3,
5454
},
55+
spinner: {
56+
marginLeft: 8,
57+
color: 'inherit',
58+
},
5559
},
5660
{ index: 1 },
5761
)

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,22 @@ export const Instance = () => {
6767
project={params.project}
6868
breadcrumbs={[
6969
{ name: 'Database Lab Instances', url: 'instances' },
70-
{ name: 'Instance #' + params.instanceId, url: null },
70+
{
71+
name: `Instance #${params.instanceId} ${
72+
params.project ? `(${params.project})` : ''
73+
}`,
74+
url: null,
75+
},
7176
]}
7277
/>
7378
),
7479
}
7580

7681
return (
7782
<InstancePage
78-
title={`Database Lab instance #${params.instanceId}`}
83+
title={`Database Lab instance #${params.instanceId} ${
84+
params.project ? `(${params.project})` : ''
85+
}`}
7986
instanceId={params.instanceId}
8087
hideInstanceTabs
8188
routes={routes}

‎ui/packages/platform/src/pages/JoeInstance/Command/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type Props = {
2222
onSend: (value: string) => void
2323
}
2424

25-
const LABEL_FONT_SIZE = '18px'
25+
const LABEL_FONT_SIZE = '14px'
2626

2727
const useStyles = makeStyles(
2828
{

‎ui/packages/platform/src/stores/store.js‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,47 @@ const Store = Reflux.createStore({
11931193
this.trigger(this.data);
11941194
},
11951195

1196+
onEditDbLabInstanceFailed: function (error) {
1197+
this.data.newDbLabInstance.isUpdating = false;
1198+
this.data.newDbLabInstance.isProcessed = false;
1199+
this.data.newDbLabInstance.updateError = true;
1200+
this.data.newDbLabInstance.updateErrorMessage = error.message;
1201+
this.trigger(this.data);
1202+
},
1203+
1204+
onEditDbLabInstanceProgressed: function (data) {
1205+
this.data.newDbLabInstance.updateErrorFields = null
1206+
this.data.newDbLabInstance.isUpdating = true
1207+
this.data.newDbLabInstance.data = {}
1208+
1209+
if (data && data.email) {
1210+
this.data.newDbLabInstance.data.email = data.email
1211+
}
1212+
1213+
this.trigger(this.data)
1214+
},
1215+
1216+
onEditDbLabInstanceCompleted: function (data) {
1217+
this.data.newDbLabInstance.isUpdating = false;
1218+
this.data.newDbLabInstance.errorMessage = this.getError(data.data);
1219+
this.data.newDbLabInstance.error = !!this.data.newDbLabInstance.errorMessage;
1220+
1221+
if (!this.data.newDbLabInstance.error && data.data) {
1222+
this.data.newDbLabInstance.data = data.data;
1223+
this.data.newDbLabInstance.isProcessed = true;
1224+
// Update orgs and projects.
1225+
Actions.getUserProfile(this.data.auth.token);
1226+
Actions.getDbLabInstances(this.data.auth.token, data.orgId, data.data
1227+
.project_id);
1228+
1229+
if (window.location.href.indexOf('edit') > -1) {
1230+
let url = window.location.href.split('/edit')[0]
1231+
window.location.href = url
1232+
}
1233+
}
1234+
this.trigger(this.data);
1235+
},
1236+
11961237

11971238
onCheckDbLabInstanceUrlFailed: function (error) {
11981239
this.data.newDbLabInstance.isChecked = false;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /