diff options
author | kushalpandya <kushal@gitlab.com> | 2017-10-13 11:36:25 +0300 |
---|---|---|
committer | kushalpandya <kushal@gitlab.com> | 2017-10-13 11:36:25 +0300 |
commit | d72b95cfb7a538c9385f373747e3675de8acb980 (patch) | |
tree | 97ba6819598f2e63d76da4e8676d74279a26849f /app/assets/javascripts/groups | |
parent | 92ed1fecdcc621b7940466becb4d10de56ec20f2 (diff) |
Add support for `archived` param
Diffstat (limited to 'app/assets/javascripts/groups')
-rw-r--r-- | app/assets/javascripts/groups/components/app.vue | 9 | ||||
-rw-r--r-- | app/assets/javascripts/groups/components/groups.vue | 3 | ||||
-rw-r--r-- | app/assets/javascripts/groups/service/groups_service.js | 6 |
3 files changed, 13 insertions, 5 deletions
diff --git a/app/assets/javascripts/groups/components/app.vue b/app/assets/javascripts/groups/components/app.vue index fdec34f5dab..2c0b6ab4ea8 100644 --- a/app/assets/javascripts/groups/components/app.vue +++ b/app/assets/javascripts/groups/components/app.vue @@ -43,8 +43,8 @@ export default { }, }, methods: { - fetchGroups({ parentId, page, filterGroupsBy, sortBy, updatePagination }) { - return this.service.getGroups(parentId, page, filterGroupsBy, sortBy) + fetchGroups({ parentId, page, filterGroupsBy, sortBy, archived, updatePagination }) { + return this.service.getGroups(parentId, page, filterGroupsBy, sortBy, archived) .then((res) => { if (updatePagination) { this.updatePagination(res.headers); @@ -63,6 +63,7 @@ export default { fetchAllGroups() { const page = getParameterByName('page') || null; const sortBy = getParameterByName('sort') || null; + const archived = getParameterByName('archived') || null; const filterGroupsBy = getParameterByName('filter') || null; this.isLoading = true; @@ -71,13 +72,14 @@ export default { page, filterGroupsBy, sortBy, + archived, updatePagination: true, }).then((res) => { this.isLoading = false; this.updateGroups(res, Boolean(filterGroupsBy)); }); }, - fetchPage(page, filterGroupsBy, sortBy) { + fetchPage(page, filterGroupsBy, sortBy, archived) { this.isLoading = true; // eslint-disable-next-line promise/catch-or-return @@ -85,6 +87,7 @@ export default { page, filterGroupsBy, sortBy, + archived, updatePagination: true, }).then((res) => { this.isLoading = false; diff --git a/app/assets/javascripts/groups/components/groups.vue b/app/assets/javascripts/groups/components/groups.vue index d3482818183..75a2bf34887 100644 --- a/app/assets/javascripts/groups/components/groups.vue +++ b/app/assets/javascripts/groups/components/groups.vue @@ -29,7 +29,8 @@ export default { change(page) { const filterGroupsParam = getParameterByName('filter_groups'); const sortParam = getParameterByName('sort'); - eventHub.$emit('fetchPage', page, filterGroupsParam, sortParam); + const archivedParam = getParameterByName('archived'); + eventHub.$emit('fetchPage', page, filterGroupsParam, sortParam, archivedParam); }, }, }; diff --git a/app/assets/javascripts/groups/service/groups_service.js b/app/assets/javascripts/groups/service/groups_service.js index 1393c96aed6..639410384c2 100644 --- a/app/assets/javascripts/groups/service/groups_service.js +++ b/app/assets/javascripts/groups/service/groups_service.js @@ -8,7 +8,7 @@ export default class GroupsService { this.groups = Vue.resource(endpoint); } - getGroups(parentId, page, filterGroups, sort) { + getGroups(parentId, page, filterGroups, sort, archived) { const data = {}; if (parentId) { @@ -26,6 +26,10 @@ export default class GroupsService { if (sort) { data.sort = sort; } + + if (archived) { + data.archived = archived; + } } return this.groups.get(data); |