Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ require('app')
.directive('addDockerfile', addDockerfile);

function addDockerfile(
$q,
$timeout,
fetchRepoDockerfile,
doesDockerfileExist
) {
Expand All @@ -20,6 +18,8 @@ function addDockerfile(
fileType: '@'
},
link: function ($scope, elem, attrs, MDC) {
$scope.MDC = MDC;

var COMPOSE_DEFAULT = 'docker-compose.yml';
var COMPOSE_TEST_DEFAULT = 'docker-compose.test.yml';
var DOCKER_DEFAULT = 'Dockerfile';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ form(
dockerfile-exists-validator = "{{fileType}}"
full-repo = "fullRepo"
id = "add-dockerfile-input"
ng-disabled = "state.dockerFileAdded || $root.featureFlags.composeEditing"
ng-disabled = "state.dockerFileAdded || $root.featureFlags.composeEditing || MDC.isSaving()"
ng-model = "newDockerfile"
ng-model-options = "{ debounce: { 'default': 100, 'blur': 0 } }"
placeholder = "{{ fileName }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function composeFilePath(
fullRepo: '='
},
link: function ($scope, elem, attr, MDC) {
$scope.MDC = MDC;

MDC.state.configurationMethod = 'dockerComposeFile';
$scope.dockerComposeState = MDC.state;
$scope.dockerfile = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require('app')
function MirrorDockerfileController(
$q,
$rootScope,
$timeout,
errs,
doesDockerfileExist,
fetchRepoDockerfile,
Expand Down Expand Up @@ -74,5 +73,9 @@ function MirrorDockerfileController(
}
});
};

MDC.isSaving = function () {
return $rootScope.isLoading.newContainerSingleRepo || $rootScope.isLoading.creatingDockerCompose;
};
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ng-disabled = "$root.featureFlags.composeEditing"
ng-model = "pathEnabled"
type = "checkbox"
ng-disabled = "MDC.isSaving()"
)
.toggle-group.toggle-sm

Expand Down Expand Up @@ -41,7 +42,7 @@
- Copy: "Select a Container"
fancy-select.btn-md.white(
disabled
ng-disabled = "loadingFile || !dockerComposeTestServices.length"
ng-disabled = "loadingFile || !dockerComposeTestServices.length || MDC.isSaving()"
ng-required = "true"
spinner-flag = "loadingFile"
value = "dockerComposeState.testReporter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ label
required
spellcheck = "false"
unique-validator = "NCC.state.namesForAllInstances"
ng-disabled = "NCC.isSaving()"
)
svg.iconnables.icons-check(
ng-if = "NCC.nameForm.$valid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ label.grid-block.align-center.btn.btn-radio(
label.grid-block.align-center.btn.btn-radio(
data-event-name = "Selected Compose Setup"
ng-class = "{'active': NCC.state.dockerFileTab === 'compose'}"
ng-click = "NCC.state.dockerFileTab = 'compose'; NCC.state.configurationMethod = 'dockerComposeFile'"
ng-click = "NCC.setToComposeTab()"
)
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
use(
Expand All @@ -30,7 +30,7 @@ label.grid-block.align-center.btn.btn-radio(
label.grid-block.align-center.btn.btn-radio(
data-event-name = "Selected Dockerfile Setup"
ng-class = "{'active': NCC.state.dockerFileTab === 'dockerfile'}"
ng-click = "NCC.state.dockerFileTab = 'dockerfile'; NCC.state.configurationMethod = 'dockerfile'"
ng-click = "NCC.setToDockerTab()"
ng-if = "!$root.featureFlags.kubernetes"
)
svg.grid-block.shrink.btn.btn-xs.btn-icon.btn-add.iconnables.icons-check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,24 @@ function NewContainerController(
(NCC.state.types.stage ? NCC.state.dockerComposeFile : NCC.state.types.test))));
};

NCC.isSaving = function () {
return $rootScope.isLoading.newContainerSingleRepo || $rootScope.isLoading.creatingDockerCompose;
};

NCC.setToComposeTab = function () {
if (!NCC.isSaving()) {
NCC.state.dockerFileTab = 'compose';
NCC.state.configurationMethod = 'dockerComposeFile';
}
};

NCC.setToDockerTab = function () {
if (!NCC.isSaving()) {
NCC.state.dockerFileTab = 'dockerfile';
NCC.state.configurationMethod = 'dockerfile';
}
};

NCC.populateComposeErrorMessage = function (errorMsg) {
var err = /ValidationError(.*)/.exec(errorMsg);
if (err) {
Expand Down