exposes start alerts

This commit is contained in:
Keagan McClelland
2021-03-03 14:18:57 -07:00
parent 21f982e9a6
commit ae90b70348
3 changed files with 6 additions and 0 deletions

View File

@@ -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)

View File

@@ -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
]

View File

@@ -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