Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove app folder #48

Merged
merged 4 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Engage-HF</title>
<link rel="icon" href="/favicon.ico" type="image/ico">
<title>ENGAGE-HF</title>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion modules/firebase/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import { redirect } from '@tanstack/react-router'
import { connectAuthEmulator, getAuth, OAuthProvider } from 'firebase/auth'
import { connectFirestoreEmulator, getFirestore } from 'firebase/firestore'
import { queryClient } from '@/app/ReactQueryClientProvider'
import { env } from '@/env'
import { firebaseConfig } from '@/modules/firebase/config'
import {
Expand All @@ -21,6 +20,7 @@
getDocDataOrThrow,
getDocumentsRefs,
} from '@/modules/firebase/utils'
import { queryClient } from '@/modules/query/queryClient'

Check warning on line 23 in modules/firebase/app.ts

View check run for this annotation

Codecov / codecov/patch

modules/firebase/app.ts#L23

Added line #L23 was not covered by tests

const firebaseApp = initializeApp(firebaseConfig)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@
//
// SPDX-License-Identifier: MIT
//
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { QueryClientProvider } from '@tanstack/react-query'

Check warning on line 8 in modules/query/ReactQueryClientProvider.tsx

View check run for this annotation

Codecov / codecov/patch

modules/query/ReactQueryClientProvider.tsx#L8

Added line #L8 was not covered by tests
import { type ReactNode } from 'react'
import { queryClient } from '@/modules/query/queryClient'

Check warning on line 10 in modules/query/ReactQueryClientProvider.tsx

View check run for this annotation

Codecov / codecov/patch

modules/query/ReactQueryClientProvider.tsx#L10

Added line #L10 was not covered by tests

interface ReactQueryClientProviderProps {
children: ReactNode
}

export const queryClient = new QueryClient({
defaultOptions: {
queries: { retry: false },
},
})

export const ReactQueryClientProvider = ({
children,
}: ReactQueryClientProviderProps) => (
Expand Down
14 changes: 14 additions & 0 deletions modules/query/queryClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// This source file is part of the Stanford Biodesign Digital Health ENGAGE-HF open-source project
//
// SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//
import { QueryClient } from '@tanstack/react-query'

Check warning on line 8 in modules/query/queryClient.ts

View check run for this annotation

Codecov / codecov/patch

modules/query/queryClient.ts#L8

Added line #L8 was not covered by tests

export const queryClient = new QueryClient({
defaultOptions: {
queries: { retry: false },
},
})

Check warning on line 14 in modules/query/queryClient.ts

View check run for this annotation

Codecov / codecov/patch

modules/query/queryClient.ts#L10-L14

Added lines #L10 - L14 were not covered by tests
2 changes: 1 addition & 1 deletion modules/user/queries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { UserType } from '@stanfordbdhg/engagehf-models'
import { queryOptions } from '@tanstack/react-query'
import { query, where } from 'firebase/firestore'
import { queryClient } from '@/app/ReactQueryClientProvider'
import { docRefs, getCurrentUser, refs } from '@/modules/firebase/app'
import { type Invitation, type Organization } from '@/modules/firebase/models'
import { mapAuthData } from '@/modules/firebase/user'
Expand All @@ -18,6 +17,7 @@
getDocsData,
type UserAuthenticationInformation,
} from '@/modules/firebase/utils'
import { queryClient } from '@/modules/query/queryClient'

Check warning on line 20 in modules/user/queries.tsx

View check run for this annotation

Codecov / codecov/patch

modules/user/queries.tsx#L20

Added line #L20 was not covered by tests

export const getNonAdminInvitations = (organizationIds: string[]) =>
query(
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions routes/~__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
//
// SPDX-License-Identifier: MIT
//
import '../app/globals.css'
import '../modules/globals.css'

Check warning on line 8 in routes/~__root.tsx

View check run for this annotation

Codecov / codecov/patch

routes/~__root.tsx#L8

Added line #L8 was not covered by tests
import { createRootRoute, Outlet, redirect } from '@tanstack/react-router'
import { NextIntlClientProvider } from 'next-intl'
import { useLayoutEffect } from 'react'
import { ReactQueryClientProvider } from '@/app/ReactQueryClientProvider'
import { auth } from '@/modules/firebase/app'
import { AuthProvider } from '@/modules/firebase/AuthProvider'
import messages from '@/modules/messages/translations/en.json'
import { ReactQueryClientProvider } from '@/modules/query/ReactQueryClientProvider'

Check warning on line 15 in routes/~__root.tsx

View check run for this annotation

Codecov / codecov/patch

routes/~__root.tsx#L15

Added line #L15 was not covered by tests
import { routes } from '@/modules/routes'
import { lightTheme } from '@/packages/design-system/src'
import { Toaster } from '@/packages/design-system/src/components/Toaster'
Expand Down
2 changes: 1 addition & 1 deletion routes/~_dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-License-Identifier: MIT
//
import { createFileRoute } from '@tanstack/react-router'
import { queryClient } from '@/app/ReactQueryClientProvider'
import { currentUserQueryOptions } from '@/modules/firebase/UserProvider'
import { queryClient } from '@/modules/query/queryClient'

Check warning on line 10 in routes/~_dashboard.tsx

View check run for this annotation

Codecov / codecov/patch

routes/~_dashboard.tsx#L10

Added line #L10 was not covered by tests

export const Route = createFileRoute('/_dashboard')({
loader: () => queryClient.ensureQueryData(currentUserQueryOptions()),
Expand Down
2 changes: 1 addition & 1 deletion routes/~_dashboard/~patients/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
} from '@stanfordbdhg/engagehf-models'
import { groupBy } from 'es-toolkit'
import { query, where } from 'firebase/firestore'
import { queryClient } from '@/app/ReactQueryClientProvider'
import { AllergyType } from '@/modules/firebase/allergy'
import { getCurrentUser, refs } from '@/modules/firebase/app'
import { type FHIRAllergyIntolerance } from '@/modules/firebase/models'
Expand All @@ -23,6 +22,7 @@
ObservationType,
type ResourceType,
} from '@/modules/firebase/utils'
import { queryClient } from '@/modules/query/queryClient'

Check warning on line 25 in routes/~_dashboard/~patients/utils.ts

View check run for this annotation

Codecov / codecov/patch

routes/~_dashboard/~patients/utils.ts#L25

Added line #L25 was not covered by tests
import { userOrganizationQueryOptions } from '@/modules/user/queries'

const getUserClinicians = async () => {
Expand Down
2 changes: 1 addition & 1 deletion routes/~_dashboard/~users/~$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import { UserType } from '@stanfordbdhg/engagehf-models'
import { createFileRoute, notFound, useRouter } from '@tanstack/react-router'
import { Users } from 'lucide-react'
import { queryClient } from '@/app/ReactQueryClientProvider'
import { callables, docRefs, ensureType } from '@/modules/firebase/app'
import { getDocDataOrThrow } from '@/modules/firebase/utils'
import { queryClient } from '@/modules/query/queryClient'

Check warning on line 14 in routes/~_dashboard/~users/~$id.tsx

View check run for this annotation

Codecov / codecov/patch

routes/~_dashboard/~users/~$id.tsx#L14

Added line #L14 was not covered by tests
import {
getUserData,
userOrganizationQueryOptions,
Expand Down
2 changes: 1 addition & 1 deletion routes/~_dashboard/~users/~invite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import { UserType } from '@stanfordbdhg/engagehf-models'
import { createFileRoute, useNavigate } from '@tanstack/react-router'
import { Users } from 'lucide-react'
import { queryClient } from '@/app/ReactQueryClientProvider'
import { callables, ensureType } from '@/modules/firebase/app'
import { queryClient } from '@/modules/query/queryClient'

Check warning on line 12 in routes/~_dashboard/~users/~invite.tsx

View check run for this annotation

Codecov / codecov/patch

routes/~_dashboard/~users/~invite.tsx#L12

Added line #L12 was not covered by tests
import { routes } from '@/modules/routes'
import { userOrganizationQueryOptions } from '@/modules/user/queries'
import { PageTitle } from '@/packages/design-system/src/molecules/DashboardLayout'
Expand Down
Loading