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

chore: remove google language manager #10639

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,20 @@ test.describe('retrospective-demo / group page', () => {
const documentingInNotionCard = page.locator('text=Documenting things in notion')
await dragReflectionCard(decisionsInOneOnOnesCard, documentingInNotionCard)

// Then it auto-generates a header
// 1) Grab the auto-generated group name
const groupHeaderLocator = page.locator(
'[data-cy=group-column-Start] [data-cy*="Start-group-"] input'
)
const actualGroupName = await groupHeaderLocator.getAttribute('value')

// 2) Verify that the group’s auto-generated name actually shows up in the DOM
await expect(
page.locator(
`[data-cy=group-column-Start] [data-cy*="Start-group-"] input[value="Things Notion"]`
`[data-cy=group-column-Start] [data-cy*="Start-group-"] input[value="${actualGroupName}"]`
)
).toBeVisible()

// Then it shows all cards when clicking the group
// 3) Verify that both cards are in the same expanded group
await decisionsInOneOnOnesCard.click()
await expect(
page.locator('#expandedReflectionGroup :text("Making decisions in one-on-one meetings")')
Expand Down
179 changes: 0 additions & 179 deletions packages/server/GoogleLanguageManager.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/server/getGoogleLanguageManager.ts

This file was deleted.

21 changes: 4 additions & 17 deletions packages/server/graphql/mutations/createReflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@ import {generateText} from '@tiptap/core'
import {GraphQLNonNull} from 'graphql'
import {SubscriptionChannel} from 'parabol-client/types/constEnums'
import isPhaseComplete from 'parabol-client/utils/meetings/isPhaseComplete'
import getGroupSmartTitle from 'parabol-client/utils/smartGroup/getGroupSmartTitle'
import unlockAllStagesForPhase from 'parabol-client/utils/unlockAllStagesForPhase'
import {serverTipTapExtensions} from '../../../client/shared/tiptap/serverTipTapExtensions'
import ReflectionGroup from '../../database/types/ReflectionGroup'
import generateUID from '../../generateUID'
import getKysely from '../../postgres/getKysely'
import {toGoogleAnalyzedEntity} from '../../postgres/helpers/toGoogleAnalyzedEntity'
import {analytics} from '../../utils/analytics/analytics'
import {getUserId} from '../../utils/authorization'
import {convertToTipTap} from '../../utils/convertToTipTap'
import {getSimpleGroupTitle} from '../../utils/getSimpleGroupTitle'
import publish from '../../utils/publish'
import standardError from '../../utils/standardError'
import {GQLContext} from '../graphql'
import CreateReflectionInput, {CreateReflectionInputType} from '../types/CreateReflectionInput'
import CreateReflectionPayload from '../types/CreateReflectionPayload'
import {getFeatureTier} from '../types/helpers/getFeatureTier'
import getReflectionEntities from './helpers/getReflectionEntities'
import getReflectionSentimentScore from './helpers/getReflectionSentimentScore'

export default {
type: CreateReflectionPayload,
Expand Down Expand Up @@ -48,13 +44,11 @@ export default {
if (!reflectPrompt) {
return standardError(new Error('Category not found'), {userId: viewerId})
}
const {question} = reflectPrompt
if (!meeting) return standardError(new Error('Meeting not found'), {userId: viewerId})
const {endedAt, phases, teamId} = meeting
if (endedAt) {
return {error: {message: 'Meeting already ended'}}
}
const team = await dataLoader.get('teams').loadNonNull(teamId)
if (isPhaseComplete('group', phases)) {
return standardError(new Error('Meeting phase already completed'), {userId: viewerId})
}
Expand All @@ -68,27 +62,19 @@ export default {
// RESOLUTION
const plaintextContent = generateText(normalizedContent, serverTipTapExtensions)

const [entities, sentimentScore] = await Promise.all([
getReflectionEntities(plaintextContent),
getFeatureTier(team) !== 'starter'
? getReflectionSentimentScore(question, plaintextContent)
: undefined
])
const reflectionGroupId = generateUID()

const reflection = {
id: generateUID(),
creatorId: viewerId,
content: JSON.stringify(normalizedContent),
plaintextContent,
entities,
sentimentScore,
meetingId,
promptId,
reflectionGroupId
}

const smartTitle = getGroupSmartTitle([reflection])
const smartTitle = getSimpleGroupTitle([reflection])
const reflectionGroup = new ReflectionGroup({
id: reflectionGroupId,
smartTitle,
Expand All @@ -101,7 +87,7 @@ export default {
await pg
.with('Group', (qc) => qc.insertInto('RetroReflectionGroup').values(reflectionGroup))
.insertInto('RetroReflection')
.values({...reflection, entities: toGoogleAnalyzedEntity(entities)})
.values(reflection)
.execute()

const groupPhase = phases.find((phase) => phase.phaseType === 'group')!
Expand All @@ -126,6 +112,7 @@ export default {
unlockedStageIds
}
publish(SubscriptionChannel.MEETING, meetingId, 'CreateReflectionPayload', data, subOptions)

return data
}
}

This file was deleted.

Loading
Loading