mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix(admin): fix message update (#3354)
* fix(admin): fix refetch data in edit creation form * fix(admin): fix message updates * fix(admin): fix stylelint issue
This commit is contained in:
parent
f6b827d43b
commit
d61e69c2f1
@ -75,180 +75,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--<script>-->
|
||||
<!--import { adminCreateContributionMessage } from '@/graphql/adminCreateContributionMessage'-->
|
||||
<!--import { adminUpdateContribution } from '@/graphql/adminUpdateContribution'-->
|
||||
<!--import TimePicker from '@/components/input/TimePicker'-->
|
||||
|
||||
<!--export default {-->
|
||||
<!-- name: 'ContributionMessagesFormular',-->
|
||||
<!-- components: {-->
|
||||
<!-- TimePicker,-->
|
||||
<!-- },-->
|
||||
<!-- props: {-->
|
||||
<!-- contributionId: {-->
|
||||
<!-- type: Number,-->
|
||||
<!-- required: true,-->
|
||||
<!-- },-->
|
||||
<!-- contributionMemo: {-->
|
||||
<!-- type: String,-->
|
||||
<!-- required: true,-->
|
||||
<!-- },-->
|
||||
<!-- hideResubmission: {-->
|
||||
<!-- type: Boolean,-->
|
||||
<!-- required: true,-->
|
||||
<!-- },-->
|
||||
<!-- inputResubmissionDate: {-->
|
||||
<!-- type: String,-->
|
||||
<!-- required: false,-->
|
||||
<!-- },-->
|
||||
<!-- },-->
|
||||
<!-- emits: [-->
|
||||
<!-- 'update-contribution',-->
|
||||
<!-- 'update-contributions',-->
|
||||
<!-- 'get-contribution',-->
|
||||
<!-- 'update-status',-->
|
||||
<!-- 'get-list-contribution-messages',-->
|
||||
<!-- ],-->
|
||||
<!-- data() {-->
|
||||
<!-- const localInputResubmissionDate = this.inputResubmissionDate-->
|
||||
<!-- ? new Date(this.inputResubmissionDate)-->
|
||||
<!-- : null-->
|
||||
|
||||
<!-- return {-->
|
||||
<!-- form: {-->
|
||||
<!-- text: '',-->
|
||||
<!-- memo: this.contributionMemo,-->
|
||||
<!-- },-->
|
||||
<!-- loading: false,-->
|
||||
<!-- resubmissionDate: localInputResubmissionDate,-->
|
||||
<!-- resubmissionTime: localInputResubmissionDate-->
|
||||
<!-- ? localInputResubmissionDate.toLocaleTimeString('de-DE', {-->
|
||||
<!-- hour: '2-digit',-->
|
||||
<!-- minute: '2-digit',-->
|
||||
<!-- })-->
|
||||
<!-- : '00:00',-->
|
||||
<!-- showResubmissionDate: localInputResubmissionDate !== null,-->
|
||||
<!-- tabindex: 0, // 0 = Chat, 1 = Notice, 2 = Memo-->
|
||||
<!-- messageType: {-->
|
||||
<!-- DIALOG: 'DIALOG',-->
|
||||
<!-- MODERATOR: 'MODERATOR',-->
|
||||
<!-- },-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- disabled() {-->
|
||||
<!-- return (-->
|
||||
<!-- (this.chatOrMemo === 0 && this.form.text === '') ||-->
|
||||
<!-- this.loading ||-->
|
||||
<!-- (this.chatOrMemo === 1 && this.form.memo.length < 5) ||-->
|
||||
<!-- (this.showResubmissionDate && !this.resubmissionDate)-->
|
||||
<!-- )-->
|
||||
<!-- },-->
|
||||
<!-- moderatorDisabled() {-->
|
||||
<!-- return this.form.text === '' || this.loading || this.chatOrMemo === 1-->
|
||||
<!-- },-->
|
||||
<!-- now() {-->
|
||||
<!-- return new Date()-->
|
||||
<!-- },-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- combineResubmissionDateAndTime() {-->
|
||||
<!-- // getTimezoneOffset-->
|
||||
<!-- const formattedDate = new Date(this.resubmissionDate)-->
|
||||
<!-- const [hours, minutes] = this.resubmissionTime.split(':')-->
|
||||
<!-- formattedDate.setHours(parseInt(hours))-->
|
||||
<!-- formattedDate.setMinutes(parseInt(minutes))-->
|
||||
<!-- return formattedDate-->
|
||||
<!-- },-->
|
||||
<!-- utcResubmissionDateTime() {-->
|
||||
<!-- if (!this.resubmissionDate) return null-->
|
||||
<!-- const localResubmissionDateAndTime = this.combineResubmissionDateAndTime()-->
|
||||
<!-- return new Date(-->
|
||||
<!-- localResubmissionDateAndTime.getTime() +-->
|
||||
<!-- localResubmissionDateAndTime.getTimezoneOffset() * 60000,-->
|
||||
<!-- )-->
|
||||
<!-- },-->
|
||||
<!-- onSubmit() {-->
|
||||
<!-- this.loading = true-->
|
||||
<!-- let mutation-->
|
||||
<!-- let updateOnlyResubmissionAt = false-->
|
||||
<!-- const resubmissionAtDate = this.showResubmissionDate-->
|
||||
<!-- ? this.combineResubmissionDateAndTime()-->
|
||||
<!-- : null-->
|
||||
<!-- const variables = {-->
|
||||
<!-- resubmissionAt: resubmissionAtDate ? resubmissionAtDate.toString() : null,-->
|
||||
<!-- }-->
|
||||
<!-- // update only resubmission date?-->
|
||||
<!-- if (this.form.text === '' && this.form.memo === this.contributionMemo) {-->
|
||||
<!-- mutation = adminUpdateContribution-->
|
||||
<!-- variables.id = this.contributionId-->
|
||||
<!-- updateOnlyResubmissionAt = true-->
|
||||
<!-- }-->
|
||||
<!-- // update tabindex 0 = dialog or 1 = moderator-->
|
||||
<!-- else if (this.tabindex !== 2) {-->
|
||||
<!-- mutation = adminCreateContributionMessage-->
|
||||
<!-- variables.message = this.form.text-->
|
||||
<!-- variables.messageType =-->
|
||||
<!-- this.tabindex === 0 ? this.messageType.DIALOG : this.messageType.MODERATOR-->
|
||||
<!-- variables.contributionId = this.contributionId-->
|
||||
<!-- // update contribution memo, tabindex 2-->
|
||||
<!-- } else {-->
|
||||
<!-- mutation = adminUpdateContribution-->
|
||||
<!-- variables.memo = this.form.memo-->
|
||||
<!-- variables.id = this.contributionId-->
|
||||
<!-- }-->
|
||||
<!-- if (this.showResubmissionDate && resubmissionAtDate < new Date()) {-->
|
||||
<!-- this.toastError(this.$t('contributionMessagesForm.resubmissionDateInPast'))-->
|
||||
<!-- this.loading = false-->
|
||||
<!-- return-->
|
||||
<!-- }-->
|
||||
<!-- this.$apollo-->
|
||||
<!-- .mutate({ mutation, variables })-->
|
||||
<!-- .then((result) => {-->
|
||||
<!-- if (-->
|
||||
<!-- (this.hideResubmission &&-->
|
||||
<!-- this.showResubmissionDate &&-->
|
||||
<!-- resubmissionAtDate > new Date()) ||-->
|
||||
<!-- this.tabindex === 2-->
|
||||
<!-- ) {-->
|
||||
<!-- this.$emit('update-contributions')-->
|
||||
<!-- } else {-->
|
||||
<!-- this.$emit('get-list-contribution-messages', this.contributionId)-->
|
||||
<!-- // update status increase message count and update chat symbol-->
|
||||
<!-- // if (updateOnlyResubmissionAt === true) no message was created-->
|
||||
<!-- if (!updateOnlyResubmissionAt) {-->
|
||||
<!-- this.$emit('update-status', this.contributionId)-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- this.toastSuccess(this.$t('message.request'))-->
|
||||
<!-- this.loading = false-->
|
||||
<!-- })-->
|
||||
<!-- .catch((error) => {-->
|
||||
<!-- this.toastError(error.message)-->
|
||||
<!-- this.loading = false-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- onReset(event) {-->
|
||||
<!-- this.form.text = ''-->
|
||||
<!-- this.form.memo = this.contributionMemo-->
|
||||
<!-- this.showResubmissionDate = false-->
|
||||
<!-- this.resubmissionDate = this.inputResubmissionDate-->
|
||||
<!-- this.resubmissionTime = this.inputResubmissionDate-->
|
||||
<!-- ? new Date(this.inputResubmissionDate).toLocaleTimeString('de-DE', {-->
|
||||
<!-- hour: '2-digit',-->
|
||||
<!-- minute: '2-digit',-->
|
||||
<!-- })-->
|
||||
<!-- : '00:00'-->
|
||||
<!-- this.showResubmissionDate =-->
|
||||
<!-- this.inputResubmissionDate !== undefined && this.inputResubmissionDate !== null-->
|
||||
<!-- },-->
|
||||
<!-- enableMemo() {-->
|
||||
<!-- this.chatOrMemo = 1-->
|
||||
<!-- },-->
|
||||
<!-- },-->
|
||||
<!--}-->
|
||||
<!--</script>-->
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
@ -380,7 +206,7 @@ const onSubmit = () => {
|
||||
return
|
||||
}
|
||||
|
||||
mutation({ variables })
|
||||
mutation({ ...variables })
|
||||
.then(() => {
|
||||
if (
|
||||
(props.hideResubmission && showResubmissionDate.value && resubmissionAtDate > new Date()) ||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<!-- eslint-disable @intlify/vue-i18n/no-dynamic-keys -->
|
||||
<template>
|
||||
<div class="creation-confirm">
|
||||
{{ console.log(currentPage) }}
|
||||
<user-query v-model="query" class="mb-2 mt-2" :placeholder="$t('user_memo_search')" />
|
||||
<p class="mb-2">
|
||||
<input v-model="noHashtag" type="checkbox" class="noHashtag" />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="nav-community">
|
||||
<div
|
||||
class="nav-community__btn-wrapper bg-209 rounded-26 d-flex bd-highlight mx-xl-6 mx-lg-5 shadow justify-content-between"
|
||||
class="nav-community-btn-wrapper bg-209 rounded-26 d-flex bd-highlight mx-xl-6 mx-lg-5 shadow justify-content-between"
|
||||
>
|
||||
<BButton
|
||||
to="contribute"
|
||||
@ -42,7 +42,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.nav-community__btn-wrapper {
|
||||
.nav-community-btn-wrapper {
|
||||
> :deep(*) {
|
||||
width: calc(100% / 3);
|
||||
display: flex;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user