Delege post confirmation modal
This commit is contained in:
parent
64a99413db
commit
5d29b7c26e
3 changed files with 40 additions and 2 deletions
|
|
@ -325,6 +325,10 @@
|
||||||
"copied_credentials_value": "Username: {userId} \nPassword: {password}",
|
"copied_credentials_value": "Username: {userId} \nPassword: {password}",
|
||||||
"copy_credentials_desc": "Your username and password are required to regain access to your chats from a new device or browser. We recommend storing these credentials in a secure location."
|
"copy_credentials_desc": "Your username and password are required to regain access to your chats from a new device or browser. We recommend storing these credentials in a secure location."
|
||||||
},
|
},
|
||||||
|
"delete_post": {
|
||||||
|
"confirm_text": "Are you sure you want to delete this message?",
|
||||||
|
"confirm_text_desc": "This action cannot be undone."
|
||||||
|
},
|
||||||
"purge_room": {
|
"purge_room": {
|
||||||
"title": "Delete room?",
|
"title": "Delete room?",
|
||||||
"info": "All members and messages will be removed. This action cannot be undone.",
|
"info": "All members and messages will be removed. This action cannot be undone.",
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
v-on:addquickreaction="addQuickReaction"
|
v-on:addquickreaction="addQuickReaction"
|
||||||
v-on:addreply="addReply(selectedEvent)"
|
v-on:addreply="addReply(selectedEvent)"
|
||||||
v-on:edit="edit(selectedEvent)"
|
v-on:edit="edit(selectedEvent)"
|
||||||
v-on:redact="redact(selectedEvent)"
|
v-on:redact="showDeletePostPopup = true"
|
||||||
v-on:download="download(selectedEvent)"
|
v-on:download="download(selectedEvent)"
|
||||||
v-on:report="reportEvent(selectedEvent)"
|
v-on:report="reportEvent(selectedEvent)"
|
||||||
v-on:more="
|
v-on:more="
|
||||||
|
|
@ -304,6 +304,9 @@
|
||||||
<div :class="['heart-wrapper', { 'is-active': heartAnimation }]" :style="hearAnimationPosition">
|
<div :class="['heart-wrapper', { 'is-active': heartAnimation }]" :style="hearAnimationPosition">
|
||||||
<div :class="['heart', { 'is-active': heartAnimation }]" />
|
<div :class="['heart', { 'is-active': heartAnimation }]" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Delete post dialog -->
|
||||||
|
<DeletePostDialog v-model="showDeletePostPopup" v-on:deletePost="onDeletePost"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -337,6 +340,7 @@ import MessageErrorHandler from "./MessageErrorHandler";
|
||||||
import MessageOperationsChannel from './messages/channel/MessageOperationsChannel.vue';
|
import MessageOperationsChannel from './messages/channel/MessageOperationsChannel.vue';
|
||||||
import prettyBytes from "pretty-bytes";
|
import prettyBytes from "pretty-bytes";
|
||||||
import RoomExport from "./RoomExport.vue";
|
import RoomExport from "./RoomExport.vue";
|
||||||
|
import DeletePostDialog from "./DeletePostDialog.vue"
|
||||||
import EmojiPicker from 'vue3-emoji-picker';
|
import EmojiPicker from 'vue3-emoji-picker';
|
||||||
import 'vue3-emoji-picker/css';
|
import 'vue3-emoji-picker/css';
|
||||||
import emitter from 'tiny-emitter/instance';
|
import emitter from 'tiny-emitter/instance';
|
||||||
|
|
@ -398,7 +402,8 @@ export default {
|
||||||
RoomExport,
|
RoomExport,
|
||||||
EmojiPicker,
|
EmojiPicker,
|
||||||
RoomUpgradePrompt,
|
RoomUpgradePrompt,
|
||||||
ReportRoomOrEventDialog
|
ReportRoomOrEventDialog,
|
||||||
|
DeletePostDialog
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -491,6 +496,7 @@ export default {
|
||||||
reverseOrder: false,
|
reverseOrder: false,
|
||||||
downloadingChat: false,
|
downloadingChat: false,
|
||||||
reportingEventId: null,
|
reportingEventId: null,
|
||||||
|
showDeletePostPopup: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2006,6 +2012,11 @@ export default {
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log("Error leaving", err);
|
console.log("Error leaving", err);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onDeletePost() {
|
||||||
|
this.redact(this.selectedEvent);
|
||||||
|
this.showDeletePostPopup = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
23
src/components/DeletePostDialog.vue
Normal file
23
src/components/DeletePostDialog.vue
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<template>
|
||||||
|
<v-dialog v-model="showDeletePostPopup" class="ma-0 pa-0" :width="$vuetify.display.smAndUp ? '688px' : '95%'" scroll-strategy="none">
|
||||||
|
<div class="dialog-content text-center">
|
||||||
|
<h2 class="dialog-title">{{ $t("delete_post.confirm_text") }}</h2>
|
||||||
|
<div class="dialog-text">{{ $t("delete_post.confirm_text_desc") }}</div>
|
||||||
|
<v-container fluid>
|
||||||
|
<v-row cols="12">
|
||||||
|
<v-col cols="6">
|
||||||
|
<v-btn variant="flat" block class="text-button" @click.stop="showDeletePostPopup = false">{{
|
||||||
|
$t("menu.cancel") }}</v-btn>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="6" align="center">
|
||||||
|
<v-btn color="red" variant="flat" block class="filled-button" @click="$emit('deletePost')">{{ $t("menu.delete")
|
||||||
|
}}</v-btn>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-container>
|
||||||
|
</div>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
const showDeletePostPopup = defineModel();
|
||||||
|
</script>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue