BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5e0e3971
Commit
5e0e3971
authored
May 05, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List groups with basic details
- Adds Groups component - Adds GroupItem component
parent
26573605
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
23 deletions
+82
-23
group_item.vue
app/assets/javascripts/groups/components/group_item.vue
+21
-0
groups.vue
app/assets/javascripts/groups/components/groups.vue
+45
-0
index.js
app/assets/javascripts/groups/index.js
+5
-15
groups_store.js
app/assets/javascripts/groups/stores/groups_store.js
+10
-1
_groups.html.haml
app/views/dashboard/groups/_groups.html.haml
+1
-7
No files found.
app/assets/javascripts/groups/components/group_item.vue
0 → 100644
View file @
5e0e3971
<
script
>
export
default
{
props
:
{
group
:
{
type
:
Object
,
required
:
true
,
}
}
};
</
script
>
<
template
>
<tr>
<td>
<div>
<a
:href=
"group.web_url"
>
{{
group
.
full_name
}}
</a>
</div>
<div>
{{
group
.
description
}}
</div>
</td>
</tr>
</
template
>
app/assets/javascripts/groups/components/groups.vue
0 → 100644
View file @
5e0e3971
<
script
>
import
GroupsStore
from
'../stores/groups_store'
;
import
GroupsService
from
'../services/groups_service'
;
import
GroupItem
from
'../components/group_item.vue'
;
export
default
{
components
:
{
'group-item'
:
GroupItem
,
},
data
()
{
const
store
=
new
GroupsStore
();
return
{
store
,
state
:
store
.
state
,
}
},
created
()
{
const
appEl
=
document
.
querySelector
(
'#dashboard-group-app'
);
this
.
service
=
new
GroupsService
(
appEl
.
dataset
.
endpoint
);
this
.
fetchGroups
();
},
methods
:
{
fetchGroups
()
{
this
.
service
.
getGroups
()
.
then
((
response
)
=>
{
this
.
store
.
setGroups
(
response
.
json
());
})
.
catch
(()
=>
{
// TODO: Handler error
});
},
}
};
</
script
>
<
template
>
<table
class=
"table table-bordered"
>
<group-item
:group=
"group"
v-for=
"group in state.groups"
/>
</table>
</
template
>
app/assets/javascripts/groups/index.js
View file @
5e0e3971
/* eslint-disable no-unused-vars */
/* eslint-disable no-unused-vars */
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
GroupsStore
from
'./stores/groups_store'
;
import
GroupsComponent
from
'./components/groups.vue'
import
GroupsService
from
'./services/groups_service'
;
$
(()
=>
{
$
(()
=>
{
const
appEl
=
document
.
querySelector
(
'.js-groups-list-holder'
);
const
appEl
=
document
.
querySelector
(
'#dashboard-group-app'
);
const
groupsStore
=
new
GroupsStore
();
const
groupsService
=
new
GroupsService
(
appEl
.
dataset
.
endpoint
);
const
GroupsApp
=
new
Vue
({
const
GroupsApp
=
new
Vue
({
el
:
appEl
,
el
:
appEl
,
data
:
groupsStore
,
components
:
{
mounted
()
{
'groups-component'
:
GroupsComponent
groupsService
.
getGroups
()
.
then
((
response
)
=>
{
this
.
groups
=
response
.
json
();
})
.
catch
(()
=>
{
// TODO: Handle error
});
},
},
render
:
createElement
=>
createElement
(
'groups-component'
),
});
});
});
});
app/assets/javascripts/groups/stores/groups_store.js
View file @
5e0e3971
export
default
class
GroupsStore
{
export
default
class
GroupsStore
{
constructor
()
{
constructor
()
{
this
.
groups
=
[];
this
.
state
=
{};
this
.
state
.
groups
=
[];
return
this
;
}
setGroups
(
groups
)
{
this
.
state
.
groups
=
groups
;
return
groups
;
}
}
}
}
app/views/dashboard/groups/_groups.html.haml
View file @
5e0e3971
.js-groups-list-holder
{
data:
{
endpoint:
dashboard_groups_path
(
format: :json
)
}
}
.js-groups-list-holder
#dashboard-group-app
{
data:
{
endpoint:
dashboard_groups_path
(
format: :json
)
}
}
%ul
.content-list
-
@groups
.
each
do
|
group
|
-
group_member
=
group
.
group_members
.
find_by
(
user_id:
current_user
)
=
render
'shared/groups/group'
,
group:
group_member
.
group
,
group_member:
group_member
=
paginate
@groups
,
theme:
'gitlab'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment