-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: small bugs found in datadog logs (#10414)
Signed-off-by: Matt Krick <[email protected]>
- Loading branch information
Showing
13 changed files
with
103 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
packages/client/components/TeamsLimitExceededNotification.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import graphql from 'babel-plugin-relay/macro' | ||
import React, {useEffect} from 'react' | ||
import {useFragment} from 'react-relay' | ||
import {TeamsLimitExceededNotification_notification$key} from '~/__generated__/TeamsLimitExceededNotification_notification.graphql' | ||
import useRouter from '~/hooks/useRouter' | ||
import defaultOrgAvatar from '~/styles/theme/images/avatar-organization.svg' | ||
import useAtmosphere from '../hooks/useAtmosphere' | ||
import {Threshold} from '../types/constEnums' | ||
import SendClientSideEvent from '../utils/SendClientSideEvent' | ||
import NotificationAction from './NotificationAction' | ||
import NotificationTemplate from './NotificationTemplate' | ||
|
||
interface Props { | ||
notification: TeamsLimitExceededNotification_notification$key | ||
} | ||
|
||
const TeamsLimitExceededNotification = (props: Props) => { | ||
const {notification: notificationRef} = props | ||
const atmosphere = useAtmosphere() | ||
const notification = useFragment( | ||
graphql` | ||
fragment TeamsLimitExceededNotification_notification on NotifyTeamsLimitExceeded { | ||
...NotificationTemplate_notification | ||
id | ||
orgId | ||
orgName | ||
orgPicture | ||
} | ||
`, | ||
notificationRef | ||
) | ||
const {history} = useRouter() | ||
const {orgId, orgName, orgPicture} = notification | ||
|
||
useEffect(() => { | ||
SendClientSideEvent(atmosphere, 'Upgrade CTA Viewed', { | ||
upgradeCTALocation: 'teamsLimitExceededNotification', | ||
orgId | ||
}) | ||
}, []) | ||
|
||
const onActionClick = () => { | ||
SendClientSideEvent(atmosphere, 'Upgrade CTA Clicked', { | ||
upgradeCTALocation: 'teamsLimitExceededNotification' | ||
}) | ||
history.push(`/me/organizations/${orgId}`) | ||
} | ||
|
||
return ( | ||
<NotificationTemplate | ||
avatar={orgPicture || defaultOrgAvatar} | ||
message={`"${orgName}" is over the limit of ${Threshold.MAX_STARTER_TIER_TEAMS} free teams.`} | ||
action={<NotificationAction label={'Upgrade'} onClick={onActionClick} />} | ||
notification={notification} | ||
/> | ||
) | ||
} | ||
|
||
export default TeamsLimitExceededNotification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ enum IntegrationProviderAuthStrategyEnum { | |
oauth2 | ||
pat | ||
webhook | ||
sharedSecret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ enum NotificationEnum { | |
TEAMS_LIMIT_REMINDER | ||
PROMPT_TO_JOIN_ORG | ||
REQUEST_TO_JOIN_ORG | ||
TEAMS_LIMIT_EXCEEDED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/server/graphql/public/types/NotifyTeamsLimitExceeded.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {NotifyTeamsLimitExceededResolvers} from '../resolverTypes' | ||
|
||
const NotifyTeamsLimitExceeded: NotifyTeamsLimitExceededResolvers = { | ||
__isTypeOf: ({type}) => type === 'TEAMS_LIMIT_EXCEEDED', | ||
orgPicture: async ({orgPicture}, _args, {dataLoader}) => { | ||
if (!orgPicture) return null | ||
return dataLoader.get('fileStoreAsset').load(orgPicture) | ||
} | ||
} | ||
|
||
export default NotifyTeamsLimitExceeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters