fix(workflows): always show navigation item

This commit is contained in:
Gregor Kleen 2022-04-21 10:09:31 +02:00
parent 56a1c9016a
commit 82a4eccaa4

View File

@ -761,14 +761,7 @@ defaultLinks = fmap catMaybes . mapM runMaybeT $ -- Define the menu items of the
, do , do
guardVolatile clusterVolatileWorkflowsEnabled guardVolatile clusterVolatileWorkflowsEnabled
-- authCtx <- getAuthContext return NavHeader
-- (haveInstances, haveWorkflows) <- lift . memcachedBy (Just . Right $ 2 * diffMinute) (NavCacheHaveTopWorkflowsInstances authCtx) . useRunDB $ (,)
-- <$> haveTopWorkflowInstances
-- <*> haveTopWorkflowWorkflows
mUserId <- maybeAuthId
-- if | haveInstances -> return NavHeader
if | isJust mUserId -> return NavHeader
{ navHeaderRole = NavHeaderPrimary { navHeaderRole = NavHeaderPrimary
, navIcon = IconMenuWorkflows , navIcon = IconMenuWorkflows
, navLink = NavLink , navLink = NavLink
@ -780,19 +773,39 @@ defaultLinks = fmap catMaybes . mapM runMaybeT $ -- Define the menu items of the
, navForceActive = False , navForceActive = False
} }
} }
-- | haveWorkflows -> return NavHeader
-- -- authCtx <- getAuthContext
-- -- (haveInstances, haveWorkflows) <- lift . memcachedBy (Just . Right $ 2 * diffMinute) (NavCacheHaveTopWorkflowsInstances authCtx) . useRunDB $ (,)
-- -- <$> haveTopWorkflowInstances
-- -- <*> haveTopWorkflowWorkflows
-- mUserId <- maybeAuthId
-- -- if | haveInstances -> return NavHeader
-- if | isJust mUserId -> return NavHeader
-- { navHeaderRole = NavHeaderPrimary -- { navHeaderRole = NavHeaderPrimary
-- , navIcon = IconMenuWorkflows -- , navIcon = IconMenuWorkflows
-- , navLink = NavLink -- , navLink = NavLink
-- { navLabel = MsgMenuTopWorkflowWorkflowListHeader -- { navLabel = MsgMenuTopWorkflowInstanceList
-- , navRoute = TopWorkflowWorkflowListR -- , navRoute = TopWorkflowInstanceListR
-- , navAccess' = NavAccessTrue -- , navAccess' = NavAccessTrue
-- , navType = NavTypeLink { navModal = False } -- , navType = NavTypeLink { navModal = False }
-- , navQuick' = mempty -- , navQuick' = mempty
-- , navForceActive = False -- , navForceActive = False
-- } -- }
-- } -- }
| otherwise -> mzero -- -- | haveWorkflows -> return NavHeader
-- -- { navHeaderRole = NavHeaderPrimary
-- -- , navIcon = IconMenuWorkflows
-- -- , navLink = NavLink
-- -- { navLabel = MsgMenuTopWorkflowWorkflowListHeader
-- -- , navRoute = TopWorkflowWorkflowListR
-- -- , navAccess' = NavAccessTrue
-- -- , navType = NavTypeLink { navModal = False }
-- -- , navQuick' = mempty
-- -- , navForceActive = False
-- -- }
-- -- }
-- | otherwise -> mzero
, return NavHeaderContainer , return NavHeaderContainer
{ navHeaderRole = NavHeaderPrimary { navHeaderRole = NavHeaderPrimary
, navLabel = SomeMessage MsgMenuAdminHeading , navLabel = SomeMessage MsgMenuAdminHeading