Skip to content

Commit

Permalink
chore: remove kudos (#9785)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickoferrall authored May 30, 2024
1 parent c31b1c9 commit 23d48c4
Show file tree
Hide file tree
Showing 47 changed files with 55 additions and 1,124 deletions.
1 change: 0 additions & 1 deletion codegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"InviteToTeamPayload": "./types/InviteToTeamPayload#InviteToTeamPayloadSource",
"JiraIssue": "./types/JiraIssue#JiraIssueSource",
"JiraRemoteProject": "../types/JiraRemoteProject#JiraRemoteProjectSource",
"Kudos": "../../postgres/types/Kudos#Kudos",
"MeetingSeries": "../../postgres/types/MeetingSeries#MeetingSeries",
"MeetingTemplate": "../../database/types/MeetingTemplate#default",
"NewMeeting": "../../postgres/types/Meeting#AnyMeeting",
Expand Down
59 changes: 0 additions & 59 deletions packages/client/components/KudosReceivedNotification.tsx

This file was deleted.

9 changes: 2 additions & 7 deletions packages/client/components/Mentioned.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const Mentioned = (props: Props) => {
status
senderName
senderPicture
kudosEmojiUnicode
createdAt
meetingId
meetingName
Expand All @@ -45,7 +44,6 @@ const Mentioned = (props: Props) => {
senderPicture,
meetingId,
meetingName,
kudosEmojiUnicode,
type,
status,
retroReflection,
Expand All @@ -58,8 +56,7 @@ const Mentioned = (props: Props) => {
useEffect(() => {
SendClientSideEvent(atmosphere, 'Notification Viewed', {
notificationType: type,
notificationStatus: status,
kudosEmojiUnicode
notificationStatus: status
})
}, [])

Expand All @@ -77,9 +74,7 @@ const Mentioned = (props: Props) => {
}
}

const message = !kudosEmojiUnicode
? `${authorName} mentioned you in ${locationType} in ${meetingName}`
: `${kudosEmojiUnicode} ${authorName} gave you kudos in ${locationType} in ${meetingName}`
const message = `${authorName} mentioned you in ${locationType} in ${meetingName}`

const goThere = () => {
history.push(actionUrl)
Expand Down
4 changes: 0 additions & 4 deletions packages/client/components/NotificationPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ const typePicker: Record<NotificationEnum, LazyExoticPreload<any>> = {
MENTIONED: lazyPreload(() => import(/* webpackChunkName: 'Mentioned' */ './Mentioned')),
RESPONSE_REPLIED: lazyPreload(
() => import(/* webpackChunkName: 'ResponseReplied' */ './ResponseReplied')
),
KUDOS_RECEIVED: lazyPreload(
() => import(/* webpackChunkName: 'KudosReceivedNotification' */ './KudosReceivedNotification')
)
}

Expand Down Expand Up @@ -86,7 +83,6 @@ const NotificationPicker = (props: Props) => {
...TeamsLimitReminderNotification_notification
...PromptToJoinOrgNotification_notification
...RequestToJoinOrgNotification_notification
...KudosReceivedNotification_notification
}
`,
notificationRef
Expand Down
10 changes: 3 additions & 7 deletions packages/client/components/ResponseMentioned.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@ const ResponseMentioned = (props: Props) => {
}
type
status
kudosEmojiUnicode
}
`,
notificationRef
)
const {history} = useRouter()
const atmosphere = useAtmosphere()
const {meeting, response, kudosEmojiUnicode, type, status} = notification
const {meeting, response, type, status} = notification
const {picture: authorPicture, preferredName: authorName} = response.user

useEffect(() => {
SendClientSideEvent(atmosphere, 'Notification Viewed', {
notificationType: type,
notificationStatus: status,
kudosEmojiUnicode
notificationStatus: status
})
}, [])

Expand All @@ -54,9 +52,7 @@ const ResponseMentioned = (props: Props) => {
history.push(`/meet/${meetingId}/responses?responseId=${encodeURIComponent(response.id)}`)
}

const message = kudosEmojiUnicode
? `${kudosEmojiUnicode} ${authorName} mentioned you and gave kudos in their response in ${meetingName}.`
: `${authorName} mentioned you in their response in ${meetingName}.`
const message = `${authorName} mentioned you in their response in ${meetingName}.`

// :TODO: (jmtaber129): Show mention preview.
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ const EmailResponseMentioned = (props: Props) => {
id
name
}
kudosEmojiUnicode
}
`,
notificationRef
)
const {meeting, response, kudosEmojiUnicode} = notification
const {meeting, response} = notification
const {rasterPicture: authorPicture, preferredName: authorName} = response.user

const {id: meetingId, name: meetingName} = meeting
Expand All @@ -47,9 +46,7 @@ const EmailResponseMentioned = (props: Props) => {
}
})

const message = kudosEmojiUnicode
? `${kudosEmojiUnicode} ${authorName} mentioned you and gave kudos in their response in ${meetingName}.`
: `${authorName} mentioned you in their response in ${meetingName}.`
const message = `${authorName} mentioned you in their response in ${meetingName}.`

// :TODO: (jmtaber129): Show mention preview.
return (
Expand Down
33 changes: 1 addition & 32 deletions packages/client/mutations/AddReactjiToReactableMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {commitMutation} from 'react-relay'
import createProxyRecord from '~/utils/relay/createProxyRecord'
import {AddReactjiToReactableMutation as TAddReactjiToReactableMutation} from '../__generated__/AddReactjiToReactableMutation.graphql'
import {StandardMutation} from '../types/relayMutations'
import SendClientSideEvent from '../utils/SendClientSideEvent'

graphql`
fragment AddReactjiToReactableMutation_meeting on AddReactjiToReactableSuccess {
Expand Down Expand Up @@ -38,14 +37,6 @@ const mutation = graphql`
message
}
}
... on AddReactjiToReactableSuccess {
addedKudos {
emojiUnicode
receiverUser {
preferredName
}
}
}
...AddReactjiToReactableMutation_meeting @relay(mask: false)
}
}
Expand Down Expand Up @@ -113,29 +104,7 @@ const AddReactjiToReactableMutation: StandardMutation<TAddReactjiToReactableMuta
}
}
},
onCompleted: (res, errors) => {
const {isRemove} = variables
const addedKudos = res.addReactjiToReactable.addedKudos
if (!isRemove && addedKudos) {
const {emojiUnicode} = addedKudos
atmosphere.eventEmitter.emit('addSnackbar', {
key: 'youGaveKudos',
message: `You gave kudos to ${addedKudos.receiverUser.preferredName} ${emojiUnicode}`,
autoDismiss: 5,
onShow: () => {
SendClientSideEvent(atmosphere, 'Snackbar Viewed', {
snackbarType: 'kudosSent'
})
},
onManualDismiss: () => {
SendClientSideEvent(atmosphere, 'Snackbar Clicked', {
snackbarType: 'kudosSent'
})
}
})
}
onCompleted(res, errors)
},
onCompleted,
onError
})
}
Expand Down
32 changes: 1 addition & 31 deletions packages/client/mutations/CreateReflectionMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {commitMutation} from 'react-relay'
import {CreateReflectionMutation_meeting$data} from '~/__generated__/CreateReflectionMutation_meeting.graphql'
import {CreateReflectionMutation as TCreateReflectionMutation} from '../__generated__/CreateReflectionMutation.graphql'
import {SharedUpdater, StandardMutation} from '../types/relayMutations'
import SendClientSideEvent from '../utils/SendClientSideEvent'
import makeEmptyStr from '../utils/draftjs/makeEmptyStr'
import clientTempId from '../utils/relay/clientTempId'
import createProxyRecord from '../utils/relay/createProxyRecord'
Expand All @@ -34,12 +33,6 @@ graphql`
id
isNavigableByFacilitator
}
draftKudoses {
receiverUser {
preferredName
}
emojiUnicode
}
}
`

Expand All @@ -66,30 +59,7 @@ const CreateReflectionMutation: StandardMutation<TCreateReflectionMutation> = (
return commitMutation<TCreateReflectionMutation>(atmosphere, {
mutation,
variables,
onCompleted: (res, errors) => {
const draftKudoses = res.createReflection?.draftKudoses
if (draftKudoses && draftKudoses.length) {
const preferredNames = draftKudoses
.map((kudos) => kudos.receiverUser.preferredName)
.join(', ')
atmosphere.eventEmitter.emit('addSnackbar', {
key: `youGaveKudos:${res.createReflection.reflectionId}`,
message: `${preferredNames} will receive kudos at the end ot the meeting ${draftKudoses[0]?.emojiUnicode}`,
autoDismiss: 5,
onShow: () => {
SendClientSideEvent(atmosphere, 'Snackbar Viewed', {
snackbarType: 'kudosSent'
})
},
onManualDismiss: () => {
SendClientSideEvent(atmosphere, 'Snackbar Clicked', {
snackbarType: 'kudosSent'
})
}
})
}
onCompleted(res, errors)
},
onCompleted,
onError,
updater: (store) => {
const payload = store.getRootField('createReflection')
Expand Down
32 changes: 1 addition & 31 deletions packages/client/mutations/UpsertTeamPromptResponseMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {UpsertTeamPromptResponseMutation_meeting$data} from '~/__generated__/Ups
import clientTempId from '~/utils/relay/clientTempId'
import {UpsertTeamPromptResponseMutation as TUpsertTeamPromptResponseMutation} from '../__generated__/UpsertTeamPromptResponseMutation.graphql'
import {LocalHandlers, SharedUpdater, StandardMutation} from '../types/relayMutations'
import SendClientSideEvent from '../utils/SendClientSideEvent'

graphql`
fragment UpsertTeamPromptResponseMutation_meeting on UpsertTeamPromptResponseSuccess {
Expand All @@ -18,12 +17,6 @@ graphql`
createdAt
...TeamPromptResponseEmojis_response
}
addedKudoses {
receiverUser {
preferredName
}
emojiUnicode
}
}
`

Expand Down Expand Up @@ -104,30 +97,7 @@ const UpsertTeamPromptResponseMutation: StandardMutation<
const payload = store.getRootField('upsertTeamPromptResponse')
upsertTeamPromptResponseUpdater(payload as any, {atmosphere, store})
},
onCompleted: (res, errors) => {
const addedKudoses = res.upsertTeamPromptResponse.addedKudoses
if (addedKudoses?.length && addedKudoses[0]) {
const {emojiUnicode} = addedKudoses[0]
atmosphere.eventEmitter.emit('addSnackbar', {
key: 'youGaveKudos',
message: `You gave kudos to ${addedKudoses
.map((kudos) => kudos.receiverUser.preferredName)
.join(', ')} ${emojiUnicode}`,
autoDismiss: 5,
onShow: () => {
SendClientSideEvent(atmosphere, 'Snackbar Viewed', {
snackbarType: 'kudosSent'
})
},
onManualDismiss: () => {
SendClientSideEvent(atmosphere, 'Snackbar Clicked', {
snackbarType: 'kudosSent'
})
}
})
}
onCompleted?.(res, errors)
},
onCompleted,
onError
})
}
Expand Down
47 changes: 0 additions & 47 deletions packages/client/mutations/toasts/mapKudosReceivedToToast.ts

This file was deleted.

Loading

0 comments on commit 23d48c4

Please sign in to comment.