mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
replace createdAt column in open creations with smart colum closed
This commit is contained in:
parent
62e6bfe414
commit
4d1eaba6cf
@ -99,6 +99,9 @@
|
||||
</BButton>
|
||||
</div>
|
||||
</template>
|
||||
<template #cell(closed)="row">
|
||||
{{ formatDateOrDash(getClosedDate(row.item)) }}
|
||||
</template>
|
||||
<template #row-details="row">
|
||||
<row-details
|
||||
:row="row"
|
||||
@ -140,6 +143,7 @@
|
||||
import RowDetails from '../RowDetails'
|
||||
import EditCreationFormular from '../EditCreationFormular'
|
||||
import ContributionMessagesList from '../ContributionMessages/ContributionMessagesList'
|
||||
import { useDateFormatter } from '@/composables/useDateFormatter'
|
||||
|
||||
const iconMap = {
|
||||
IN_PROGRESS: 'question-square',
|
||||
@ -195,6 +199,7 @@ export default {
|
||||
this.removeClipboardListener()
|
||||
},
|
||||
methods: {
|
||||
...useDateFormatter(),
|
||||
myself(item) {
|
||||
return item.userId === this.$store.state.moderator.id
|
||||
},
|
||||
@ -209,6 +214,16 @@ export default {
|
||||
if (item.contributionStatus === 'IN_PROGRESS') return 'table-primary'
|
||||
if (item.contributionStatus === 'PENDING') return 'table-primary'
|
||||
},
|
||||
getClosedDate(item) {
|
||||
if (item.contributionStatus === 'CONFIRMED') {
|
||||
return item.confirmedAt
|
||||
} else if (item.contributionStatus === 'DENIED') {
|
||||
return item.deniedAt
|
||||
} else if (item.contributionStatus === 'DELETED') {
|
||||
return item.deletedAt
|
||||
}
|
||||
return null
|
||||
},
|
||||
updateStatus(id) {
|
||||
this.$emit('update-status', id)
|
||||
},
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
export const useDateFormatter = () => {
|
||||
const formatDateFromDateTime = (datetimeString) => {
|
||||
if (!datetimeString || !datetimeString?.includes('T')) return datetimeString
|
||||
if (!datetimeString || !datetimeString?.includes('T')) {
|
||||
return datetimeString
|
||||
}
|
||||
return datetimeString.split('T')[0]
|
||||
}
|
||||
const formatDateOrDash = (value) => (value ? new Date(value).toLocaleDateString() : '—')
|
||||
|
||||
return {
|
||||
formatDateFromDateTime,
|
||||
formatDateOrDash,
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +55,7 @@
|
||||
},
|
||||
"contributions": {
|
||||
"all": "Alle",
|
||||
"closed": "Geschlossen",
|
||||
"confirms": "Bestätigt",
|
||||
"deleted": "Gelöscht",
|
||||
"denied": "Abgelehnt",
|
||||
|
||||
@ -55,6 +55,7 @@
|
||||
},
|
||||
"contributions": {
|
||||
"all": "All",
|
||||
"closed": "Closed",
|
||||
"confirms": "Confirmed",
|
||||
"deleted": "Deleted",
|
||||
"denied": "Rejected",
|
||||
|
||||
@ -108,6 +108,7 @@ import { confirmContribution } from '../graphql/confirmContribution'
|
||||
import { denyContribution } from '../graphql/denyContribution'
|
||||
import { getContribution } from '../graphql/getContribution'
|
||||
import { useAppToast } from '@/composables/useToast'
|
||||
import { useDateFormatter } from '@/composables/useDateFormatter'
|
||||
import CONFIG from '@/config'
|
||||
|
||||
const FILTER_TAB_MAP = [
|
||||
@ -134,7 +135,7 @@ const query = ref('')
|
||||
const noHashtag = ref(null)
|
||||
const hideResubmissionModel = ref(true)
|
||||
|
||||
const formatDateOrDash = (value) => (value ? new Date(value).toLocaleDateString() : '—')
|
||||
const { formatDateOrDash } = useDateFormatter()
|
||||
|
||||
const baseFields = {
|
||||
firstName: { key: 'user.firstName', label: t('firstname'), class: 'no-select' },
|
||||
@ -159,11 +160,6 @@ const baseFields = {
|
||||
class: 'no-select',
|
||||
formatter: formatDateOrDash,
|
||||
},
|
||||
confirmedByUserName: {
|
||||
key: 'confirmedByUserName',
|
||||
label: t('moderator.who'),
|
||||
class: 'no-select',
|
||||
},
|
||||
}
|
||||
|
||||
const fields = computed(
|
||||
@ -231,7 +227,11 @@ const fields = computed(
|
||||
baseFields.memo,
|
||||
baseFields.contributionDate,
|
||||
baseFields.createdAt,
|
||||
baseFields.confirmedAt,
|
||||
{
|
||||
key: 'closed',
|
||||
label: t('contributions.closed'),
|
||||
class: 'no-select',
|
||||
},
|
||||
{ key: 'chatCreation', label: t('details') },
|
||||
],
|
||||
][tabIndex.value],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user