Commit a0f13d2f authored by Alfredo Sumaran's avatar Alfredo Sumaran Committed by Dmitriy Zaporozhets

Expose correct path to group

parent 459d8d65
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
if (this.group.hasSubgroups) { if (this.group.hasSubgroups) {
eventHub.$emit('toggleSubGroups', this.group); eventHub.$emit('toggleSubGroups', this.group);
} else { } else {
window.location.href = this.group.webUrl; window.location.href = this.group.groupPath;
} }
} }
}, },
...@@ -192,7 +192,7 @@ export default { ...@@ -192,7 +192,7 @@ export default {
<div <div
class="avatar-container s40 hidden-xs"> class="avatar-container s40 hidden-xs">
<a <a
:href="group.webUrl"> :href="group.groupPath">
<img <img
class="avatar s40" class="avatar s40"
:src="group.avatarUrl" :src="group.avatarUrl"
...@@ -202,7 +202,7 @@ export default { ...@@ -202,7 +202,7 @@ export default {
<div <div
class="title"> class="title">
<a <a
:href="group.webUrl">{{fullPath}}</a> :href="group.groupPath">{{fullPath}}</a>
<template v-if="group.permissions.humanGroupAccess"> <template v-if="group.permissions.humanGroupAccess">
as as
<span class="access-type">{{group.permissions.humanGroupAccess}}</span> <span class="access-type">{{group.permissions.humanGroupAccess}}</span>
......
...@@ -122,6 +122,7 @@ export default class GroupsStore { ...@@ -122,6 +122,7 @@ export default class GroupsStore {
canEdit: rawGroup.can_edit, canEdit: rawGroup.can_edit,
description: rawGroup.description, description: rawGroup.description,
webUrl: rawGroup.web_url, webUrl: rawGroup.web_url,
groupPath: rawGroup.group_path,
parentId: rawGroup.parent_id, parentId: rawGroup.parent_id,
visibility: rawGroup.visibility, visibility: rawGroup.visibility,
leavePath: rawGroup.leave_path, leavePath: rawGroup.leave_path,
......
...@@ -5,11 +5,15 @@ class GroupEntity < Grape::Entity ...@@ -5,11 +5,15 @@ class GroupEntity < Grape::Entity
include GroupsHelper include GroupsHelper
expose :id, :name, :path, :description, :visibility expose :id, :name, :path, :description, :visibility
expose :web_url
expose :full_name, :full_path expose :full_name, :full_path
expose :web_url
expose :parent_id expose :parent_id
expose :created_at, :updated_at expose :created_at, :updated_at
expose :group_path do |group|
group_path(group)
end
expose :permissions do expose :permissions do
expose :human_group_access do |group, options| expose :human_group_access do |group, options|
group.group_members.find_by(user_id: request.current_user)&.human_access group.group_members.find_by(user_id: request.current_user)&.human_access
......
...@@ -6,6 +6,7 @@ const group1 = { ...@@ -6,6 +6,7 @@ const group1 = {
visibility: 'public', visibility: 'public',
avatar_url: null, avatar_url: null,
web_url: 'http://localhost:3000/groups/level1', web_url: 'http://localhost:3000/groups/level1',
group_path: '/level1',
full_name: 'level1', full_name: 'level1',
full_path: 'level1', full_path: 'level1',
parent_id: null, parent_id: null,
...@@ -28,6 +29,7 @@ const group14 = { ...@@ -28,6 +29,7 @@ const group14 = {
visibility: 'public', visibility: 'public',
avatar_url: null, avatar_url: null,
web_url: 'http://localhost:3000/groups/level1/level2/level3/level4', web_url: 'http://localhost:3000/groups/level1/level2/level3/level4',
group_path: '/level1/level2/level3/level4',
full_name: 'level1 / level2 / level3 / level4', full_name: 'level1 / level2 / level3 / level4',
full_path: 'level1/level2/level3/level4', full_path: 'level1/level2/level3/level4',
parent_id: 1127, parent_id: 1127,
...@@ -49,6 +51,7 @@ const group2 = { ...@@ -49,6 +51,7 @@ const group2 = {
visibility: 'public', visibility: 'public',
avatar_url: null, avatar_url: null,
web_url: 'http://localhost:3000/groups/devops', web_url: 'http://localhost:3000/groups/devops',
group_path: '/devops',
full_name: 'devops', full_name: 'devops',
full_path: 'devops', full_path: 'devops',
parent_id: null, parent_id: null,
...@@ -70,6 +73,7 @@ const group21 = { ...@@ -70,6 +73,7 @@ const group21 = {
visibility: 'public', visibility: 'public',
avatar_url: null, avatar_url: null,
web_url: 'http://localhost:3000/groups/devops/chef', web_url: 'http://localhost:3000/groups/devops/chef',
group_path: '/devops/chef',
full_name: 'devops / chef', full_name: 'devops / chef',
full_path: 'devops/chef', full_path: 'devops/chef',
parent_id: 1119, parent_id: 1119,
......
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