From 38e1819336873fa6c3aa1ccbb6f5b34581d9935d Mon Sep 17 00:00:00 2001 From: Luke C Hartman Date: Tue, 22 Oct 2024 11:22:20 -0700 Subject: [PATCH 1/7] defaultLabels fix & admin user can edit labels --- components/ReportSystem.jsx | 2 +- components/Settings.jsx | 14 ++++++++++++-- components/TagSystem.jsx | 2 +- components/modals/NewReportModal.jsx | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/components/ReportSystem.jsx b/components/ReportSystem.jsx index cb0a39a..d769bd8 100644 --- a/components/ReportSystem.jsx +++ b/components/ReportSystem.jsx @@ -109,7 +109,7 @@ const ReportSystem = ({ const defaultTopics = ["Health","Other","Politics","Weather"] // tag system 1 const defaultSources = ["Newspaper", "Other","Social","Website"] // tag system 2 - const defaultLabels = ["Important", "Flagged"] // tag system 3 + const defaultLabels = ["To Investigate", "Investigated: Flagged", "Investigated: Benign"] // tag system 3 // useEffect(() => { // console.log('Authenticated user:', user); diff --git a/components/Settings.jsx b/components/Settings.jsx index d9b9e14..d5b3488 100644 --- a/components/Settings.jsx +++ b/components/Settings.jsx @@ -29,7 +29,7 @@ const Settings = () => { const setData = async(agencyID) => { const defaultTopics = ["Health","Other","Politics","Weather"] // tag system 1 const defaultSources = ["Newspaper", "Other/Otro","Social","Website"] // tag system 2 - const defaultLabels = ["Important", "Flagged"] // tag system 3 + const defaultLabels = ["To Investigate", "Investigated: Flagged", "Investigated: Benign"] // tag system 3 // create topics collection for the new agency setDoc(doc(db, "tags", agencyID), { @@ -181,7 +181,7 @@ const Settings = () => { } {agencyID && -
+
Topic Tags
+ {customClaims.admin && +
+
Labels
+ +
+ } {/*
Customized Labels
{lower.includes(tag.toLowerCase()) &&

This tag already exists, do you want to replace?

} - {tag.length > 20 &&

You cannot type a tag more than 18 characters long. Please try another name

} + {tag.length > 25 &&

You cannot type a tag more than 18 characters long. Please try another name

}