Skip to content

Commit

Permalink
Merge branch 'dev' into l10n_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Apr 3, 2024
2 parents 671767c + 95a2e05 commit bf44fff
Show file tree
Hide file tree
Showing 101 changed files with 4,598 additions and 2,117 deletions.
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"packageRules": [
{
"groupName": "patched packages",
"matchPackageNames": ["@crowdin/ota-client", "trpc-panel", "msw-storybook-addon"],
"matchPackageNames": ["@crowdin/ota-client", "trpc-panel", "msw-storybook-addon", "json-schema-to-zod"],
"matchUpdateTypes": ["major", "minor", "patch"]
},
{
Expand Down
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

7 changes: 7 additions & 0 deletions InReach.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"figma.figma-vscode-extension",
"yoavbls.pretty-ts-errors",
"quick-lint.quick-lint-js",
"sonarsource.sonarlint-vscode",
],
},
"folders": [
Expand Down Expand Up @@ -224,6 +225,12 @@
"typescript.tsdk": "✨ InReach (root)/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.workspaceSymbols.scope": "allOpenProjects",
"sonarlint.connectedMode.project": {
"connectionId": "inreach",
"projectKey": "weareinreach_InReach",
},
"sonarlint.output.showAnalyzerLogs": true,
"sonarlint.output.showVerboseLogs": false,
},
"launch": {
"configurations": [
Expand Down
6 changes: 0 additions & 6 deletions apps/app/.vscode/settings.json

This file was deleted.

10 changes: 6 additions & 4 deletions apps/app/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { type AppProps, type NextWebVitalsMetric } from 'next/app'
import dynamic from 'next/dynamic'
import Head from 'next/head'
import { useRouter } from 'next/router'
import Script from 'next/script'
// import Script from 'next/script'
import { type Session } from 'next-auth'
import { appWithTranslation } from 'next-i18next'
import { DefaultSeo, type DefaultSeoProps } from 'next-seo'
Expand Down Expand Up @@ -52,7 +52,7 @@ export function reportWebVitals(stats: NextWebVitalsMetric) {
appEvent.webVitals(stats)
}

const PageContent = ({ Component, ...pageProps }: AppPropsWithGridSwitch) => {
const PageContent = ({ Component, pageProps }: AppPropsWithGridSwitch) => {
const router = useRouter()
const autoResetState = Component.autoResetState ? { key: router.asPath } : {}
return Component.omitGrid ? (
Expand All @@ -78,11 +78,13 @@ const MyApp = (appProps: AppPropsWithGridSwitch) => {
<Providers session={session}>
<DefaultSeo {...defaultSEO} />
<GoogleAnalytics trackPageViews defaultConsent='granted' />
<Script id='gtm_conversion'>
{/* <Script id='gtm_conversion'>
{`
if (window.gtag) {
gtag?.('config','G-RL8CR7T4EP')
}
`}
</Script>
</Script> */}
<PageLoadProgress />
<Navbar />
<PageContent {...appProps} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { DevTool } from '@hookform/devtools'
import { createStyles, Grid, Stack, Tabs, Title } from '@mantine/core'
import { compareArrayVals } from 'crud-object-diff'
import { type InferGetServerSidePropsType, type NextPage } from 'next'
Expand Down Expand Up @@ -131,11 +130,12 @@ const OrgLocationPage: NextPage<InferGetServerSidePropsType<typeof getServerSide
option: 'back',
backTo: 'dynamicText',
backToText: data.organization.name,
onClick: () =>
onClick: async () => {
router.push({
pathname: '/org/[slug]/edit',
query: { slug: data.organization.slug },
}),
})
},
}}
organizationId={data.organization.id}
saved={Boolean(isSaved)}
Expand Down Expand Up @@ -193,19 +193,19 @@ const OrgLocationPage: NextPage<InferGetServerSidePropsType<typeof getServerSide
</Tabs.List>
<Stack spacing={40} pt={40}>
<Stack spacing={20} ref={servicesRef}>
<Stack spacing={8}>
<Title order={3}>{'Associated services'}</Title>
<ServicesInfoCard parentId={data.id} />
</Stack>
<Stack spacing={8}>
<Title order={3}>{'Associate service(s) to this location'}</Title>
<MultiSelectPopover
{/*<MultiSelectPopover
label='Services available'
data={orgServices}
control={formMethods.control}
name='services'
indicateWhenDirty
/>
</Stack>
<Stack spacing={8}>
<Title order={3}>{'Associated services'}</Title>
<ServicesInfoCard parentId={data.id} />
/>*/}
</Stack>
</Stack>
<div ref={photosRef}>
Expand All @@ -224,7 +224,6 @@ const OrgLocationPage: NextPage<InferGetServerSidePropsType<typeof getServerSide
<VisitCard locationId={data.id} edit />
</Stack>
</Grid.Col>
<DevTool control={formMethods.control} />
</FormProvider>
</>
)
Expand All @@ -247,30 +246,34 @@ export const getServerSideProps = async ({
if (!session) {
return {
redirect: {
destination: '/',
destination: `/org/${slug}/${id}`,
permanent: false,
},
}
}
const ssg = await trpcServerClient({ session })
const { id: orgId } = await ssg.organization.getIdFromSlug.fetch({ slug })
const [i18n] = await Promise.all([
const [i18n] = await Promise.allSettled([
getServerSideTranslations(locale, [
'common',
'services',
'attribute',
'phone-type',
'country',
'gov-dist',
orgId,
]),
ssg.location.forLocationPageEdits.prefetch({ id }),
ssg.location.getAlerts.prefetch({ id }),
])

const translations = i18n.status === 'fulfilled' ? i18n.value : {}

const props = {
organizationId: orgId,
session,
trpcState: ssg.dehydrate(),
...i18n,
...translations,
}

return {
Expand Down
Loading

0 comments on commit bf44fff

Please sign in to comment.