summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2017-04-04 03:37:22 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-04-04 03:38:58 +0100
commit07d7d8e65905a39164b63f55eccdcea8f10f5d14 (patch)
tree4fc627e0256a787ab80f4483b3d6e2442c26a619 /app/assets
parentf9e849c076efb3162a3d951d8aae2e7be3e574f4 (diff)
downloadgitlab-ce-07d7d8e65905a39164b63f55eccdcea8f10f5d14.tar.gz
Renamed ProtectedTag push_access_levels to create_access_levels
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/protected_tags/protected_tag_create.js14
-rw-r--r--app/assets/javascripts/protected_tags/protected_tag_edit.js22
2 files changed, 18 insertions, 18 deletions
diff --git a/app/assets/javascripts/protected_tags/protected_tag_create.js b/app/assets/javascripts/protected_tags/protected_tag_create.js
index 4c652e7747f..84b1b232649 100644
--- a/app/assets/javascripts/protected_tags/protected_tag_create.js
+++ b/app/assets/javascripts/protected_tags/protected_tag_create.js
@@ -11,20 +11,20 @@
}
buildDropdowns() {
- const $allowedToPushDropdown = this.$wrap.find('.js-allowed-to-push');
+ const $allowedToCreateDropdown = this.$wrap.find('.js-allowed-to-create');
// Cache callback
this.onSelectCallback = this.onSelect.bind(this);
- // Allowed to Push dropdown
+ // Allowed to Create dropdown
new gl.ProtectedTagAccessDropdown({
- $dropdown: $allowedToPushDropdown,
- data: gon.push_access_levels,
+ $dropdown: $allowedToCreateDropdown,
+ data: gon.create_access_levels,
onSelect: this.onSelectCallback
});
// Select default
- $allowedToPushDropdown.data('glDropdown').selectRowAtIndex(0);
+ $allowedToCreateDropdown.data('glDropdown').selectRowAtIndex(0);
// Protected tag dropdown
new ProtectedTagDropdown({
@@ -37,9 +37,9 @@
onSelect() {
// Enable submit button
const $tagInput = this.$wrap.find('input[name="protected_tag[name]"]');
- const $allowedToPushInput = this.$wrap.find('input[name="protected_tag[push_access_levels_attributes][0][access_level]"]');
+ const $allowedToCreateInput = this.$wrap.find('input[name="protected_tag[create_access_levels_attributes][0][access_level]"]');
- this.$form.find('input[type="submit"]').attr('disabled', !($tagInput.val() && $allowedToPushInput.length));
+ this.$form.find('input[type="submit"]').attr('disabled', !($tagInput.val() && $allowedToCreateInput.length));
}
};
})(window);
diff --git a/app/assets/javascripts/protected_tags/protected_tag_edit.js b/app/assets/javascripts/protected_tags/protected_tag_edit.js
index b93e903621e..0227be35c8f 100644
--- a/app/assets/javascripts/protected_tags/protected_tag_edit.js
+++ b/app/assets/javascripts/protected_tags/protected_tag_edit.js
@@ -7,27 +7,27 @@
gl.ProtectedTagEdit = class {
constructor(options) {
this.$wrap = options.$wrap;
- this.$allowedToPushDropdown = this.$wrap.find('.js-allowed-to-push');
+ this.$allowedToCreateDropdown = this.$wrap.find('.js-allowed-to-create');
this.buildDropdowns();
}
buildDropdowns() {
- // Allowed to push dropdown
+ // Allowed to create dropdown
new gl.ProtectedTagAccessDropdown({
- $dropdown: this.$allowedToPushDropdown,
- data: gon.push_access_levels,
+ $dropdown: this.$allowedToCreateDropdown,
+ data: gon.create_access_levels,
onSelect: this.onSelect.bind(this)
});
}
onSelect() {
- const $allowedToPushInput = this.$wrap.find(`input[name="${this.$allowedToPushDropdown.data('fieldName')}"]`);
+ const $allowedToCreateInput = this.$wrap.find(`input[name="${this.$allowedToCreateDropdown.data('fieldName')}"]`);
// Do not update if one dropdown has not selected any option
- if (!$allowedToPushInput.length) return;
+ if (!$allowedToCreateInput.length) return;
- this.$allowedToPushDropdown.disable();
+ this.$allowedToCreateDropdown.disable();
$.ajax({
type: 'POST',
@@ -36,9 +36,9 @@
data: {
_method: 'PATCH',
protected_tag: {
- push_access_levels_attributes: [{
- id: this.$allowedToPushDropdown.data('access-level-id'),
- access_level: $allowedToPushInput.val()
+ create_access_levels_attributes: [{
+ id: this.$allowedToCreateDropdown.data('access-level-id'),
+ access_level: $allowedToCreateInput.val()
}]
}
},
@@ -47,7 +47,7 @@
new Flash('Failed to update tag!');
}
}).always(() => {
- this.$allowedToPushDropdown.enable();
+ this.$allowedToCreateDropdown.enable();
});
}
};