From 18a81c4f611adc945842ce62859b55050c9fe8bf Mon Sep 17 00:00:00 2001 From: Jeffrey Biles Date: Wed, 22 Apr 2020 21:16:54 -0700 Subject: [PATCH 1/7] Delete everything except the starter stuff --- src/App.vue | 57 ++++++++++++++----- src/components/BulkActionBar.vue | 82 --------------------------- src/components/MailScreen.vue | 78 -------------------------- src/components/MailTable.vue | 84 ---------------------------- src/components/MailView.vue | 63 --------------------- src/components/ModalView.vue | 28 ---------- src/composition/useEmailSelection.js | 47 ---------------- src/composition/useKeydown.js | 18 ------ 8 files changed, 43 insertions(+), 414 deletions(-) delete mode 100644 src/components/BulkActionBar.vue delete mode 100644 src/components/MailScreen.vue delete mode 100644 src/components/MailTable.vue delete mode 100644 src/components/MailView.vue delete mode 100644 src/components/ModalView.vue delete mode 100644 src/composition/useEmailSelection.js delete mode 100644 src/composition/useKeydown.js diff --git a/src/App.vue b/src/App.vue index 68681d8..97e08b7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,23 +1,52 @@ - + diff --git a/src/components/BulkActionBar.vue b/src/components/BulkActionBar.vue deleted file mode 100644 index 2078229..0000000 --- a/src/components/BulkActionBar.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/MailScreen.vue b/src/components/MailScreen.vue deleted file mode 100644 index a13d3f4..0000000 --- a/src/components/MailScreen.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/MailTable.vue b/src/components/MailTable.vue deleted file mode 100644 index 30cc41f..0000000 --- a/src/components/MailTable.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/MailView.vue b/src/components/MailView.vue deleted file mode 100644 index 3d8dff0..0000000 --- a/src/components/MailView.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/ModalView.vue b/src/components/ModalView.vue deleted file mode 100644 index c87c693..0000000 --- a/src/components/ModalView.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/composition/useEmailSelection.js b/src/composition/useEmailSelection.js deleted file mode 100644 index 76d227d..0000000 --- a/src/composition/useEmailSelection.js +++ /dev/null @@ -1,47 +0,0 @@ -import { reactive } from 'vue'; -import axios from 'axios'; - -let emailSet = new Set() - -export const useEmailSelection = function(){ - const emails = reactive(emailSet) - - const forSelected = (fn) => { - emails.forEach(email => { - fn(email) - axios.put(`http://localhost:3000/emails/${email.id}`, email) - }) - } - const clear = () => { - emails.clear(); - } - const toggle = (id) => { - if(emails.has(id)) { - emails.delete(id) - } else { - emails.add(id); - } - } - const addMultiple = (newEmails) => { - newEmails.forEach(email => { - emails.add(email) - }) - } - const markRead = () => { forSelected(e => e.read = true )} - const markUnread = () => { forSelected(e => e.read = false )} - const archive = () => { forSelected(e => e.archived = true); clear();} - const moveToInbox = () => { forSelected(e => e.archived = false); clear();} - - return { - emails, - clear, - toggle, - addMultiple, - markRead, - markUnread, - archive, - moveToInbox - } -} - -export default useEmailSelection; \ No newline at end of file diff --git a/src/composition/useKeydown.js b/src/composition/useKeydown.js deleted file mode 100644 index acfd5a4..0000000 --- a/src/composition/useKeydown.js +++ /dev/null @@ -1,18 +0,0 @@ -import { onBeforeUnmount } from 'vue'; - -export const useKeydown = function(keyCombos) { - let onkey = function(event) { - let kc = keyCombos.find(({key, fn}) => key == event.key ) - if(kc) { - kc.fn() - } - } - - window.addEventListener('keydown', onkey); - - onBeforeUnmount(()=> { - window.removeEventListener('keydown', onkey); - }) -} - -export default useKeydown; \ No newline at end of file From d92ba8f840eef56b7c02fa388f678147981acba0 Mon Sep 17 00:00:00 2001 From: Jeffrey Biles Date: Tue, 12 May 2020 15:30:55 -0700 Subject: [PATCH 2/7] update read status to match the screen --- src/App.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 97e08b7..79d9fb5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,7 +16,7 @@ export default { "body": "The opening keynote of VueConf US this year was Evan You (the creator of Vue), giving his State of the Vuenion address. He walked us through the journey of getting Vue 3 from a prototype to a reality the past year. He also dove into Vue's overall growth in the community.", "sentAt": "2020-03-27T18:25:43.511Z", "archived": false, - "read": false + "read": true }, { "id": 2, @@ -34,7 +34,7 @@ export default { "body": "First of all, lets congratulate Kia King Ishii on joining the Vue.js core team! 🎉 He has been doing an incredible job building vuex-orm and will now focus on working on the next versions of Vuex.\n\nSpeaking of which – Vuex v4.0.0-alpha.1 has just been released! This is the version of Vuex that will work with Vue 3.0 but keep the familiar API you know from the current version.", "sentAt": "2020-03-18T18:25:43.511Z", "archived": false, - "read": true + "read": false }, { "id": 4, @@ -43,7 +43,7 @@ export default { "body": "Newsletter Issue #161", "sentAt": "2020-03-24T18:25:43.511Z", "archived": true, - "read": true + "read": false } ] } From 935d5c2401c798541db279142d9e2f0708af294a Mon Sep 17 00:00:00 2001 From: Jeffrey Biles Date: Tue, 12 May 2020 16:10:29 -0700 Subject: [PATCH 3/7] Video 2 - Create UI for table using Options API techniques --- src/App.vue | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/App.vue b/src/App.vue index 79d9fb5..d5adfb6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,13 +1,34 @@ From c6d845148431ed44439798b2ffe5c3ccd8f3cf51 Mon Sep 17 00:00:00 2001 From: Jeffrey Biles Date: Sun, 31 May 2020 23:50:00 -0700 Subject: [PATCH 4/7] Lesson 3 - Suspense, async setup, and the MailTable component --- src/App.vue | 84 +++++------------------------------ src/components/MailTable.vue | 85 ++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 72 deletions(-) create mode 100644 src/components/MailTable.vue diff --git a/src/App.vue b/src/App.vue index d5adfb6..41be425 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,83 +1,23 @@ diff --git a/src/components/MailTable.vue b/src/components/MailTable.vue new file mode 100644 index 0000000..950efa9 --- /dev/null +++ b/src/components/MailTable.vue @@ -0,0 +1,85 @@ + + + + + \ No newline at end of file From 2af604ce1116d3171b2b50570c90de119786b336 Mon Sep 17 00:00:00 2001 From: Jeffrey Biles Date: Thu, 15 Oct 2020 10:13:16 -0700 Subject: [PATCH 5/7] add ref to emails --- src/components/MailTable.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/MailTable.vue b/src/components/MailTable.vue index 950efa9..e974d6b 100644 --- a/src/components/MailTable.vue +++ b/src/components/MailTable.vue @@ -21,13 +21,14 @@