Merge branch 'open-creations-query-admin' into 2803-open-contribution-edit-button

This commit is contained in:
Moriz Wahl 2023-03-10 10:09:04 +01:00
commit 91c74331ff
6 changed files with 41 additions and 10 deletions

View File

@ -75,6 +75,7 @@
</template>
<script>
import { adminUpdateContribution } from '../graphql/adminUpdateContribution'
import { openCreations } from '../graphql/openCreations'
import { creationMonths } from '../mixins/creationMonths'
export default {
@ -96,10 +97,6 @@ export default {
type: Object,
required: true,
},
creation: {
type: Array,
required: true,
},
},
data() {
return {
@ -108,6 +105,7 @@ export default {
rangeMin: 0,
rangeMax: 1000,
selected: '',
creation: [0, 0, 0],
}
},
methods: {
@ -151,6 +149,25 @@ export default {
})
},
},
apollo: {
OpenCreations: {
query() {
return openCreations
},
fetchPolicy: 'network-only',
variables() {
return {
userId: this.item.userId,
}
},
update({ openCreations }) {
this.creation = openCreations.map((c) => c.amount)
},
error({ message }) {
this.toastError(message)
},
},
},
created() {
if (this.creationUserData.date) {
const month = this.$d(new Date(this.creationUserData.date), 'month')

View File

@ -93,7 +93,6 @@
<div v-if="row.item.moderatorId">
<edit-creation-formular
type="singleCreation"
:creation="row.item.creation"
:item="row.item"
:row="row"
:creationUserData="creationUserData"

View File

@ -0,0 +1,11 @@
import gql from 'graphql-tag'
export const openCreations = gql`
query ($userId: Int) {
openCreations(userId: $userID) {
year
month
amount
}
}
`

View File

@ -37,9 +37,9 @@
"denied": "Rejected",
"open": "Open"
},
"created": "Confirmed",
"createdAt": "Created",
"creation": "Creation",
"created": "Created for",
"createdAt": "Created at",
"creation": "Amount",
"creationList": "Creation list",
"creation_form": {
"creation_for": "Active Basic Income for",

View File

@ -25,7 +25,11 @@
</div>
<div class="mt-3 font-weight-bold">{{ $t('contributionText') }}</div>
<div class="mb-3 text-break word-break">{{ memo }}</div>
<div v-if="state === 'IN_PROGRESS' && !allContribution" class="text-205">
<div
v-if="state === 'IN_PROGRESS'"
class="text-205 pointer hover-font-bold"
@click="visible = !visible"
>
{{ $t('contribution.alert.answerQuestion') }}
</div>
</b-col>

View File

@ -13,7 +13,7 @@
<span class="ml-2">{{ $t('navigation.overview') }}</span>
</b-nav-item>
<b-nav-item to="/send" class="mb-3" active-class="activeRoute">
<b-img src="/img/svg/send.svg" height="20" class="svg-icon" />
<b-icon icon="cash" aria-hidden="true"></b-icon>
<span class="ml-2">{{ $t('navigation.send') }}</span>
</b-nav-item>
<b-nav-item to="/transactions" class="mb-3" active-class="activeRoute">