Skip to content

Commit

Permalink
Merge branch 'master' into feat/embedder1
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <[email protected]>
  • Loading branch information
mattkrick committed Mar 29, 2024
2 parents 0c80dd6 + d1af0f1 commit 826a044
Show file tree
Hide file tree
Showing 54 changed files with 245 additions and 363 deletions.
11 changes: 2 additions & 9 deletions packages/chronos/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
"~/*": ["client/*"]
},
"outDir": "lib",
"lib": ["esnext"],
"types": ["node"]
},
"files": [
"chronos.ts",
"../server/types/webpackEnv.ts",
"../server/types/modules.d.ts",
"../client/modules/email/components/SummaryEmail/MeetingSummaryEmail/MeetingSummaryEmail.tsx"
]
"lib": ["esnext"]
}
}
74 changes: 0 additions & 74 deletions packages/client/components/AnimatedFade.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import graphql from 'babel-plugin-relay/macro'
import React from 'react'
import {useFragment} from 'react-relay'
import useUnusedRecords from '~/hooks/useUnusedRecords'
import {AzureDevOpsScopingSelectAllIssues_workItems$key} from '../__generated__/AzureDevOpsScopingSelectAllIssues_workItems.graphql'
import useAtmosphere from '../hooks/useAtmosphere'
import useMutationProps from '../hooks/useMutationProps'
import UpdatePokerScopeMutation from '../mutations/UpdatePokerScopeMutation'
Expand All @@ -11,7 +12,6 @@ import {PALETTE} from '../styles/paletteV3'
import {Threshold} from '../types/constEnums'
import AzureDevOpsClientManager from '../utils/AzureDevOpsClientManager'
import getSelectAllTitle from '../utils/getSelectAllTitle'
import {AzureDevOpsScopingSelectAllIssues_workItems$key} from '../__generated__/AzureDevOpsScopingSelectAllIssues_workItems.graphql'
import Checkbox from './Checkbox'

const Item = styled('div')({
Expand Down Expand Up @@ -42,7 +42,7 @@ interface Props {
}

const AzureDevOpsScopingSelectAllIssues = (props: Props) => {
const {meetingId, usedServiceTaskIds, workItems: workItemsRef, providerId} = props
const {meetingId, usedServiceTaskIds, workItems: workItemsRef} = props
const workItems = useFragment(
graphql`
fragment AzureDevOpsScopingSelectAllIssues_workItems on AzureDevOpsWorkItemEdge
Expand All @@ -57,7 +57,7 @@ const AzureDevOpsScopingSelectAllIssues = (props: Props) => {
workItemsRef
)
const atmosphere = useAtmosphere()
const {onCompleted, onError, submitMutation, submitting, error} = useMutationProps()
const {onCompleted, onError, submitMutation, error} = useMutationProps()
const getProjectId = (url: URL) => {
const firstIndex = url.pathname.indexOf('/', 1)
const seconedIndex = url.pathname.indexOf('/', firstIndex + 1)
Expand Down
43 changes: 0 additions & 43 deletions packages/client/hooks/useAtlassianSites.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import graphql from 'babel-plugin-relay/macro'
import {MeetingSummaryEmailRootSSRQuery} from 'parabol-client/__generated__/MeetingSummaryEmailRootSSRQuery.graphql'
import React from 'react'
import {useLazyLoadQuery} from 'react-relay'
import {Environment} from 'relay-runtime'
import {EMAIL_CORS_OPTIONS} from '../../../types/cors'
import makeAppURL from '../../../utils/makeAppURL'
import MeetingSummaryEmail from './SummaryEmail/MeetingSummaryEmail/MeetingSummaryEmail'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const NotificationSummaryEmailRoot = (props: NotificationSummaryRootProps) => {
(edge) =>
edge.node.status === 'UNREAD' &&
new Date(edge.node.createdAt) > new Date(Date.now() - ms('1d')) &&
NOTIFICATION_TEMPLATE_TYPE[edge.node.type] // Filter down to the notifications that have been implemented.
NOTIFICATION_TEMPLATE_TYPE[edge.node.type as keyof typeof NOTIFICATION_TEMPLATE_TYPE] // Filter down to the notifications that have been implemented.
)
.map((edge) => edge.node)
.slice(0, MAX_EMAIL_NOTIFICATIONS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ const pagePadding = {
paddingTop: 24
}

declare module 'react' {
interface TdHTMLAttributes<T> {
height?: string | number
width?: string | number
bgcolor?: string
}
interface TableHTMLAttributes<T> {
align?: 'center' | 'left' | 'right'
bgcolor?: string
height?: string | number
width?: string | number
}
}

const PagePadding = () => {
return (
<table align='center' width='100%'>
Expand Down
11 changes: 7 additions & 4 deletions packages/client/mutations/handlers/handleUpdateTeamMembers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import {RecordProxy, RecordSourceSelectorProxy} from 'relay-runtime'
import fromTeamMemberId from '../../utils/relay/fromTeamMemberId'
import safeRemoveNodeFromArray from '../../utils/relay/safeRemoveNodeFromArray'
import pluralizeHandler from './pluralizeHandler'

const handleUpdateTeamMember = (updatedTeamMember, store) => {
const handleUpdateTeamMember = (
updatedTeamMember: RecordProxy<{id: string}>,
store: RecordSourceSelectorProxy
) => {
if (!updatedTeamMember) return
const {teamId} = fromTeamMemberId(updatedTeamMember.getValue('id'))
const isNotRemoved = updatedTeamMember.getValue('isNotRemoved')
Expand All @@ -11,16 +15,15 @@ const handleUpdateTeamMember = (updatedTeamMember, store) => {
const sorts = ['preferredName']
if (isNotRemoved) {
sorts.forEach((sortBy) => {
const teamMembers = team.getLinkedRecords('teamMembers', {sortBy})
const teamMembers = team.getLinkedRecords<[]>('teamMembers', {sortBy})
if (!teamMembers) return
teamMembers.sort((a, b) => (a.getValue(sortBy) > b.getValue(sortBy) ? 1 : -1))
team.setLinkedRecords(teamMembers, 'teamMembers', {sortBy})
})
} else {
const teamMemberId = updatedTeamMember.getValue('id')
sorts.forEach((sortBy) => {
const teamMembers = team.getLinkedRecords('teamMembers', {sortBy})
safeRemoveNodeFromArray(teamMemberId, teamMembers, 'teamMembers', {
safeRemoveNodeFromArray(teamMemberId, team, 'teamMembers', {
storageKeyArgs: {sortBy}
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/draft-js": "^0.10.24",
"@types/fbjs": "^3.0.4",
"@types/humanize-duration": "3.27.1",
"@types/jest": "^29.5.1",
"@types/jest": "^29.5.12",
"@types/json2csv": "^4.4.0",
"@types/jwt-decode": "^2.1.0",
"@types/linkify-it": "^3.0.2",
Expand Down Expand Up @@ -75,15 +75,15 @@
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.2",
"@mui/x-date-pickers": "^6.3.1",
"@radix-ui/react-alert-dialog": "1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.4",
"@radix-ui/react-radio-group": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.0.3",
"@radix-ui/react-select": "^1.2.2",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-alert-dialog": "1.0.5",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/browser": "^5.8.0",
"@stripe/react-stripe-js": "^1.16.5",
Expand Down
4 changes: 1 addition & 3 deletions packages/client/serviceWorker/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
// "composite": true,
"lib": ["esnext", "webworker"],
"target": "esnext",
"module": "commonjs",
Expand All @@ -11,6 +10,5 @@
"*" // resolve all absolute imports as imports relative to the client package
]
}
},
// "references": [{"path": "../"}]
}
}
9 changes: 2 additions & 7 deletions packages/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["*"],
"static/*": ["../../static/*"]
"~/*": ["*"]
},
"outDir": "lib",
"lib": ["esnext", "dom"],
"types": ["node"]
"lib": ["esnext", "dom"]
},
"files": [
"client.tsx",
],
"exclude": ["serviceWorker", "**/node_modules"]
}
1 change: 1 addition & 0 deletions packages/client/types/modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ declare module 'emoji-mart/dist-modern/utils/data.js'
declare module 'emoji-mart/dist-modern/components/picker/nimble-picker'
declare module 'react-textarea-autosize'
declare module 'react-copy-to-clipboard'
declare module 'tayden-clusterfck'

declare let __webpack_public_path__: string
declare const __PRODUCTION__: string
Expand Down
15 changes: 15 additions & 0 deletions packages/client/types/reactHTML4.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'react'

declare module 'react' {
export interface TdHTMLAttributes<T> {
height?: string | number
width?: string | number
bgcolor?: string
}
export interface TableHTMLAttributes<T> {
align?: 'center' | 'left' | 'right'
bgcolor?: string
height?: string | number
width?: string | number
}
}
4 changes: 2 additions & 2 deletions packages/client/ui/AlertDialog/AlertDialogContent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react'
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
import clsx from 'clsx'
import * as React from 'react'
import {AlertDialogOverlay} from './AlertDialogOverlay'
import {AlertDialogPortal} from './AlertDialog'
import {AlertDialogPortal} from './AlertDialogPortal'

const AlertDialogContent = React.forwardRef<
HTMLDivElement,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/ui/AlertDialog/AlertDialogPortal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'

const AlertDialogPortal = AlertDialogPrimitive.Portal
export const AlertDialogPortal = AlertDialogPrimitive.Portal
2 changes: 1 addition & 1 deletion packages/client/ui/AlertDialog/AlertDialogTrigger.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'

const AlertDialogTrigger = AlertDialogPrimitive.Trigger
export const AlertDialogTrigger = AlertDialogPrimitive.Trigger
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/* eslint-env jest */
import parseEmailAddressList from '../parseEmailAddressList'

const getAddressStr = (res) => res && res.parsedInvitees.map((val) => val.address).join(', ')
type Res = {
parsedInvitees: {
[other: string]: any
}[]
}
const getAddressStr = (res: Res) => res && res.parsedInvitees.map((val) => val.address).join(', ')

describe('parseEmailAddressList', () => {
it('validates a simple single email', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const bezierLookup = [] as {x: number; y: number}[]
const getBezierTimePercentGivenDistancePercent = (threshold: number, bezierCurve: string) => {
if (bezierLookup.length === 0) {
const re = /\(([^)]+)\)/
const [x1, y1, x2, y2] = re.exec(bezierCurve)![1].split(',').map(Number)
const [x1, y1, x2, y2] = re.exec(bezierCurve)![1]!.split(',').map(Number) as [
number,
number,
number,
number
]
// css bezier-curves imply a start of 0,0 and end of 1,1
const x0 = 0
const y0 = 0
Expand All @@ -32,9 +37,9 @@ const getBezierTimePercentGivenDistancePercent = (threshold: number, bezierCurve
}
let x
for (let i = 1; i < bezierLookup.length; i++) {
const point = bezierLookup[i]
const point = bezierLookup[i]!
if (point.y > threshold) {
x = bezierLookup[i - 1].x
x = bezierLookup[i - 1]!.x
break
}
}
Expand Down
Loading

0 comments on commit 826a044

Please sign in to comment.