From 9b7d351265edcd046f6a83b3d801bfb00251865f Mon Sep 17 00:00:00 2001 From: Douglas Sebastian Date: Thu, 5 Sep 2024 17:31:34 -0300 Subject: [PATCH 1/4] change: close modal on search users --- .../Group/GroupTabs/GroupPeople/GroupPeople.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx index 70dbd282..07b70446 100644 --- a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx +++ b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx @@ -1,7 +1,7 @@ import { useContext, useState, useMemo, useEffect } from "react"; import { Link } from "react-router-dom"; -import { EMPTY_LIST_CLASS, GroupContext, GroupContextType } from "@/pages/Group"; +import { EMPTY_LIST_CLASS, GroupContext } from "@/pages/Group"; import { ProfileClass } from "@/types/Profile"; import { ProfileImage } from "@/components/ProfileImage/ProfileImage"; @@ -10,6 +10,7 @@ import { Filter } from "@/components/Filter/Filter"; import Select from 'react-select' import { CompetenceType, LevelToLabel, Level, intToLevel } from "@/types/Competence"; import UniversimeApi from "@/services/UniversimeApi"; +import ActionButton from "@/components/ActionButton"; type competenceSearch = { typeId?: string, @@ -69,6 +70,7 @@ export function GroupPeople() { let searchCriteria = document.getElementById("search-criteria"); if(searchCriteria) searchCriteria?.classList.remove("hidden") + setShowAdvancedSearch(false); } if (!groupContext) @@ -198,12 +200,12 @@ export function GroupPeople() { } -
- Pesquisar -
+ - ) } From 2030686e79b46ba7ebc451543d89eaca16d1d70d Mon Sep 17 00:00:00 2001 From: Douglas Sebastian Date: Thu, 5 Sep 2024 17:40:01 -0300 Subject: [PATCH 2/4] change: add competence with ActionButton and remove search from modal --- .../GroupTabs/GroupPeople/GroupPeople.tsx | 38 ++++++------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx index 07b70446..7ced62a9 100644 --- a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx +++ b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx @@ -159,20 +159,20 @@ export function GroupPeople() { } -
{ - if(!currentCompetence || currentCompetence.level == undefined || !currentCompetence.label || !currentCompetence.typeId) return + - Adicionar competência à busca -
+ radio.checked = false + setCurrentCompetence(undefined) + } + }} />
@@ -184,22 +184,6 @@ export function GroupPeople() { />
-
- { addedCompetences.length != 0? - addedCompetences.map((competence)=>( -
- {competence.label} - { - if(competence.typeId == undefined || competence.level == undefined) - return - removeAddedCompetence(competence.typeId, competence.level); - }}> -
- )) - : <> - } -
- Date: Thu, 5 Sep 2024 17:41:32 -0300 Subject: [PATCH 3/4] change: move matchEveryCompetence box to search criteria --- .../GroupTabs/GroupPeople/GroupPeople.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx index 7ced62a9..fdab238f 100644 --- a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx +++ b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx @@ -46,7 +46,7 @@ export function GroupPeople() { else searchUsers(); - }, [addedCompetences]) + }, [ addedCompetences, matchEveryCompetence ]) const competenceTypeOptions = useMemo(() => { @@ -118,6 +118,17 @@ export function GroupPeople() { } + +
+ + {setMatchEveryCompetence(!matchEveryCompetence)}} + /> +
+

{ let searchCriteriaText = document.getElementById("search-criteria") if(searchCriteriaText) searchCriteriaText.classList.add("hidden") @@ -174,16 +185,6 @@ export function GroupPeople() { } }} /> -

- - {setMatchEveryCompetence(!matchEveryCompetence)}} - /> -
- Date: Thu, 5 Sep 2024 18:02:23 -0300 Subject: [PATCH 4/4] change: clear search with ActionButton --- .../Group/GroupTabs/GroupPeople/GroupPeople.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx index fdab238f..1f2a79d6 100644 --- a/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx +++ b/src/pages/Group/GroupTabs/GroupPeople/GroupPeople.tsx @@ -129,11 +129,15 @@ export function GroupPeople() { /> -

{ - let searchCriteriaText = document.getElementById("search-criteria") - if(searchCriteriaText) searchCriteriaText.classList.add("hidden") - clearFilteredPeople(); - }}>Limpar busca

+
{