Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit f8ec572

Browse files
Merge pull request #357 from deckgo/nm-description
infra: render presentation description
2 parents 4ea6fc3 + 58b74f5 commit f8ec572

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

infra/handler/app/Test.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ testPresDeploys = withQueueName $ withEnv $ \env -> withSQS env $ withS3 env $ d
173173
, presentationOwner = someUserId
174174
, presentationAttributes = HMS.empty
175175
, presentationBackground = Nothing
176+
, presentationDescription = ""
176177
}
177178

178179
let uname = Username "josph"

infra/handler/src/DeckGo/Handler.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ data PresentationInfo = PresentationInfo
311311
, presentationBackground :: Maybe PresentationBackground
312312
, presentationAttributes :: HMS.HashMap T.Text T.Text
313313
, presentationSlides :: [Slide]
314+
, presentationDescription :: T.Text
314315
} deriving (Show, Eq)
315316

316317
data PresentationResult = PresentationResult
@@ -327,7 +328,8 @@ instance FromJSONObject PresentationInfo where
327328
obj .: "owner_id" <*>
328329
obj .:? "background" <*>
329330
obj .:? "attributes" .!= HMS.empty <*>
330-
obj .: "slides"
331+
obj .: "slides" <*>
332+
obj .: "description"
331333

332334
instance FromJSONObject PresentationResult where
333335
parseJSONObject = undefined -- \obj ->
@@ -1245,11 +1247,10 @@ withPresentationFiles uname psname presentationInfo act = do
12451247
T.replace "{{DECKDECKGO_TITLE_SHORT}}" (T.take 12 $ unPresentationName pname) .
12461248
T.replace "{{DECKDECKGO_AUTHOR}}" (unUsername uname) .
12471249
T.replace "{{DECKDECKGO_USERNAME}}" (unUsername uname) .
1250+
T.replace "{{DECKDECKGO_DESCRIPTION}}" (presentationDescription presentationInfo) .
12481251
T.replace "{{DECKDECKGO_USER_ID}}"
12491252
(unFirebaseId . unUserId $ presentationOwner presentationInfo) .
12501253
T.replace "{{DECKDECKGO_DECKNAME}}" (unPresShortname psname) .
1251-
-- TODO: description
1252-
T.replace "{{DECKDECKGO_DESCRIPTION}}" "(no description given)" .
12531254
T.replace "{{DECKDECKGO_BASE_HREF}}"
12541255
("/" <> unPresentationPrefix (presentationPrefix uname psname))
12551256

0 commit comments

Comments
 (0)