Skip to content

Commit

Permalink
Merge branch 'dev' into IN-920-update-crowdin
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Apr 24, 2024
2 parents 427d210 + 29b4663 commit 5d579b8
Show file tree
Hide file tree
Showing 203 changed files with 226 additions and 286 deletions.
1 change: 1 addition & 0 deletions apps/app/.eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.spec.ts
webpack-stats.json
2 changes: 2 additions & 0 deletions apps/app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ yarn-error.log*

# Sentry Auth Token
.sentryclirc

webpack-stats.json
1 change: 1 addition & 0 deletions apps/app/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ pnpm-lock.yaml
.DS_Store
.eslintignore
.trace/*.json
webpack-stats.json
6 changes: 5 additions & 1 deletion apps/app/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ const nextConfig = {
config.plugins = [...config.plugins, new PrismaPlugin()]
}
if (!dev && !isServer) {
config.plugins.push(new RelativeCiAgentWebpackPlugin())
config.plugins.push(
new RelativeCiAgentWebpackPlugin({
stats: { excludeAssets: [/.*\/webpack-stats\.json/, /build-manifest\.json/] },
})
)
}
if (dev && !isServer) {
/** WDYR */
Expand Down
2 changes: 0 additions & 2 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"@types/node": "20.12.7",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
"@types/umami": "0.1.5",
"@typescript-eslint/eslint-plugin": "7.7.1",
"@typescript-eslint/parser": "7.7.1",
"@weareinreach/config": "workspace:*",
Expand All @@ -132,7 +131,6 @@
"i18next-hmr": "3.1.2",
"listr2": "8.2.1",
"prettier": "3.2.5",
"trpc-client-devtools-link": "0.2.1-next",
"trpc-panel": "1.3.4",
"trpc-playground": "1.0.4",
"type-fest": "4.16.0",
Expand Down
4 changes: 0 additions & 4 deletions apps/app/src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
} from '@trpc/client'
import { createTRPCNext } from '@trpc/next'
import { type inferRouterInputs, type inferRouterOutputs } from '@trpc/server'
import { devtoolsLink } from 'trpc-client-devtools-link'

import { type AppRouter } from '@weareinreach/api'
import { getEnv } from '@weareinreach/env'
Expand Down Expand Up @@ -34,9 +33,6 @@ export const api = createTRPCNext<AppRouter>({
links: [
...(isDev
? [
devtoolsLink({
enabled: isDev,
}),
loggerLink({
enabled: () => isDev,
}),
Expand Down
4 changes: 3 additions & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { type KnipConfig } from 'knip'

const config: KnipConfig = {}
const config: KnipConfig = {
ignore: ['./lambdas/*/dist/*'],
}
export default config
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
}
},
"overrides": {
"@tanstack/[email protected]": "@tanstack/[email protected]",
"better-sqlite3@<9": "^9.0.0",
"sourcemap-codec": "npm:@jridgewell/sourcemap-codec"
},
Expand Down
1 change: 0 additions & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"just-pascal-case": "3.2.0",
"next": "14.2.2",
"prettier": "3.2.5",
"trpc-client-devtools-link": "0.2.1-next",
"trpc-panel": "1.3.4",
"type-fest": "4.16.0",
"typescript": "5.4.5"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { prisma } from '@weareinreach/db'

export const getFilterOptions = async () => {
const getFilterOptions = async () => {
const result = await prisma.attribute.findMany({
where: {
AND: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/attribute/query.getOne.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TGetOneSchema } from './query.getOne.schema'

export const getOne = async ({ input }: TRPCHandlerParams<TGetOneSchema>) => {
const getOne = async ({ input }: TRPCHandlerParams<TGetOneSchema>) => {
const result = await prisma.attribute.findUniqueOrThrow({
where: input,
select: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/attribute/query.map.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { prisma } from '@weareinreach/db'
import { handleError } from '~api/lib/errorHandler'
import { type TRPCHandlerParams } from '~api/types/handler'

export const map = async ({ ctx: _ }: TRPCHandlerParams) => {
const map = async ({ ctx: _ }: TRPCHandlerParams) => {
try {
const result = await prisma.attribute.findMany({
where: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TAttributeEditWrapperSchema } from './mutation.AttributeEditWrapper.schema'

export const AttributeEditWrapper = async ({
const AttributeEditWrapper = async ({
ctx,
input,
}: TRPCHandlerParams<TAttributeEditWrapperSchema, 'protected'>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TEditModeBarDeleteSchema } from './mutation.EditModeBarDelete.schema'

export const EditModeBarDelete = async ({
const EditModeBarDelete = async ({
ctx,
input,
}: TRPCHandlerParams<TEditModeBarDeleteSchema, 'protected'>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TEditModeBarPublishSchema } from './mutation.EditModeBarPublish.schema'

export const EditModeBarPublish = async ({
const EditModeBarPublish = async ({
ctx,
input,
}: TRPCHandlerParams<TEditModeBarPublishSchema, 'protected'>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TEditModeBarReverifySchema } from './mutation.EditModeBarReverify.schema'

export const EditModeBarReverify = async ({
const EditModeBarReverify = async ({
ctx,
input,
}: TRPCHandlerParams<TEditModeBarReverifySchema, 'protected'>) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/component/query.EditModeBar.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TEditModeBarSchema } from './query.EditModeBar.schema'

export const EditModeBar = async ({ input }: TRPCHandlerParams<TEditModeBarSchema>) => {
const EditModeBar = async ({ input }: TRPCHandlerParams<TEditModeBarSchema>) => {
try {
const { orgLocationId, orgServiceId, slug } = input

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { prisma } from '@weareinreach/db'
import { handleError } from '~api/lib/errorHandler'
import { type TRPCHandlerParams } from '~api/types/handler'

export const ServiceSelect = async ({ ctx: _ctx }: TRPCHandlerParams) => {
const ServiceSelect = async ({ ctx: _ctx }: TRPCHandlerParams) => {
try {
const result = await prisma.serviceCategory.findMany({
where: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TServiceModalSchema } from './query.serviceModal.schema'

export const serviceModal = async ({ ctx, input }: TRPCHandlerParams<TServiceModalSchema>) => {
const serviceModal = async ({ ctx, input }: TRPCHandlerParams<TServiceModalSchema>) => {
try {
return null
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TAttributeCategoriesSchema } from './query.attributeCategories.schema'

export const attributeCategories = async ({ input }: TRPCHandlerParams<TAttributeCategoriesSchema>) => {
const attributeCategories = async ({ input }: TRPCHandlerParams<TAttributeCategoriesSchema>) => {
const results = await prisma.attributeCategory.findMany({
where: { active: true, ...(input?.length ? { tag: { in: input } } : {}) },
select: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const validateJsonSchema = (schema: unknown): schema is JSONSchemaType<unknown>
return false
}

export const attributesByCategory = async ({ input }: TRPCHandlerParams<TAttributesByCategorySchema>) => {
const attributesByCategory = async ({ input }: TRPCHandlerParams<TAttributesByCategorySchema>) => {
console.log(input)
const result = await prisma.attributesByCategory.findMany({
where: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/fieldOpt/query.ccaMap.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TCcaMapSchema } from './query.ccaMap.schema'

export const ccaMap = async ({ input }: TRPCHandlerParams<TCcaMapSchema>) => {
const ccaMap = async ({ input }: TRPCHandlerParams<TCcaMapSchema>) => {
try {
const data = await prisma.country.findMany({
where: input.activeForOrgs
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/fieldOpt/query.countries.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TCountriesSchema } from './query.countries.schema'

export const countries = async ({ input }: TRPCHandlerParams<TCountriesSchema>) => {
const countries = async ({ input }: TRPCHandlerParams<TCountriesSchema>) => {
const { where } = input ?? {}
const result = await prisma.country.findMany({
where,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { prisma } from '@weareinreach/db'

export const countryGovDistMap = async () => {
const countryGovDistMap = async () => {
const fields = { id: true, tsKey: true, tsNs: true }

const countries = await prisma.country.findMany({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TGetSubDistrictsSchema } from './query.getSubDistricts.schema'

export const getSubDistricts = async ({ input }: TRPCHandlerParams<TGetSubDistrictsSchema>) => {
const getSubDistricts = async ({ input }: TRPCHandlerParams<TGetSubDistrictsSchema>) => {
try {
const results = await prisma.govDist.findMany({
where: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/fieldOpt/query.govDists.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TGovDistsSchema } from './query.govDists.schema'

export const govDists = async ({ input }: TRPCHandlerParams<TGovDistsSchema>) => {
const govDists = async ({ input }: TRPCHandlerParams<TGovDistsSchema>) => {
try {
const results = await prisma.govDist.findMany({
where: input,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TGovDistsByCountrySchema } from './query.govDistsByCountry.schema'

export const govDistsByCountry = async ({ input }: TRPCHandlerParams<TGovDistsByCountrySchema>) => {
const govDistsByCountry = async ({ input }: TRPCHandlerParams<TGovDistsByCountrySchema>) => {
const data = await prisma.country.findMany({
where: {
cca2: input?.cca2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TGovDistsByCountryNoSubSchema } from './query.govDistsByCountryNoSub.schema'

export const govDistsByCountryNoSub = async ({ input }: TRPCHandlerParams<TGovDistsByCountryNoSubSchema>) => {
const govDistsByCountryNoSub = async ({ input }: TRPCHandlerParams<TGovDistsByCountryNoSubSchema>) => {
const data = await prisma.country.findMany({
where: {
cca2: input?.cca2,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/fieldOpt/query.languages.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TLanguagesSchema } from './query.languages.schema'

export const languages = async ({ input }: TRPCHandlerParams<TLanguagesSchema>) => {
const languages = async ({ input }: TRPCHandlerParams<TLanguagesSchema>) => {
const results = await prisma.language.findMany({
where: input,
select: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/fieldOpt/query.orgBadges.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TOrgBadgesSchema } from './query.orgBadges.schema'

export const orgBadges = async ({ input }: TRPCHandlerParams<TOrgBadgesSchema>) => {
const orgBadges = async ({ input }: TRPCHandlerParams<TOrgBadgesSchema>) => {
try {
const badges = await prisma.attribute.findMany({
where: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/fieldOpt/query.phoneTypes.handler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { prisma } from '@weareinreach/db'

export const phoneTypes = async () => {
const phoneTypes = async () => {
const result = await prisma.phoneType.findMany({
where: { active: true },
select: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/fieldOpt/query.userTitle.handler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { prisma } from '@weareinreach/db'

export const userTitle = async () => {
const userTitle = async () => {
const results = await prisma.userTitle.findMany({
where: { searchable: true },
select: { id: true, title: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/geo/query.autocomplete.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const getTypes = (input: TAutocompleteSchema): PlaceAutocompleteType => {
] as unknown as PlaceAutocompleteType
}

export const autocomplete = async ({ input }: TRPCHandlerParams<TAutocompleteSchema>) => {
const autocomplete = async ({ input }: TRPCHandlerParams<TAutocompleteSchema>) => {
const types = getTypes(input)

const { data } = await googleMapsApi.placeAutocomplete({
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/geo/query.geoByPlaceId.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TGeoByPlaceIdSchema } from './query.geoByPlaceId.schema'

export const geoByPlaceId = async ({ input }: TRPCHandlerParams<TGeoByPlaceIdSchema>) => {
const geoByPlaceId = async ({ input }: TRPCHandlerParams<TGeoByPlaceIdSchema>) => {
const { data } = await googleMapsApi.geocode({
params: {
key: process.env.GOOGLE_PLACES_API_KEY as string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TCreateSchema } from './mutation.create.schema'

export const create = async ({ ctx, input }: TRPCHandlerParams<TCreateSchema, 'protected'>) => {
const create = async ({ ctx, input }: TRPCHandlerParams<TCreateSchema, 'protected'>) => {
const prisma = getAuditedClient(ctx.actorId)
const { id } = await prisma.internalNote.create(input)

Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/internalNote/query.byId.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TByIdSchema } from './query.byId.schema'

export const byId = async ({ input }: TRPCHandlerParams<TByIdSchema, 'protected'>) => {
const byId = async ({ input }: TRPCHandlerParams<TByIdSchema, 'protected'>) => {
const result = await prisma.internalNote.findFirstOrThrow({ where: { id: input } })
return result
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TGetAllForRecordSchema } from './query.getAllForRecord.schema'

export const getAllForRecord = async ({ input }: TRPCHandlerParams<TGetAllForRecordSchema, 'protected'>) => {
const getAllForRecord = async ({ input }: TRPCHandlerParams<TGetAllForRecordSchema, 'protected'>) => {
const results = prisma.internalNote.findMany({ where: input })
return results
}
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/location/mutation.create.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TCreateSchema } from './mutation.create.schema'

export const create = async ({ ctx, input }: TRPCHandlerParams<TCreateSchema, 'protected'>) => {
const create = async ({ ctx, input }: TRPCHandlerParams<TCreateSchema, 'protected'>) => {
const prisma = getAuditedClient(ctx.actorId)
const result = await prisma.orgLocation.create(input)

Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/location/mutation.update.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TUpdateSchema } from './mutation.update.schema'

export const update = async ({ ctx, input }: TRPCHandlerParams<TUpdateSchema, 'protected'>) => {
const update = async ({ ctx, input }: TRPCHandlerParams<TUpdateSchema, 'protected'>) => {
const prisma = getAuditedClient(ctx.actorId)
const { where, data } = input

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const getCenter = (coords: { latitude: number; longitude: number }[]): google.ma
return { lat: center.latitude, lng: center.longitude }
}

export const forGoogleMaps = async ({ input }: TRPCHandlerParams<TForGoogleMapsSchema>) => {
const forGoogleMaps = async ({ input }: TRPCHandlerParams<TForGoogleMapsSchema>) => {
const result = await prisma.orgLocation.findMany({
where: {
...globalWhere.isPublic(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TForLocationCardSchema } from './query.forLocationCard.schema'

export const forLocationCard = async ({ input }: TRPCHandlerParams<TForLocationCardSchema>) => {
const forLocationCard = async ({ input }: TRPCHandlerParams<TForLocationCardSchema>) => {
const result = await prisma.orgLocation.findUniqueOrThrow({
where: {
id: input,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TForLocationPageSchema } from './query.forLocationPage.schema'

export const forLocationPage = async ({ input }: TRPCHandlerParams<TForLocationPageSchema>) => {
const forLocationPage = async ({ input }: TRPCHandlerParams<TForLocationPageSchema>) => {
const location = await prisma.orgLocation.findUniqueOrThrow({
where: {
id: input.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TForLocationPageEditsSchema } from './query.forLocationPageEdits.schema'

export const forLocationPageEdits = async ({ input }: TRPCHandlerParams<TForLocationPageEditsSchema>) => {
const forLocationPageEdits = async ({ input }: TRPCHandlerParams<TForLocationPageEditsSchema>) => {
try {
const location = await prisma.orgLocation.findUniqueOrThrow({
where: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/router/location/query.forVisitCard.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type TRPCHandlerParams } from '~api/types/handler'

import { type TForVisitCardSchema } from './query.forVisitCard.schema'

export const forVisitCard = async ({ input }: TRPCHandlerParams<TForVisitCardSchema>) => {
const forVisitCard = async ({ input }: TRPCHandlerParams<TForVisitCardSchema>) => {
try {
const result = await prisma.orgLocation.findUnique({
where: {
Expand Down
Loading

0 comments on commit 5d579b8

Please sign in to comment.