Skip to content

Commit a2b7377

Browse files
authored
Merge pull request #224 from harvardinformatics/dda_expanded_mail_button
Change local mail button to be similar to `IFXMailButton` but with fi…
2 parents 169cb21 + cbc289c commit a2b7377

File tree

3 files changed

+69
-11
lines changed

3 files changed

+69
-11
lines changed

src/components/billingRecord/IFXBillingRecordHeaderDecimal.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ export default {
3939
required: true,
4040
},
4141
},
42-
mounted() {
43-
this.localRowSelectionToggle = this.rowSelectionToggle.concat()
44-
},
42+
mounted() {},
4543
data() {
4644
return {
4745
localRowSelectionToggle: [],
@@ -55,7 +53,14 @@ export default {
5553
this.toggleGroup(this.group)
5654
},
5755
},
58-
watch: {},
56+
watch: {
57+
rowSelectionToggle: {
58+
handler(value) {
59+
this.localRowSelectionToggle = value.concat()
60+
},
61+
immediate: true,
62+
},
63+
},
5964
}
6065
</script>
6166
<template>

src/components/billingRecord/IFXBillingRecordListDecimal.vue

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,20 @@ export default {
646646
allowEditingRecords(item) {
647647
return item.currentState !== 'FINAL'
648648
},
649+
goToComposeMessage(field) {
650+
this.recipientField = field
651+
const orgs = this.selected.length ? this.selected : this.filteredItems
652+
const orgSlugs = orgs.map((item) => item.account.organization)
653+
this.$router.push({
654+
name: 'MailingCompose',
655+
params: {
656+
labManagerOrgSlugs: [...new Set(orgSlugs)],
657+
message: null,
658+
subject: null,
659+
recipientField: this.recipientField,
660+
},
661+
})
662+
},
649663
defaultNotifyLabManagers() {
650664
const orgSlugs = this.items.map((item) => item.account.organization)
651665
this.$api.notifyLabManagers(
@@ -805,14 +819,14 @@ export default {
805819
{{ facility.name }}
806820
</div>
807821
</v-col>
808-
<v-col cols="3">
822+
<v-col class="flex-grow-2">
809823
<v-row dense>
810824
<v-col>
811825
<IFXSearchField :search.sync="search" />
812826
</v-col>
813827
</v-row>
814828
</v-col>
815-
<v-col cols="4">
829+
<v-col>
816830
<v-row dense class="d-flex flex-nowrap justify-end align-start">
817831
<v-col v-if="updating">
818832
<v-progress-circular indeterminate color="primary"></v-progress-circular>
@@ -830,9 +844,41 @@ export default {
830844
<v-tooltip top v-else>
831845
<template v-slot:activator="{ on, attrs }">
832846
<div v-on="on">
833-
<v-btn small fab color="green" v-bind="attrs" @click="openNotifyDialog">
834-
<v-icon dark color="white">mdi-email-send-outline</v-icon>
835-
</v-btn>
847+
<v-speed-dial direction="bottom" v-model="mailFab" v-bind="attrs">
848+
<template v-slot:activator>
849+
<v-btn v-model="mailFab" small color="green" fab>
850+
<v-icon color="white" dark v-if="mailFab">mdi-close</v-icon>
851+
<v-icon color="white" dark v-else>mdi-email-send-outline</v-icon>
852+
</v-btn>
853+
</template>
854+
<v-btn small color="teal" class="white--text" @click="openNotifyDialog">
855+
Notify Lab Managers
856+
</v-btn>
857+
<v-btn
858+
xSmall
859+
color="#A4F323"
860+
@click="goToComposeMessage('to')"
861+
:disabled="!filteredItems.length"
862+
>
863+
Send a message to selected Lab Managers
864+
</v-btn>
865+
<v-btn
866+
xSmall
867+
color="#86C61D"
868+
@click="goToComposeMessage('cc')"
869+
:disabled="!filteredItems.length"
870+
>
871+
CC selected Lab Managers
872+
</v-btn>
873+
<v-btn
874+
xSmall
875+
color="#669617"
876+
@click="goToComposeMessage('bcc')"
877+
:disabled="!filteredItems.length"
878+
>
879+
BCC selected Lab Managers
880+
</v-btn>
881+
</v-speed-dial>
836882
837883
<v-dialog v-bind="attrs" v-model="notifyDialog" max-width="600px">
838884
<v-card>
@@ -856,7 +902,7 @@ export default {
856902
</v-row>
857903
<v-row no-gutters>
858904
<v-col cols="12">
859-
<div class="text-divider font-italic text-center">
905+
<div class="text-divider font-italic text-center mt-2">
860906
Or specify email addresses directly
861907
</div>
862908
<IFXContactablesCombobox
@@ -1337,6 +1383,12 @@ export default {
13371383
.border-bottom {
13381384
border-bottom: 1px solid #ccc;
13391385
}
1386+
.flex-grow-2 {
1387+
flex-grow: 2;
1388+
}
1389+
.search-field {
1390+
width: 100%;
1391+
}
13401392
</style>
13411393
<style>
13421394
#data-table .v-data-table__expand-icon--active {

src/components/mailing/IFXMailingCompose.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ export default {
304304
v-model="fromAddr"
305305
:rules="formRules.generic"
306306
:error-messages="fieldErrors.fromAddr"
307+
required
307308
class="required"
308309
></v-text-field>
309310
<IFXContactablesCombobox
@@ -345,7 +346,7 @@ export default {
345346
</span>
346347
</v-form>
347348
<div class="mt-3">
348-
<IFXPageActionBar :disabled="false" btnType="submit" btnText="Send" @action="sendMailing"></IFXPageActionBar>
349+
<IFXPageActionBar :disabled="!isValid" btnType="submit" btnText="Send" @action="sendMailing"></IFXPageActionBar>
349350
</div>
350351
</v-container>
351352
</v-container>

0 commit comments

Comments
 (0)