From ab98930a105a7051d7464113c6a052314fc737b3 Mon Sep 17 00:00:00 2001 From: Javokhir Nematov Date: Sat, 2 Dec 2023 11:03:04 +0500 Subject: [PATCH 01/27] added report --- src/components/Admin/ManageReports.vue | 104 ++++++++++++++++++ .../Posts/Comments/DisplayComment.vue | 63 ++++++++++- src/pages/AdminPage.vue | 6 + src/stores/comments.js | 3 + src/stores/index.js | 2 + src/stores/reports.js | 59 ++++++++++ 6 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 src/components/Admin/ManageReports.vue create mode 100644 src/stores/reports.js diff --git a/src/components/Admin/ManageReports.vue b/src/components/Admin/ManageReports.vue new file mode 100644 index 00000000..7721857d --- /dev/null +++ b/src/components/Admin/ManageReports.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/Posts/Comments/DisplayComment.vue b/src/components/Posts/Comments/DisplayComment.vue index 92c2515a..3dddda22 100644 --- a/src/components/Posts/Comments/DisplayComment.vue +++ b/src/components/Posts/Comments/DisplayComment.vue @@ -27,6 +27,9 @@ Delete + + Report + @@ -50,6 +53,41 @@ + + + + + + + + + + + + + + + + + + + + + + +
@@ -111,12 +149,13 @@ import { computed, onMounted, ref } from 'vue' import { useRouter } from 'vue-router' import { shortMonthDayTime } from 'src/utils/date' -import { useCommentStore, useErrorStore, useUserStore } from 'src/stores' +import { useCommentStore, useErrorStore, useUserStore, useReportStore } from 'src/stores' import { useQuasar } from 'quasar' const router = useRouter() const userStore = useUserStore() const commentStore = useCommentStore() +const reportStore = useReportStore() const errorStore = useErrorStore() const props = defineProps({ @@ -127,8 +166,11 @@ const props = defineProps({ const userId = ref('') const inputEdit = ref('') +const inputReport = ref('') const isEditing = ref(false) +const isReporting = ref(false) const newComment = ref(props.comment.text) +const reportMessage = ref("") const $q = useQuasar() onMounted(async () => { @@ -146,6 +188,20 @@ async function editComment(commentId, editedComment) { .finally(() => (isEditing.value = false)) } +async function reportComment(commentId, reportMessage) { + const report = { + collectionName: props.collectionName, + documentId: props.documentId, + commentId: commentId, + reportMessage: reportMessage + } + await reportStore + .addReports(report) + .then(() => $q.notify({ type: 'info', message: 'Comment successfully reported!' })) + .catch((error) => errorStore.throwError(error, 'Failed to report comment')) + .finally(() => (isReporting.value = false)) +} + async function deleteComment(commentId) { await commentStore .deleteComment(props.collectionName, props.documentId, commentId) @@ -188,4 +244,9 @@ function editInput(commentId) { isEditing.value = !isEditing.value inputEdit.value = commentId } + +function reportInput(commentId) { + isReporting.value = !isReporting.value + inputReport.value = commentId +} diff --git a/src/pages/AdminPage.vue b/src/pages/AdminPage.vue index e9eb2cb9..81184dd0 100644 --- a/src/pages/AdminPage.vue +++ b/src/pages/AdminPage.vue @@ -37,6 +37,7 @@ + @@ -55,6 +56,10 @@ + + + + @@ -72,6 +77,7 @@ import EntryCard from 'src/components/Admin/EntryCard.vue' import ManageErrors from 'src/components/Admin/ManageErrors.vue' import ManageFeedbacks from 'src/components/Admin/ManageFeedbacks.vue' +import ManageReports from 'src/components/Admin/ManageReports.vue' import ManagePromptsEntries from 'src/components/Admin/ManagePromptsEntries.vue' import ManageUsers from 'src/components/Admin/ManageUsers.vue' import PromptCard from 'src/components/Admin/PromptCard.vue' diff --git a/src/stores/comments.js b/src/stores/comments.js index 37b029b2..4f09d550 100644 --- a/src/stores/comments.js +++ b/src/stores/comments.js @@ -168,6 +168,9 @@ export const useCommentStore = defineStore('comments', { }, async deleteComment(collectionName, documentId, commentId) { + console.log("Collection name: ", collectionName) + console.log("Document ID: ", documentId) + console.log("Comment ID: ", commentId) const userStore = useUserStore() await userStore.fetchUserIp() diff --git a/src/stores/index.js b/src/stores/index.js index 3fb80486..8ede81be 100644 --- a/src/stores/index.js +++ b/src/stores/index.js @@ -6,6 +6,7 @@ import { useCommentStore } from './comments' import { useEntryStore } from './entries' import { useErrorStore } from './errors' import { useFeedbackStore } from './feedbacks' +import { useReportStore } from './reports' import { useLikeStore } from './likes' import { useNotificationStore } from './notifications' import { usePromptStore } from './prompts' @@ -54,6 +55,7 @@ export { useEntryStore, useErrorStore, useFeedbackStore, + useReportStore, useLikeStore, useNotificationStore, usePromptStore, diff --git a/src/stores/reports.js b/src/stores/reports.js new file mode 100644 index 00000000..954e098b --- /dev/null +++ b/src/stores/reports.js @@ -0,0 +1,59 @@ +import { addDoc, collection, deleteDoc, doc, getDoc, onSnapshot, Timestamp } from 'firebase/firestore' +import { defineStore } from 'pinia' +import { db } from 'src/firebase' +import { useUserStore } from './user' +import { useCommentStore } from './comments' + +export const useReportStore = defineStore('reports', { + state: () => ({ + _reports: undefined, + _isLoading: false, + _unSubscribe: undefined + }), + + getters: { + getReports: (state) => state._reports, + isLoading: (state) => state._isLoading, + isLoaded: (state) => !!state._reports + }, + + actions: { + async fetchReports() { + this._isLoading = true + + if (!this._unSubscribe) + this._unSubscribe = onSnapshot(collection(db, 'reports'), async (querySnapshot) => { + const reports = querySnapshot.docs.map((doc) => ({ id: doc.id, ...doc.data() })) + + for (const report of reports) { + report.author = await getDoc(report.author).then((doc) => doc.data()) + } + this.$patch({ _reports: reports }) + }) + this._isLoading = false + }, + + async addReports(report) { + const userStore = useUserStore() + + report.author = userStore.getUserRef + report.created = Timestamp.fromDate(new Date()) + report.id = Date.now() + '-' + (report.author.id || report.author) + + this._isLoading = true + await addDoc(collection(db, 'reports'), report).finally(() => (this._isLoading = false)) + }, + + async deleteReport(id) { + this._isLoading = true + await deleteDoc(doc(db, 'reports', id)).finally(() => (this._isLoading = false)) + }, + + async deleteComment(commentId) { + const commentStore = useCommentStore() + this._isLoading = true + await commentStore.deleteComment("entries", "2023-12T1701010519528", commentId) + this._isLoading = false + } + } +}) From 2b14cd1a8787df093744a97b7d6ea868456205d6 Mon Sep 17 00:00:00 2001 From: Javokhir Nematov Date: Sat, 2 Dec 2023 16:59:03 +0500 Subject: [PATCH 02/27] refactored reporting comment --- src/components/Admin/ManageReports.vue | 74 +++++++++------- .../Posts/Comments/DisplayComment.vue | 88 ++++++++++--------- src/stores/reports.js | 78 ++++++++++++---- 3 files changed, 149 insertions(+), 91 deletions(-) diff --git a/src/components/Admin/ManageReports.vue b/src/components/Admin/ManageReports.vue index 7721857d..143f4361 100644 --- a/src/components/Admin/ManageReports.vue +++ b/src/components/Admin/ManageReports.vue @@ -16,17 +16,32 @@ @@ -35,12 +50,12 @@ -
Delete Report?
+
Delete {{ isComment ? 'comment' : 'report' }}?
- Are you sure you want to delete this report from {{ deleteDialog.author.displayName }}? + Are you sure you want to delete this {{ isComment ? 'comment' : 'report' }}? - +
@@ -62,43 +77,38 @@ const columns = [ { name: 'action', label: 'Action', field: 'action' } ] const deleteDialog = ref({}) +const isComment = ref(false) const pagination = { sortBy: 'created', descending: true, rowsPerPage: 0 } onMounted(async () => { await reportStore.fetchReports() }) -function confirmDelete(report) { +function confirmDelete(report, value) { + if (value == 'comment') { + isComment.value = true + } else { + isComment.value = false + } deleteDialog.value = report deleteDialog.value.show = true } -function onDeleteReport(id) { - reportStore - .deleteComment(id) - .then(() => $q.notify({ color: 'positive', message: 'Report deleted successfully' })) - .catch((error) => errorStore.throwError(error, 'Failed to delete report')) +function onDeleteReport() { + if (isComment.value) { + reportStore + .deleteComment(deleteDialog.value.collectionName, deleteDialog.value.documentId, deleteDialog.value.commentId, deleteDialog.value.id) + .then(() => $q.notify({ color: 'positive', message: 'Comment deleted successfully' })) + .catch((error) => errorStore.throwError(error, 'Failed to delete comment')) + } else { + reportStore + .deleteReport(deleteDialog.value.id) + .then(() => $q.notify({ color: 'positive', message: 'Report deleted successfully' })) + .catch((error) => errorStore.throwError(error, 'Failed to delete report')) + } deleteDialog.value.show = false } -// function onDeleteReport(id) { -// reportStore -// .deleteReport(id) -// .then(() => $q.notify({ color: 'positive', message: 'Report deleted successfully' })) -// .catch((error) => errorStore.throwError(error, 'Failed to delete report')) -// deleteDialog.value.show = false -// } diff --git a/src/components/Posts/Comments/DisplayComment.vue b/src/components/Posts/Comments/DisplayComment.vue index 3dddda22..e3902f6d 100644 --- a/src/components/Posts/Comments/DisplayComment.vue +++ b/src/components/Posts/Comments/DisplayComment.vue @@ -27,13 +27,14 @@ Delete - + Report + - - - - - - - - - - - - - - - - - - - - - -
@@ -98,6 +65,28 @@ {{ comment.text }}
+ + + + +
Report comment
+ + +
+ + + + + + + +
+
+
{ @@ -188,18 +188,22 @@ async function editComment(commentId, editedComment) { .finally(() => (isEditing.value = false)) } -async function reportComment(commentId, reportMessage) { +async function reportComment(commentId, commentText, reportMessage) { const report = { collectionName: props.collectionName, documentId: props.documentId, commentId: commentId, + commentText: commentText, reportMessage: reportMessage } + await reportStore - .addReports(report) - .then(() => $q.notify({ type: 'info', message: 'Comment successfully reported!' })) - .catch((error) => errorStore.throwError(error, 'Failed to report comment')) - .finally(() => (isReporting.value = false)) + .addReports(report) + .then(() => $q.notify({ type: 'info', message: 'Comment successfully reported!' })) + .catch((error) => errorStore.throwError(error, 'Failed to report comment')) + .finally(() => (isReporting.value = false)) + + reportOption.value = null } async function deleteComment(commentId) { @@ -245,8 +249,8 @@ function editInput(commentId) { inputEdit.value = commentId } -function reportInput(commentId) { +function reportInput() { isReporting.value = !isReporting.value - inputReport.value = commentId + reportOption.value = null } diff --git a/src/stores/reports.js b/src/stores/reports.js index 954e098b..b1d9bf2c 100644 --- a/src/stores/reports.js +++ b/src/stores/reports.js @@ -1,4 +1,4 @@ -import { addDoc, collection, deleteDoc, doc, getDoc, onSnapshot, Timestamp } from 'firebase/firestore' +import { collection, deleteDoc, doc, getDoc, onSnapshot, updateDoc, Timestamp, setDoc } from 'firebase/firestore' import { defineStore } from 'pinia' import { db } from 'src/firebase' import { useUserStore } from './user' @@ -33,27 +33,71 @@ export const useReportStore = defineStore('reports', { this._isLoading = false }, - async addReports(report) { - const userStore = useUserStore() - - report.author = userStore.getUserRef - report.created = Timestamp.fromDate(new Date()) - report.id = Date.now() + '-' + (report.author.id || report.author) - - this._isLoading = true - await addDoc(collection(db, 'reports'), report).finally(() => (this._isLoading = false)) + async addReports(payload) { + try { + const userStore = useUserStore(); + this._isLoading = true; + const report = { + ...payload, + author: userStore.getUserRef, + created: Timestamp.fromDate(new Date()), + id: Date.now() + '-' + (payload.author?.id || payload.author), + status: 'New', + }; + const reportRef = doc(db, 'reports', report.id); + await setDoc(reportRef, report); + } catch (error) { + console.error('Error adding report:', error.message); + } finally { + this._isLoading = false; + } }, async deleteReport(id) { - this._isLoading = true - await deleteDoc(doc(db, 'reports', id)).finally(() => (this._isLoading = false)) + try { + this._isLoading = true; + const reportRef = doc(db, 'reports', id); + await deleteDoc(reportRef); + } catch (error) { + console.error('Error deleting document:', error.message); + } finally { + this._isLoading = false; + } }, - async deleteComment(commentId) { - const commentStore = useCommentStore() - this._isLoading = true - await commentStore.deleteComment("entries", "2023-12T1701010519528", commentId) - this._isLoading = false + async editStatusReport(id) { + const reportRef = doc(db, 'reports', id); + + try { + const reportSnapshot = await getDoc(reportRef); + if (reportSnapshot.exists()) { + const updatedTimestamp = Timestamp.fromDate(new Date()); + await updateDoc(reportRef, { + status: 'Deleted', + updated: updatedTimestamp, + }); + } else { + console.error('Document does not exist'); + } + } catch (error) { + console.error('Error updating document status:', error.message); + } finally { + this._isLoading = false; + } + }, + + async deleteComment(collectionName, documentId, commentId, reportId) { + try { + this._isLoading = true; + const commentStore = useCommentStore(); + await commentStore.deleteComment(collectionName, documentId, commentId); + await this.editStatusReport(reportId); + } catch (error) { + console.error('Error deleting comment:', error.message); + } finally { + this._isLoading = false; + } } + } }) From a0ed5ba4ec327eba9f1b1d61afbc5a05efa9745f Mon Sep 17 00:00:00 2001 From: Javokhir Nematov Date: Tue, 5 Dec 2023 20:13:16 +0500 Subject: [PATCH 03/27] Added persmission --- src/components/Posts/Comments/DisplayComment.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Posts/Comments/DisplayComment.vue b/src/components/Posts/Comments/DisplayComment.vue index e3902f6d..75be60db 100644 --- a/src/components/Posts/Comments/DisplayComment.vue +++ b/src/components/Posts/Comments/DisplayComment.vue @@ -18,13 +18,13 @@ {{ comment.author?.displayName || 'Anonymous' }} {{ shortMonthDayTime(comment.created) }} - + - + Edit - + Delete From f97c7dc9d9ae62371f62a65466c4588f69dba29e Mon Sep 17 00:00:00 2001 From: Javokhir Nematov Date: Sat, 9 Dec 2023 14:08:35 +0500 Subject: [PATCH 04/27] Ran format command --- src/components/Admin/ManageReports.vue | 24 ++++++-- .../Posts/Comments/DisplayComment.vue | 46 ++++++++++------ src/stores/comments.js | 6 +- src/stores/reports.js | 55 +++++++++---------- 4 files changed, 78 insertions(+), 53 deletions(-) diff --git a/src/components/Admin/ManageReports.vue b/src/components/Admin/ManageReports.vue index 143f4361..0f8a21c4 100644 --- a/src/components/Admin/ManageReports.vue +++ b/src/components/Admin/ManageReports.vue @@ -21,7 +21,12 @@ Author: {{ props.row.author.displayName }}
-
{{ props.row.status }}
+
+ {{ props.row.status }} +
@@ -39,8 +44,18 @@

- - + +
@@ -110,5 +125,4 @@ function onDeleteReport() { } - + diff --git a/src/components/Posts/Comments/DisplayComment.vue b/src/components/Posts/Comments/DisplayComment.vue index 75be60db..5bace8bd 100644 --- a/src/components/Posts/Comments/DisplayComment.vue +++ b/src/components/Posts/Comments/DisplayComment.vue @@ -21,10 +21,22 @@ - + Edit - + Delete @@ -54,7 +66,6 @@ -
@@ -74,15 +85,16 @@ - + - + @@ -159,8 +171,8 @@ const inputReport = ref('') const isEditing = ref(false) const isReporting = ref(false) const newComment = ref(props.comment.text) -const reportMessage = ref("") -const reportOption = ref(null); +const reportMessage = ref('') +const reportOption = ref(null) const reportOptions = [ { label: 'Unwanted commercial content or spam', value: 'Unwanted commercial content or spam' }, { label: 'Pornography or sexually explicit material', value: 'Pornography or sexually explicit material' }, @@ -169,8 +181,8 @@ const reportOptions = [ { label: 'Promotes terrorism', value: 'Promotes terrorism' }, { label: 'Harassment or bullying', value: 'Harassment or bullying' }, { label: 'Suicide or self injury', value: 'Suicide or self injury' }, - { label: 'Misinformation', value: 'Misinformation' }, -]; + { label: 'Misinformation', value: 'Misinformation' } +] const $q = useQuasar() onMounted(async () => { @@ -198,10 +210,10 @@ async function reportComment(commentId, commentText, reportMessage) { } await reportStore - .addReports(report) - .then(() => $q.notify({ type: 'info', message: 'Comment successfully reported!' })) - .catch((error) => errorStore.throwError(error, 'Failed to report comment')) - .finally(() => (isReporting.value = false)) + .addReports(report) + .then(() => $q.notify({ type: 'info', message: 'Comment successfully reported!' })) + .catch((error) => errorStore.throwError(error, 'Failed to report comment')) + .finally(() => (isReporting.value = false)) reportOption.value = null } diff --git a/src/stores/comments.js b/src/stores/comments.js index 4f09d550..2ec2653e 100644 --- a/src/stores/comments.js +++ b/src/stores/comments.js @@ -168,9 +168,9 @@ export const useCommentStore = defineStore('comments', { }, async deleteComment(collectionName, documentId, commentId) { - console.log("Collection name: ", collectionName) - console.log("Document ID: ", documentId) - console.log("Comment ID: ", commentId) + console.log('Collection name: ', collectionName) + console.log('Document ID: ', documentId) + console.log('Comment ID: ', commentId) const userStore = useUserStore() await userStore.fetchUserIp() diff --git a/src/stores/reports.js b/src/stores/reports.js index b1d9bf2c..b5860475 100644 --- a/src/stores/reports.js +++ b/src/stores/reports.js @@ -35,69 +35,68 @@ export const useReportStore = defineStore('reports', { async addReports(payload) { try { - const userStore = useUserStore(); - this._isLoading = true; + const userStore = useUserStore() + this._isLoading = true const report = { ...payload, author: userStore.getUserRef, created: Timestamp.fromDate(new Date()), id: Date.now() + '-' + (payload.author?.id || payload.author), - status: 'New', - }; - const reportRef = doc(db, 'reports', report.id); - await setDoc(reportRef, report); + status: 'New' + } + const reportRef = doc(db, 'reports', report.id) + await setDoc(reportRef, report) } catch (error) { - console.error('Error adding report:', error.message); + console.error('Error adding report:', error.message) } finally { - this._isLoading = false; + this._isLoading = false } }, async deleteReport(id) { try { - this._isLoading = true; - const reportRef = doc(db, 'reports', id); - await deleteDoc(reportRef); + this._isLoading = true + const reportRef = doc(db, 'reports', id) + await deleteDoc(reportRef) } catch (error) { - console.error('Error deleting document:', error.message); + console.error('Error deleting document:', error.message) } finally { - this._isLoading = false; + this._isLoading = false } }, async editStatusReport(id) { - const reportRef = doc(db, 'reports', id); + const reportRef = doc(db, 'reports', id) try { - const reportSnapshot = await getDoc(reportRef); + const reportSnapshot = await getDoc(reportRef) if (reportSnapshot.exists()) { - const updatedTimestamp = Timestamp.fromDate(new Date()); + const updatedTimestamp = Timestamp.fromDate(new Date()) await updateDoc(reportRef, { status: 'Deleted', - updated: updatedTimestamp, - }); + updated: updatedTimestamp + }) } else { - console.error('Document does not exist'); + console.error('Document does not exist') } } catch (error) { - console.error('Error updating document status:', error.message); + console.error('Error updating document status:', error.message) } finally { - this._isLoading = false; + this._isLoading = false } }, async deleteComment(collectionName, documentId, commentId, reportId) { try { - this._isLoading = true; - const commentStore = useCommentStore(); - await commentStore.deleteComment(collectionName, documentId, commentId); - await this.editStatusReport(reportId); + this._isLoading = true + const commentStore = useCommentStore() + await commentStore.deleteComment(collectionName, documentId, commentId) + await this.editStatusReport(reportId) } catch (error) { - console.error('Error deleting comment:', error.message); + console.error('Error deleting comment:', error.message) } finally { - this._isLoading = false; + this._isLoading = false } } - } }) From c9323d6daadc11448c52314b27eda63532e18270 Mon Sep 17 00:00:00 2001 From: Javokhir Nematov Date: Sat, 9 Dec 2023 14:13:06 +0500 Subject: [PATCH 05/27] Removed the console.logs --- src/components/__tests__/TheComments.spec.js.dep | 1 - src/stores/comments.js | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/components/__tests__/TheComments.spec.js.dep b/src/components/__tests__/TheComments.spec.js.dep index a564dc42..d22cd922 100644 --- a/src/components/__tests__/TheComments.spec.js.dep +++ b/src/components/__tests__/TheComments.spec.js.dep @@ -36,7 +36,6 @@ describe('TheComment Component', () => { } catch (error) { const errorCode = error.code const errorMessage = error.message - console.log(errorCode, errorMessage) } }) diff --git a/src/stores/comments.js b/src/stores/comments.js index 2ec2653e..37b029b2 100644 --- a/src/stores/comments.js +++ b/src/stores/comments.js @@ -168,9 +168,6 @@ export const useCommentStore = defineStore('comments', { }, async deleteComment(collectionName, documentId, commentId) { - console.log('Collection name: ', collectionName) - console.log('Document ID: ', documentId) - console.log('Comment ID: ', commentId) const userStore = useUserStore() await userStore.fetchUserIp() From be50faf782c48b2d6743ba5c3130cea2cc3ab8cc Mon Sep 17 00:00:00 2001 From: Javokhir Nematov Date: Sat, 9 Dec 2023 14:17:59 +0500 Subject: [PATCH 06/27] Removed unused variables --- src/components/Posts/Comments/DisplayComment.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/Posts/Comments/DisplayComment.vue b/src/components/Posts/Comments/DisplayComment.vue index 5bace8bd..0ee9c62b 100644 --- a/src/components/Posts/Comments/DisplayComment.vue +++ b/src/components/Posts/Comments/DisplayComment.vue @@ -167,11 +167,9 @@ const props = defineProps({ const userId = ref('') const inputEdit = ref('') -const inputReport = ref('') const isEditing = ref(false) const isReporting = ref(false) const newComment = ref(props.comment.text) -const reportMessage = ref('') const reportOption = ref(null) const reportOptions = [ { label: 'Unwanted commercial content or spam', value: 'Unwanted commercial content or spam' }, From 0f20c3d04585332ec7fe82beb814aa3992f60883 Mon Sep 17 00:00:00 2001 From: Javokhir Nematov Date: Sat, 9 Dec 2023 14:56:01 +0500 Subject: [PATCH 07/27] interacted with deleted content --- src/components/Admin/ManageReports.vue | 2 +- .../Posts/Comments/DisplayComment.vue | 4 ++-- src/stores/comments.js | 3 ++- src/stores/reports.js | 17 +++++++++++++---- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/components/Admin/ManageReports.vue b/src/components/Admin/ManageReports.vue index 0f8a21c4..1a636eca 100644 --- a/src/components/Admin/ManageReports.vue +++ b/src/components/Admin/ManageReports.vue @@ -19,7 +19,7 @@
Author: - {{ props.row.author.displayName }} + {{ props.row.author ? props.row.author.displayName : 'Anonymously' }}
{{ comment.author?.displayName || 'Anonymous' }} {{ shortMonthDayTime(comment.created) }} - + -
+
(this._isLoading = false)) }, diff --git a/src/stores/reports.js b/src/stores/reports.js index b5860475..766edd6c 100644 --- a/src/stores/reports.js +++ b/src/stores/reports.js @@ -20,13 +20,21 @@ export const useReportStore = defineStore('reports', { actions: { async fetchReports() { this._isLoading = true + const userStore = useUserStore() + if (!userStore.getUsers) { + await userStore.fetchUsers() + } if (!this._unSubscribe) this._unSubscribe = onSnapshot(collection(db, 'reports'), async (querySnapshot) => { const reports = querySnapshot.docs.map((doc) => ({ id: doc.id, ...doc.data() })) for (const report of reports) { - report.author = await getDoc(report.author).then((doc) => doc.data()) + if (!report.isAnonymous) { + report.author = await getDoc(report.author).then((doc) => doc.data()) + } else { + report.author = userStore.getUserById(report.author.id) || report.author.id + } } this.$patch({ _reports: reports }) }) @@ -39,10 +47,11 @@ export const useReportStore = defineStore('reports', { this._isLoading = true const report = { ...payload, - author: userStore.getUserRef, + author: userStore.isAuthenticated ? userStore.getUserRef : userStore.getUserIpHash, created: Timestamp.fromDate(new Date()), - id: Date.now() + '-' + (payload.author?.id || payload.author), - status: 'New' + id: Date.now() + '-' + (userStore.isAuthenticated ? userStore.getUserRef : userStore.getUserIpHash), + status: 'New', + isAnonymous: !userStore.isAuthenticated } const reportRef = doc(db, 'reports', report.id) await setDoc(reportRef, report) From a924c67fea6b3f769beb28d80ddc14a1fa778bed Mon Sep 17 00:00:00 2001 From: Krishnadeva Date: Fri, 15 Mar 2024 22:10:15 +0530 Subject: [PATCH 08/27] Fix:Display unpopulated dates in the Likes chart #313 --- src/components/Posts/Graphs/LikesBar.vue | 26 +++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/components/Posts/Graphs/LikesBar.vue b/src/components/Posts/Graphs/LikesBar.vue index b8aaf5e1..d8719556 100644 --- a/src/components/Posts/Graphs/LikesBar.vue +++ b/src/components/Posts/Graphs/LikesBar.vue @@ -105,6 +105,23 @@ function groupLikesAndDislikesByDate(data) { return new Date(dateA) - new Date(dateB) }) + // Generate missing dates between the first provided date and today's date + const uniqueDates = new Set(mergedResult.map((item) => Object.keys(item)[0])) + const today = new Date() + const firstDate = mergedResult[0] ? Object.keys(mergedResult[0])[0] : null + const startDate = firstDate ? new Date(firstDate) : null + + for (let currentDate = startDate; currentDate <= today; currentDate.setDate(currentDate.getDate() + 1)) { + const formattedDate = currentDate.toLocaleDateString('en-US') + + if (!uniqueDates.has(formattedDate)) { + mergedResult.push({ [formattedDate]: {} }) + uniqueDates.add(formattedDate) + } + } + + // Sort the array by date + mergedResult.sort((a, b) => new Date(Object.keys(a)[0]) - new Date(Object.keys(b)[0])) return mergedResult } @@ -121,11 +138,14 @@ watchEffect(() => { } dates.value = info.map((obj) => Object.keys(obj)[0]) - likes.value = info.map((obj) => Object.values(obj)[0].likes) - dislikes.value = info.map((obj) => Object.values(obj)[0].dislikes) + likes.value = info.map((obj) => Object.values(obj)[0].likes || 0) + dislikes.value = info.map((obj) => { + const dislikesValue = Object.values(obj)[0].dislikes || 0 + return dislikesValue < 0 ? -dislikesValue : dislikesValue + }) countLikes.value = likes.value.reduce((acc, item) => acc + item, 0) - countDislikes.value = dislikes.value.reduce((acc, item) => acc - item, 0) + countDislikes.value = dislikes.value.reduce((acc, item) => acc + item, 0) compute() }) From 77b27eeee633503873dd1d97c14065c051c353dd Mon Sep 17 00:00:00 2001 From: Arnon R Date: Fri, 15 Mar 2024 19:04:42 -0300 Subject: [PATCH 09/27] Update Node.js minimum version to ^20 || ^18 || ^16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93d15903..9ba7665a 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "workbox-strategies": "^6.5.4" }, "engines": { - "node": "^18 || ^16 || ^14.19", + "node": "^20 || ^18 || ^16", "npm": ">= 6.13.4", "yarn": ">= 1.21.1" } From 3942c92989ee6094afcfb67b4b089ab05bef170c Mon Sep 17 00:00:00 2001 From: Lupanciuc Marc Date: Sun, 17 Mar 2024 16:06:37 +0200 Subject: [PATCH 10/27] fix: added push notification when user credentials are wrong --- src/components/Profile/LoginForm.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Profile/LoginForm.vue b/src/components/Profile/LoginForm.vue index 89b47e22..b400f5bf 100644 --- a/src/components/Profile/LoginForm.vue +++ b/src/components/Profile/LoginForm.vue @@ -52,6 +52,7 @@ diff --git a/src/stores/comments.js b/src/stores/comments.js index 957dee39..e84be359 100644 --- a/src/stores/comments.js +++ b/src/stores/comments.js @@ -211,6 +211,10 @@ export const useCommentStore = defineStore('comments', { this._isLoading = true await deleteDoc(doc(db, collectionName, documentId, 'comments', commentId)).finally(() => (this._isLoading = false)) + }, + + async resetComments() { + this._comments = undefined } } }) diff --git a/src/stores/likes.js b/src/stores/likes.js index 5a98eab4..54c25293 100644 --- a/src/stores/likes.js +++ b/src/stores/likes.js @@ -29,8 +29,6 @@ export const useLikeStore = defineStore('likes', { if (this._unSubscribeLike || this._unSubscribeDislike) { this._unSubscribeLike() this._unSubscribeDislike() - this._likes = undefined - this._dislikes = undefined } this._unSubscribeLike = onSnapshot(likesCollection, (likesSnapshot) => { this._likes = likesSnapshot.docs.map((doc) => ({ id: doc.id, ...doc.data() })) @@ -112,6 +110,11 @@ export const useLikeStore = defineStore('likes', { await deleteDoc(doc.ref) }) this._isLoading = false + }, + + async resetLikes() { + this._likes = undefined + this._dislikes = undefined } } }) diff --git a/src/stores/shares.js b/src/stores/shares.js index a3792d51..2b7114f1 100644 --- a/src/stores/shares.js +++ b/src/stores/shares.js @@ -54,6 +54,10 @@ export const useShareStore = defineStore('shares', { await deleteDoc(doc.ref) }) this._isLoading = false + }, + + async resetShares() { + this._shares = undefined } } }) From 7431370a9b7f66eb1f12be6db1335832e0631c6f Mon Sep 17 00:00:00 2001 From: Sana Yasmin Date: Wed, 20 Mar 2024 15:19:48 +0530 Subject: [PATCH 14/27] Added Notification for already email exists and also added notification is unexpected error happens --- src/stores/user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/stores/user.js b/src/stores/user.js index b1b2cdef..d77e8618 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -118,7 +118,13 @@ export const useUserStore = defineStore('user', { .then(() => Notify.create({ color: 'positive', message: 'Account created successfully' })) .catch((error) => console.error(error)) }) - .catch((error) => console.error(error)) + .catch((error) => { + console.error(error) + if (error.code === 'auth/email-already-in-use') Notify.create({ type: 'negative', message: 'Email already exists' }) + else { + Notify.create({ type: 'negative', message: 'Something went wrong.' }) + } + }) .finally(() => (this._isLoading = false)) }, From 273ecfaeabc378d4ff24cd32c318db4689a7c3f4 Mon Sep 17 00:00:00 2001 From: Sana Yasmin Date: Wed, 20 Mar 2024 15:20:20 +0530 Subject: [PATCH 15/27] Message updated ' --- src/stores/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/user.js b/src/stores/user.js index d77e8618..d280f60a 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -122,7 +122,7 @@ export const useUserStore = defineStore('user', { console.error(error) if (error.code === 'auth/email-already-in-use') Notify.create({ type: 'negative', message: 'Email already exists' }) else { - Notify.create({ type: 'negative', message: 'Something went wrong.' }) + Notify.create({ type: 'negative', message: 'Something went wrong, Please try again' }) } }) .finally(() => (this._isLoading = false)) From b9f15147af2706d8ae46f652cf25cd4fc1d217d9 Mon Sep 17 00:00:00 2001 From: Sana Yasmin Date: Wed, 20 Mar 2024 15:47:04 +0530 Subject: [PATCH 16/27] Added password visibility icon for showing password --- src/components/Profile/LoginForm.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/Profile/LoginForm.vue b/src/components/Profile/LoginForm.vue index 89b47e22..3d8d7934 100644 --- a/src/components/Profile/LoginForm.vue +++ b/src/components/Profile/LoginForm.vue @@ -34,9 +34,17 @@ lazy-rules required :rules="[(val) => /^.{6,}$/.test(val) || 'Invalid Password']" - type="password" + :type="isVisibleOn ? 'text' : 'password'" v-model="user.password" - /> + > + + + + @@ -59,6 +67,12 @@ const userStore = useUserStore() const user = ref({ email: '', name: '', password: '' }) const tab = ref('signin') +const isVisibleOn = ref(false) + +function toggleVisibility(){ + isVisibleOn.value = !isVisibleOn.value +} + async function emailSign() { if (tab.value === 'signin') { await userStore.emailSignIn(user.value).catch((error) => errorStore.throwError(error)) From 5699e3948e726c914e9629ea5c24c7811ec8d00f Mon Sep 17 00:00:00 2001 From: Sana Yasmin Date: Thu, 21 Mar 2024 15:04:09 +0530 Subject: [PATCH 17/27] Profile tab migrated to router tab and if user refresh the page it will open the same tab --- src/pages/profile/FeedbackIndex.vue | 6 ++++ .../ProfileIndex.vue} | 34 +++++++------------ src/pages/profile/ProfileTab.vue | 6 ++++ src/pages/profile/SettingsIndex.vue | 6 ++++ src/pages/profile/SubscriptionsIndex.vue | 6 ++++ src/router/profile.js | 30 ++++++++++++++++ src/router/routes.js | 9 ++--- 7 files changed, 69 insertions(+), 28 deletions(-) create mode 100644 src/pages/profile/FeedbackIndex.vue rename src/pages/{ProfilePage.vue => profile/ProfileIndex.vue} (55%) create mode 100644 src/pages/profile/ProfileTab.vue create mode 100644 src/pages/profile/SettingsIndex.vue create mode 100644 src/pages/profile/SubscriptionsIndex.vue create mode 100644 src/router/profile.js diff --git a/src/pages/profile/FeedbackIndex.vue b/src/pages/profile/FeedbackIndex.vue new file mode 100644 index 00000000..d2cd3319 --- /dev/null +++ b/src/pages/profile/FeedbackIndex.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/ProfilePage.vue b/src/pages/profile/ProfileIndex.vue similarity index 55% rename from src/pages/ProfilePage.vue rename to src/pages/profile/ProfileIndex.vue index 8e3d0de3..502d4111 100644 --- a/src/pages/ProfilePage.vue +++ b/src/pages/profile/ProfileIndex.vue @@ -7,32 +7,22 @@ - - - - - + + + + + - - - - - - - - - - - - - - - - - + diff --git a/src/pages/profile/ProfileTab.vue b/src/pages/profile/ProfileTab.vue new file mode 100644 index 00000000..f5d1d9cc --- /dev/null +++ b/src/pages/profile/ProfileTab.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/profile/SettingsIndex.vue b/src/pages/profile/SettingsIndex.vue new file mode 100644 index 00000000..a29d968a --- /dev/null +++ b/src/pages/profile/SettingsIndex.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/profile/SubscriptionsIndex.vue b/src/pages/profile/SubscriptionsIndex.vue new file mode 100644 index 00000000..9ca50935 --- /dev/null +++ b/src/pages/profile/SubscriptionsIndex.vue @@ -0,0 +1,6 @@ + + diff --git a/src/router/profile.js b/src/router/profile.js new file mode 100644 index 00000000..8dfdb7db --- /dev/null +++ b/src/router/profile.js @@ -0,0 +1,30 @@ +export default [ + { + path: 'profile', + component: () => import('pages/profile/ProfileIndex.vue'), + name: 'profile', + redirect: { name: 'profile.index' }, + children: [ + { + name: 'profile.index', + path: '', + component: () => import('pages/profile/ProfileTab.vue') + }, + { + name: 'profile.subscriptions', + path: 'subscriptions', + component: () => import('pages/profile/SubscriptionsIndex.vue') + }, + { + name: 'profile.feedback', + path: 'feedback', + component: () => import('pages/profile/FeedbackIndex.vue') + }, + { + name: 'profile.settings', + path: 'settings', + component: () => import('pages/profile/SettingsIndex.vue') + } + ] + } +] diff --git a/src/router/routes.js b/src/router/routes.js index 2038264e..79d4c7ff 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,5 +1,5 @@ import { useUserStore } from 'stores' - +import profileTest from './profile' const routes = [ { path: '/robots.txt', @@ -52,10 +52,6 @@ const routes = [ path: 'fan/:username', component: () => import('pages/PublicProfilePage.vue') }, - { - path: 'profile', - component: () => import('pages/ProfilePage.vue') - }, { path: 'admin', component: () => import('pages/AdminPage.vue'), @@ -64,7 +60,8 @@ const routes = [ if (userStore.isWriterOrAbove) next() else next('/') } - } + }, + ...profileTest ] }, { From 6c40bad34ad401f01739a0f1a6a6e2a3c703f700 Mon Sep 17 00:00:00 2001 From: Sana Yasmin Date: Fri, 22 Mar 2024 16:09:00 +0530 Subject: [PATCH 18/27] Admin route updated --- .../{AdminPage.vue => admin/AdminIndex.vue} | 52 +++++++++++++--- src/pages/admin/ErrorsIndex.vue | 9 +++ src/pages/admin/FeedbacksIndex.vue | 10 +++ src/pages/admin/PromptsIndex.vue | 13 ++++ src/pages/admin/ReportsIndex.vue | 9 +++ src/pages/admin/UsersIndex.vue | 9 +++ src/pages/profile/ProfileIndex.vue | 2 - src/router/admin.js | 62 +++++++++++++++++++ src/router/routes.js | 16 ++--- src/stores/entries.js | 3 +- src/stores/prompts.js | 4 +- 11 files changed, 166 insertions(+), 23 deletions(-) rename src/pages/{AdminPage.vue => admin/AdminIndex.vue} (73%) create mode 100644 src/pages/admin/ErrorsIndex.vue create mode 100644 src/pages/admin/FeedbacksIndex.vue create mode 100644 src/pages/admin/PromptsIndex.vue create mode 100644 src/pages/admin/ReportsIndex.vue create mode 100644 src/pages/admin/UsersIndex.vue create mode 100644 src/router/admin.js diff --git a/src/pages/AdminPage.vue b/src/pages/admin/AdminIndex.vue similarity index 73% rename from src/pages/AdminPage.vue rename to src/pages/admin/AdminIndex.vue index 81184dd0..39dedcf7 100644 --- a/src/pages/AdminPage.vue +++ b/src/pages/admin/AdminIndex.vue @@ -32,7 +32,7 @@ - + + + + + + + + + + + @@ -69,17 +110,14 @@ + + diff --git a/src/pages/admin/FeedbacksIndex.vue b/src/pages/admin/FeedbacksIndex.vue new file mode 100644 index 00000000..859affa3 --- /dev/null +++ b/src/pages/admin/FeedbacksIndex.vue @@ -0,0 +1,10 @@ + + + diff --git a/src/pages/admin/PromptsIndex.vue b/src/pages/admin/PromptsIndex.vue new file mode 100644 index 00000000..eb2d0793 --- /dev/null +++ b/src/pages/admin/PromptsIndex.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/pages/admin/ReportsIndex.vue b/src/pages/admin/ReportsIndex.vue new file mode 100644 index 00000000..2e6110c2 --- /dev/null +++ b/src/pages/admin/ReportsIndex.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/pages/admin/UsersIndex.vue b/src/pages/admin/UsersIndex.vue new file mode 100644 index 00000000..21581f2f --- /dev/null +++ b/src/pages/admin/UsersIndex.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/pages/profile/ProfileIndex.vue b/src/pages/profile/ProfileIndex.vue index 502d4111..b55562ba 100644 --- a/src/pages/profile/ProfileIndex.vue +++ b/src/pages/profile/ProfileIndex.vue @@ -40,10 +40,8 @@ import { ref } from 'vue' const userStore = useUserStore() const user = ref(userStore.getUser) -const tab = ref(userStore.getProfileTab) userStore.$subscribe((_mutation, state) => { user.value = state._user - tab.value = state._profileTab }) diff --git a/src/router/admin.js b/src/router/admin.js new file mode 100644 index 00000000..78269884 --- /dev/null +++ b/src/router/admin.js @@ -0,0 +1,62 @@ +import { useUserStore } from 'stores' + +export default [ + { + path: '/admin', + name: 'admin', + beforeEnter: (_to, _from, next) => { + const userStore = useUserStore() + if (userStore.isWriterOrAbove) next() + else next('/') + }, + redirect: { name: 'admin.prompts' }, + component: () => import('pages/admin/AdminIndex.vue'), + children: [ + { + name: 'admin.prompts', + path: 'prompts', + component: () => import('pages/admin/PromptsIndex.vue') + }, + { + name: 'admin.users', + path: 'users', + component: () => import('pages/admin/UsersIndex.vue'), + beforeEnter: (_to, _from, next) => { + const userStore = useUserStore() + if (userStore.isAdmin) next() + else next('/') + } + }, + { + name: 'admin.feedbacks', + path: 'feedbacks', + component: () => import('pages/admin/FeedbacksIndex.vue'), + beforeEnter: (_to, _from, next) => { + const userStore = useUserStore() + if (userStore.isEditorOrAbove) next() + else next('/') + } + }, + { + name: 'admin.errors', + path: 'errors', + component: () => import('pages/admin/ErrorsIndex.vue'), + beforeEnter: (_to, _from, next) => { + const userStore = useUserStore() + if (userStore.isAdmin) next() + else next('/') + } + }, + { + name: 'admin.reports', + path: 'reports', + component: () => import('pages/admin/ReportsIndex.vue'), + beforeEnter: (_to, _from, next) => { + const userStore = useUserStore() + if (userStore.isEditorOrAbove) next() + else next('/') + } + } + ] + } +] diff --git a/src/router/routes.js b/src/router/routes.js index 79d4c7ff..e8d8d950 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,5 +1,5 @@ -import { useUserStore } from 'stores' -import profileTest from './profile' +import profile from './profile' +import admin from './admin' const routes = [ { path: '/robots.txt', @@ -52,16 +52,8 @@ const routes = [ path: 'fan/:username', component: () => import('pages/PublicProfilePage.vue') }, - { - path: 'admin', - component: () => import('pages/AdminPage.vue'), - beforeEnter: (_to, _from, next) => { - const userStore = useUserStore() - if (userStore.isWriterOrAbove) next() - else next('/') - } - }, - ...profileTest + ...profile, + ...admin ] }, { diff --git a/src/stores/entries.js b/src/stores/entries.js index 87b7c37e..0e769c45 100644 --- a/src/stores/entries.js +++ b/src/stores/entries.js @@ -33,7 +33,8 @@ export const useEntryStore = defineStore('entries', { _entries: undefined, _isLoading: false, _unSubscribe: undefined, - _tab: 'post' + _tab: 'post', + entryDialog: {} }), persist: true, diff --git a/src/stores/prompts.js b/src/stores/prompts.js index ef3bab9b..7585ce92 100644 --- a/src/stores/prompts.js +++ b/src/stores/prompts.js @@ -17,7 +17,9 @@ export const usePromptStore = defineStore('prompts', { state: () => ({ _isLoading: false, _prompts: undefined, - _tab: 'post' + _tab: 'post', + promptDialog: false, + entryDialog: {} }), persist: true, From d3d055534ab6715f3885d557881331caa38cfe6e Mon Sep 17 00:00:00 2001 From: Arnon R Date: Fri, 22 Mar 2024 07:48:49 -0300 Subject: [PATCH 19/27] Removed console + add brackets --- src/stores/user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/user.js b/src/stores/user.js index d280f60a..777ba57c 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -119,9 +119,9 @@ export const useUserStore = defineStore('user', { .catch((error) => console.error(error)) }) .catch((error) => { - console.error(error) - if (error.code === 'auth/email-already-in-use') Notify.create({ type: 'negative', message: 'Email already exists' }) - else { + if (error.code === 'auth/email-already-in-use') { + Notify.create({ type: 'negative', message: 'Email already exists' }) + } else { Notify.create({ type: 'negative', message: 'Something went wrong, Please try again' }) } }) From af455a1d774fde5dabd6dd493fc3ec2702f9df5c Mon Sep 17 00:00:00 2001 From: Sana Yasmin Date: Sat, 23 Mar 2024 12:57:26 +0530 Subject: [PATCH 20/27] Router updated from path to name --- src/pages/admin/AdminIndex.vue | 39 +++++----------------------------- src/router/admin.js | 7 +----- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/src/pages/admin/AdminIndex.vue b/src/pages/admin/AdminIndex.vue index 39dedcf7..9acc8a1b 100644 --- a/src/pages/admin/AdminIndex.vue +++ b/src/pages/admin/AdminIndex.vue @@ -32,40 +32,11 @@ - - + diff --git a/src/router/admin.js b/src/router/admin.js index 78269884..d899d886 100644 --- a/src/router/admin.js +++ b/src/router/admin.js @@ -9,16 +9,14 @@ export default [ if (userStore.isWriterOrAbove) next() else next('/') }, - redirect: { name: 'admin.prompts' }, + redirect: { path: 'admin/prompts' }, component: () => import('pages/admin/AdminIndex.vue'), children: [ { - name: 'admin.prompts', path: 'prompts', component: () => import('pages/admin/PromptsIndex.vue') }, { - name: 'admin.users', path: 'users', component: () => import('pages/admin/UsersIndex.vue'), beforeEnter: (_to, _from, next) => { @@ -28,7 +26,6 @@ export default [ } }, { - name: 'admin.feedbacks', path: 'feedbacks', component: () => import('pages/admin/FeedbacksIndex.vue'), beforeEnter: (_to, _from, next) => { @@ -38,7 +35,6 @@ export default [ } }, { - name: 'admin.errors', path: 'errors', component: () => import('pages/admin/ErrorsIndex.vue'), beforeEnter: (_to, _from, next) => { @@ -48,7 +44,6 @@ export default [ } }, { - name: 'admin.reports', path: 'reports', component: () => import('pages/admin/ReportsIndex.vue'), beforeEnter: (_to, _from, next) => { From 443229d26d51711cc12c6c9381826652571806dd Mon Sep 17 00:00:00 2001 From: Lupanciuc Marc Date: Sat, 23 Mar 2024 17:28:44 +0200 Subject: [PATCH 21/27] Changed UI layout for search page and user entries section --- src/components/shared/ItemCard.vue | 15 +++++++++++-- src/components/shared/TheEntries.vue | 32 +++++++++++++++++++++++----- src/pages/SearchPage.vue | 22 ++++++++++++++++--- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/src/components/shared/ItemCard.vue b/src/components/shared/ItemCard.vue index 5666b6f2..7d7cc9e8 100644 --- a/src/components/shared/ItemCard.vue +++ b/src/components/shared/ItemCard.vue @@ -1,5 +1,5 @@ @@ -62,4 +61,16 @@ function goToUrl() { text-decoration: none; color: black; } + +.article-card-item { + min-width: 620px; + width: 100%; + border: 1px solid #e54757; + border-radius: 24px; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); + + @media (max-width: 1320px) { + min-width: 320px; + } +} diff --git a/src/components/shared/TheEntries.vue b/src/components/shared/TheEntries.vue index 6987b34c..026aefa9 100644 --- a/src/components/shared/TheEntries.vue +++ b/src/components/shared/TheEntries.vue @@ -1,8 +1,9 @@ -