File tree Expand file tree Collapse file tree 4 files changed +34
-7
lines changed
client/directives/environment/modals Expand file tree Collapse file tree 4 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 14
14
)
15
15
16
16
.grid-block.shrink.align-center.well.gray.in.row-xxs (
17
- ng-if = "!SMC.state.advanced || !$root.featureFlags.dockerfileMirroring"
17
+ ng-if = "( !SMC.state.advanced && !SMC.state.isMirroingDockerfile) || !$root.featureFlags.dockerfileMirroring"
18
18
)
19
19
svg.grid-content.row-xxs.shrink.iconnables.icons-dockerfile-lock
20
20
use(
58
58
59
59
//- add logic for repository containers only
60
60
.grid-block.shrink.align-center.well.gray.in.row-xxs (
61
- ng-if = "$root.featureFlags.dockerfileMirroring && SMC.state.advanced"
61
+ ng-if = "$root.featureFlags.dockerfileMirroring && ( SMC.state.advanced || SMC.state.isMirroingDockerfile) "
62
62
)
63
63
svg.grid-content.row-xxs.shrink.iconnables.icons-sync
64
64
use(
69
69
)
70
70
div Mirror Dockerfile
71
71
small.small (
72
- ng-if = "state.syncing "
72
+ ng-if = "state.isMirroingDockerfile "
73
73
)
74
74
span.span.text-overflow.float-left (
75
- title = "reponame/path/to/dockerfile "
75
+ ng- title = "state.contextVersion.attrs.buildDockerfilePath "
76
76
) Mirroring from GitHub: reponame/path/to/dockerfile
77
77
//- when there's an error
78
78
//- svg.iconnables.icons-alert-alt.float-left
95
95
internal-modal-helper = "changeMirrorView"
96
96
) Change…
97
97
small.small (
98
- ng-if = "!state.syncing "
98
+ ng-if = "!state.isMirroingDockerfile "
99
99
) Mirror with a Dockerfile from this repo on GitHub.
100
100
101
101
//- this should open the 'viewModalSync' view when syncing has not been set up
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ function SetupMirrorServerModalController(
20
20
promisify ,
21
21
cardInfoTypes ,
22
22
OpenItems ,
23
+ updateDockerfileFromState ,
23
24
close ,
24
25
repo ,
25
26
build ,
@@ -231,6 +232,32 @@ function SetupMirrorServerModalController(
231
232
} ) ;
232
233
} ;
233
234
235
+ SMC . changeFromMirrorModeToAdvanced = function ( ) {
236
+ SMC . state . advanced = true ;
237
+ SMC . state . isMirroingDockerfile = false ;
238
+ var dockerfileBody = SMC . state . dockerfile . attrs . body ;
239
+ return promisify ( SMC . state . contextVersion , 'update' ) ( {
240
+ advanced : SMC . state . advanced ,
241
+ buildDockerfilePath : null
242
+ } )
243
+ . then ( function ( ) {
244
+ return $q . all ( [
245
+ promisify ( SMC . state . contextVersion , 'fetch' ) ( ) ,
246
+ SMC . openDockerfile ( SMC . state , SMC . openItems )
247
+ ] ) ;
248
+ } )
249
+ . then ( function ( ) {
250
+ return promisify ( SMC . state . dockerfile , 'update' ) ( {
251
+ json : {
252
+ body : dockerfileBody
253
+ }
254
+ } ) ;
255
+ } )
256
+ . then ( function ( ) {
257
+ return SMC . resetStateContextVersion ( SMC . state . contextVersion , false ) ;
258
+ } ) ;
259
+ } ;
260
+
234
261
/**
235
262
* This function determines if a tab chooser should be shown
236
263
*
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ function SetupServerModalController(
410
410
411
411
SMC . isPrimaryButtonDisabled = function ( serverFormInvalid ) {
412
412
return (
413
- ( SMC . state . step === 2 && SMC . repositoryForm . $invalid ) ||
413
+ ( SMC . state . step === 2 && SMC . repositoryForm && SMC . repositoryForm . $invalid ) ||
414
414
$filter ( 'selectedStackInvalid' ) ( SMC . state . selectedStack )
415
415
) ;
416
416
} ;
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ function ServerModalController(
325
325
return SMC . state . promises . contextVersion
326
326
. then ( function ( contextVersion ) {
327
327
// Only parse the Dockerfile info when no error has occurred
328
- if ( shouldParseDockerfile && ! SMC . state . advanced ) {
328
+ if ( shouldParseDockerfile && ! SMC . state . advanced ) {
329
329
return parseDockerfileForCardInfoFromInstance ( SMC . instance , contextVersion )
330
330
. then ( function ( data ) {
331
331
angular . extend ( SMC , data ) ;
You can’t perform that action at this time.
0 commit comments