Skip to content

Commit e70d2d7

Browse files
authored
feat: only show the active organization (#1235)
1 parent 236a966 commit e70d2d7

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

tasks/components/layout/OrganizationDisplay.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { useOrganizationsForUserQuery } from '@helpwave/api-services/mutations/u
88
import type { OrganizationDTO } from '@helpwave/api-services/types/users/organizations'
99
import { ColumnTitle } from '../ColumnTitle'
1010
import { OrganizationCard } from '../cards/OrganizationCard'
11-
import { AddCard } from '../cards/AddCard'
1211
import { OrganizationContext } from '@/pages/organizations'
1312
import clsx from 'clsx'
1413

@@ -50,7 +49,9 @@ export const OrganizationDisplay = ({
5049
const { organizations: tokenOrganizations } = useAuth()
5150
const { fakeTokenEnable } = getAPIServiceConfig()
5251

53-
usedOrganizations = usedOrganizations.filter((organization) => fakeTokenEnable || tokenOrganizations.includes(organization.id))
52+
usedOrganizations = usedOrganizations
53+
.filter((organization) => fakeTokenEnable || tokenOrganizations.includes(organization.id))
54+
.filter((organization) => tokenOrganizations.includes(organization.id))
5455

5556
const usedSelectedId = selectedOrganizationId ?? context.state.organizationId
5657
return (
@@ -68,11 +69,15 @@ export const OrganizationDisplay = ({
6869
}}
6970
/>
7071
))}
71-
<AddCard
72-
text={translation.addOrganization}
73-
onClick={() => context.updateContext({ ...context.state, organizationId: '' })}
74-
className={clsx('h-full', { 'border-primary border-solid': usedSelectedId === '' })}
75-
/>
72+
{
73+
/* Show again when multi organization should be re-enabled
74+
<AddCard
75+
text={translation.addOrganization}
76+
onClick={() => context.updateContext({ ...context.state, organizationId: '' })}
77+
className={clsx('h-full', { 'border-primary border-solid': usedSelectedId === '' })}
78+
/>
79+
*/
80+
}
7681
</div>
7782
</div>
7883
)

tasks/components/layout/PageWithHeader.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { BreadCrumb } from '@helpwave/hightide'
55
import { useAuth } from '@helpwave/api-services/authentication/useAuth'
66
import { UserMenu } from '@/components/UserMenu'
77
import { Header, type HeaderProps } from '@/components/Header'
8-
import { FeedbackButton } from '@/components/FeedbackButton'
98

109
type PageWithHeaderProps = Partial<HeaderProps> & {
1110
crumbs?: Crumb[],
@@ -24,7 +23,7 @@ export const PageWithHeader = ({
2423
rightSide,
2524
crumbs
2625
}: PropsWithChildren<PageWithHeaderProps>) => {
27-
const { user, redirectUserToOrganizationSelection } = useAuth()
26+
const { user } = useAuth()
2827

2928
if (!user) return null
3029

@@ -38,12 +37,6 @@ export const PageWithHeader = ({
3837
leftSideClassName="max-tablet:hidden"
3938
rightSide={[
4039
...(rightSide ?? []),
41-
(<FeedbackButton key="feedback"/>),
42-
(
43-
<button key="organization" onClick={() => redirectUserToOrganizationSelection()}>
44-
{user?.organization?.name}
45-
</button>
46-
),
4740
(<UserMenu key="usermenu"/>),
4841
]}
4942
/>

tasks/pages/ward/[wardId].tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ export const WardOverviewContext = createContext<WardOverviewContextType>({
8484

8585
const WardOverview: NextPage = ({ overwriteTranslation }: PropsForTranslation<WardOverviewTranslation>) => {
8686
const translation = useTranslation(defaultWardOverviewTranslation, overwriteTranslation)
87+
88+
89+
8790
// TODO: could we differentiate between the two using two different states?
8891
const [draggedPatient, setDraggedPatient] = useState<{
8992
patient?: PatientMinimalDTO,

0 commit comments

Comments
 (0)