Skip to content

Commit

Permalink
Merge pull request #145 from SingularityNET-Archive:development
Browse files Browse the repository at this point in the history
refactor: Update workgroup references to 'AI Sandbox/Think-tank' and implement MeetingTypeSelect component
  • Loading branch information
Andre-Diamond authored Nov 5, 2024
2 parents f08bff4 + 39db9b2 commit da19211
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 25 deletions.
6 changes: 3 additions & 3 deletions components/SummaryAgendaItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {

const getHeading = (itemType: any, workgroup: any) => {
switch (itemType) {

// Only check this section when changing or adding new workgroup
case "issues":
if (workgroup === "Onboarding Workgroup") return "To carry over for next meeting";
if (workgroup === "AI Sandbox") return "To carry over for next meeting";
if (workgroup === "AI Sandbox/Think-tank") 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"

case "discussionPoints":
if (workgroup === "Onboarding Workgroup") return "In this meeting we discussed";
if (workgroup === "AI Sandbox") return "In this meeting we discussed";
if (workgroup === "AI Sandbox/Think-tank") return "In this meeting we discussed";
return "Discussion Points";

case "meetingTopics":
Expand Down
27 changes: 9 additions & 18 deletions components/SummaryMeetingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useMyVariable } from '../context/MyVariableContext';
import SelectNames from './SelectNames';
import WorkingDocs from './WorkingDocs';
import TimestampedVideo from './TimestampedVideo';
import { MeetingTypeSelect } from '../components/meeting/MeetingTypeSelect';

type SummaryMeetingInfoProps = {
workgroup: string;
Expand Down Expand Up @@ -174,31 +175,21 @@ const SummaryMeetingInfo: React.FC<SummaryMeetingInfoProps> = ({ workgroup, onUp
};
});
}, []);

console.log("myVariable", myVariable);
return (
<>
<div className={styles['form-column-flex']}>
<div className={styles['row-flex-start']}>
<div className={styles['form-column-flex']}>
<div className={styles['row-flex-space-between']}>
<div className={styles['column-flex']}>
{myVariable.workgroup?.preferred_template?.meetingInfo?.name == 1 && (<>
<label className={styles['form-label']}>
Type of meeting:
</label>
<select
name="name"
value={meetingInfo.name || ""}
onChange={handleChange}
className={styles['form-select']}
title="Select the type of meeting. If it's a one-off event, please select 'One-off event'"
>
<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>
</>)}
{myVariable.workgroup?.preferred_template?.meetingInfo?.name == 1 && (
<MeetingTypeSelect
workgroup={workgroup}
value={meetingInfo.name}
onChange={handleChange}
/>
)}
</div>
<div className={styles['column-flex']}>
{myVariable.workgroup?.preferred_template?.meetingInfo?.date == 1 && (<>
Expand Down
39 changes: 39 additions & 0 deletions components/meeting/MeetingTypeSelect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// src/components/meeting/MeetingTypeSelect.tsx
import React from 'react';
import { meetingTypesConfig } from '../../config/meeting/meetingTypesConfig';
import styles from '../../styles/meetinginfo.module.css';

interface MeetingTypeSelectProps {
workgroup: string;
value: string;
onChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
}

export const MeetingTypeSelect: React.FC<MeetingTypeSelectProps> = ({
workgroup,
value,
onChange
}) => {
const config = meetingTypesConfig[workgroup] || meetingTypesConfig.default;

return (
<div className={styles['column-flex']}>
<label className={styles['form-label']}>
Type of meeting:
</label>
<select
name="name"
value={value || config.defaultType}
onChange={onChange}
className={styles['form-select']}
title="Select the type of meeting. If it's a one-off event, please select 'One-off event'"
>
{config.types.map(type => (
<option key={type.value} value={type.value}>
{type.label}
</option>
))}
</select>
</div>
);
};
21 changes: 21 additions & 0 deletions config/meeting/meetingTypesConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// src/config/meeting/meetingTypesConfig.ts
import { WorkgroupMeetingTypes } from '../../types/meeting';

export const meetingTypesConfig: WorkgroupMeetingTypes = {
default: {
defaultType: 'Weekly',
types: [
{ value: 'Weekly', label: 'Weekly' },
{ value: 'Biweekly', label: 'Biweekly' },
{ value: 'Monthly', label: 'Monthly' },
{ value: 'One-off event', label: 'One-off event' },
]
},
'AI Sandbox/Think-tank': {
defaultType: 'Weekly',
types: [
{ value: 'Sandbox', label: 'Sandbox' },
{ value: 'Think-Tank', label: 'Think-Tank' },
]
}
};
2 changes: 1 addition & 1 deletion pages/api/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
'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,
'AI Sandbox': process.env.SNET_DISCORD_WEBHOOK_URL,
'AI Sandbox/Think-tank': process.env.SNET_DISCORD_WEBHOOK_URL,
'GitHub PBL WG': process.env.SNET_DISCORD_WEBHOOK_URL,
};

Expand Down
2 changes: 1 addition & 1 deletion pages/submit-meeting-summary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const SubmitMeetingSummary: NextPage = () => {
"Strategy Guild": ["narrative", "decisionItems", "actionItems"],
"LatAm Guild": ["narrative", "decisionItems", "actionItems"],
"WG Sync Call": ["meetingTopics", "discussion", "decisionItems", "actionItems", "issues"],
"AI Sandbox": ["townHallUpdates", "discussionPoints", "decisionItems", "actionItems", "learningPoints", "issues"],
"AI Sandbox/Think-tank": ["townHallUpdates", "discussionPoints", "decisionItems", "actionItems", "learningPoints", "issues"],
"GitHub PBL WG": ["discussionPoints", "decisionItems", "actionItems"]
};
// When you add a new Workgroup you need to update this ordermapping and the Discord API with the new workgroup
Expand Down
12 changes: 12 additions & 0 deletions types/meeting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// src/types/meeting.ts
export type MeetingType = {
value: string;
label: string;
};

export type WorkgroupMeetingTypes = {
[key: string]: {
defaultType: string;
types: MeetingType[];
};
};
4 changes: 2 additions & 2 deletions utils/generateMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function generateMarkdown(summary, order) {
break;
case 'discussionPoints':
if (item.discussionPoints && item.discussionPoints.length > 0) {
if (summary.workgroup == "Onboarding Workgroup" || summary.workgroup == "AI Sandbox") {
if (summary.workgroup == "Onboarding Workgroup" || summary.workgroup == "AI Sandbox/Think-tank") {
formatItems("In this meeting we discussed", item.discussionPoints, 'discussionPoints');
} else {
formatItems("Discussion Points", item.discussionPoints, 'discussionPoints');
Expand All @@ -197,7 +197,7 @@ export function generateMarkdown(summary, order) {
break;
case 'issues':
if (item.issues && item.issues.length > 0) {
if (summary.workgroup == "Onboarding Workgroup" || summary.workgroup == "AI Sandbox") {
if (summary.workgroup == "Onboarding Workgroup" || summary.workgroup == "AI Sandbox/Think-tank") {
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');
Expand Down

0 comments on commit da19211

Please sign in to comment.