@@ -38,9 +38,19 @@ export default {
3838 }),
3939 computed: {
4040 ... mapState ([" screenshots" ]),
41- ... mapGetters ([" currentDataset" , " currentSession" , " siteMap" ])
41+ ... mapGetters ([
42+ " currentUser" ,
43+ " currentDataset" ,
44+ " currentSession" ,
45+ " siteMap"
46+ ])
4247 },
4348 watch: {
49+ currentUser (value ) {
50+ if (value) {
51+ this .initialize ();
52+ }
53+ },
4454 currentDataset (value ) {
4555 if (value) {
4656 this .initialize ();
@@ -93,16 +103,21 @@ export default {
93103 this .to = this .toCandidates .map (c => c .name );
94104 this .cc = this .ccCandidates .map (c => c .name );
95105 this .bcc = this .bccCandidates .map (c => c .name );
106+ if (this .currentUser ) {
107+ this .bcc .push (this .currentUser .email );
108+ }
96109 this .showCC = !! this .cc .length ;
97110 this .showBCC = !! this .bcc .length ;
98- var experiment = ` Regarding ${ this .currentSession .meta .experimentId } ( ${ this . currentSession . meta . experimentId2 } ) , ${ this .currentSession .name } ` ;
111+ var experiment = ` Regarding ${ this .currentSession .meta .experimentId } , ${ this .currentSession .name } ` ;
99112 this .subject = experiment;
100- this .body = ` ${ experiment}
101-
102- ${ location .href }
103-
113+ this .body = ` Experiment: ${ this .currentSession .meta .experimentId }
114+ Scan: ${ this .currentSession .name } ` ;
115+ if (this .note ) {
116+ this .body = ` ${ this .body }
117+ Note:
104118${ this .note }
105119` ;
120+ }
106121 this .initialized = true ;
107122 },
108123 toggleScreenshotSelection (screenshot ) {
@@ -143,6 +158,19 @@ ${this.note}
143158 this .sending = false ;
144159 this .$emit (" input" , false );
145160 this .initialized = false ;
161+ for (let i = this .screenshots .length - 1 ; i >= 0 ; i-- ) {
162+ const screenshot = this .screenshots [i];
163+ if (this .selectedScreenshots .indexOf (screenshot) !== - 1 ) {
164+ this .removeScreenshot (screenshot);
165+ }
166+ }
167+ this .selectedScreenshots = [];
168+ },
169+ getBorder (screenshot ) {
170+ if (this .selectedScreenshots .indexOf (screenshot) === - 1 ) {
171+ return " transparent" ;
172+ }
173+ return this .$vuetify .theme .currentTheme .primary ;
146174 }
147175 }
148176};
@@ -166,7 +194,7 @@ ${this.note}
166194 label =" to"
167195 v-model =" to"
168196 :candidates =" toCandidates.map(c => c.name)"
169- :required =" !(to.length + cc.length + bcc.length) "
197+ :required =" true "
170198 />
171199 </v-flex >
172200 <v-flex shrink >
@@ -180,7 +208,7 @@ ${this.note}
180208 label =" cc"
181209 v-model =" cc"
182210 :candidates =" ccCandidates.map(c => c.name)"
183- :required =" !(to.length + cc.length + bcc.length) "
211+ :required =" false "
184212 />
185213 </v-flex >
186214 </v-layout >
@@ -190,7 +218,7 @@ ${this.note}
190218 label =" bcc"
191219 v-model =" bcc"
192220 :candidates =" bccCandidates.map(c => c.name)"
193- :required =" !(to.length + cc.length + bcc.length) "
221+ :required =" false "
194222 />
195223 </v-flex >
196224 </v-layout >
@@ -225,16 +253,15 @@ ${this.note}
225253 class =" screenshot"
226254 @click =" toggleScreenshotSelection(screenshot)"
227255 :style =" {
228- borderColor:
229- selectedScreenshots.indexOf(screenshot) === -1
230- ? 'transparent'
231- : $vuetify.theme.primary
256+ borderColor: getBorder(screenshot)
232257 }"
233258 >
234259 <v-img :src =" screenshot.dataURL" aspect-ratio =" 1" ></v-img >
235260 <v-card-text class =" text-truncate" >
236261 <v-tooltip top >
237- <span slot =" activator" >{{ screenshot.name }}</span >
262+ <template #activator =" { on } " >
263+ <span v-on =" on" >{{ screenshot.name }}</span >
264+ </template >
238265 <span >{{ screenshot.name }}</span >
239266 </v-tooltip >
240267 </v-card-text >
0 commit comments