From e103904a0454d8a05cea60d984bc1ef1e2b9e652 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 19 May 2019 20:41:23 +0900 Subject: Resolve #4941 --- .../app/common/views/components/messaging.vue | 5 +- .../app/common/views/pages/user-group-editor.vue | 12 ++- src/client/app/common/views/pages/user-groups.vue | 92 +++++++++++++++++----- 3 files changed, 85 insertions(+), 24 deletions(-) (limited to 'src/client/app') diff --git a/src/client/app/common/views/components/messaging.vue b/src/client/app/common/views/components/messaging.vue index 01d7a5a798..c7c70a4ce5 100644 --- a/src/client/app/common/views/components/messaging.vue +++ b/src/client/app/common/views/components/messaging.vue @@ -217,12 +217,13 @@ export default Vue.extend({ this.navigate(user); }, async startGroup() { - const groups = await this.$root.api('users/groups/joined'); + const groups1 = await this.$root.api('users/groups/owned'); + const groups2 = await this.$root.api('users/groups/joined'); const { canceled, result: group } = await this.$root.dialog({ type: null, title: this.$t('select-group'), select: { - items: groups.map(group => ({ + items: groups1.concat(groups2).map(group => ({ value: group, text: group.name })) }, diff --git a/src/client/app/common/views/pages/user-group-editor.vue b/src/client/app/common/views/pages/user-group-editor.vue index fb9f1a6772..ef79689ae8 100644 --- a/src/client/app/common/views/pages/user-group-editor.vue +++ b/src/client/app/common/views/pages/user-group-editor.vue @@ -16,7 +16,7 @@
- {{ $t('add-user') }} + {{ $t('invite') }}
@@ -134,18 +134,22 @@ export default Vue.extend({ }); }, - async add() { + async invite() { + const t = this.$t('invited'); const { result: user } = await this.$root.dialog({ user: { local: true } }); if (user == null) return; - this.$root.api('users/groups/push', { + this.$root.api('users/groups/invite', { groupId: this.group.id, userId: user.id }).then(() => { - this.fetchUsers(); + this.$root.dialog({ + type: 'success', + text: t + }); }); } } diff --git a/src/client/app/common/views/pages/user-groups.vue b/src/client/app/common/views/pages/user-groups.vue index 336772799b..2a89196e55 100644 --- a/src/client/app/common/views/pages/user-groups.vue +++ b/src/client/app/common/views/pages/user-groups.vue @@ -1,36 +1,70 @@ -- cgit v1.2.3-freya