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(kudos): add kudos team settings #9163

Merged
merged 3 commits into from
Nov 29, 2023
Merged
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
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()
}
Loading