-
Notifications
You must be signed in to change notification settings - Fork 1
San 3912 dockerfile mirroing #1553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 88 commits
706943c
5a6ca8e
eaf3d33
6ef5b70
6c1b38a
171d139
80f5853
43a1780
215ba42
4a5f7d4
b051ab4
f010c0b
2e85c37
c1ed103
cbb83b4
17cec4c
3972e05
f5616d7
3a4128a
7987d10
f77ee14
68d8ebe
ea090ee
7db6352
d1adcda
5a9bc06
470ef27
2ace728
0c0a8cf
0349ef9
bbf04b0
49ac6fb
a905df7
22a1f5e
db7e48b
f4714ae
f8cd1ae
83d4be5
4ce30f3
62e9b61
90b905a
eb24244
5fa4ff9
c0123b0
e587d47
9399ee6
fc51785
f06b962
93c437e
826d9d0
c54c157
c897c03
594f619
343f1a1
442508a
1bac572
d49c453
99f7740
f90b396
7339afa
ed8143a
78f0752
956ce08
5467ea7
888e314
abf424a
6d51745
2ca3d57
681673c
8b37753
cd16271
38b8769
56f006c
28767c4
e77362f
d728d67
14c5899
fa488af
a41a620
3fe3a72
ef36dc9
515aab3
c2fc52f
653502e
7e9b537
16ddf55
8255576
f7da8e9
904d02c
a6f4651
c007ed9
ef9e083
bf1a346
f17da88
31004e2
f51cbd6
cb25669
58d2c95
bf59254
ee92e4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ li.folder( | |
li.file( | ||
ng-class = "{\ | ||
active: acv.editing,\ | ||
disabled: !acv.id() || readOnly\ | ||
disabled: !acv.id() || readOnly || (acv.id() === fileModel.getMainAppCodeVersion().id()) \ | ||
}" | ||
ng-repeat = "acv in fileModel.appCodeVersions.models | orderBy:'attrs.repo'" | ||
pop-over | ||
|
@@ -71,9 +71,10 @@ li.folder( | |
a( | ||
ng-class = "{\ | ||
active: acv.editing,\ | ||
disabled: !acv.id()\ | ||
disabled: !acv.id() || acv.id() === fileModel.getMainAppCodeVersion().id()\ | ||
}" | ||
ng-click = "popoverFileExplorerRepository.actions.editRepo(acv)" | ||
ng-disabled = "acv.id() === fileModel.getMainAppCodeVersion().id()" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why both ng-disabled and disabled class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does ng-disabled do? The disabled attribute isn't used on anchor tags. |
||
pop-over | ||
pop-over-actions = "popoverFilesRepositoryCommitToggle.actions" | ||
pop-over-active = "acv.editing" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
button.btn.btn-md.gray.btn-cancel.float-left.js-animate( | ||
ng-click = "SMC.actions.close()" | ||
ng-if = "!SMC.instance && SMC.state.step < 4" | ||
ng-if = "!SMC.instance" | ||
type = "button" | ||
) Cancel | ||
|
||
|
@@ -9,14 +9,14 @@ button.btn.btn-md.btn-done.white.float-right( | |
'js-animate': SMC.state.step > 3\ | ||
}" | ||
ng-click = "SMC.actions.close()" | ||
ng-if = "SMC.instance || SMC.state.step > 3" | ||
ng-if = "SMC.instance" | ||
type = "button" | ||
) Done | ||
|
||
button.btn.btn-md.btn-primary.white.text-next.float-right( | ||
ng-click = "SMC.goToNextStep()" | ||
ng-disabled = "isPrimaryButtonDisabled()" | ||
ng-if = "SMC.state.step < 3" | ||
ng-if = "!SMC.instance && !SMC.isTabVisible('buildfiles')" | ||
type = "button" | ||
) | ||
span.btn-text.float-left Next | ||
|
@@ -39,8 +39,8 @@ button.btn.btn-md.white.btn-primary.float-right.js-animate( | |
'text-save-build': showSaveAndBuild()\ | ||
}" | ||
ng-click = "thisForm.$invalid || createServerOrUpdate()" | ||
ng-disabled = "(SMC.needToBeDirtyToSaved() && !SMC.isDirty()) || isPrimaryButtonDisabled()" | ||
ng-if = "SMC.instance || SMC.state.step > 2" | ||
ng-disabled = "(SMC.needsToBeDirtySaved() && !SMC.isDirty()) || isPrimaryButtonDisabled()" | ||
ng-if = "SMC.instance || SMC.isTabVisible('buildfiles')" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we not say the "next" button shouldn't be there if the buildfiles tab is not visible? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed it to this: |
||
type = "submit" | ||
) | ||
span.btn-text.float-left Save | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ function EnvironmentController( | |
newContainer: function () { | ||
return ModalService.showModal({ | ||
controller: 'NewContainerModalController', | ||
controllerAs: 'NCMC', | ||
controllerAs: 'MC', // Shared | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yay! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
templateUrl: 'newContainerModalView' | ||
}); | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ | |
state = "SMC.state" | ||
) | ||
button.btn.btn-sm.white( | ||
internal-modal-helper = "confirmSetupAdvancedModalView" | ||
ng-click = "SMC.showAdvancedModeConfirm()" | ||
ng-if = "$root.featureFlags.dockerfileMirroring" | ||
) | ||
svg.iconnables.icons-lock | ||
|
@@ -58,22 +58,26 @@ | |
|
||
//- add logic for repository containers only | ||
.grid-block.shrink.align-center.well.gray.in.row-xxs( | ||
ng-if = "$root.featureFlags.dockerfileMirroring && SMC.state.advanced" | ||
ng-if = "$root.featureFlags.dockerfileMirroring && SMC.state.advanced && !SMC.state.isNonRepoContainer" | ||
) | ||
svg.grid-content.row-xxs.shrink.iconnables.icons-sync | ||
use( | ||
xlink:href = "#icons-sync" | ||
) | ||
.grid-content.row-xxs.text-overflow( | ||
ng-class = "{'padding-right': state.syncing}" | ||
ng-class = "{'padding-right': SMC.state.advanced === 'isMirroringDockerfile'}" | ||
) | ||
div Mirror Dockerfile | ||
small.small( | ||
ng-if = "state.syncing" | ||
ng-if = "SMC.state.advanced === 'isMirroringDockerfile'" | ||
) | ||
span.span.text-overflow.float-left( | ||
title = "reponame/path/to/dockerfile" | ||
) Mirroring from GitHub: reponame/path/to/dockerfile | ||
ng-title = "SMC.state.contextVersion.attrs.buildDockerfilePath" | ||
) Mirroring from GitHub: {{ SMC.state.contextVersion.attrs.buildDockerfilePath }} | ||
small.small( | ||
ng-if = "SMC.state.advanced !== 'isMirroringDockerfile'" | ||
) | ||
span.span.text-overflow.float-left Mirror with a Dockerfile from this repo on GitHub. | ||
//- when there's an error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you be more specific? Do you mean having no Dockerfile (Yes, we do have it) or having an error (We don't have it right now. Will be working on it). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The having an error :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, let's leave it for now. I'll have another PR that adds this functionality (you know, splitting PRs and stuff) |
||
//- svg.iconnables.icons-alert-alt.float-left | ||
//- use( | ||
|
@@ -92,16 +96,15 @@ | |
xlink:href = "#icons-help" | ||
) | ||
button.btn.btn-xxs.gray( | ||
ng-if = "$root.featureFlags.dockerfileMirroringMultiple" | ||
internal-modal-helper = "changeMirrorView" | ||
) Change… | ||
small.small( | ||
ng-if = "!state.syncing" | ||
) Mirror with a Dockerfile from this repo on GitHub. | ||
|
||
//- this should open the 'viewModalSync' view when syncing has not been set up | ||
label.toggle-wrapper | ||
input.toggle-input( | ||
ng-model = "state.syncing" | ||
ng-model = "SMC.switchBetweenAdvancedAndMirroring" | ||
ng-model-options = "{getterSetter: true}" | ||
type = "checkbox" | ||
) | ||
.toggle-group.toggle-sm | ||
|
@@ -114,7 +117,6 @@ | |
'ace-runnable-dark': !$root.featureFlags.imAfraidOfTheDark,\ | ||
'ace-runnable-light': $root.featureFlags.imAfraidOfTheDark\ | ||
}" | ||
ng-init = "state.syncing = null" | ||
) | ||
|
||
.sidebar( | ||
|
@@ -123,7 +125,7 @@ | |
explorer-title = "Build Files" | ||
file-model = "SMC.state.contextVersion" | ||
loading-promises-target = "editServerModal" | ||
ng-if = "!state.syncing" | ||
ng-if = "SMC.state.advanced !== 'isMirroringDockerfile'" | ||
open-items = "SMC.openItems" | ||
read-only = "!SMC.state.advanced" | ||
root-dir = "SMC.state.contextVersion.rootDir" | ||
|
@@ -135,11 +137,11 @@ | |
file = "item" | ||
file-editor | ||
loading-promises-target = "editServerModal" | ||
ng-class = "{'readonly': !SMC.state.advanced || state.syncing}" | ||
ng-class = "{'readonly': !SMC.state.advanced || (SMC.state.advanced && SMC.state.advanced === 'isMirroringDockerfile') }" | ||
ng-if = "item.state.type === 'File'" | ||
ng-repeat = "item in SMC.openItems.models track by item.id()" | ||
ng-show = "item === SMC.openItems.activeHistory.last()" | ||
read-only = "!SMC.state.advanced || state.syncing" | ||
read-only = "!SMC.state.advanced || SMC.state.advanced === 'isMirroringDockerfile'" | ||
state = "SMC.state" | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.label.clearfix( | ||
ng-if = "showStackSelector" | ||
ng-include = "'viewFormStackSelector'" | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
ng-class = "{'in': active}" | ||
) | ||
.popover-header Choose Dockerfile | ||
svg.iconnables.icons-close | ||
svg.iconnables.icons-close( | ||
ng-click = "MC.cancel()" | ||
) | ||
use( | ||
xlink:href = "#icons-close" | ||
) | ||
|
@@ -14,12 +16,15 @@ | |
onload = "fromTool = true" | ||
) | ||
footer.modal-footer.clearfix | ||
button.btn.btn-md.white.float-left Cancel | ||
button.btn.btn-md.white.float-left( | ||
ng-click = "MC.cancel()" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MC Cancel is my homeboy |
||
) Cancel | ||
button.btn.btn-md.green.float-right.btn-spinner( | ||
ng-disabled = "!dockerfile.selection" | ||
ng-click = "MC.confirm(MC.state.dockerfile)" | ||
ng-disabled = "!MC.state.dockerfile" | ||
) | ||
//- add the 'in' class to .btn-spinner when spinning! | ||
//- .spinner-wrapper.spinner-white.spinner-sm.in( | ||
//- ng-include = "'spinner'" | ||
//- ) | ||
| Start Mirroring | ||
| Start Mirroring |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
'use strict'; | ||
|
||
require('app') | ||
.controller('ChooseDockerfileModalController', ChooseDockerfileModalController); | ||
|
||
function ChooseDockerfileModalController( | ||
$rootScope, | ||
errs, | ||
fetchRepoDockerfiles, | ||
keypather, | ||
loading, | ||
close, | ||
repo, | ||
branchName | ||
) { | ||
var CDMC = this; | ||
if (!repo) { | ||
throw new Error('A repo is required for this controller'); | ||
} | ||
angular.extend(CDMC, { | ||
name: 'ChooseDockerfileModal', | ||
state: { | ||
repo: repo | ||
} | ||
}); | ||
loading.reset(CDMC.name); | ||
|
||
loading(CDMC.name, true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is CDMC.name set? Maybe just put 'ChooseDockerfileModal'? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
var oauthName = keypather.get($rootScope, 'dataApp.data.activeAccount.oauthName()'); | ||
var name = keypather.get(repo, 'attrs.name'); | ||
var fullname = keypather.get(repo, 'attrs.full_name') || (oauthName + '/' + name); | ||
var defaultBranch = keypather.get(repo, 'attrs.default_branch'); | ||
fetchRepoDockerfiles(fullname, branchName || defaultBranch) | ||
.then(function (dockerfiles) { | ||
CDMC.state.repo.dockerfiles = dockerfiles; | ||
}) | ||
.catch(errs.handler) | ||
.finally(function () { | ||
loading(CDMC.name, false); | ||
}); | ||
|
||
CDMC.cancel = close.bind(null, false); | ||
|
||
CDMC.confirm = function (dockerfile) { | ||
if (dockerfile) { | ||
return close(dockerfile); | ||
} | ||
throw new Error('Dockerfile path needed'); | ||
}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think this could cause issues wherever we have to refetch a file. Off the top of my head, I think this can occur when an instance fails to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to rely on a
isRemoteCopy
property on the file. Not sure if there's a better way to deal with this.