From 2853a4bbef8e3ded138d7dcb4be8d074a08a6907 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 21 Jan 2020 16:37:04 +0530 Subject: [PATCH 1/6] fix: validation for duplicate collections --- store/postwoman.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/store/postwoman.js b/store/postwoman.js index bf5881268..895464977 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -111,6 +111,10 @@ export const mutations = { }, addNewCollection({ collections }, collection) { + const duplicateCollection = collections.some(item => item.name === collection.name) + if (duplicateCollection) { + alert('Duplicate collection'); + } collections.push({ name: "", folders: [], From a34acfd0c53b79227ddc5f9edfdd003278ba7108 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 21 Jan 2020 16:38:09 +0530 Subject: [PATCH 2/6] fix: return for duplicate collection --- store/postwoman.js | 1 + 1 file changed, 1 insertion(+) diff --git a/store/postwoman.js b/store/postwoman.js index 895464977..dabaf781b 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -114,6 +114,7 @@ export const mutations = { const duplicateCollection = collections.some(item => item.name === collection.name) if (duplicateCollection) { alert('Duplicate collection'); + return; } collections.push({ name: "", From fcdf93c5e55683f8f02edd450c7e76a2fa9c88ec Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 21 Jan 2020 16:38:34 +0530 Subject: [PATCH 3/6] fix: prefer destructuring approach --- store/postwoman.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/postwoman.js b/store/postwoman.js index dabaf781b..df7399d31 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -111,7 +111,8 @@ export const mutations = { }, addNewCollection({ collections }, collection) { - const duplicateCollection = collections.some(item => item.name === collection.name) + const { name } = collection + const duplicateCollection = collections.some(item => item.name === name) if (duplicateCollection) { alert('Duplicate collection'); return; From e16019dcbf0c939305fecd79a32cb37f6ea80741 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 21 Jan 2020 19:45:52 +0530 Subject: [PATCH 4/6] chore: make use of toast --- store/postwoman.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/store/postwoman.js b/store/postwoman.js index df7399d31..d07d70957 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -114,8 +114,7 @@ export const mutations = { const { name } = collection const duplicateCollection = collections.some(item => item.name === name) if (duplicateCollection) { - alert('Duplicate collection'); - return; + this.$toast.info('Duplicate collection'); } collections.push({ name: "", From bb973ee449cf2f44bb95e558b2e2e69a23d042f2 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 21 Jan 2020 19:46:33 +0530 Subject: [PATCH 5/6] fix: prevent creation of duplicate collection --- store/postwoman.js | 1 + 1 file changed, 1 insertion(+) diff --git a/store/postwoman.js b/store/postwoman.js index d07d70957..61712fb65 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -115,6 +115,7 @@ export const mutations = { const duplicateCollection = collections.some(item => item.name === name) if (duplicateCollection) { this.$toast.info('Duplicate collection'); + return; } collections.push({ name: "", From 32d57814a9c56e8a5787b14653220e6581aab9ea Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Wed, 22 Jan 2020 19:29:11 +0530 Subject: [PATCH 6/6] :tada: Powered by Netlify --- assets/css/styles.scss | 5 +---- layouts/default.vue | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/assets/css/styles.scss b/assets/css/styles.scss index 48b6130c3..39552888b 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -852,10 +852,7 @@ input[type="radio"]:checked + label + .tab { } @media (max-width: $responsiveWidth) { - .content { - flex-flow: column; - } - + .content, .columns { flex-flow: column; } diff --git a/layouts/default.vue b/layouts/default.vue index 9514893c6..4da707eec 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -352,15 +352,7 @@