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

feat: Service Edits #1097

Merged
merged 142 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
92ca81a
fix ts errors
JoeKarow Feb 13, 2024
98ef104
go to service edit page in edit mode
JoeKarow Feb 13, 2024
26537b4
group with other basic components
JoeKarow Feb 13, 2024
94b160e
tweaks from convo with Josh
JoeKarow Feb 13, 2024
f4c311c
update service edit drawer to use RHF
JoeKarow Feb 13, 2024
abc3fb4
convert AttributeModal to RHF
JoeKarow Feb 13, 2024
25a6a72
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 14, 2024
6f85899
attribute supplement schemas
JoeKarow Feb 14, 2024
3b2e391
schema updates
JoeKarow Feb 14, 2024
df85373
dynamic fields
JoeKarow Feb 14, 2024
4af375d
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 14, 2024
c86c218
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 14, 2024
4898b47
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 15, 2024
a411387
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 15, 2024
0d98a52
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 15, 2024
ab2ac40
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 15, 2024
39c28a3
update i18n generation
JoeKarow Feb 15, 2024
3bac477
update schema & migrations
JoeKarow Feb 15, 2024
ad8d544
update api
JoeKarow Feb 15, 2024
baf803a
Attribute modal
JoeKarow Feb 15, 2024
cec1366
update handler cache
JoeKarow Feb 15, 2024
51b393f
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Feb 15, 2024
c179641
fix linting errors
JoeKarow Feb 15, 2024
2fe017d
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 16, 2024
d7ac50a
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 16, 2024
7fa5892
alter view
JoeKarow Feb 16, 2024
c2f3f5a
supplement handling
JoeKarow Feb 16, 2024
4c296bd
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
a9b41ee
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
8430e69
uncomment criteria
JoeKarow Feb 20, 2024
a62a6bb
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
bf0b40d
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
92a599a
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
b1886dd
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
0993db9
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
5781aae
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
c991410
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 20, 2024
e59f381
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 21, 2024
518ab4c
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 23, 2024
a95572c
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Feb 26, 2024
f564b1c
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 27, 2024
4ba39c9
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 27, 2024
84fc7e5
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 27, 2024
f6bc0c0
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 27, 2024
2f0104f
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Feb 27, 2024
cfae4bf
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Mar 6, 2024
b4f55e3
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Mar 6, 2024
c6cc4eb
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 7, 2024
2f7e217
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 7, 2024
6b47e82
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 7, 2024
4892210
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 7, 2024
8399d52
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 7, 2024
7ff7d98
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 7, 2024
16ad7e0
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 7, 2024
9f600b1
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 12, 2024
aa33968
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 12, 2024
736431e
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 12, 2024
5bd0b16
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 12, 2024
6258290
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 12, 2024
da1a6f7
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Mar 12, 2024
40e2ebd
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 13, 2024
93b5586
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 13, 2024
e41abf4
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 13, 2024
74fa2cf
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 15, 2024
5db767d
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 15, 2024
e25be7b
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 18, 2024
6306831
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 18, 2024
d4a65b2
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 18, 2024
2fb80c2
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 18, 2024
b815800
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 18, 2024
4e8d756
update mock data
JoeKarow Mar 18, 2024
acc8dcc
update msw worker, clean up common schema files
JoeKarow Mar 18, 2024
0ab69aa
update handler
JoeKarow Mar 18, 2024
d2d0cf3
add submit handler, update schema
JoeKarow Mar 18, 2024
74647cd
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Mar 18, 2024
7439194
use Section.* components
JoeKarow Mar 19, 2024
c40ea99
add sections
JoeKarow Mar 19, 2024
8389bda
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 19, 2024
bb8353b
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 19, 2024
df8deb4
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 19, 2024
b1c3edb
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 19, 2024
cdb43a9
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Mar 20, 2024
78732cb
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 20, 2024
2b6602e
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 20, 2024
d4d2a56
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 20, 2024
209219e
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 21, 2024
612bc21
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 21, 2024
0f1afe6
patch for z.never()
JoeKarow Mar 21, 2024
3336155
schema update
JoeKarow Mar 21, 2024
a7a2105
break in to pieces
JoeKarow Mar 21, 2024
946363d
add i18next as peerdep
JoeKarow Mar 21, 2024
368212f
enable new turbo ui
JoeKarow Mar 21, 2024
92c4586
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 22, 2024
f0a70dc
sonarcloud workspace binding
JoeKarow Mar 22, 2024
5d2fcef
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Mar 22, 2024
b8d5ef1
service attribute processing
JoeKarow Mar 25, 2024
cb7a6f0
update criteria
JoeKarow Mar 25, 2024
016822c
extract processing to separate fns
JoeKarow Mar 25, 2024
9a84bcc
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 25, 2024
4ead6ee
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 25, 2024
369df9e
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 25, 2024
c07a29e
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 25, 2024
8dab64d
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 26, 2024
818e310
Merge branch 'dev' into IN-945-service-edit-page
JoeKarow Mar 26, 2024
925b8c6
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 26, 2024
1e99747
unify service attrib select criteria, update api & mock data
JoeKarow Mar 27, 2024
03a07a0
allow passed data, widen param type
JoeKarow Mar 27, 2024
3f274e6
display data
JoeKarow Mar 27, 2024
79584de
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 28, 2024
ab73d15
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 28, 2024
f2d8b1a
implement Add Attribute modal
JoeKarow Mar 28, 2024
925dc17
fix useRouter import
JoeKarow Mar 28, 2024
a3ff546
launch service drawer
JoeKarow Mar 28, 2024
f269cd7
remove data viewer
JoeKarow Mar 28, 2024
41a7b2e
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 28, 2024
654f246
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Mar 29, 2024
d5e9683
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Apr 1, 2024
9588eae
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Apr 1, 2024
83b27d9
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Apr 2, 2024
a480cca
temp disable gtag addition
JoeKarow Apr 2, 2024
d0e570f
`slug` isn't being passed to page props??
JoeKarow Apr 2, 2024
b86ba23
temp remove service multi select popover
JoeKarow Apr 2, 2024
b2d065a
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Apr 2, 2024
7c1137b
revert paths
JoeKarow Apr 2, 2024
dddc731
fix PageContent props
JoeKarow Apr 2, 2024
1a80bcb
fix group spacing
JoeKarow Apr 2, 2024
4e8860c
Add Coverage modal
JoeKarow Apr 2, 2024
ea43160
remove placeholder
JoeKarow Apr 2, 2024
8b3abfc
styling
JoeKarow Apr 2, 2024
761d57b
api routes & mock data
JoeKarow Apr 2, 2024
1321b62
service edit drawer work
JoeKarow Apr 2, 2024
183a602
cleanup console.log
JoeKarow Apr 2, 2024
7136550
Merge branch 'dev' into IN-945-service-edit-page
kodiakhq[bot] Apr 3, 2024
87f36bc
update attribute schemas
JoeKarow Apr 3, 2024
aef1312
remove devtool
JoeKarow Apr 3, 2024
df5d9b5
misc cleanup
JoeKarow Apr 3, 2024
507a096
sonarlint config
JoeKarow Apr 3, 2024
20cd842
cleanup
JoeKarow Apr 3, 2024
4b8a410
fix schema
JoeKarow Apr 3, 2024
965d282
fix sonarlint issues
JoeKarow Apr 3, 2024
5f3a7be
add sonarlint recommendation
JoeKarow Apr 3, 2024
f4aeb24
fix sonar/deepsource issues
JoeKarow Apr 3, 2024
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
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
Loading