Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -126,6 +127,7 @@ const Item = ({ type, item, agendaIndex, itemIndex, onUpdate, onRemove }: any) =
case 'narrative':
case 'townHallSummary':
case 'gameRules':
case 'discussion':
return <TextAreaInput
type={type}
value={item}
Expand Down
24 changes: 23 additions & 1 deletion components/SummaryAgendaItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
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
}
Expand All @@ -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"

Expand All @@ -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

Expand Down Expand Up @@ -140,6 +143,25 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
</>
)
},
{
type: "discussion",
isEnabled: (template: any) => template?.discussion === 1,
render: (item: any, agendaIndex: any) => (
<>
<h3>Discussion</h3>
<div className={styles['action-item']}>
<Item
type="discussion"
item={item.discussion}
agendaIndex={agendaIndex}
itemIndex={0}
onUpdate={(agendaIdx: any, itemIdx: any, updatedItem: any) => handleItemUpdate('discussion', agendaIdx, itemIdx, updatedItem)}
onRemove={removeItem}
/>
</div>
</>
)
},
{
type: "meetingTopics",
isEnabled: (template: any) => template?.meetingTopics === 1,
Expand Down
1 change: 1 addition & 0 deletions components/SummaryMeetingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ const SummaryMeetingInfo: React.FC<SummaryMeetingInfoProps> = ({ workgroup, onUp
>
<option value="Weekly">Weekly</option>
<option value="Biweekly">Biweekly</option>
<option value="Monthly">Monthly</option>
<option value="One-off event">One-off event</option>
</select>
</>)}
Expand Down
1 change: 1 addition & 0 deletions components/SummaryTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => {
townHallUpdates: "",
townHallSummary: "",
narrative: "",
discussion: "",
gameRules: "",
meetingTopics:[""],
issues: [""],
Expand Down
4 changes: 2 additions & 2 deletions components/Tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const Tags: React.FC<TagsProps> = ({ tags, setTags }) => {
</div>
</div>
</div>
<div className={styles['links-column-flex']}>
{!(myVariable.workgroup?.workgroup == 'WG Sync Call') && (<div className={styles['links-column-flex']}>
<div>
<label className={styles['form-label']}>
Other / General
Expand All @@ -89,7 +89,7 @@ const Tags: React.FC<TagsProps> = ({ tags, setTags }) => {
type="other"
/>
</div>
</div>
</div>)}
</div>
);
};
Expand Down
1 change: 1 addition & 0 deletions pages/api/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};


Expand Down
3 changes: 3 additions & 0 deletions pages/submit-meeting-summary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 8 additions & 1 deletion utils/generateMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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');
}
Expand All @@ -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');
}
Expand Down
1 change: 1 addition & 0 deletions utils/getDefaultAgendaItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const getDefaultAgendaItem = () => ({
townHallUpdates: "",
townHallSummary: "",
narrative: "",
discussion: "",
gameRules: "",
leaderboard: [""],
meetingTopics: [""],
Expand Down