Skip to content

Commit 3d944a8

Browse files
committed
feat: add link to graph from slack message
1 parent a4c6704 commit 3d944a8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/bot/messages/message-builder.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as R from 'remeda'
44

55
import { dayIndexToDay, getWeekNumber } from '../../utils/date'
66
import { ScoredAsk, ScoredQuestion } from '../../metrics/metrics'
7-
import { plainHeader, textSection } from '../events/modal-utils'
7+
import { addIf, plainHeader, textSection } from '../events/modal-utils'
88
import { questionTypeToText } from '../../utils/asked'
99
import { scoreToEmoji } from '../../utils/score'
1010
import { QuestionType } from '../../safe-types'
@@ -99,6 +99,24 @@ export function createScoreBlocks(
9999

100100
return [
101101
plainHeader(`Helsesjekkresultat for team ${team.name} i uke ${getWeekNumber(asked.timestamp)}`),
102+
...addIf(team.assosiatedGroup != null, () => ({
103+
type: 'section',
104+
text: {
105+
type: 'mrkdwn',
106+
text: 'Du kan se utviklingen over tid i Helsesjekk Dashboard',
107+
},
108+
accessory: {
109+
type: 'button',
110+
text: {
111+
type: 'plain_text',
112+
text: 'Helsegraf',
113+
emoji: true,
114+
},
115+
value: 'helsesjekk-link-button',
116+
url: `https://helsesjekk-bot.nav.no/team/${team.assosiatedGroup}/${team.id}/graph`,
117+
action_id: 'button-action',
118+
},
119+
})),
102120
{
103121
type: 'section',
104122
text: {

0 commit comments

Comments
 (0)