Skip to content

Commit 970a75f

Browse files
SAN-6097 Code review change
1 parent 268dc52 commit 970a75f

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

client/directives/components/newContainer/forms/setupMethodView.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ label.grid-block.align-center.btn.btn-radio(
1717
label.grid-block.align-center.btn.btn-radio(
1818
data-event-name = "Selected Compose Setup"
1919
ng-class = "{'active': NCC.state.dockerFileTab === 'compose'}"
20-
ng-click = "NCC.state.dockerFileTab = 'compose'; NCC.state.configurationMethod = 'dockerComposeFile'"
20+
ng-click = "NCC.setToComposeTab()"
2121
)
2222
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
2323
use(
@@ -30,7 +30,7 @@ label.grid-block.align-center.btn.btn-radio(
3030
label.grid-block.align-center.btn.btn-radio(
3131
data-event-name = "Selected Dockerfile Setup"
3232
ng-class = "{'active': NCC.state.dockerFileTab === 'dockerfile'}"
33-
ng-click = "NCC.state.dockerFileTab = 'dockerfile'; NCC.state.configurationMethod = 'dockerfile'"
33+
ng-click = "NCC.setToDockerTab()"
3434
ng-if = "!$root.featureFlags.kubernetes"
3535
)
3636
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check

client/directives/components/newContainer/newContainerController.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,20 @@ function NewContainerController(
400400
return $rootScope.isLoading.newContainerSingleRepo || $rootScope.isLoading.creatingDockerCompose;
401401
};
402402

403+
NCC.setToComposeTab = function () {
404+
if (!NCC.isSaving()) {
405+
NCC.state.dockerFileTab = 'compose';
406+
NCC.state.configurationMethod = 'dockerComposeFile';
407+
}
408+
};
409+
410+
NCC.setToDockerTab = function () {
411+
if (!NCC.isSaving()) {
412+
NCC.state.dockerFileTab = 'dockerfile';
413+
NCC.state.configurationMethod = 'dockerfile';
414+
}
415+
};
416+
403417
NCC.populateComposeErrorMessage = function (errorMsg) {
404418
var err = /ValidationError(.*)/.exec(errorMsg);
405419
if (err) {

0 commit comments

Comments
 (0)