Commit fb78fb73 authored by kushalpandya's avatar kushalpandya

Use autocomplete paths from data attr

parent ff691472
......@@ -17,8 +17,8 @@ export default class ProtectedTagAccessDropdown {
this.accessLevelsData = accessLevelsData.roles;
this.$dropdown = $dropdown;
this.$wrap = this.$dropdown.closest(`.${this.accessLevel}-container`);
this.usersPath = '/autocomplete/users.json';
this.groupsPath = '/autocomplete/project_groups.json';
this.usersPath = $('.js-protected-tags-container').data('users-autocomplete');
this.groupsPath = $('.js-protected-tags-container').data('groups-autocomplete');
this.defaultLabel = this.$dropdown.data('defaultLabel');
this.setSelectedItems([]);
......
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('protected_tags')
.row.prepend-top-default.append-bottom-default
.row.prepend-top-default.append-bottom-default.js-protected-tags-container{ data: { "groups-autocomplete" => "#{autocomplete_project_groups_path(format: :json)}", "users-autocomplete" => "#{autocomplete_users_path(format: :json)}" } }
.col-lg-3
%h4.prepend-top-0
Protected Tags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment