moveToInbox action + actions array in bulkActions component

This commit is contained in:
Jeffrey Biles
2020-03-18 02:06:31 -07:00
parent 279e72dbbf
commit efdfb2d516
4 changed files with 21 additions and 5 deletions

View File

@@ -3,15 +3,26 @@
<span v-if="!allAreSelected && numberSelected > 0">-</span> <!-- later on this minus sign will be in the checkbox, as it is in gmail -->
<input type="checkbox" :checked="allAreSelected" @click="bulkSelect">
<button @click="emailSelection.markRead()" :disabled="Array.from(emailSelection.emails).every(e => e.read)">
<button @click="emailSelection.markRead()"
:disabled="Array.from(emailSelection.emails).every(e => e.read)"
v-if="actions.includes('markRead')">
Mark Read
</button>
<button @click="emailSelection.markUnread()" :disabled="Array.from(emailSelection.emails).every(e => !e.read)">
<button @click="emailSelection.markUnread()"
:disabled="Array.from(emailSelection.emails).every(e => !e.read)"
v-if="actions.includes('markUnread')">
Mark Unread
</button>
<button @click="emailSelection.archive()" :disabled="numberSelected == 0">
<button @click="emailSelection.archive()"
:disabled="numberSelected == 0"
v-if="actions.includes('archive')">
Archive
</button>
<button @click="emailSelection.moveToInbox()"
:disabled="numberSelected == 0"
v-if="actions.includes('moveToInbox')">
Move to Inbox
</button>
</div>
</template>
@@ -42,6 +53,10 @@
emails: {
type: Array,
default: []
},
actions: {
type: Array,
default: ['markRead', 'markUnread']
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<h1>VMail Archives</h1>
<BulkActionBar :emails="archivedEmails" />
<BulkActionBar :emails="archivedEmails" :actions="['markRead', 'markUnread', 'moveToInbox']" />
<MailTable :emails="archivedEmails" />
</template>

View File

@@ -1,7 +1,7 @@
<template>
<h1>VMail Inbox</h1>
<BulkActionBar :emails="inboxEmails" />
<BulkActionBar :emails="inboxEmails" :actions="['markRead', 'markUnread', 'archive']" />
<MailTable :emails="inboxEmails" />
</template>