review moriz: chnge OpenCreationsTable

This commit is contained in:
ogerly 2023-02-07 07:47:42 +01:00
parent 8cffe8ed0d
commit feb4f10501

View File

@ -10,11 +10,7 @@
:tbody-tr-class="rowClass" :tbody-tr-class="rowClass"
> >
<template #cell(state)="row"> <template #cell(state)="row">
<b-icon v-if="row.item.state === 'IN_PROGRESS'" icon="question-square"></b-icon> <b-icon :icon="getStatusIcon(row.item.state)"></b-icon>
<b-icon v-if="row.item.state === 'PENDING'" icon="bell-fill"></b-icon>
<b-icon v-if="row.item.state === 'CONFIRMED'" icon="check"></b-icon>
<b-icon v-if="row.item.state === 'DELETED'" icon="trash"></b-icon>
<b-icon v-if="row.item.state === 'DENIED'" icon="x-circle"></b-icon>
</template> </template>
<template #cell(bookmark)="row"> <template #cell(bookmark)="row">
<b-button <b-button
@ -53,7 +49,7 @@
</div> </div>
</template> </template>
<template #cell(reActive)> <template #cell(reActive)>
<b-button variant="warning" size="md" @click="reActive" class="mr-2"> <b-button variant="warning" size="md" class="mr-2">
<b-icon icon="arrow-up" variant="light"></b-icon> <b-icon icon="arrow-up" variant="light"></b-icon>
</b-button> </b-button>
</template> </template>
@ -125,6 +121,14 @@ import RowDetails from '../RowDetails.vue'
import EditCreationFormular from '../EditCreationFormular.vue' import EditCreationFormular from '../EditCreationFormular.vue'
import ContributionMessagesList from '../ContributionMessages/ContributionMessagesList.vue' import ContributionMessagesList from '../ContributionMessages/ContributionMessagesList.vue'
const iconMap = {
IN_PROGRESS: 'question-square',
PENDING: 'bell-fill',
CONFIRMED: 'check',
DELETED: 'trash',
DENIED: 'x-circle',
}
export default { export default {
name: 'OpenCreationsTable', name: 'OpenCreationsTable',
mixins: [toggleRowDetails], mixins: [toggleRowDetails],
@ -154,6 +158,9 @@ export default {
} }
}, },
methods: { methods: {
getStatusIcon(status) {
return iconMap[status] ? iconMap[status] : 'default-icon'
},
rowClass(item, type) { rowClass(item, type) {
if (!item || type !== 'row') return if (!item || type !== 'row') return
if (item.state === 'CONFIRMED') return 'table-success' if (item.state === 'CONFIRMED') return 'table-success'
@ -172,9 +179,6 @@ export default {
updateState(id) { updateState(id) {
this.$emit('update-state', id) this.$emit('update-state', id)
}, },
reActive() {
alert('reActive Contribution')
},
}, },
} }
</script> </script>