mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Can change group conversations visibility
This commit is contained in:
parent
2fb3c7e789
commit
5073c4e1ba
@ -134,6 +134,21 @@ const GroupsInterface = {
|
|||||||
}, true)
|
}, true)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change group conversation visibility
|
||||||
|
*
|
||||||
|
* @param {Number} convID The ID of the conversation to delete
|
||||||
|
* @param {String} newLevel New minimal conversation visibility level
|
||||||
|
*/
|
||||||
|
changeGroupConversationVisibility: async function(convID, newLevel) {
|
||||||
|
await api("groups/set_conversation_visibility", {
|
||||||
|
conv_id: convID,
|
||||||
|
min_membership_level: newLevel
|
||||||
|
}, true)
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a group conversation
|
* Delete a group conversation
|
||||||
*
|
*
|
||||||
|
@ -381,6 +381,22 @@ const GroupSettingsPage = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change conversation visibility
|
||||||
|
*
|
||||||
|
* @param {Conversation} conv Information about the target conversation
|
||||||
|
*/
|
||||||
|
changeVisibility: async function (conv) {
|
||||||
|
try {
|
||||||
|
await GroupsInterface.changeGroupConversationVisibility(conv.id, conv.group_min_membership_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(e) {
|
||||||
|
console.error(e)
|
||||||
|
notify(tr("Failed to delete update conversation!"), "danger")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a conversation
|
* Delete a conversation
|
||||||
*/
|
*/
|
||||||
|
@ -14,7 +14,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr v-for="conv in conversations">
|
<tr v-for="conv in conversations">
|
||||||
<td>{{ conv.name }}</td>
|
<td>{{ conv.name }}</td>
|
||||||
<td>{{ conv.group_min_membership_level }}</td>
|
<td>
|
||||||
|
<select class="form-control" v-model="conv.group_min_membership_level" style="height: 26px;line-height: 7px;padding: 2px;" @change="changeVisibility(conv)">
|
||||||
|
<option value="member">tr("Members")</option>
|
||||||
|
<option value="moderator">tr("Moderators")</option>
|
||||||
|
<option value="administrator">tr("Administrators")</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a style="color: white;" @click="deleteConv(conv.id)"><i class="fa fa-trash"></i></a>
|
<a style="color: white;" @click="deleteConv(conv.id)"><i class="fa fa-trash"></i></a>
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user