diff --git a/components/Item.tsx b/components/Item.tsx index dc9cab9..af1fe43 100644 --- a/components/Item.tsx +++ b/components/Item.tsx @@ -8,7 +8,8 @@ const TextAreaInput = ({ value, onChange, placeholder, type }: any) => { narrative: 'Meeting narrative: Try to make your narrative concise and information-dense, and avoid filler', townHallUpdates: 'Write down Weekly Town Hall updates', gameRules: 'Write down Game Rules', - townHallSummary: 'Write down Weekly Town Hall Summary' + townHallSummary: 'Write down Weekly Town Hall Summary', + discussion: 'Discussion: Note the main points raised. Try to make your narrative concise and information-dense, and avoid filler', }; // Determine the title based on the type @@ -126,6 +127,7 @@ const Item = ({ type, item, agendaIndex, itemIndex, onUpdate, onRemove }: any) = case 'narrative': case 'townHallSummary': case 'gameRules': + case 'discussion': return { const newAgendaItems = JSON.parse(JSON.stringify(prevAgendaItems)); // Check if the type is 'narrative' - if (type === 'townHallUpdates' || type === 'narrative' || type === 'gameRules' || type === 'townHallSummary') { + if (type === 'townHallUpdates' || type === 'narrative' || type === 'gameRules' || type === 'townHallSummary' || type === 'discussion') { if (newAgendaItems[agendaIdx]) { newAgendaItems[agendaIdx][type] = updatedItem[type]; // Directly set the narrative or gameRules string } @@ -81,8 +81,10 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { const getHeading = (itemType: any, workgroup: any) => { switch (itemType) { + case "issues": if (workgroup === "Onboarding Workgroup") return "To carry over for next meeting"; + if (workgroup === "WG Sync Call") return "To carry over for next meeting"; // Add more specific conditions for "issues" if needed return "Issues"; // Default for "issues" @@ -93,6 +95,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { case "meetingTopics": if (workgroup === "Research and Development Guild") return "Agenda Items"; if (workgroup === "Education Workgroup") return "In this meeting we discussed"; + if (workgroup === "WG Sync Call") return "Agenda Items"; return "Meeting Topics"; // Add cases for other item types as needed @@ -140,6 +143,25 @@ const SummaryAgendaItems = ({ onUpdate }: any) => { ) }, + { + type: "discussion", + isEnabled: (template: any) => template?.discussion === 1, + render: (item: any, agendaIndex: any) => ( + <> +

Discussion

+
+ handleItemUpdate('discussion', agendaIdx, itemIdx, updatedItem)} + onRemove={removeItem} + /> +
+ + ) + }, { type: "meetingTopics", isEnabled: (template: any) => template?.meetingTopics === 1, diff --git a/components/SummaryMeetingInfo.tsx b/components/SummaryMeetingInfo.tsx index 31925fe..d29a099 100644 --- a/components/SummaryMeetingInfo.tsx +++ b/components/SummaryMeetingInfo.tsx @@ -186,6 +186,7 @@ const SummaryMeetingInfo: React.FC = ({ workgroup, onUp > + )} diff --git a/components/SummaryTemplate.tsx b/components/SummaryTemplate.tsx index b7fcfc1..df6a0db 100644 --- a/components/SummaryTemplate.tsx +++ b/components/SummaryTemplate.tsx @@ -98,6 +98,7 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => { townHallUpdates: "", townHallSummary: "", narrative: "", + discussion: "", gameRules: "", meetingTopics:[""], issues: [""], diff --git a/components/Tags.tsx b/components/Tags.tsx index 0fb7006..174314d 100644 --- a/components/Tags.tsx +++ b/components/Tags.tsx @@ -76,7 +76,7 @@ const Tags: React.FC = ({ tags, setTags }) => { -
+ {!(myVariable.workgroup?.workgroup == 'WG Sync Call') && (
-
+
)} ); }; diff --git a/pages/api/discord.ts b/pages/api/discord.ts index b9a264a..e4284af 100644 --- a/pages/api/discord.ts +++ b/pages/api/discord.ts @@ -32,6 +32,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) 'Africa Guild': process.env.SNET_DISCORD_WEBHOOK_URL, 'Strategy Guild': process.env.SNET_DISCORD_WEBHOOK_URL, 'LatAm Guild': process.env.SNET_DISCORD_WEBHOOK_URL, + 'WG Sync Call': process.env.SNET_DISCORD_WEBHOOK_URL }; diff --git a/pages/submit-meeting-summary/index.tsx b/pages/submit-meeting-summary/index.tsx index 822da7f..be29432 100644 --- a/pages/submit-meeting-summary/index.tsx +++ b/pages/submit-meeting-summary/index.tsx @@ -98,7 +98,10 @@ const SubmitMeetingSummary: NextPage = () => { "Africa Guild": ["narrative", "decisionItems", "actionItems"], "Strategy Guild": ["narrative", "decisionItems", "actionItems"], "LatAm Guild": ["narrative", "decisionItems", "actionItems"], + "WG Sync Call": ["meetingTopics", "discussion", "decisionItems", "actionItems", "issues"], }; // When you add a new Workgroup you need to update this ordermapping and the Discord API with the new workgroup + //If you add a new AgendaItem type, you need to update the following components: Item.tsx, SummaryTemplate.tsx and AgendaItem.tsx and + // the database template. You also need to update the generateMarkdown.js and getDefaultAgendaItem.js utils functions useEffect(() => { async function fetchInitialData(workgroupId: string) { diff --git a/utils/generateMarkdown.js b/utils/generateMarkdown.js index a01b116..dd73239 100644 --- a/utils/generateMarkdown.js +++ b/utils/generateMarkdown.js @@ -110,7 +110,7 @@ export function generateMarkdown(summary, order) { // Generic function to format items const formatItems = (title, items, itemType) => { let sectionContent = ''; - if (itemType === 'townHallUpdates' || itemType === 'narrative' || itemType === 'gameRules' || itemType === 'townHallSummary') { + if (itemType === 'townHallUpdates' || itemType === 'narrative' || itemType === 'gameRules' || itemType === 'townHallSummary' || itemType === 'discussion') { if (items.trim()) { // Check if narrative or gameRules are not empty sectionContent = `${items}\n\n`; } @@ -161,6 +161,9 @@ export function generateMarkdown(summary, order) { case 'narrative': if (item.narrative) formatItems("Narrative", item.narrative, 'narrative'); break; + case 'discussion': + if (item.discussion) formatItems("Discussion", item.discussion, 'discussion'); + break; case 'actionItems': if (item.actionItems && item.actionItems.length > 0) formatItems("Action Items", item.actionItems, 'actionItems'); break; @@ -185,6 +188,8 @@ export function generateMarkdown(summary, order) { formatItems("In this meeting we discussed", item.meetingTopics, 'meetingTopics'); } else if (summary.workgroup == "Research and Development Guild") { formatItems("Agenda Items", item.meetingTopics, 'meetingTopics'); + } else if (summary.workgroup == "WG Sync Call") { + formatItems("Agenda Items", item.meetingTopics, 'meetingTopics'); } else { formatItems("Meeting Topics", item.meetingTopics, 'meetingTopics'); } @@ -194,6 +199,8 @@ export function generateMarkdown(summary, order) { if (item.issues && item.issues.length > 0) { if (summary.workgroup == "Onboarding Workgroup") { formatItems("To carry over for next meeting", item.issues, 'issues'); + } else if (summary.workgroup == "WG Sync Call") { + formatItems("To carry over for next meeting", item.issues, 'issues'); } else { formatItems("Issues", item.issues, 'issues'); } diff --git a/utils/getDefaultAgendaItem.js b/utils/getDefaultAgendaItem.js index 4599eb1..a51032a 100644 --- a/utils/getDefaultAgendaItem.js +++ b/utils/getDefaultAgendaItem.js @@ -4,6 +4,7 @@ export const getDefaultAgendaItem = () => ({ townHallUpdates: "", townHallSummary: "", narrative: "", + discussion: "", gameRules: "", leaderboard: [""], meetingTopics: [""],