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 = () => {
4949 branches : ( ) => ROUTES . INSTANCE . BRANCHES . BRANCHES . path ,
5050 snapshot : ( snapshotId : string ) =>
5151 ROUTES . INSTANCE . SNAPSHOTS . SNAPSHOT . createPath ( snapshotId ) ,
52+ createClone : ( ) => ROUTES . INSTANCE . CLONES . CREATE . path ,
5253 } }
5354 />
5455 </ PageContainer >
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export const Snapshot = () => {
5050 ROUTES . INSTANCE . BRANCHES . BRANCH . createPath ( branchName ) ,
5151 clone : ( cloneId : string ) =>
5252 ROUTES . INSTANCE . CLONES . CLONE . createPath ( cloneId ) ,
53+ createClone : ( ) => ROUTES . INSTANCE . CLONES . CREATE . path ,
5354 } }
5455 api = { api }
5556 elements = { elements }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ type Req = {
99 dbUser : string
1010 dbPassword : string
1111 isProtected : boolean
12+ branch ?: string
1213}
1314
1415export const createClone = async ( req : Req ) => {
@@ -19,6 +20,7 @@ export const createClone = async (req: Req) => {
1920 action : '/clone' ,
2021 method : 'post' ,
2122 data : {
23+ branch : req . branch ,
2224 id : req . cloneId ,
2325 snapshot : {
2426 id : req . snapshotId ,
Original file line number Diff line number Diff line change @@ -52,6 +52,17 @@ export const Branch = () => {
5252 instanceId : params . instanceId ,
5353 snapshotId,
5454 } ) ,
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+ } ) ,
5566 }
5667
5768 const api = {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { getInstance } from 'api/instances/getInstance'
77import { getSnapshots } from 'api/snapshots/getSnapshots'
88import { createClone } from 'api/clones/createClone'
99import { getClone } from 'api/clones/getClone'
10+ import { getBranches } from 'api/branches/getBranches'
1011import { ConsoleBreadcrumbsWrapper } from 'components/ConsoleBreadcrumbs/ConsoleBreadcrumbsWrapper'
1112
1213type Params = {
@@ -38,6 +39,7 @@ export const CreateClone = () => {
3839 getInstance,
3940 createClone,
4041 getClone,
42+ getBranches
4143 }
4244
4345 const elements = {
Original file line number Diff line number Diff line change @@ -62,6 +62,17 @@ export const Snapshot = () => {
6262 cloneId : cloneId ,
6363 instanceId : params . instanceId ,
6464 } ) ,
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+ } ) ,
6576 }
6677
6778 const api = {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export type Host = {
1010 branch : ( ) => string
1111 branches : ( ) => string
1212 snapshot : ( snapshotId : string ) => string
13+ createClone : ( ) => string
1314 }
1415 api : Api
1516 elements : {
Original file line number Diff line number Diff line change @@ -214,6 +214,16 @@ export const BranchesPage = observer((props: Props) => {
214214 < div className = { classes . wrapper } >
215215 < div className = { classes . container } >
216216 < 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 >
217227 < Button
218228 variant = "contained"
219229 color = "primary"
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ export const CreateClone = observer((props: Props) => {
214214
215215 < Select
216216 fullWidth
217- label = "Data state time *"
217+ label = "Snapshot *"
218218 value = { formik . values . snapshotId }
219219 disabled = { ! snapshots || isCreatingClone }
220220 onChange = { ( e ) =>
@@ -228,12 +228,12 @@ export const CreateClone = observer((props: Props) => {
228228 value : snapshot . id ,
229229 children : (
230230 < 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+ ) }
237237 { snapshot . message && (
238238 < span > Message: { snapshot . message } </ span >
239239 ) }
Original file line number Diff line number Diff line change 101101.elapsedTime {
102102 margin-left : 24px ;
103103}
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