Commit 15ad1d88 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Use full group name/path in UI dropdowns

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4468104f
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
} else { } else {
avatar = gon.default_avatar_url; avatar = gon.default_avatar_url;
} }
return "<div class='group-result'> <div class='group-name'>" + group.name + "</div> <div class='group-path'>" + group.path + "</div> </div>"; return "<div class='group-result'> <div class='group-name'>" + group.full_name + "</div> <div class='group-path'>" + group.full_path + "</div> </div>";
}; };
GroupsSelect.prototype.formatSelection = function(group) { GroupsSelect.prototype.formatSelection = function(group) {
return group.name; return group.full_name;
}; };
return GroupsSelect; return GroupsSelect;
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
filterable: true, filterable: true,
fieldName: 'group_id', fieldName: 'group_id',
search: { search: {
fields: ['name'] fields: ['full_name']
}, },
data: function(term, callback) { data: function(term, callback) {
return Api.groups(term, {}, function(data) { return Api.groups(term, {}, function(data) {
data.unshift({ data.unshift({
name: 'Any' full_name: 'Any'
}); });
data.splice(1, 0, 'divider'); data.splice(1, 0, 'divider');
return callback(data); return callback(data);
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
return obj.id; return obj.id;
}, },
text: function(obj) { text: function(obj) {
return obj.name; return obj.full_name;
}, },
toggleLabel: function(obj) { toggleLabel: function(obj) {
return ($groupDropdown.data('default-label')) + " " + obj.name; return ($groupDropdown.data('default-label')) + " " + obj.full_name;
}, },
clicked: (function(_this) { clicked: (function(_this) {
return function() { return function() {
......
...@@ -89,7 +89,7 @@ module SearchHelper ...@@ -89,7 +89,7 @@ module SearchHelper
{ {
category: "Groups", category: "Groups",
id: group.id, id: group.id,
label: "#{search_result_sanitize(group.name)}", label: "#{search_result_sanitize(group.full_name)}",
url: group_path(group) url: group_path(group)
} }
end end
......
...@@ -137,6 +137,7 @@ module API ...@@ -137,6 +137,7 @@ module API
expose :avatar_url expose :avatar_url
expose :web_url expose :web_url
expose :request_access_enabled expose :request_access_enabled
expose :full_name, :full_path
expose :statistics, if: :statistics do expose :statistics, if: :statistics do
with_options format_with: -> (value) { value.to_i } do with_options format_with: -> (value) { value.to_i } do
......
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