mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Refactored to modalData for Delete Comment and Posts
The error is gone with this.
This commit is contained in:
parent
f944142e4b
commit
b2e1873ade
@ -9,12 +9,14 @@
|
|||||||
<ds-space margin-bottom="x-small">
|
<ds-space margin-bottom="x-small">
|
||||||
<hc-user :user="author" :date-time="comment.createdAt" />
|
<hc-user :user="author" :date-time="comment.createdAt" />
|
||||||
</ds-space>
|
</ds-space>
|
||||||
|
<!-- Content Menu (can open Modals) -->
|
||||||
<no-ssr>
|
<no-ssr>
|
||||||
<content-menu
|
<content-menu
|
||||||
placement="bottom-end"
|
placement="bottom-end"
|
||||||
resource-type="comment"
|
resource-type="comment"
|
||||||
:resource="comment"
|
:resource="comment"
|
||||||
:callbacks="{ confirm: deleteCommentCallback, cancel: null }"
|
:callbacks="{ confirm: deleteCommentCallback, cancel: null }"
|
||||||
|
:modalsData="menuModalsData"
|
||||||
style="float-right"
|
style="float-right"
|
||||||
:is-owner="isAuthor(author.id)"
|
:is-owner="isAuthor(author.id)"
|
||||||
/>
|
/>
|
||||||
@ -47,6 +49,31 @@ export default {
|
|||||||
},
|
},
|
||||||
dateTime: { type: [Date, String], default: null },
|
dateTime: { type: [Date, String], default: null },
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menuModalsData: {
|
||||||
|
delete: {
|
||||||
|
titleIdent: 'delete.comment.title',
|
||||||
|
messageIdent: 'delete.comment.message',
|
||||||
|
messageParams: {
|
||||||
|
name: this.$filters.truncate(this.comment.contentExcerpt, 30),
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
confirm: {
|
||||||
|
icon: 'trash',
|
||||||
|
textIdent: 'delete.submit',
|
||||||
|
callback: this.deleteCommentCallback,
|
||||||
|
},
|
||||||
|
cancel: {
|
||||||
|
icon: 'close',
|
||||||
|
textIdent: 'delete.cancel',
|
||||||
|
callback: () => {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
user: 'auth/user',
|
user: 'auth/user',
|
||||||
|
|||||||
@ -43,7 +43,13 @@ export default {
|
|||||||
return value.match(/(contribution|comment|organization|user)/)
|
return value.match(/(contribution|comment|organization|user)/)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
callbacks: { type: Object, required: true },
|
modalsData: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
// default: () => {
|
||||||
|
// return {}
|
||||||
|
// },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
routes() {
|
routes() {
|
||||||
@ -145,7 +151,7 @@ export default {
|
|||||||
data: {
|
data: {
|
||||||
type: this.resourceType,
|
type: this.resourceType,
|
||||||
resource: this.resource,
|
resource: this.resource,
|
||||||
callbacks: this.callbacks,
|
modalsData: this.modalsData,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
:id="data.resource.id"
|
:id="data.resource.id"
|
||||||
:type="data.type"
|
:type="data.type"
|
||||||
:name="name"
|
:name="name"
|
||||||
:callbacks="data.callbacks"
|
|
||||||
@close="close"
|
@close="close"
|
||||||
/>
|
/>
|
||||||
<release-modal
|
<release-modal
|
||||||
@ -21,7 +20,6 @@
|
|||||||
:id="data.resource.id"
|
:id="data.resource.id"
|
||||||
:type="data.type"
|
:type="data.type"
|
||||||
:name="name"
|
:name="name"
|
||||||
:callbacks="data.callbacks"
|
|
||||||
@close="close"
|
@close="close"
|
||||||
/>
|
/>
|
||||||
<delete-modal
|
<delete-modal
|
||||||
@ -29,7 +27,7 @@
|
|||||||
:id="data.resource.id"
|
:id="data.resource.id"
|
||||||
:type="data.type"
|
:type="data.type"
|
||||||
:name="name"
|
:name="name"
|
||||||
:callbacks="data.callbacks"
|
:modalData="data.modalsData.delete"
|
||||||
@close="close"
|
@close="close"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -63,7 +61,7 @@ export default {
|
|||||||
switch (this.data.type) {
|
switch (this.data.type) {
|
||||||
case 'user':
|
case 'user':
|
||||||
return name
|
return name
|
||||||
case 'contribution':
|
case 'contribution': // REFACTORING: In DeleteModal – Already replaced "title" by "this.menuModalsData.delete.messageParams".
|
||||||
return title
|
return title
|
||||||
case 'comment':
|
case 'comment':
|
||||||
return author && author.name
|
return author && author.name
|
||||||
|
|||||||
@ -10,10 +10,18 @@
|
|||||||
<p v-html="message" />
|
<p v-html="message" />
|
||||||
|
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<ds-button class="cancel" icon="close" @click="cancel">{{ $t('delete.cancel') }}</ds-button>
|
<ds-button class="cancel" :icon="modalData.buttons.cancel.icon" @click="cancel">
|
||||||
|
{{ $t(modalData.buttons.cancel.textIdent) }}
|
||||||
|
</ds-button>
|
||||||
|
|
||||||
<ds-button danger class="confirm" icon="trash" :loading="loading" @click="confirm">
|
<ds-button
|
||||||
{{ $t('delete.submit') }}
|
danger
|
||||||
|
class="confirm"
|
||||||
|
:icon="modalData.buttons.confirm.icon"
|
||||||
|
:loading="loading"
|
||||||
|
@click="confirm"
|
||||||
|
>
|
||||||
|
{{ $t(modalData.buttons.confirm.textIdent) }}
|
||||||
</ds-button>
|
</ds-button>
|
||||||
</template>
|
</template>
|
||||||
</ds-modal>
|
</ds-modal>
|
||||||
@ -30,7 +38,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
name: { type: String, default: '' },
|
name: { type: String, default: '' },
|
||||||
type: { type: String, required: true },
|
type: { type: String, required: true },
|
||||||
callbacks: { type: Object, required: true },
|
modalData: { type: Object, required: true },
|
||||||
id: { type: String, required: true },
|
id: { type: String, required: true },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -42,18 +50,15 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return this.$t(`delete.${this.type}.title`)
|
return this.$t(this.modalData.titleIdent)
|
||||||
},
|
},
|
||||||
message() {
|
message() {
|
||||||
const name = this.$filters.truncate(this.name, 30)
|
return this.$t(this.modalData.messageIdent, this.modalData.messageParams)
|
||||||
return this.$t(`delete.${this.type}.message`, { name })
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async cancel() {
|
async cancel() {
|
||||||
if (this.callbacks.cancel) {
|
await this.modalData.buttons.cancel.callback()
|
||||||
await this.callbacks.cancel()
|
|
||||||
}
|
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
@ -62,9 +67,7 @@ export default {
|
|||||||
async confirm() {
|
async confirm() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
if (this.callbacks.confirm) {
|
await this.modalData.buttons.confirm.callback()
|
||||||
await this.callbacks.confirm()
|
|
||||||
}
|
|
||||||
this.success = true
|
this.success = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
|
|||||||
@ -21,7 +21,6 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
name: { type: String, default: '' },
|
name: { type: String, default: '' },
|
||||||
type: { type: String, required: true },
|
type: { type: String, required: true },
|
||||||
callbacks: { type: Object, required: true },
|
|
||||||
id: { type: String, required: true },
|
id: { type: String, required: true },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -42,9 +41,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async cancel() {
|
async cancel() {
|
||||||
if (this.callbacks.cancel) {
|
// TODO: Use the "modalData" structure introduced in "DeleteModal" and refactor this here. Be aware that all the Jest tests have to be refactored as well !!!
|
||||||
await this.callbacks.cancel()
|
// await this.modalData.buttons.cancel.callback()
|
||||||
}
|
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
@ -52,9 +50,8 @@ export default {
|
|||||||
},
|
},
|
||||||
async confirm() {
|
async confirm() {
|
||||||
try {
|
try {
|
||||||
if (this.callbacks.confirm) {
|
// TODO: Use the "modalData" structure introduced in "DeleteModal" and refactor this here. Be aware that all the Jest tests have to be refactored as well !!!
|
||||||
await this.callbacks.confirm()
|
// await this.modalData.buttons.confirm.callback()
|
||||||
}
|
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation($id: ID!) {
|
mutation($id: ID!) {
|
||||||
|
|||||||
@ -10,9 +10,7 @@
|
|||||||
<p v-html="message" />
|
<p v-html="message" />
|
||||||
|
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<ds-button class="cancel" icon="close" @click="cancel">
|
<ds-button class="cancel" icon="close" @click="cancel">{{ $t('report.cancel') }}</ds-button>
|
||||||
{{ $t('report.cancel') }}
|
|
||||||
</ds-button>
|
|
||||||
|
|
||||||
<ds-button
|
<ds-button
|
||||||
danger
|
danger
|
||||||
@ -39,7 +37,6 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
name: { type: String, default: '' },
|
name: { type: String, default: '' },
|
||||||
type: { type: String, required: true },
|
type: { type: String, required: true },
|
||||||
callbacks: { type: Object, required: true },
|
|
||||||
id: { type: String, required: true },
|
id: { type: String, required: true },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -60,9 +57,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async cancel() {
|
async cancel() {
|
||||||
if (this.callbacks.cancel) {
|
// TODO: Use the "modalData" structure introduced in "DeleteModal" and refactor this here. Be aware that all the Jest tests have to be refactored as well !!!
|
||||||
await this.callbacks.cancel()
|
// await this.modalData.buttons.cancel.callback()
|
||||||
}
|
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
@ -70,10 +66,9 @@ export default {
|
|||||||
},
|
},
|
||||||
async confirm() {
|
async confirm() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
// TODO: Use the "modalData" structure introduced in "DeleteModal" and refactor this here. Be aware that all the Jest tests have to be refactored as well !!!
|
||||||
|
// await this.modalData.buttons.confirm.callback()
|
||||||
try {
|
try {
|
||||||
if (this.callbacks.confirm) {
|
|
||||||
await this.callbacks.confirm()
|
|
||||||
}
|
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation($id: ID!) {
|
mutation($id: ID!) {
|
||||||
|
|||||||
@ -18,9 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<ds-space margin-bottom="small" />
|
<ds-space margin-bottom="small" />
|
||||||
<!-- Post Title -->
|
<!-- Post Title -->
|
||||||
<ds-heading tag="h3" no-margin>
|
<ds-heading tag="h3" no-margin>{{ post.title }}</ds-heading>
|
||||||
{{ post.title }}
|
|
||||||
</ds-heading>
|
|
||||||
<ds-space margin-bottom="small" />
|
<ds-space margin-bottom="small" />
|
||||||
<!-- Post Content Excerpt -->
|
<!-- Post Content Excerpt -->
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
@ -55,7 +53,7 @@
|
|||||||
<content-menu
|
<content-menu
|
||||||
resource-type="contribution"
|
resource-type="contribution"
|
||||||
:resource="post"
|
:resource="post"
|
||||||
:callbacks="{ confirm: deletePostCallback, cancel: null }"
|
:modalsData="menuModalsData"
|
||||||
:is-owner="isAuthor"
|
:is-owner="isAuthor"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -40,6 +40,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
cancel() {
|
cancel() {
|
||||||
|
// TODO: Use the "modalData" structure introduced in "DeleteModal" and refactor this here. Be aware that all the Jest tests have to be refactored as well !!!
|
||||||
|
// await this.modalData.buttons.cancel.callback()
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
@ -47,6 +49,8 @@ export default {
|
|||||||
},
|
},
|
||||||
async confirm() {
|
async confirm() {
|
||||||
try {
|
try {
|
||||||
|
// TODO: Use the "modalData" structure introduced in "DeleteModal" and refactor this here. Be aware that all the Jest tests have to be refactored as well !!!
|
||||||
|
// await this.modalData.buttons.confirm.callback()
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation($id: ID!) {
|
mutation($id: ID!) {
|
||||||
|
|||||||
@ -235,7 +235,7 @@
|
|||||||
"comment": {
|
"comment": {
|
||||||
"title": "Lösche Kommentar",
|
"title": "Lösche Kommentar",
|
||||||
"type": "Comment",
|
"type": "Comment",
|
||||||
"message": "Bist du sicher, dass du den Kommentar von \"<b>{name}</b>\" löschen möchtest?",
|
"message": "Bist du sicher, dass du den Kommentar \"<b>{name}</b>\" löschen möchtest?",
|
||||||
"success": "Kommentar erfolgreich gelöscht!"
|
"success": "Kommentar erfolgreich gelöscht!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -235,7 +235,7 @@
|
|||||||
"comment": {
|
"comment": {
|
||||||
"title": "Delete Comment",
|
"title": "Delete Comment",
|
||||||
"type": "Comment",
|
"type": "Comment",
|
||||||
"message": "Do you really want to delete the comment from \"<b>{name}</b>\"?",
|
"message": "Do you really want to delete the comment \"<b>{name}</b>\"?",
|
||||||
"success": "Comment successfully deleted!"
|
"success": "Comment successfully deleted!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,9 +1,34 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menuModalsData: {
|
||||||
|
delete: {
|
||||||
|
titleIdent: 'delete.contribution.title',
|
||||||
|
messageIdent: 'delete.contribution.message',
|
||||||
|
messageParams: {
|
||||||
|
// "this.post" is not defined at the beginning …
|
||||||
|
name: this.post ? this.$filters.truncate(this.post.title, 30) : '',
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
confirm: {
|
||||||
|
icon: 'trash',
|
||||||
|
textIdent: 'delete.submit',
|
||||||
|
callback: this.deletePostCallback,
|
||||||
|
},
|
||||||
|
cancel: {
|
||||||
|
icon: 'close',
|
||||||
|
textIdent: 'delete.cancel',
|
||||||
|
callback: () => {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async deletePostCallback(postDisplayType = 'list') {
|
async deletePostCallback(postDisplayType = 'list') {
|
||||||
// console.log('inside "deletePostCallback" !!! ', this.post)
|
|
||||||
try {
|
try {
|
||||||
var gqlMutation = gql`
|
var gqlMutation = gql`
|
||||||
mutation($id: ID!) {
|
mutation($id: ID!) {
|
||||||
@ -19,15 +44,12 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
this.$toast.success(this.$t('delete.contribution.success'))
|
this.$toast.success(this.$t('delete.contribution.success'))
|
||||||
// console.log('called "this.$t" !!!')
|
|
||||||
switch (postDisplayType) {
|
switch (postDisplayType) {
|
||||||
case 'list':
|
case 'list':
|
||||||
this.$emit('deletePost')
|
this.$emit('deletePost')
|
||||||
// console.log('emitted "deletePost" !!!')
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
// case 'page'
|
// case 'page':
|
||||||
// console.log('called "this.$router.history.push" !!!')
|
|
||||||
this.$router.history.push('/') // Single page type: Redirect to index (main) page
|
this.$router.history.push('/') // Single page type: Redirect to index (main) page
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,19 +7,18 @@
|
|||||||
>
|
>
|
||||||
<ds-space margin-bottom="small" />
|
<ds-space margin-bottom="small" />
|
||||||
<hc-user :user="post.author" :date-time="post.createdAt" />
|
<hc-user :user="post.author" :date-time="post.createdAt" />
|
||||||
|
<!-- Content Menu (can open Modals) -->
|
||||||
<no-ssr>
|
<no-ssr>
|
||||||
<content-menu
|
<content-menu
|
||||||
placement="bottom-end"
|
placement="bottom-end"
|
||||||
resource-type="contribution"
|
resource-type="contribution"
|
||||||
:resource="post"
|
:resource="post"
|
||||||
:callbacks="{ confirm: () => deletePostCallback('page'), cancel: null }"
|
:modalsData="menuModalsDataPage()"
|
||||||
:is-owner="isAuthor(post.author.id)"
|
:is-owner="isAuthor(post.author.id)"
|
||||||
/>
|
/>
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
<ds-space margin-bottom="small" />
|
<ds-space margin-bottom="small" />
|
||||||
<ds-heading tag="h3" no-margin>
|
<ds-heading tag="h3" no-margin>{{ post.title }}</ds-heading>
|
||||||
{{ post.title }}
|
|
||||||
</ds-heading>
|
|
||||||
<ds-space margin-bottom="small" />
|
<ds-space margin-bottom="small" />
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
@ -215,6 +214,11 @@ export default {
|
|||||||
isAuthor(id) {
|
isAuthor(id) {
|
||||||
return this.$store.getters['auth/user'].id === id
|
return this.$store.getters['auth/user'].id === id
|
||||||
},
|
},
|
||||||
|
menuModalsDataPage() {
|
||||||
|
const locMenuModalsData = this.menuModalsData
|
||||||
|
locMenuModalsData.delete.buttons.confirm.callback = () => this.deletePostCallback('page')
|
||||||
|
return locMenuModalsData
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -12,13 +12,12 @@
|
|||||||
>
|
>
|
||||||
<hc-upload v-if="myProfile" :user="user" />
|
<hc-upload v-if="myProfile" :user="user" />
|
||||||
<hc-avatar v-else :user="user" class="profile-avatar" size="x-large" />
|
<hc-avatar v-else :user="user" class="profile-avatar" size="x-large" />
|
||||||
<!-- Content Menu (can open Modals) -->
|
<!-- Menu -->
|
||||||
<no-ssr>
|
<no-ssr>
|
||||||
<content-menu
|
<content-menu
|
||||||
placement="bottom-end"
|
placement="bottom-end"
|
||||||
resource-type="user"
|
resource-type="user"
|
||||||
:resource="user"
|
:resource="user"
|
||||||
:modalsData="modalsData"
|
|
||||||
:is-owner="myProfile"
|
:is-owner="myProfile"
|
||||||
class="user-content-menu"
|
class="user-content-menu"
|
||||||
/>
|
/>
|
||||||
@ -241,7 +240,6 @@ import HcEmpty from '~/components/Empty.vue'
|
|||||||
import ContentMenu from '~/components/ContentMenu'
|
import ContentMenu from '~/components/ContentMenu'
|
||||||
import HcUpload from '~/components/Upload'
|
import HcUpload from '~/components/Upload'
|
||||||
import HcAvatar from '~/components/Avatar/Avatar.vue'
|
import HcAvatar from '~/components/Avatar/Avatar.vue'
|
||||||
import PostMutationHelpers from '~/mixins/PostMutationHelpers'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -256,7 +254,6 @@ export default {
|
|||||||
ContentMenu,
|
ContentMenu,
|
||||||
HcUpload,
|
HcUpload,
|
||||||
},
|
},
|
||||||
mixins: [PostMutationHelpers],
|
|
||||||
transition: {
|
transition: {
|
||||||
name: 'slide-up',
|
name: 'slide-up',
|
||||||
mode: 'out-in',
|
mode: 'out-in',
|
||||||
@ -267,35 +264,6 @@ export default {
|
|||||||
voted: false,
|
voted: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 6,
|
pageSize: 6,
|
||||||
modalsData: {
|
|
||||||
delete: {
|
|
||||||
titel: () => {
|
|
||||||
this.$t('delete.contribution.title')
|
|
||||||
},
|
|
||||||
message: () => {
|
|
||||||
const name = this.$filters.truncate(this.name, 30)
|
|
||||||
return this.$t(`delete.contribution.message`, { name })
|
|
||||||
},
|
|
||||||
buttons: {
|
|
||||||
confirm: {
|
|
||||||
icon: 'trash',
|
|
||||||
text: () => {
|
|
||||||
this.$t('delete.submit')
|
|
||||||
},
|
|
||||||
callback: this.deletePostCallback,
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
icon: 'close',
|
|
||||||
text: () => {
|
|
||||||
this.$t('delete.cancel')
|
|
||||||
},
|
|
||||||
callback: () => {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
disableCallbacks: { confirmCallback: () => {}, cancelCallback: () => {} },
|
|
||||||
reportCallbacks: { confirmCallback: () => {}, cancelCallback: () => {} },
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user