Loading gms-ui/src/api/mock/data/groups.json +2 −1 Original line number Diff line number Diff line Loading @@ -28,5 +28,6 @@ "hasPreviousPages": false, "hasFollowingPages": false }, "permission": "ADMIN" "permission": "ADMIN", "leaf": false } gms-ui/src/api/server/index.js +6 −4 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ const BASE_API_URL = process.env.VUE_APP_API_BASE_URL; function apiRequest(url, options) { loading(true); return new Promise((resolve, reject) => { return new Promise((resolve) => { fetch(url, options) .then(response => { loading(false); Loading Loading @@ -123,7 +123,7 @@ export default { } }); }, addGroup(newGroupName, input) { addGroup(newGroupName, leaf, input) { let url = BASE_API_URL + 'group'; return apiRequest(url, { method: 'POST', Loading @@ -138,11 +138,12 @@ export default { parentGroupId: input.selectedGroupId, paginatorPageSize: input.paginatorPageSize, paginatorPage: input.paginatorPage, searchFilter: input.searchFilter searchFilter: input.searchFilter, leaf: leaf }) }); }, renameGroup(groupId, newGroupName, input) { renameGroup(groupId, newGroupName, leaf, input) { let url = BASE_API_URL + 'group/' + groupId; return apiRequest(url, { method: 'PUT', Loading @@ -154,6 +155,7 @@ export default { }, body: JSON.stringify({ newGroupName: newGroupName, leaf: leaf, paginatorPageSize: input.paginatorPageSize, paginatorPage: input.paginatorPage, searchFilter: input.searchFilter Loading gms-ui/src/components/GroupsBreadcrumb.vue +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ export default { changeBreadcrumb: function(groupId) { this.input.selectedGroupId = groupId; this.input.searchFilter = null; if (this.input.selectedTab === 'groups') { if (this.input.tabIndex === 0) { client.fetchGroupsTab(this.input) .then(model => { this.$store.commit('updateGroups', model); Loading gms-ui/src/components/GroupsPanel.vue +1 −1 Original line number Diff line number Diff line <template> <b-tab title="Groups" active> <b-tab title="Groups" :title-link-class="{ 'd-none': model.leaf }"> <b-row> <b-col xs="12"> <b-form-input placeholder="Search group" v-model="input.searchFilter" v-on:input="filterGroups"></b-form-input> Loading gms-ui/src/components/Main.vue +16 −31 Original line number Diff line number Diff line Loading @@ -47,48 +47,33 @@ export default { computed: mapState({ model: state => state.model, input: state => state.input, showAddMemberBtn: state => state.model.permission === 'ADMIN' && state.input.selectedTab === 'members', showAddCollaboratorBtn: state => state.model.permission === 'MANAGE_MEMBERS' && state.input.selectedTab === 'members', showAddGroupBtn: state => state.model.permission === 'ADMIN' && state.input.selectedTab === 'groups', showAddPermissionBtn: state => state.model.permission === 'ADMIN' && state.input.selectedTab === 'permissions' showAddMemberBtn: state => state.model.permission === 'ADMIN' && state.input.tabIndex === 1, showAddCollaboratorBtn: state => state.model.permission === 'MANAGE_MEMBERS' && state.input.tabIndex === 1, showAddGroupBtn: state => state.model.permission === 'ADMIN' && state.input.tabIndex === 0, showAddPermissionBtn: state => state.model.permission === 'ADMIN' && state.input.tabIndex === 2 }), methods: { tabChanged: function(tabIndex) { let tab; switch (tabIndex) { case 0: tab = 'groups'; break; case 1: tab = 'members'; break; case 2: tab = 'permissions'; break; } if (this.input.selectedTab !== tab) { this.input.selectedTab = tab; switch (this.input.selectedTab) { case 'groups': client.fetchGroupsTab(this.input) .then(model => { this.$store.commit('updateGroups', model); }); break; case 'members': case 1: client.fetchMembersPanel(this.input) .then(panel => { this.$store.commit('updateMembersPanel', panel); }); break; case 'permissions': case 2: client.fetchPermissionsPanel(this.input) .then(panel => { this.$store.commit('updatePermissionsPanel', panel); }); break; } } }, openAddGroupModal: function() { this.$bvModal.show('add-group-modal'); Loading Loading
gms-ui/src/api/mock/data/groups.json +2 −1 Original line number Diff line number Diff line Loading @@ -28,5 +28,6 @@ "hasPreviousPages": false, "hasFollowingPages": false }, "permission": "ADMIN" "permission": "ADMIN", "leaf": false }
gms-ui/src/api/server/index.js +6 −4 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ const BASE_API_URL = process.env.VUE_APP_API_BASE_URL; function apiRequest(url, options) { loading(true); return new Promise((resolve, reject) => { return new Promise((resolve) => { fetch(url, options) .then(response => { loading(false); Loading Loading @@ -123,7 +123,7 @@ export default { } }); }, addGroup(newGroupName, input) { addGroup(newGroupName, leaf, input) { let url = BASE_API_URL + 'group'; return apiRequest(url, { method: 'POST', Loading @@ -138,11 +138,12 @@ export default { parentGroupId: input.selectedGroupId, paginatorPageSize: input.paginatorPageSize, paginatorPage: input.paginatorPage, searchFilter: input.searchFilter searchFilter: input.searchFilter, leaf: leaf }) }); }, renameGroup(groupId, newGroupName, input) { renameGroup(groupId, newGroupName, leaf, input) { let url = BASE_API_URL + 'group/' + groupId; return apiRequest(url, { method: 'PUT', Loading @@ -154,6 +155,7 @@ export default { }, body: JSON.stringify({ newGroupName: newGroupName, leaf: leaf, paginatorPageSize: input.paginatorPageSize, paginatorPage: input.paginatorPage, searchFilter: input.searchFilter Loading
gms-ui/src/components/GroupsBreadcrumb.vue +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ export default { changeBreadcrumb: function(groupId) { this.input.selectedGroupId = groupId; this.input.searchFilter = null; if (this.input.selectedTab === 'groups') { if (this.input.tabIndex === 0) { client.fetchGroupsTab(this.input) .then(model => { this.$store.commit('updateGroups', model); Loading
gms-ui/src/components/GroupsPanel.vue +1 −1 Original line number Diff line number Diff line <template> <b-tab title="Groups" active> <b-tab title="Groups" :title-link-class="{ 'd-none': model.leaf }"> <b-row> <b-col xs="12"> <b-form-input placeholder="Search group" v-model="input.searchFilter" v-on:input="filterGroups"></b-form-input> Loading
gms-ui/src/components/Main.vue +16 −31 Original line number Diff line number Diff line Loading @@ -47,48 +47,33 @@ export default { computed: mapState({ model: state => state.model, input: state => state.input, showAddMemberBtn: state => state.model.permission === 'ADMIN' && state.input.selectedTab === 'members', showAddCollaboratorBtn: state => state.model.permission === 'MANAGE_MEMBERS' && state.input.selectedTab === 'members', showAddGroupBtn: state => state.model.permission === 'ADMIN' && state.input.selectedTab === 'groups', showAddPermissionBtn: state => state.model.permission === 'ADMIN' && state.input.selectedTab === 'permissions' showAddMemberBtn: state => state.model.permission === 'ADMIN' && state.input.tabIndex === 1, showAddCollaboratorBtn: state => state.model.permission === 'MANAGE_MEMBERS' && state.input.tabIndex === 1, showAddGroupBtn: state => state.model.permission === 'ADMIN' && state.input.tabIndex === 0, showAddPermissionBtn: state => state.model.permission === 'ADMIN' && state.input.tabIndex === 2 }), methods: { tabChanged: function(tabIndex) { let tab; switch (tabIndex) { case 0: tab = 'groups'; break; case 1: tab = 'members'; break; case 2: tab = 'permissions'; break; } if (this.input.selectedTab !== tab) { this.input.selectedTab = tab; switch (this.input.selectedTab) { case 'groups': client.fetchGroupsTab(this.input) .then(model => { this.$store.commit('updateGroups', model); }); break; case 'members': case 1: client.fetchMembersPanel(this.input) .then(panel => { this.$store.commit('updateMembersPanel', panel); }); break; case 'permissions': case 2: client.fetchPermissionsPanel(this.input) .then(panel => { this.$store.commit('updatePermissionsPanel', panel); }); break; } } }, openAddGroupModal: function() { this.$bvModal.show('add-group-modal'); Loading