update admin logic to be still intuitive

This commit is contained in:
einhorn_b 2023-11-23 14:46:15 +01:00
parent 9dc7d08b3d
commit 5d22b5912d
4 changed files with 18 additions and 10 deletions

View File

@ -112,15 +112,10 @@ export default {
combineResubmissionDateAndTime() {
if (this.resubmissionDate) {
const formattedDate = new Date(this.resubmissionDate)
console.log('resubmission time: %s', this.resubmissionTime)
const [hours, minutes] = this.resubmissionTime.split(':')
console.log('hours: %s, minutes: %s', hours, minutes)
formattedDate.setHours(parseInt(hours))
console.log('set hours: %d', formattedDate.getHours())
formattedDate.setMinutes(parseInt(minutes))
console.log('set minutes: %d', formattedDate.getMinutes())
console.log('IOS String: %s', formattedDate.toISOString())
return formattedDate.toString()
return formattedDate
} else {
return null
}
@ -136,14 +131,18 @@ export default {
message: this.form.text,
messageType: mType,
resubmissionAt: this.showResubmissionDate
? this.combineResubmissionDateAndTime()
? this.combineResubmissionDateAndTime().toString()
: null,
},
})
.then((result) => {
this.$emit('get-list-contribution-messages', this.contributionId)
this.$emit('update-status', this.contributionId)
this.form.text = ''
if (this.showResubmissionDate && this.combineResubmissionDateAndTime() > new Date()) {
this.$emit('update-contributions')
} else {
this.$emit('get-list-contribution-messages', this.contributionId)
this.$emit('update-status', this.contributionId)
}
this.onReset()
this.toastSuccess(this.$t('message.request'))
this.loading = false
})

View File

@ -15,6 +15,7 @@
@get-list-contribution-messages="$apollo.queries.Messages.refetch()"
@update-status="updateStatus"
@reload-contribution="reloadContribution"
@update-contributions="updateContributions"
/>
</div>
</div>
@ -79,6 +80,9 @@ export default {
reloadContribution(id) {
this.$emit('reload-contribution', id)
},
updateContributions() {
this.$emit('update-contributions')
},
},
}
</script>

View File

@ -114,6 +114,7 @@
:contributionMemo="row.item.memo"
@update-status="updateStatus"
@reload-contribution="reloadContribution"
@update-contributions="updateContributions"
/>
</div>
</template>
@ -176,6 +177,9 @@ export default {
reloadContribution(id) {
this.$emit('reload-contribution', id)
},
updateContributions() {
this.$emit('update-contributions')
},
},
}
</script>

View File

@ -49,6 +49,7 @@ export default {
// may be at some point we need a pagination here
return {
statusFilter: this.statusFilter,
hideResubmission: true,
}
},
update({ adminListContributions }) {