File tree Expand file tree Collapse file tree 13 files changed +71
-9
lines changed
Instance/Snapshots/components/SnapshotsList Expand file tree Collapse file tree 13 files changed +71
-9
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export const Branch = () => {
49
49
branches : ( ) => ROUTES . INSTANCE . BRANCHES . BRANCHES . path ,
50
50
snapshot : ( snapshotId : string ) =>
51
51
ROUTES . INSTANCE . SNAPSHOTS . SNAPSHOT . createPath ( snapshotId ) ,
52
+ createClone : ( ) => ROUTES . INSTANCE . CLONES . CREATE . path ,
52
53
} }
53
54
/>
54
55
</ PageContainer >
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export const Snapshot = () => {
50
50
ROUTES . INSTANCE . BRANCHES . BRANCH . createPath ( branchName ) ,
51
51
clone : ( cloneId : string ) =>
52
52
ROUTES . INSTANCE . CLONES . CLONE . createPath ( cloneId ) ,
53
+ createClone : ( ) => ROUTES . INSTANCE . CLONES . CREATE . path ,
53
54
} }
54
55
api = { api }
55
56
elements = { elements }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ type Req = {
9
9
dbUser : string
10
10
dbPassword : string
11
11
isProtected : boolean
12
+ branch ?: string
12
13
}
13
14
14
15
export const createClone = async ( req : Req ) => {
@@ -19,6 +20,7 @@ export const createClone = async (req: Req) => {
19
20
action : '/clone' ,
20
21
method : 'post' ,
21
22
data : {
23
+ branch : req . branch ,
22
24
id : req . cloneId ,
23
25
snapshot : {
24
26
id : req . snapshotId ,
Original file line number Diff line number Diff line change @@ -52,6 +52,17 @@ export const Branch = () => {
52
52
instanceId : params . instanceId ,
53
53
snapshotId,
54
54
} ) ,
55
+ createClone : ( ) =>
56
+ params . project
57
+ ? ROUTES . ORG . PROJECT . INSTANCES . INSTANCE . CLONES . ADD . createPath ( {
58
+ org : params . org ,
59
+ project : params . project ,
60
+ instanceId : params . instanceId ,
61
+ } )
62
+ : ROUTES . ORG . INSTANCES . INSTANCE . CLONES . ADD . createPath ( {
63
+ org : params . org ,
64
+ instanceId : params . instanceId ,
65
+ } ) ,
55
66
}
56
67
57
68
const api = {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { getInstance } from 'api/instances/getInstance'
7
7
import { getSnapshots } from 'api/snapshots/getSnapshots'
8
8
import { createClone } from 'api/clones/createClone'
9
9
import { getClone } from 'api/clones/getClone'
10
+ import { getBranches } from 'api/branches/getBranches'
10
11
import { ConsoleBreadcrumbsWrapper } from 'components/ConsoleBreadcrumbs/ConsoleBreadcrumbsWrapper'
11
12
12
13
type Params = {
@@ -38,6 +39,7 @@ export const CreateClone = () => {
38
39
getInstance,
39
40
createClone,
40
41
getClone,
42
+ getBranches
41
43
}
42
44
43
45
const elements = {
Original file line number Diff line number Diff line change @@ -62,6 +62,17 @@ export const Snapshot = () => {
62
62
cloneId : cloneId ,
63
63
instanceId : params . instanceId ,
64
64
} ) ,
65
+ createClone : ( ) =>
66
+ params . project
67
+ ? ROUTES . ORG . PROJECT . INSTANCES . INSTANCE . CLONES . ADD . createPath ( {
68
+ org : params . org ,
69
+ project : params . project ,
70
+ instanceId : params . instanceId ,
71
+ } )
72
+ : ROUTES . ORG . INSTANCES . INSTANCE . CLONES . ADD . createPath ( {
73
+ org : params . org ,
74
+ instanceId : params . instanceId ,
75
+ } ) ,
65
76
}
66
77
67
78
const api = {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export type Host = {
10
10
branch : ( ) => string
11
11
branches : ( ) => string
12
12
snapshot : ( snapshotId : string ) => string
13
+ createClone : ( ) => string
13
14
}
14
15
api : Api
15
16
elements : {
Original file line number Diff line number Diff line change @@ -214,6 +214,16 @@ export const BranchesPage = observer((props: Props) => {
214
214
< div className = { classes . wrapper } >
215
215
< div className = { classes . container } >
216
216
< div className = { classes . actions } >
217
+ < Button
218
+ variant = "contained"
219
+ color = "primary"
220
+ onClick = { ( ) => history . push ( props . routes . createClone ( ) ) }
221
+ disabled = { isReloading }
222
+ title = { 'Create clone' }
223
+ className = { classes . actionButton }
224
+ >
225
+ Create clone
226
+ </ Button >
217
227
< Button
218
228
variant = "contained"
219
229
color = "primary"
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ export const CreateClone = observer((props: Props) => {
214
214
215
215
< Select
216
216
fullWidth
217
- label = "Data state time *"
217
+ label = "Snapshot *"
218
218
value = { formik . values . snapshotId }
219
219
disabled = { ! snapshots || isCreatingClone }
220
220
onChange = { ( e ) =>
@@ -228,12 +228,12 @@ export const CreateClone = observer((props: Props) => {
228
228
value : snapshot . id ,
229
229
children : (
230
230
< div className = { styles . snapshotItem } >
231
- < span >
232
- { snapshot . dataStateAt }
233
- { isLatest && (
234
- < span className = { styles . snapshotTag } > Latest </ span >
235
- ) }
236
- </ span >
231
+ < strong className = { styles . snapshotOverflow } >
232
+ { snapshot ?. id } { isLatest && < span > Latest </ span > }
233
+ </ strong >
234
+ { snapshot ?. dataStateAt && (
235
+ < p > Data state at: { snapshot ?. dataStateAt } </ p >
236
+ ) }
237
237
{ snapshot . message && (
238
238
< span > Message: { snapshot . message } </ span >
239
239
) }
Original file line number Diff line number Diff line change 101
101
.elapsedTime {
102
102
margin-left : 24px ;
103
103
}
104
+
105
+ .snapshotOverflow {
106
+ width : 100% ;
107
+ word-wrap : break-word ;
108
+ white-space : initial ;
109
+ }
You can’t perform that action at this time.
0 commit comments