From 0427aee13bbc958af3e6036d5f80a56ff766ea5a Mon Sep 17 00:00:00 2001 From: David Newell Date: Fri, 22 Sep 2023 12:34:12 +0100 Subject: [PATCH] fix: show defaults not suggestions (#17584) --- .../Settings/PersonDisplayNameProperties.tsx | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/frontend/src/scenes/project/Settings/PersonDisplayNameProperties.tsx b/frontend/src/scenes/project/Settings/PersonDisplayNameProperties.tsx index 5804754576c57..df85da1d32db3 100644 --- a/frontend/src/scenes/project/Settings/PersonDisplayNameProperties.tsx +++ b/frontend/src/scenes/project/Settings/PersonDisplayNameProperties.tsx @@ -1,4 +1,4 @@ -import { LemonButton, LemonSnack } from '@posthog/lemon-ui' +import { LemonButton } from '@posthog/lemon-ui' import { useActions, useValues } from 'kea' import { PersonPropertySelect } from 'lib/components/PersonPropertySelect/PersonPropertySelect' import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton' @@ -10,19 +10,16 @@ export function PersonDisplayNameProperties(): JSX.Element { const { currentTeam } = useValues(teamLogic) const { updateCurrentTeam } = useActions(teamLogic) const [value, setValue] = useState([] as string[]) - const [suggestions, setSuggestions] = useState([] as string[]) - useEffect(() => { - setValue(currentTeam?.person_display_name_properties || []) - setSuggestions(PERSON_DEFAULT_DISPLAY_NAME_PROPERTIES) - }, [currentTeam]) + useEffect( + () => setValue(currentTeam?.person_display_name_properties || PERSON_DEFAULT_DISPLAY_NAME_PROPERTIES), + [currentTeam] + ) if (!currentTeam) { return } - const activeSuggestions = suggestions.filter((s) => !value.includes(s)) - return ( <>

@@ -36,16 +33,6 @@ export function PersonDisplayNameProperties(): JSX.Element { addText="Add" sortable /> -

-

Suggestions

-
- {activeSuggestions.map((suggestion) => ( - setValue([...value, suggestion])}> - {suggestion} - - ))} -
-