From 0b9df13acc69a308726660979bb456a08cbb21ac Mon Sep 17 00:00:00 2001 From: Matti Luukkainen Date: Mon, 2 Sep 2024 14:59:52 +0300 Subject: [PATCH] tweaks --- .../GroupManagementPage/GroupCreationForm.jsx | 2 +- .../GroupManagementPage/TopicSelect.jsx | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/GroupManagementPage/GroupCreationForm.jsx b/frontend/src/components/GroupManagementPage/GroupCreationForm.jsx index 016bdf6c..35126edd 100644 --- a/frontend/src/components/GroupManagementPage/GroupCreationForm.jsx +++ b/frontend/src/components/GroupManagementPage/GroupCreationForm.jsx @@ -96,7 +96,6 @@ const GroupCreationForm = ({ onInstructorChange, topics, onTopicSelectChange, - groupTopicID, groupConfigurationID, createGroupSuccsess, @@ -108,6 +107,7 @@ const GroupCreationForm = ({ const thistopic = topics.find((topic) => topic.id === topicid) onNameChangeForm(thistopic.content.title) } + return (
{ + + const filteredTopics = topics.filter(topic => { + const isSelected = (emails) => { + if (!emails || emails.length===0) { + return false + } + + return emails.map(email => email.email.type).includes('topicAccepted') + } + + return topic.active && topic.configuration_id === groupConfig && isSelected(topic.sentEmails) + }) + return (