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
26573605
Commit
26573605
authored
May 04, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GroupsService to fetch data from server
parent
d67ab685
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
index.js
app/assets/javascripts/groups/index.js
+16
-1
groups_service.js
app/assets/javascripts/groups/services/groups_service.js
+14
-0
_groups.html.haml
app/views/dashboard/groups/_groups.html.haml
+1
-1
No files found.
app/assets/javascripts/groups/index.js
View file @
26573605
/* eslint-disable no-unused-vars */
import
Vue
from
'vue'
;
import
GroupsStore
from
'./stores/groups_store'
;
import
GroupsService
from
'./services/groups_service'
;
$
(()
=>
{
const
appEl
=
document
.
querySelector
(
'.js-groups-list-holder'
);
const
groupsStore
=
new
GroupsStore
();
const
groupsService
=
new
GroupsService
(
appEl
.
dataset
.
endpoint
);
const
GroupsApp
=
new
Vue
({
el
:
document
.
querySelector
(
'.js-groups-list-holder'
)
,
el
:
appEl
,
data
:
groupsStore
,
mounted
()
{
groupsService
.
getGroups
()
.
then
((
response
)
=>
{
this
.
groups
=
response
.
json
();
})
.
catch
(()
=>
{
// TODO: Handle error
});
},
});
});
app/assets/javascripts/groups/services/groups_service.js
0 → 100644
View file @
26573605
import
Vue
from
'vue'
;
import
VueResource
from
'vue-resource'
;
Vue
.
use
(
VueResource
);
export
default
class
GroupsService
{
constructor
(
endpoint
)
{
this
.
groups
=
Vue
.
resource
(
endpoint
);
}
getGroups
()
{
return
this
.
groups
.
get
();
}
}
app/views/dashboard/groups/_groups.html.haml
View file @
26573605
.js-groups-list-holder
.js-groups-list-holder
{
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
)
...
...
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