diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-04 03:37:22 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-04 03:38:58 +0100 |
commit | 07d7d8e65905a39164b63f55eccdcea8f10f5d14 (patch) | |
tree | 4fc627e0256a787ab80f4483b3d6e2442c26a619 /app/assets/javascripts/protected_tags/protected_tag_edit.js | |
parent | f9e849c076efb3162a3d951d8aae2e7be3e574f4 (diff) | |
download | gitlab-ce-07d7d8e65905a39164b63f55eccdcea8f10f5d14.tar.gz |
Renamed ProtectedTag push_access_levels to create_access_levels
Diffstat (limited to 'app/assets/javascripts/protected_tags/protected_tag_edit.js')
-rw-r--r-- | app/assets/javascripts/protected_tags/protected_tag_edit.js | 22 |
1 files changed, 11 insertions, 11 deletions
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(); }); } }; |