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
16 changes: 13 additions & 3 deletions components/ArchiveSummaries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ArchiveSummaries = () => {

useEffect(() => {
setRenderedMarkdown(formData.meetingSummary);
console.log(formData.meetingSummary)
//console.log(formData.meetingSummary)
}, [formData.meetingSummary]);

useEffect(() => {
Expand All @@ -52,15 +52,21 @@ const ArchiveSummaries = () => {
};

const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => {
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) {
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion components/SummaryTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
2 changes: 2 additions & 0 deletions pages/api/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};


Expand Down
1 change: 1 addition & 0 deletions pages/issues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const Issues: NextPage = () => {
<a href={newIssueUrl} target="_blank" rel="noopener noreferrer">
<button className={styles.createIssueButton}>Create New Issue</button>
</a>
<p>For further assistance, contact Lord Kizzy on Discord for help.</p>
<div className={styles.issuesTableContainer}>

{/* Open Issues Table */}
Expand Down
21 changes: 20 additions & 1 deletion pages/submit-meeting-summary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -233,6 +233,19 @@ useEffect(() => {
}));
};

const noSummaryGiven = () => {
setMyVariable(prevMyVariable => ({
...prevMyVariable,
summary: {
...prevMyVariable.summary,
meetingInfo: {},
agendaItems: [],
tags: {},
noSummaryGiven: true
}
}));
};

return (
<div className={styles.container}>
<div className={styles.navbar}>
Expand Down Expand Up @@ -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
</button>
{myVariable.roles?.isAdmin && activeComponent == 'four' && (<button
className={styles.resetButton}
onClick={noSummaryGiven}
title="All values will be cleared, and markdown changed to 'No Sammary given'"
>No Summary Given
</button>)}
</>)}
</div>
{myVariable.isLoggedIn && selectedWorkgroupId && (<div className={styles.mainContent}>
Expand Down
5 changes: 4 additions & 1 deletion utils/generateMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
3 changes: 2 additions & 1 deletion utils/updateWorkgroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export async function updateWorkgroups(workgroupData) {
}
],
"tags":1,
"type":"Custom"
"type":"Custom",
"noSummaryGiven": false
}
let updates = {...workgroupData, preferred_template}

Expand Down