Skip to content

Commit

Permalink
chore(kudos): add kudos team settings (#9163)
Browse files Browse the repository at this point in the history
* chore(kudos): add kudos team settings

* store emoji id
  • Loading branch information
igorlesnenko authored Nov 29, 2023
1 parent c719112 commit 97fba6c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/server/database/types/Team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface Input {
qualAIMeetingsCount?: number
isOnboardTeam?: boolean
isOneOnOneTeam?: boolean
giveKudosWithEmoji?: boolean
kudosEmoji?: string
updatedAt?: Date
}

Expand All @@ -36,6 +38,8 @@ export default class Team {
orgId: string
isOnboardTeam: boolean
isOneOnOneTeam?: boolean
giveKudosWithEmoji: boolean
kudosEmoji: string
qualAIMeetingsCount: number
updatedAt: Date
constructor(input: Input) {
Expand All @@ -47,6 +51,8 @@ export default class Team {
isArchived,
isOnboardTeam,
isOneOnOneTeam,
giveKudosWithEmoji,
kudosEmoji,
lastMeetingType,
isPaid,
name,
Expand All @@ -69,6 +75,8 @@ export default class Team {
this.isArchived = isArchived ?? false
this.isOnboardTeam = isOnboardTeam ?? false
this.isOneOnOneTeam = isOneOnOneTeam ?? false
this.giveKudosWithEmoji = giveKudosWithEmoji ?? true
this.kudosEmoji = kudosEmoji ?? 'heart'
this.isPaid = isPaid ?? true
this.qualAIMeetingsCount = qualAIMeetingsCount ?? 0
}
Expand Down
10 changes: 10 additions & 0 deletions packages/server/graphql/public/typeDefs/Team.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,14 @@ type Team {
The team member that is the viewer
"""
viewerTeamMember: TeamMember

"""
Enable giving kudos with emoji
"""
giveKudosWithEmoji: Boolean!

"""
Emoji that will be used for giving kudos
"""
kudosEmoji: String!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {Client} from 'pg'
import getPgConfig from '../getPgConfig'

export async function up() {
const client = new Client(getPgConfig())
await client.connect()
await client.query(`
DO $$
BEGIN
ALTER TABLE "Team"
ADD COLUMN IF NOT EXISTS "giveKudosWithEmoji" BOOLEAN NOT NULL DEFAULT TRUE,
ADD COLUMN IF NOT EXISTS "kudosEmoji" TEXT NOT NULL DEFAULT 'heart';
END
$$;
`)
await client.end()
}

export async function down() {
const client = new Client(getPgConfig())
await client.connect()
await client.query(`
DO $$
BEGIN
ALTER TABLE "Team"
DROP COLUMN "giveKudosWithEmoji",
DROP COLUMN "kudosEmoji";
END
$$;
`)
await client.end()
}

0 comments on commit 97fba6c

Please sign in to comment.