summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-11-03 22:23:45 +0000
committerFatih Acet <acetfatih@gmail.com>2016-11-03 22:23:45 +0000
commit257075e43b88056fa38ca157f3552d3fa87653b2 (patch)
tree91a871b5baec5ba7f25efde222289994ad073caf
parentac1bbe7a78b0d861850de26797552c797966b309 (diff)
parentfb3229d771a42b0022f4bbbd084ce245a17626fe (diff)
downloadgitlab-ce-257075e43b88056fa38ca157f3552d3fa87653b2.tar.gz
Merge branch 'project-container-repo-disable' into 'master'
Hides registry if project repository is disabled ## What does this MR do? When disabling the projects repository it now hides the container registry as well. ## Screenshots (if relevant) ![Screen_Shot_2016-10-21_at_11.23.29](/uploads/e07d74e0666348748690689ab993f9d8/Screen_Shot_2016-10-21_at_11.23.29.png) ![Screen_Shot_2016-10-21_at_11.23.32](/uploads/e2f0757397a4524eca5aa069c1fabad3/Screen_Shot_2016-10-21_at_11.23.32.png) ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/19734#note_17224181 See merge request !7036
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/assets/javascripts/project_new.js13
-rw-r--r--app/views/projects/edit.html.haml4
3 files changed, 15 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7efa9efa4f8..1917360e9d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,7 @@ entry.
- Fix sidekiq stats in admin area (blackst0ne)
- Added label description as tooltip to issue board list title
- Created cycle analytics bundle JavaScript file
+- Hides container registry when repository is disabled
- API: Fix booleans not recognized as such when using the `to_boolean` helper
- Removed delete branch tooltip !6954
- Stop unauthorized users dragging on milestone page (blackst0ne)
diff --git a/app/assets/javascripts/project_new.js b/app/assets/javascripts/project_new.js
index 40575caa57f..0d3fb31a9cf 100644
--- a/app/assets/javascripts/project_new.js
+++ b/app/assets/javascripts/project_new.js
@@ -45,7 +45,9 @@
};
ProjectNew.prototype.toggleRepoVisibility = function () {
- var $repoAccessLevel = $('.js-repo-access-level select');
+ var $repoAccessLevel = $('.js-repo-access-level select'),
+ containerRegistry = document.querySelectorAll('.js-container-registry')[0],
+ containerRegistryCheckbox = document.getElementById('project_container_registry_enabled');
this.$repoSelects.find("option[value='" + $repoAccessLevel.val() + "']")
.nextAll()
@@ -70,8 +72,17 @@
if (selectedVal) {
this.$repoSelects.removeClass('disabled');
+
+ if (containerRegistry) {
+ containerRegistry.style.display = '';
+ }
} else {
this.$repoSelects.addClass('disabled');
+
+ if (containerRegistry) {
+ containerRegistry.style.display = 'none';
+ containerRegistryCheckbox.checked = false;
+ }
}
}.bind(this));
};
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index c40ad06969e..a5422966617 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -102,7 +102,7 @@
= link_to icon('question-circle'), help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs')
- if Gitlab.config.registry.enabled
- .form-group
+ .form-group.js-container-registry{ style: ("display: none;" if @project.project_feature.send(:repository_access_level) == 0) }
.checkbox
= f.label :container_registry_enabled do
= f.check_box :container_registry_enabled
@@ -290,4 +290,4 @@
Saving project.
%p Please wait a moment, this page will automatically refresh when ready.
-= render 'shared/confirm_modal', phrase: @project.path \ No newline at end of file
+= render 'shared/confirm_modal', phrase: @project.path