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: 2 additions & 2 deletions components/SelectTags.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useMemo } from 'react';
import { useMyVariable } from '../context/MyVariableContext';
import debounce from 'lodash/debounce';
import { debounce } from 'lodash';
import CreatableSelect from 'react-select/creatable';
import { saveNewTags } from '../utils/saveNewTags'

Expand All @@ -11,7 +11,7 @@ interface SelectTagsProps {
}

const SelectTags: React.FC<SelectTagsProps> = ({ onSelect, initialValue, type }) => {
let initialOptions = initialValue ? initialValue.split(", ").map((val: any) => ({ label: val, value: val })) : [];
let initialOptions = initialValue ? initialValue.split(", ").map((val) => ({ label: val, value: val })) : [];
const [selectedLabels, setSelectedLabels] = React.useState(initialOptions);
const { myVariable } = useMyVariable();
const options = myVariable.tags[`${type}`] || [
Expand Down
34 changes: 17 additions & 17 deletions components/SummaryAgendaItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {

// Utility to add an entire new "agenda item" section
const addAgendaItem = () => {
setAgendaItems((prev) => [
setAgendaItems((prev: any) => [
...prev,
{ ...getDefaultAgendaItem() }
]);
};

// Remove one entire "agenda item" section
const removeAgendaItem = (index: number) => {
setAgendaItems((prev) => {
setAgendaItems((prev: any) => {
const updated = [...prev];
updated.splice(index, 1);
return updated;
Expand All @@ -70,7 +70,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {

// Add a sub‐item (actionItems, discussionPoints, etc.)
const addItem = (type: string, agendaIndex: number) => {
setAgendaItems((prev) => {
setAgendaItems((prev: any) => {
const updated = [...prev];

// Ensure the target array exists; if not, initialize it.
Expand Down Expand Up @@ -103,7 +103,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {

// Remove a sub‐item
const removeItem = (type: string, agendaIndex: number, itemIndex: number) => {
setAgendaItems((prev) => {
setAgendaItems((prev: any) => {
const updated = [...prev];
updated[agendaIndex][type].splice(itemIndex, 1);
return updated;
Expand All @@ -117,7 +117,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
itemIdx: number,
updatedItem: any
) => {
setAgendaItems((prev) => {
setAgendaItems((prev: any) => {
const cloned = JSON.parse(JSON.stringify(prev));

// Some fields (narrative, discussion, etc.) are single text fields
Expand Down Expand Up @@ -152,7 +152,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={item.townHallUpdates}
agendaIndex={agendaIndex}
itemIndex={0}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("townHallUpdates", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand All @@ -173,7 +173,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={item.narrative}
agendaIndex={agendaIndex}
itemIndex={0}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("narrative", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand All @@ -194,7 +194,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={item.discussion}
agendaIndex={agendaIndex}
itemIndex={0}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("discussion", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand All @@ -217,7 +217,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={topic}
agendaIndex={agendaIndex}
itemIndex={idx}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("meetingTopics", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand Down Expand Up @@ -248,7 +248,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={pt}
agendaIndex={agendaIndex}
itemIndex={idx}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("discussionPoints", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand Down Expand Up @@ -278,7 +278,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={action}
agendaIndex={agendaIndex}
itemIndex={actionIdx}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("actionItems", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand Down Expand Up @@ -307,7 +307,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={dec}
agendaIndex={agendaIndex}
itemIndex={decIdx}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("decisionItems", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand Down Expand Up @@ -335,7 +335,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={item.gameRules}
agendaIndex={agendaIndex}
itemIndex={0}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("gameRules", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand All @@ -356,7 +356,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={item.townHallSummary}
agendaIndex={agendaIndex}
itemIndex={0}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("townHallSummary", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand All @@ -379,7 +379,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={lb}
agendaIndex={agendaIndex}
itemIndex={lbIdx}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("leaderboard", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand Down Expand Up @@ -410,7 +410,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={lp}
agendaIndex={agendaIndex}
itemIndex={lpIdx}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("learningPoints", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand Down Expand Up @@ -441,7 +441,7 @@ const SummaryAgendaItems = ({ onUpdate }: any) => {
item={issue}
agendaIndex={agendaIndex}
itemIndex={issueIdx}
onUpdate={(aIdx, iIdx, updated) =>
onUpdate={(aIdx: any, iIdx: any, updated: any) =>
handleItemUpdate("issues", aIdx, iIdx, updated)
}
onRemove={removeItem}
Expand Down
6 changes: 4 additions & 2 deletions components/SummaryMeetingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ const SummaryMeetingInfo: React.FC<SummaryMeetingInfoProps> = ({ workgroup, onUp
}, [meetingInfo.purpose]);

// Generic handler for top-level text fields
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const handleChange = (
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>
) => {
const { name, value } = e.target;
setMeetingInfo((prev) => ({
...prev,
[name]: value,
}));
};
};

useEffect(() => {
onUpdate(meetingInfo);
Expand Down
2 changes: 1 addition & 1 deletion components/SummaryTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ../components/SummaryTemplate.tsx
import { useState, useEffect, useMemo, useRef } from "react";
import debounce from "lodash/debounce";
import { debounce } from 'lodash';
import isEqual from "lodash/isEqual";
import styles from '../styles/summarytemplate.module.css';
import { useMyVariable } from '../context/MyVariableContext';
Expand Down
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"devDependencies": {
"@netlify/plugin-nextjs": "^5.9.4",
"@types/lodash": "^4.17.15"
"@types/lodash": "^4.17.15",
"@types/react-modal": "^3.16.3"
}
}