mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
changes suggested by @tirokk
This commit is contained in:
parent
b7c620c78c
commit
287e5c29ea
@ -87,19 +87,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
cancelModal() {
|
||||
this.user = {}
|
||||
this.clear()
|
||||
this.isOpen = false
|
||||
},
|
||||
closeModal() {
|
||||
this.clear()
|
||||
this.isOpen = false
|
||||
},
|
||||
confirmModal() {
|
||||
this.addMemberToGroup()
|
||||
this.clear()
|
||||
this.isOpen = false
|
||||
this.clear()
|
||||
},
|
||||
onFocus(event) {},
|
||||
onBlur(event) {
|
||||
onFocus() {},
|
||||
onBlur() {
|
||||
this.query = ''
|
||||
},
|
||||
handleInput(event) {
|
||||
@ -119,10 +120,10 @@ export default {
|
||||
this.users = []
|
||||
},
|
||||
onSelect(item) {
|
||||
this.user = item
|
||||
this.user = { ...item }
|
||||
if (this.groupMembers.find((member) => member.id === this.user.id)) {
|
||||
this.$toast.error(this.$t('group.errors.userAlreadyMember', { slug: this.user.slug }))
|
||||
this.user = {}
|
||||
this.$toast.error(this.$t('group.errors.userAlreadyMember', { name: this.user.name }))
|
||||
this.clear()
|
||||
return
|
||||
}
|
||||
this.isOpen = true
|
||||
@ -135,10 +136,13 @@ export default {
|
||||
mutation: changeGroupMemberRoleMutation(),
|
||||
variables: { groupId: this.groupId, userId: this.user.id, roleInGroup: newRole },
|
||||
})
|
||||
this.$emit('loadGroupMembers')
|
||||
this.$toast.success(
|
||||
this.$t('group.changeMemberRole', { role: this.$t(`group.roles.${newRole}`) }),
|
||||
this.$t('group.addMemberToGroupSuccess', {
|
||||
role: this.$t(`group.roles.${newRole}`),
|
||||
name: this.user.name,
|
||||
}),
|
||||
)
|
||||
this.$emit('loadGroupMembers')
|
||||
} catch (error) {
|
||||
this.$toast.error(error.message)
|
||||
}
|
||||
|
||||
@ -139,30 +139,6 @@ export default {
|
||||
this.$toast.error(error.message)
|
||||
}
|
||||
},
|
||||
async addMemberToGroup() {
|
||||
const newRole = 'usual'
|
||||
if (this.groupMembers.find((member) => member.id === this.user.id)) {
|
||||
this.$toast.error(this.$t('group.errors.userAlreadyMember', { slug: this.user.slug }))
|
||||
return
|
||||
}
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: changeGroupMemberRoleMutation(),
|
||||
variables: { groupId: this.groupId, userId: this.user.id, roleInGroup: newRole },
|
||||
})
|
||||
this.$emit('loadGroupMembers')
|
||||
this.$toast.success(
|
||||
this.$t('group.changeMemberRole', { role: this.$t(`group.roles.${newRole}`) }),
|
||||
)
|
||||
} catch (error) {
|
||||
this.$toast.error(error.message)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.ds-select-dropdown {
|
||||
position: unset;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -405,9 +405,10 @@
|
||||
},
|
||||
"actionRadius": "Aktionsradius",
|
||||
"addMemberToGroup": "Zur Gruppe hinzufügen",
|
||||
"addMemberToGroupSuccess": "„{name}“ wurde der Gruppe mit der Rolle „{role}“ hinzugefügt!",
|
||||
"addUser": "Benutzer hinzufügen",
|
||||
"addUserNoOptions": "Keine Nutzer gefunden!",
|
||||
"addUserPlaceholder": "Benutzername oder Slug",
|
||||
"addUserPlaceholder": "Benutzername",
|
||||
"allGroups": "Alle Gruppen",
|
||||
"categories": "Thema ::: Themen",
|
||||
"changeMemberRole": "Die Rolle wurde auf „{role}“ geändert!",
|
||||
@ -424,7 +425,7 @@
|
||||
"title": "Meine Gruppe ändern"
|
||||
},
|
||||
"errors": {
|
||||
"userAlreadyMember": "Nutzer @{slug} ist bereits Mitglied"
|
||||
"userAlreadyMember": "Nutzer „{name}“ ist bereits Mitglied"
|
||||
},
|
||||
"follow": "Folge",
|
||||
"foundation": "Gründung",
|
||||
@ -455,7 +456,7 @@
|
||||
"modal": {
|
||||
"cancel": "Abbrechen",
|
||||
"confirm": "Bestätigen",
|
||||
"confirmAddGroupMemberText": "Nutzer “{name}” zur Gruppe hinzufügen?",
|
||||
"confirmAddGroupMemberText": "Nutzer „{name}“ zur Gruppe hinzufügen?",
|
||||
"confirmAddGroupMemberTitle": "Bestätigen"
|
||||
},
|
||||
"myGroups": "Meine Gruppen",
|
||||
|
||||
@ -405,9 +405,10 @@
|
||||
},
|
||||
"actionRadius": "Action radius",
|
||||
"addMemberToGroup": "Add to group",
|
||||
"addMemberToGroupSuccess": "“{name}” was added to the group with the role “{role}”!",
|
||||
"addUser": "Add User",
|
||||
"addUserNoOptions": "No users found!",
|
||||
"addUserPlaceholder": " User name or slug",
|
||||
"addUserPlaceholder": " Username",
|
||||
"allGroups": "All Groups",
|
||||
"categories": "Topic ::: Topics",
|
||||
"changeMemberRole": "The role has been changed to “{role}”!",
|
||||
@ -424,7 +425,7 @@
|
||||
"title": "Edit My Group"
|
||||
},
|
||||
"errors": {
|
||||
"userAlreadyMember": "User @{slug} is already a member"
|
||||
"userAlreadyMember": "User “{name}” is already a member"
|
||||
},
|
||||
"follow": "Follow",
|
||||
"foundation": "Foundation",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user