mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 21:39:21 +00:00
Can delete a group conversation
This commit is contained in:
parent
ac2ba87f18
commit
2fb3c7e789
@ -134,6 +134,17 @@ const GroupsInterface = {
|
|||||||
}, true)
|
}, true)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a group conversation
|
||||||
|
*
|
||||||
|
* @param {Number} convID The ID of the conversation to delete
|
||||||
|
*/
|
||||||
|
deleteGroupConversation: async function(convID) {
|
||||||
|
await api("groups/delete_conversation", {
|
||||||
|
conv_id: convID,
|
||||||
|
}, true)
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the availability of a virtual directory for a group
|
* Check the availability of a virtual directory for a group
|
||||||
*
|
*
|
||||||
|
@ -350,12 +350,17 @@ const GroupSettingsPage = {
|
|||||||
Vue.createApp({
|
Vue.createApp({
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
|
conversations: settings.conversations,
|
||||||
newConvName: "",
|
newConvName: "",
|
||||||
newConvVisibility: "member"
|
newConvVisibility: "member"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new conversation
|
||||||
|
*/
|
||||||
createNewConv: async function() {
|
createNewConv: async function() {
|
||||||
try {
|
try {
|
||||||
const convName = this.newConvName;
|
const convName = this.newConvName;
|
||||||
@ -374,6 +379,27 @@ const GroupSettingsPage = {
|
|||||||
console.error(e)
|
console.error(e)
|
||||||
notify(tr("Failed to create group conversation!"), "danger")
|
notify(tr("Failed to create group conversation!"), "danger")
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a conversation
|
||||||
|
*/
|
||||||
|
deleteConv: async function(convID) {
|
||||||
|
try {
|
||||||
|
if (!await showConfirmDialog("Do you really want to delete this conversation ?"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
await GroupsInterface.deleteGroupConversation(convID)
|
||||||
|
|
||||||
|
notify("The conversation was successfully deleted!", "success")
|
||||||
|
|
||||||
|
Page.refresh_current_page();
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(e) {
|
||||||
|
console.error(e)
|
||||||
|
notify(tr("Failed to delete group conversation!"), "danger")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).mount(conversationsSettingsTarget);
|
}).mount(conversationsSettingsTarget);
|
||||||
|
1
assets/js/typings/Conversations.d.ts
vendored
1
assets/js/typings/Conversations.d.ts
vendored
@ -27,6 +27,7 @@ declare interface Conversation {
|
|||||||
color?: string,
|
color?: string,
|
||||||
logo?: string,
|
logo?: string,
|
||||||
group_id?: number,
|
group_id?: number,
|
||||||
|
group_min_membership_level ?: "member"|"moderator"|"administrator",
|
||||||
members: ConversationMember[],
|
members: ConversationMember[],
|
||||||
can_everyone_add_members: boolean,
|
can_everyone_add_members: boolean,
|
||||||
can_have_call: boolean,
|
can_have_call: boolean,
|
||||||
|
3
assets/js/typings/Group.d.ts
vendored
3
assets/js/typings/Group.d.ts
vendored
@ -10,7 +10,8 @@ declare interface AdvancedGroupInfo extends Group {
|
|||||||
description: String,
|
description: String,
|
||||||
url: String,
|
url: String,
|
||||||
number_likes: Number,
|
number_likes: Number,
|
||||||
is_liking: Boolean
|
is_liking: Boolean,
|
||||||
|
conversations: Conversation[],
|
||||||
}
|
}
|
||||||
|
|
||||||
declare interface GroupSettings extends AdvancedGroupInfo {}
|
declare interface GroupSettings extends AdvancedGroupInfo {}
|
@ -5,6 +5,22 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
|
<div class="box-body no-padding">
|
||||||
|
<table class="table">
|
||||||
|
<tbody><tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Visibility</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
<tr v-for="conv in conversations">
|
||||||
|
<td>{{ conv.name }}</td>
|
||||||
|
<td>{{ conv.group_min_membership_level }}</td>
|
||||||
|
<td>
|
||||||
|
<a style="color: white;" @click="deleteConv(conv.id)"><i class="fa fa-trash"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Create a new conversation-->
|
<!-- Create a new conversation-->
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
|
Loading…
Reference in New Issue
Block a user