From 9852cc3afe416816f9927d07a231124cbc7532cf Mon Sep 17 00:00:00 2001 From: Andre-Diamond <32074058+Andre-Diamond@users.noreply.github.com> Date: Mon, 26 Feb 2024 06:01:28 +0200 Subject: [PATCH 1/4] Add new Discord webhook URLs --- pages/api/discord.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/api/discord.ts b/pages/api/discord.ts index ae6d9cc..a4dc3dd 100644 --- a/pages/api/discord.ts +++ b/pages/api/discord.ts @@ -24,6 +24,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) 'Marketing Guild': process.env.SNET_DISCORD_WEBHOOK_URL, 'Research and Development Guild': process.env.SNET_DISCORD_WEBHOOK_URL, 'Ambassador Town Hall': process.env.SNET_DISCORD_WEBHOOK_URL, + 'Deep Funding Town Hall': process.env.SNET_DISCORD_WEBHOOK_URL, + 'One-off Event': process.env.SNET_DISCORD_WEBHOOK_URL }; From 2f18840838332e45ec77cc522237f1e187ad78d3 Mon Sep 17 00:00:00 2001 From: Andre-Diamond <32074058+Andre-Diamond@users.noreply.github.com> Date: Tue, 27 Feb 2024 04:38:30 +0200 Subject: [PATCH 2/4] Change to Gamers' Guild template - [Date: 2024-02-24] Fixes #81 --- pages/submit-meeting-summary/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/submit-meeting-summary/index.tsx b/pages/submit-meeting-summary/index.tsx index 8aca3f3..607785f 100644 --- a/pages/submit-meeting-summary/index.tsx +++ b/pages/submit-meeting-summary/index.tsx @@ -71,7 +71,7 @@ const SubmitMeetingSummary: NextPage = () => { setIsLoading(false); } const orderMapping = { - "Gamers Guild": ["narrative", "decisionItems", "actionItems", "gameRules", "leaderboard"], + "Gamers Guild": ["narrative", "discussionPoints", "decisionItems", "actionItems", "gameRules", "leaderboard"], "Writers Workgroup": ["narrative", "decisionItems", "actionItems", "learningPoints"], "Video Workgroup": ["discussionPoints", "decisionItems", "actionItems"], "Archival Workgroup": ["decisionItems", "actionItems", "learningPoints"], From b9187bdba52ca8baf4d7377486d60f39a4962854 Mon Sep 17 00:00:00 2001 From: Andre-Diamond <32074058+Andre-Diamond@users.noreply.github.com> Date: Tue, 27 Feb 2024 04:50:07 +0200 Subject: [PATCH 3/4] Add contact information for further assistance --- pages/issues.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/issues.tsx b/pages/issues.tsx index 8deead0..038173f 100644 --- a/pages/issues.tsx +++ b/pages/issues.tsx @@ -50,6 +50,7 @@ const Issues: NextPage = () => { +

For further assistance, contact Lord Kizzy on Discord for help.

{/* Open Issues Table */} From 910a262f77612a47796ee9c65cec6a78c5a0785e Mon Sep 17 00:00:00 2001 From: Andre-Diamond <32074058+Andre-Diamond@users.noreply.github.com> Date: Tue, 27 Feb 2024 06:06:13 +0200 Subject: [PATCH 4/4] Fix summary submission issue and add "No Summary Given" option --- components/ArchiveSummaries.tsx | 16 +++++++++++++--- components/SummaryTemplate.tsx | 3 ++- pages/submit-meeting-summary/index.tsx | 19 +++++++++++++++++++ utils/generateMarkdown.js | 5 ++++- utils/updateWorkgroups.js | 3 ++- 5 files changed, 40 insertions(+), 6 deletions(-) diff --git a/components/ArchiveSummaries.tsx b/components/ArchiveSummaries.tsx index 650b806..eb0a188 100644 --- a/components/ArchiveSummaries.tsx +++ b/components/ArchiveSummaries.tsx @@ -25,7 +25,7 @@ const ArchiveSummaries = () => { useEffect(() => { setRenderedMarkdown(formData.meetingSummary); - console.log(formData.meetingSummary) + //console.log(formData.meetingSummary) }, [formData.meetingSummary]); useEffect(() => { @@ -52,15 +52,21 @@ const ArchiveSummaries = () => { }; const handleChange = (e: React.ChangeEvent) => { - const { name, value, type, checked } = e.target; + const { name, value, type } = e.target; if (type === "checkbox") { + const checked = (e.target as HTMLInputElement).checked; name === "commitToGitBook" ? setCommitToGitBook(checked) : setSendToDiscord(checked); + } else if (name == 'date' && myVariable.summary.noSummaryGiven == true) { + console.log(myVariable, formData, value) + setFormData({ ...formData, [name]: value, confirmed: false }); + setSendToDiscord(false); } else { setFormData({ ...formData, [name]: value }); } if (name === 'meetingSummary') { adjustTextareaHeight(); } + }; async function handleSubmit(e: React.FormEvent) { @@ -110,7 +116,11 @@ const ArchiveSummaries = () => { await sendDiscordMessage(myVariable, renderedMarkdown); } } else { - alert('Summary already archived'); + if (myVariable.summary.noSummaryGiven == true) { + alert('Select a date') + } else { + alert('Summary already archived'); + } } setLoading(false); diff --git a/components/SummaryTemplate.tsx b/components/SummaryTemplate.tsx index 260a139..bfecbb9 100644 --- a/components/SummaryTemplate.tsx +++ b/components/SummaryTemplate.tsx @@ -107,7 +107,8 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => { } ], tags: { topicsCovered: "", emotions: "", other: "", gamesPlayed: "" }, - type: "Custom" + type: "Custom", + noSummaryGiven: false }; const [formData, setFormData] = useState(filterFormData(filterKeys(myVariable.summary || {}, defaultFormData))); diff --git a/pages/submit-meeting-summary/index.tsx b/pages/submit-meeting-summary/index.tsx index 607785f..5cc43d3 100644 --- a/pages/submit-meeting-summary/index.tsx +++ b/pages/submit-meeting-summary/index.tsx @@ -233,6 +233,19 @@ useEffect(() => { })); }; + const noSummaryGiven = () => { + setMyVariable(prevMyVariable => ({ + ...prevMyVariable, + summary: { + ...prevMyVariable.summary, + meetingInfo: {}, + agendaItems: [], + tags: {}, + noSummaryGiven: true + } + })); + }; + return (
@@ -296,6 +309,12 @@ useEffect(() => { title="All values will be cleared, so please make sure to select all dropdowns and fill in all fields" >Clear Summary + {myVariable.roles?.isAdmin && activeComponent == 'four' && ()} )}
{myVariable.isLoggedIn && selectedWorkgroupId && (
diff --git a/utils/generateMarkdown.js b/utils/generateMarkdown.js index 10d1da2..779245c 100644 --- a/utils/generateMarkdown.js +++ b/utils/generateMarkdown.js @@ -227,12 +227,15 @@ export function generateMarkdown(summary, order) { // Process tags if (summary.tags) { const { topicsCovered, references, emotions, other, gamesPlayed } = summary.tags; - markdown += `#### Keywords/tags:\n`; + if (topicsCovered || emotions || other || gamesPlayed) markdown += `#### Keywords/tags:\n`; if (topicsCovered) markdown += `- topics covered: ${topicsCovered}\n`; if (emotions) markdown += `- emotions: ${emotions}\n`; if (other) markdown += `- other: ${other}\n`; if (gamesPlayed) markdown += `- games played: ${gamesPlayed}\n`; } + if (summary.noSummaryGiven == true) { + markdown += `No Summary Given \n`; + } return markdown; }; diff --git a/utils/updateWorkgroups.js b/utils/updateWorkgroups.js index ef537a4..0752595 100644 --- a/utils/updateWorkgroups.js +++ b/utils/updateWorkgroups.js @@ -40,7 +40,8 @@ export async function updateWorkgroups(workgroupData) { } ], "tags":1, - "type":"Custom" + "type":"Custom", + "noSummaryGiven": false } let updates = {...workgroupData, preferred_template}