Skip to content

Commit

Permalink
feat: two new question categories for custom questions
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-run committed Jan 20, 2025
1 parent 28f028e commit a4c6704
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/bot/events/healthcheck/healthcheck-modal-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ export function createHealthCheckModalBlocks(
plainHeader(questionTypeToText(QuestionType.TEAM_HEALTH)),
...teamHealth.map((question) => createSelectSectionBlock(question, existingAnswers)),
]),
...addIfArray(grouped.ME, (me) => [
plainHeader(questionTypeToText(QuestionType.ME)),
...me.map((question) => createSelectSectionBlock(question, existingAnswers)),
]),
...addIfArray(grouped.SURROUNDINGS, (surroundings) => [
plainHeader(questionTypeToText(QuestionType.SURROUNDINGS)),
...surroundings.map((question) => createSelectSectionBlock(question, existingAnswers)),
]),
...addIfArray(grouped.SPEED, (speed) => [
plainHeader(questionTypeToText(QuestionType.SPEED)),
...speed.map((question) => createSelectSectionBlock(question, existingAnswers)),
Expand Down
2 changes: 2 additions & 0 deletions src/components/graphs/GlobalScoreGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type Props = {
const colors = {
score: 'rgba(0, 103, 197, 0.65)',
[QuestionType.TEAM_HEALTH]: 'rgba(139, 69, 19, 0.65)',
[QuestionType.ME]: 'rgba(255,116,12,0.65)',
[QuestionType.SURROUNDINGS]: 'rgba(136,0,4,0.65)',
[QuestionType.SPEED]: 'rgba(102, 102, 51, 0.65)',
[QuestionType.TECH]: 'rgba(128, 0, 128, 0.65)',
[QuestionType.OTHER]: 'rgba(255, 140, 0, 0.65)',
Expand Down
2 changes: 2 additions & 0 deletions src/safe-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export enum QuestionType {
TEAM_HEALTH = 'TEAM_HEALTH',
ME = 'ME',
SURROUNDINGS = 'SURROUNDINGS',
SPEED = 'SPEED',
TECH = 'TECH',
OTHER = 'OTHER',
Expand Down
4 changes: 4 additions & 0 deletions src/utils/asked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { QuestionType } from '../safe-types'

export function questionTypeToText(type: QuestionType): string {
switch (type) {
case QuestionType.ME:
return 'Meg'
case QuestionType.SURROUNDINGS:
return 'Omgivelsene'
case QuestionType.TEAM_HEALTH:
return 'Teamhelse'
case QuestionType.SPEED:
Expand Down

0 comments on commit a4c6704

Please sign in to comment.