@@ -27,20 +27,30 @@
|
- {{ t('workspace', 'Workspace name') }} |
- {{ t('workspace', 'Quota') }} |
- {{ t('workspace', 'Space administrators') }} |
+
+ {{ t('workspace', 'Workspace name') }}
+ |
+
+ {{ t('workspace', 'Quota') }}
+ |
+
+ {{ t('workspace', 'Space administrators') }}
+ |
|
- {{ name }} |
- {{ space.quota }} |
+
+ {{ name }}
+ |
+
+ {{ space.quota }}
+ |
+
+ @license GNU AGPL version 3 or any later version
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+-->
+
+
+
+
+
+
+
+ {{ user.name }}
+
+
+
+
+
+ {{ t('workspace', 'WM') }}
+
+
+
+
+ {{ t('workspace', 'remove users from selection') }}
+
+
+
+
+
+
+
+
+
diff --git a/src/UserTable.vue b/src/UserTable.vue
index f46269a95..a22f252dd 100644
--- a/src/UserTable.vue
+++ b/src/UserTable.vue
@@ -29,8 +29,12 @@
{{ t('workspace', 'Users') }}
|
- {{ t('workspace', 'Role') }} |
- {{ t('workspace', 'Groups') }} |
+
+ {{ t('workspace', 'Role') }}
+ |
+
+ {{ t('workspace', 'Groups') }}
+ |
|
|
@@ -49,8 +53,12 @@
{{ user.email }}
- {{ t('workspace', $store.getters.isSpaceAdmin(user, $route.params.space) ? 'admin' : 'user') }} |
- {{ sortGroups(user.groups) }} |
+
+ {{ t('workspace', $store.getters.isSpaceAdmin(user, $route.params.space) ? 'admin' : 'user') }}
+ |
+
+ {{ user.groups.map(group => $store.getters.groupName($route.params.space, group)).join(', ') }}
+ |
diff --git a/src/services/Groups/ManagerGroup.js b/src/services/Groups/ManagerGroup.js
index dc60e8608..d49b46fd9 100644
--- a/src/services/Groups/ManagerGroup.js
+++ b/src/services/Groups/ManagerGroup.js
@@ -23,7 +23,7 @@
import { PREFIX_MANAGER } from '../../constants.js'
/**
- * @param {object} space
+ * @param {object} space present the space entity
* @return {string}
*/
function getGid(space) {
diff --git a/src/store/actions.js b/src/store/actions.js
index 49a06f3ba..6e9680574 100644
--- a/src/store/actions.js
+++ b/src/store/actions.js
@@ -344,8 +344,8 @@ export default {
updateGroupfolders(context, { groupfolder }) {
context.commit('UPDATE_GROUPFOLDERS', { groupfolder })
},
- async addUsersFromCSV(context, { formData }) {
- const url = generateUrl('/apps/workspace/file/csv/import-data')
+ async addUsersFromCSV(context, { formData, spaceId }) {
+ const url = generateUrl(`/apps/workspace/space/${spaceId}/import-users/local`)
const resp = await axios({
method: 'POST',
url,
@@ -353,8 +353,8 @@ export default {
})
return resp.data
},
- async importCsvFromFiles(context, { formData }) {
- const url = generateUrl('/apps/workspace/file/csv/import-from-files')
+ async importCsvFromFiles(context, { formData, spaceId }) {
+ const url = generateUrl(`/apps/workspace/space/${spaceId}/import-users/files`)
const resp = await axios({
method: 'POST',
url,
diff --git a/src/tests/jest.setup.js b/src/tests/jest.setup.js
index c4e234d56..c9bfa3680 100644
--- a/src/tests/jest.setup.js
+++ b/src/tests/jest.setup.js
@@ -4,6 +4,7 @@ import 'regenerator-runtime/runtime.js'
/* eslint-disable-next-line */
import { OC } from './OC.js'
import { config } from '@vue/test-utils'
+import mockAxios from 'jest-mock-axios'
document.title = 'Standard Nextcloud title'
@@ -28,3 +29,5 @@ global.console = {
}
global.OCA = {}
+
+jest.mock('@nextcloud/axios', () => mockAxios)
diff --git a/src/tests/unit/selectUsers.test.js b/src/tests/unit/addUsersTabs.test.js
similarity index 94%
rename from src/tests/unit/selectUsers.test.js
rename to src/tests/unit/addUsersTabs.test.js
index 01df24464..bc4de553f 100644
--- a/src/tests/unit/selectUsers.test.js
+++ b/src/tests/unit/addUsersTabs.test.js
@@ -23,7 +23,7 @@
import { createLocalVue, mount } from '@vue/test-utils'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
-import SelectUsers from '../../SelectUsers.vue'
+import AddUsersTabs from '../../AddUsersTabs.vue'
import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'
@@ -36,7 +36,7 @@ const localVue = createLocalVue()
const router = new VueRouter()
localVue.use(Vuex)
localVue.use(VueRouter)
-const wrappedSelectUsers = mount(SelectUsers, {
+const wrappedSelectUsers = mount(AddUsersTabs, {
store,
localVue,
router,
@@ -44,7 +44,7 @@ const wrappedSelectUsers = mount(SelectUsers, {
// const expect = require('chai').expect
-describe('SelectUsers component tests', () => {
+describe('AddUsersTabs component tests', () => {
wrappedSelectUsers.vm.$store.commit('addSpace', {
color: '#3794ac',
@@ -78,7 +78,7 @@ describe('SelectUsers component tests', () => {
email: 'admin@acme.org',
subtitle: 'admin@acme.org',
groups: [],
- role: 'admin',
+ role: 'wm',
},
]
@@ -119,7 +119,7 @@ describe('SelectUsers component tests', () => {
email: 'admin@acme.org',
subtitle: 'admin@acme.org',
groups: [],
- role: 'admin',
+ role: 'wm',
},
]
diff --git a/src/tests/unit/spaceService.test.js b/src/tests/unit/spaceService.test.js
index 469f02f03..4c151eebd 100644
--- a/src/tests/unit/spaceService.test.js
+++ b/src/tests/unit/spaceService.test.js
@@ -90,7 +90,7 @@ describe('transferUsersToUserGroup method', () => {
'SPACE-U-1',
'dev',
],
- role: 'admin',
+ role: 'wm',
},
bob: {
uid: 'bob',
@@ -102,7 +102,7 @@ describe('transferUsersToUserGroup method', () => {
'SPACE-U-1',
'dev',
],
- role: 'admin',
+ role: 'wm',
},
jane: {
uid: 'jane',
@@ -114,7 +114,7 @@ describe('transferUsersToUserGroup method', () => {
'SPACE-U-1',
'dev',
],
- role: 'admin',
+ role: 'wm',
},
user2: {
uid: 'user2',
diff --git a/src/tests/unit/store.test.js b/src/tests/unit/store.test.js
index 0d10c0048..30c602d35 100644
--- a/src/tests/unit/store.test.js
+++ b/src/tests/unit/store.test.js
@@ -52,7 +52,7 @@ describe('Vuex store tests', () => {
'GE-test-space',
'yolo-1234',
],
- role: 'admin',
+ role: 'wm',
},
],
},
|