From ae90b70348056cd54acd596536336ea9d8105ca7 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Wed, 3 Mar 2021 14:18:57 -0700 Subject: [PATCH] exposes start alerts --- agent/src/Handler/Apps.hs | 2 ++ agent/src/Handler/Types/Apps.hs | 2 ++ agent/src/Lib/External/AppManifest.hs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/agent/src/Handler/Apps.hs b/agent/src/Handler/Apps.hs index efe1ae4e0..ad4f93bbc 100644 --- a/agent/src/Handler/Apps.hs +++ b/agent/src/Handler/Apps.hs @@ -297,6 +297,7 @@ getInstalledAppByIdLogic appId = do , appInstalledFullConfiguredRequirements = [] , appInstalledFullUninstallAlert = Nothing , appInstalledFullRestoreAlert = Nothing + , appInstalledFullStartAlert = Nothing , appInstalledFullActions = [] } serverApps <- AppMgr2.list [AppMgr2.flags|-s -d|] @@ -339,6 +340,7 @@ getInstalledAppByIdLogic appId = do , appInstalledFullConfiguredRequirements = HM.elems requirements , appInstalledFullUninstallAlert = manifest >>= AppManifest.appManifestUninstallAlert , appInstalledFullRestoreAlert = manifest >>= AppManifest.appManifestRestoreAlert + , appInstalledFullStartAlert = manifest >>= AppManifest.appManifestStartAlert , appInstalledFullActions = fromMaybe [] $ AppManifest.appManifestActions <$> manifest } runMaybeT (installing <|> installed) `orThrowM` NotFoundE "appId" (show appId) diff --git a/agent/src/Handler/Types/Apps.hs b/agent/src/Handler/Types/Apps.hs index da9d5a3e8..5265446c9 100644 --- a/agent/src/Handler/Types/Apps.hs +++ b/agent/src/Handler/Types/Apps.hs @@ -138,6 +138,7 @@ data AppInstalledFull = AppInstalledFull , appInstalledFullConfiguredRequirements :: [Stripped AppDependencyRequirement] , appInstalledFullUninstallAlert :: Maybe Text , appInstalledFullRestoreAlert :: Maybe Text + , appInstalledFullStartAlert :: Maybe Text , appInstalledFullActions :: [Manifest.Action] } instance ToJSON AppInstalledFull where @@ -154,6 +155,7 @@ instance ToJSON AppInstalledFull where , "status" .= appInstalledFullStatus , "uninstallAlert" .= appInstalledFullUninstallAlert , "restoreAlert" .= appInstalledFullRestoreAlert + , "startAlert" .= appInstalledFullStartAlert , "actions" .= appInstalledFullActions ] diff --git a/agent/src/Lib/External/AppManifest.hs b/agent/src/Lib/External/AppManifest.hs index fd6eb4144..f14952c6f 100644 --- a/agent/src/Lib/External/AppManifest.hs +++ b/agent/src/Lib/External/AppManifest.hs @@ -88,6 +88,7 @@ data AppManifest where , appManifestDependencies :: HM.HashMap AppId VersionRange , appManifestUninstallAlert :: Maybe Text , appManifestRestoreAlert :: Maybe Text + , appManifestStartAlert :: Maybe Text , appManifestActions :: [Action] } -> AppManifest @@ -110,6 +111,7 @@ instance FromJSON AppManifest where appManifestDependencies <- o .:? "dependencies" .!= HM.empty >>= traverse parseDepInfo appManifestUninstallAlert <- o .:? "uninstall-alert" appManifestRestoreAlert <- o .:? "restore-alert" + appManifestStartAlert <- o .:? "start-alert" appManifestActions <- o .: "actions" pure $ AppManifest { .. } where