|
6 | 6 | <div class="d-flex justify-content-between"> |
7 | 7 | <div class="flex-grow-1"> |
8 | 8 | <div v-if="editing" class="d-flex flex-wrap"> |
9 | | - <GroupSelect v-model="editgroup" modonly class="mr-1" size="lg" /> |
| 9 | + <GroupSelect v-model="editgroup" modonly class="mr-1" size="lg" :disabled-except-for="memberGroupIds" /> |
10 | 10 | <div v-if="message.item && message.location" class="d-flex justify-content-start"> |
11 | 11 | <b-select v-model="message.type" :options="typeOptions" class="type mr-1" size="lg" /> |
12 | 12 | <b-input v-model="message.item.name" size="lg" class="mr-1" /> |
|
63 | 63 | {{ message.fromuser.displayname }} |
64 | 64 | </div> |
65 | 65 | <div v-if="expanded" class="d-flex"> |
66 | | - <div> |
67 | | - <b-btn v-if="message.source === 'Email'" variant="white" @click="viewSource"> |
68 | | - <v-icon name="book-open" /><span class="d-none d-sm-inline"> View Email Source</span> |
69 | | - </b-btn> |
| 66 | + <div class="d-flex flex-column align-content-end"> |
70 | 67 | <b-btn v-if="!editing" variant="white" @click="startEdit"> |
71 | 68 | <v-icon name="pen" /><span class="d-none d-sm-inline"> Edit</span> |
72 | 69 | </b-btn> |
| 70 | + <b-btn v-if="message.source === 'Email'" variant="white" class="mt-2" @click="viewSource"> |
| 71 | + <v-icon name="book-open" /><span class="d-none d-sm-inline"> View Email Source</span> |
| 72 | + </b-btn> |
| 73 | + <SpinButton |
| 74 | + v-if="message.groups[0].collection === 'Approved'" |
| 75 | + class="mt-2" |
| 76 | + variant="white" |
| 77 | + :handler="backToPending" |
| 78 | + name="reply" |
| 79 | + label="Back to Pending" |
| 80 | + confirm |
| 81 | + /> |
73 | 82 | </div> |
74 | 83 | <div class="ml-2"> |
75 | 84 | <b-btn v-if="summary" variant="white" @click="expanded = !expanded"> |
@@ -350,6 +359,7 @@ import GroupSelect from './GroupSelect' |
350 | 359 | import MessageMap from './MessageMap' |
351 | 360 | import ModMessageMicroVolunteering from './ModMessageMicroVolunteering' |
352 | 361 | import twem from '~/assets/js/twem' |
| 362 | +import SpinButton from '~/components/SpinButton' |
353 | 363 | const Highlighter = () => import('vue-highlight-words') |
354 | 364 | const OurFilePond = () => import('~/components/OurFilePond') |
355 | 365 |
|
@@ -378,7 +388,8 @@ export default { |
378 | 388 | MessageReplyInfo, |
379 | 389 | MessageUserInfo, |
380 | 390 | MessageHistory, |
381 | | - Highlighter |
| 391 | + Highlighter, |
| 392 | + SpinButton |
382 | 393 | }, |
383 | 394 | mixins: [keywords], |
384 | 395 | props: { |
@@ -622,6 +633,13 @@ export default { |
622 | 633 | }, |
623 | 634 | duplicates() { |
624 | 635 | return this.checkHistory(true) |
| 636 | + }, |
| 637 | + memberGroupIds() { |
| 638 | + return this.message && |
| 639 | + this.message.fromuser && |
| 640 | + this.message.fromuser.memberof |
| 641 | + ? this.message.fromuser.memberof.map(g => g.id) |
| 642 | + : [] |
625 | 643 | } |
626 | 644 | }, |
627 | 645 | watch: { |
@@ -880,6 +898,11 @@ export default { |
880 | 898 | this.$store.dispatch('messages/fetch', { |
881 | 899 | id: this.message.id |
882 | 900 | }) |
| 901 | + }, |
| 902 | + backToPending() { |
| 903 | + this.$store.dispatch('messages/backToPending', { |
| 904 | + id: this.message.id |
| 905 | + }) |
883 | 906 | } |
884 | 907 | } |
885 | 908 | } |
|
0 commit comments