diff --git a/web/components/Notifications.tsx b/web/components/Notifications.tsx index 04992d4..76b2de0 100644 --- a/web/components/Notifications.tsx +++ b/web/components/Notifications.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo } from 'react' -import { Button, Chip, PopUp, PopUpContext, PopUpOpener, PopUpRoot, Tooltip, useLocalStorage, Visibility } from '@helpwave/hightide' +import { Button, Chip, IconButton, PopUp, PopUpContext, PopUpOpener, PopUpRoot, useStorage, Visibility } from '@helpwave/hightide' import { Bell } from 'lucide-react' import { useOverviewData } from '@/data' import { useTasksTranslation } from '@/i18n/useTasksTranslation' @@ -26,12 +26,12 @@ export const Notifications = () => { const { value: readNotificationsRaw, setValue: setReadNotificationsRaw - } = useLocalStorage('read-notifications', []) + } = useStorage({ key: 'read-notifications', defaultValue: [] }) const { value: dismissedNotificationsRaw, setValue: setDismissedNotificationsRaw - } = useLocalStorage('dismissed-notifications', []) + } = useStorage({ key: 'dismissed-notifications', defaultValue: [] }) const readNotifications = useMemo(() => { return new Set(readNotificationsRaw || []) @@ -131,29 +131,23 @@ export const Notifications = () => { return ( - - {({ isOpen }) => ( - - - {({ props }) => ( - - )} - - + + {({ props }) => ( + + + {unreadCount > 0 && ( + + {unreadCount > 9 ? '9+' : unreadCount} + + )} + )} - + { const { value: lastTimeStagingDisclaimerDismissed, setValue: setLastTimeStagingDisclaimerDismissed - } = useLocalStorage('staging-disclaimer-dismissed-time', 0) + } = useStorage({ key: 'staging-disclaimer-dismissed-time', defaultValue: 0 }) const dismissStagingDisclaimer = () => { setLastTimeStagingDisclaimerDismissed(new Date().getTime()) @@ -102,17 +103,17 @@ export const SurveyModal = () => { const { value: onboardingSurveyCompleted, setValue: setOnboardingSurveyCompleted - } = useLocalStorage('onboarding-survey-completed', 0) + } = useStorage({ key: 'onboarding-survey-completed', defaultValue: 0 }) const { value: weeklySurveyLastCompleted, setValue: setWeeklySurveyLastCompleted - } = useLocalStorage('weekly-survey-last-completed', 0) + } = useStorage({ key: 'weekly-survey-last-completed', defaultValue: 0 }) const { value: surveyLastDismissed, setValue: setSurveyLastDismissed - } = useLocalStorage('survey-last-dismissed', 0) + } = useStorage({ key: 'survey-last-dismissed', defaultValue: 0 }) useEffect(() => { if (!config.onboardingSurveyUrl && !config.weeklySurveyUrl) { @@ -333,33 +334,38 @@ export const Header = ({ onMenuClick, isMenuOpen, ...props }: HeaderProps) => { )} >
- +
- - - - - - + setIsFeedbackOpen(true)} + > + + + router.push('/settings')} + > + + +
diff --git a/web/components/locations/LocationSelectionDialog.tsx b/web/components/locations/LocationSelectionDialog.tsx index bc18629..ec00d56 100644 --- a/web/components/locations/LocationSelectionDialog.tsx +++ b/web/components/locations/LocationSelectionDialog.tsx @@ -5,7 +5,8 @@ import { Checkbox, Button, SearchBar, - useLocalStorage + useStorage, + IconButton } from '@helpwave/hightide' import { useTasksTranslation } from '@/i18n/useTasksTranslation' import type { LocationNodeType } from '@/api/gql/generated' @@ -148,14 +149,15 @@ const LocationTreeItem = ({ return (
{ + onExpandedChange={(isOpen) => { onExpandToggle(node.id, isOpen) }} className="!shadow-none !bg-transparent !rounded-none w-full" - headerClassName="px-2 hover:bg-surface-hover rounded-lg transition-colors !text-text-primary hover:!text-text-primary flex-row-reverse justify-end cursor-pointer" + triggerProps={{ + className: 'px-2 hover:bg-surface-hover rounded-lg transition-colors !text-text-primary hover:!text-text-primary flex-row-reverse justify-end cursor-pointer' + }} contentExpandedClassName="!max-h-none !h-auto !min-h-0 !overflow-visible !flex !flex-col px-1 data-[expanded]:py-2 border-l-2 border-divider ml-5 pl-2 pr-0 mt-1" >
@@ -194,12 +196,12 @@ export const LocationSelectionDialog = ({ const { value: storedExpandedIds, setValue: setStoredExpandedIds - } = useLocalStorage(storageKey, []) + } = useStorage({ key: storageKey, defaultValue: [] }) const { value: storedTreeSignature, setValue: setStoredTreeSignature - } = useLocalStorage(signatureKey, '') + } = useStorage({ key: signatureKey, defaultValue: '' }) const [selectedIds, setSelectedIds] = useState>(new Set(initialSelectedIds)) const [expandedIds, setExpandedIds] = useState>(new Set()) @@ -481,22 +483,22 @@ export const LocationSelectionDialog = ({
- - +
{multiSelect && useCase !== 'root' && (
- - +
)}
diff --git a/web/components/patients/PatientDataEditor.tsx b/web/components/patients/PatientDataEditor.tsx index c13119d..b6d5351 100644 --- a/web/components/patients/PatientDataEditor.tsx +++ b/web/components/patients/PatientDataEditor.tsx @@ -1,6 +1,6 @@ import { useState, useMemo, useEffect } from 'react' import type { FormFieldDataHandling } from '@helpwave/hightide' -import { FormProvider, Input, DateTimeInput, Select, SelectOption, Textarea, Checkbox, Button, ConfirmDialog, LoadingContainer, useCreateForm, FormField, Visibility, useFormObserverKey } from '@helpwave/hightide' +import { FormProvider, Input, DateTimeInput, Select, SelectOption, Textarea, Checkbox, Button, ConfirmDialog, LoadingContainer, useCreateForm, FormField, Visibility, useFormObserverKey, IconButton } from '@helpwave/hightide' import { CenteredLoadingLogo } from '@/components/CenteredLoadingLogo' import { useTasksTranslation } from '@/i18n/useTasksTranslation' import type { CreatePatientInput, LocationNodeType, UpdatePatientInput, GetPatientQuery } from '@/api/gql/generated' @@ -275,13 +275,13 @@ export const PatientDataEditor = ({ return ( <> {isRefreshing && ( -
+
- {translation('refreshing')} + {translation('refreshing')}
)} -
{event.preventDefault(); form.submit() }} className="flex-col-4"> + {event.preventDefault(); form.submit() }} className="flex-col-6 pb-16 overflow-y-auto px-2 pt-4">
name="firstname" @@ -377,7 +377,9 @@ export const PatientDataEditor = ({ onValueChange(value ? PatientState.Wait : PatientState.Admitted)} + onValueChange={(value) => { + onValueChange(value ? PatientState.Wait : PatientState.Admitted)} + } onEditComplete={(value) => onEditComplete(value ? PatientState.Wait : PatientState.Admitted)} /> {translation('waitingForPatient')} @@ -446,25 +448,23 @@ export const PatientDataEditor = ({ className="flex-grow cursor-pointer" onClick={() => setIsClinicDialogOpen(true)} /> - + {value && !isEditMode && ( - + )}
@@ -486,25 +486,23 @@ export const PatientDataEditor = ({ className="flex-grow cursor-pointer" onClick={() => setIsPositionDialogOpen(true)} /> - + {value && ( - + )} @@ -528,25 +526,24 @@ export const PatientDataEditor = ({ className="flex-grow cursor-pointer" onClick={() => setIsTeamsDialogOpen(true)} /> - + {value && value.length > 0 && ( - + )} diff --git a/web/components/patients/PatientDetailView.tsx b/web/components/patients/PatientDetailView.tsx index b78f4b6..97292ca 100644 --- a/web/components/patients/PatientDetailView.tsx +++ b/web/components/patients/PatientDetailView.tsx @@ -160,7 +160,7 @@ export const PatientDetailView = ({ {taskStats.totalTasks > 0 && (
@@ -182,18 +182,18 @@ export const PatientDetailView = ({ )} - {isEditMode && patientId && ( - + + {patientId && ( - - )} + )} + - {isEditMode && hasAvailableProperties && patientId && ( - + + {patientId && ( - - )} + )} + - + - {isEditMode && patientId && ( - + + {patientId && ( - - )} + )} +
) diff --git a/web/components/tables/PatientList.tsx b/web/components/tables/PatientList.tsx index 4635a28..53bd725 100644 --- a/web/components/tables/PatientList.tsx +++ b/web/components/tables/PatientList.tsx @@ -1,5 +1,5 @@ import { useMemo, useState, forwardRef, useImperativeHandle, useEffect, useCallback } from 'react' -import { Chip, FillerCell, Button, HelpwaveLogo, LoadingContainer, SearchBar, ProgressIndicator, Tooltip, Drawer, TableProvider, TableDisplay, TableColumnSwitcher } from '@helpwave/hightide' +import { Chip, FillerCell, HelpwaveLogo, LoadingContainer, SearchBar, ProgressIndicator, Tooltip, Drawer, TableProvider, TableDisplay, TableColumnSwitcher, IconButton } from '@helpwave/hightide' import { PlusIcon } from 'lucide-react' import { Sex, PatientState, type GetPatientsQuery, type TaskType, PropertyEntity, type FullTextSearchInput, type LocationType } from '@/api/gql/generated' import { usePropertyDefinitions, usePatientsPaginated, useRefreshingEntityIds } from '@/data' @@ -189,7 +189,7 @@ export const PatientList = forwardRef(({ initi minSize: 120, size: 144, maxSize: 180, - filterFn: 'tags', + filterFn: 'singleTag', meta: { filterData: { tags: allPatientStates.map(state => ({ label: translation('patientState', { state: state as string }), tag: state })), @@ -229,7 +229,7 @@ export const PatientList = forwardRef(({ initi minSize: 160, size: 160, maxSize: 200, - filterFn: 'tags', + filterFn: 'singleTag', meta: { filterData: { tags: [ @@ -301,7 +301,7 @@ export const PatientList = forwardRef(({ initi return (
@@ -362,17 +362,16 @@ export const PatientList = forwardRef(({ initi
- - - + { + setSelectedPatient(undefined) + setIsPanelOpen(true) + }} + color="primary" + > + +
diff --git a/web/components/tables/TaskList.tsx b/web/components/tables/TaskList.tsx index 7b111b5..c1c0f8a 100644 --- a/web/components/tables/TaskList.tsx +++ b/web/components/tables/TaskList.tsx @@ -1,6 +1,6 @@ import { useMemo, useState, forwardRef, useImperativeHandle, useEffect, useRef, useCallback } from 'react' import { useQueryClient } from '@tanstack/react-query' -import { Button, Checkbox, ConfirmDialog, FillerCell, HelpwaveLogo, LoadingContainer, SearchBar, Select, SelectOption, TableColumnSwitcher, TableDisplay, TableProvider, Tooltip } from '@helpwave/hightide' +import { Button, Checkbox, ConfirmDialog, FillerCell, HelpwaveLogo, IconButton, LoadingContainer, SearchBar, Select, SelectOption, TableColumnSwitcher, TableDisplay, TableProvider } from '@helpwave/hightide' import { PlusIcon, UserCheck, Users } from 'lucide-react' import type { TaskPriority, GetTasksQuery } from '@/api/gql/generated' import { PropertyEntity } from '@/api/gql/generated' @@ -551,11 +551,11 @@ export const TaskList = forwardRef(({ tasks: initial value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} onSearch={() => null} - containerProps={{ className: 'max-w-80 h-10' }} + containerProps={{ className: 'max-w-80' }} />
-
+