Commit 18aab30e authored by Fabien Maniere's avatar Fabien Maniere

Merge branch 'feature-flags-hide' into 'dev'

Feature flags hide

See merge request !511
parents 3f014a95 b3fad287
Pipeline #7626 passed with stages
in 23 minutes and 2 seconds
...@@ -49,7 +49,7 @@ bundle.js ...@@ -49,7 +49,7 @@ bundle.js
/dist/bundle.min.js* /dist/bundle.min.js*
# IDE specific # IDE specific
.idea/ .vscode
.vscode/ dist/dev/bundle
dist/dev
.parcel-cache/ .parcel-cache
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"test": "spago test", "test": "spago test",
"dev": "concurrently \"npm run watch\" \"npm run serve\" ", "dev": "concurrently \"npm run watch\" \"npm run serve\" ",
"serve": "npx parcel serve --dist-dir ./dist/dev/bundle ./dist/dev/index.html", "serve": "npx parcel serve --dist-dir ./dist/dev/bundle ./dist/dev/index.html",
"format-ps": "purs-tidy format-in-place src",
"prepare": "husky" "prepare": "husky"
}, },
"dependencies": { "dependencies": {
......
...@@ -22,6 +22,7 @@ import Gargantext.Utils.Reactix as R2 ...@@ -22,6 +22,7 @@ import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
import Gargantext.Hooks.UseFeatureFlag as Feature
type Props = type Props =
( nodeId :: ID ( nodeId :: ID
...@@ -107,28 +108,11 @@ layoutCpt = here.component "layout" cpt ...@@ -107,28 +108,11 @@ layoutCpt = here.component "layout" cpt
[ editionBlock [ editionBlock
{ nodeId } { nodeId }
] ]
, H.div , Feature.hide
{ className: "node-layout__code-section corpus-layout__code-section" } { keys: [ "expert" ]
[ tileMenu , render: viewCodeSectionButton boxes corpusCodeRoute
{ boxes
, currentTile: Just corpusCodeRoute }
, xTile: Just corpusCodeRoute
, yTile: Just corpusCodeRoute
}
[ B.button
{ callback: const $ pure unit
, status: Muted
, size: SmallSize
, variant: ButtonVariant Secondary
}
[ B.icon
{ name: "code" }
, B.wad_
[ "d-inline-block", "virtual-space", "w-1" ]
, H.text "Code section"
]
]
]
, H.div , H.div
{ className: "node-layout__folders corpus-layout__folders" } { className: "node-layout__folders corpus-layout__folders" }
[ FV.folderView [ FV.folderView
...@@ -138,6 +122,31 @@ layoutCpt = here.component "layout" cpt ...@@ -138,6 +122,31 @@ layoutCpt = here.component "layout" cpt
] ]
] ]
viewCodeSectionButton :: Record AppStore.Store -> (Unit -> Effect GR.AppRoute) -> R.Element
viewCodeSectionButton boxes corpusCodeRoute =
H.div
{ className: "node-layout__code-section corpus-layout__code-section" }
[ tileMenu
{ boxes
, currentTile: Just corpusCodeRoute
, xTile: Just corpusCodeRoute
, yTile: Just corpusCodeRoute
}
[ B.button
{ callback: const $ pure unit
, status: Muted
, size: SmallSize
, variant: ButtonVariant Secondary
}
[ B.icon
{ name: "code" }
, B.wad_
[ "d-inline-block", "virtual-space", "w-1" ]
, H.text "Code section"
]
]
]
onExpandTableEditionChange :: T.Change Boolean -> Effect Unit onExpandTableEditionChange :: T.Change Boolean -> Effect Unit
onExpandTableEditionChange { new } = do onExpandTableEditionChange { new } = do
cache <- R2.loadLocalStorageState' R2.appParamsKey defaultCacheParams cache <- R2.loadLocalStorageState' R2.appParamsKey defaultCacheParams
......
...@@ -86,43 +86,6 @@ derive instance Generic DocumentV3 _ ...@@ -86,43 +86,6 @@ derive instance Generic DocumentV3 _
derive instance Newtype DocumentV3 _ derive instance Newtype DocumentV3 _
derive newtype instance JSON.ReadForeign DocumentV3 derive newtype instance JSON.ReadForeign DocumentV3
derive newtype instance JSON.WriteForeign DocumentV3 derive newtype instance JSON.WriteForeign DocumentV3
instance Show DocumentV3 where
show = genericShow
defaultNodeDocumentV3 :: NodePoly DocumentV3
defaultNodeDocumentV3 =
NodePoly
{ id: 0
, typename: 0
, userId: 0
, parentId: Just 0
, name: "Default name"
, date: "Default date"
, hyperdata: defaultDocumentV3
}
defaultDocumentV3 :: DocumentV3
defaultDocumentV3 =
DocumentV3
{ abstract: Nothing
, authors: Nothing
--, error : Nothing
, language_iso2: Nothing
, language_iso3: Nothing
, language_name: Nothing
, publication_date: Nothing
, publication_day: Nothing
, publication_hour: Nothing
, publication_minute: Nothing
, publication_month: Nothing
, publication_second: Nothing
, publication_year: Nothing
, realdate_full_: Nothing
, source: Nothing
, statuses: Nothing
, title: Nothing
}
newtype Document = newtype Document =
Document Document
{ abstract :: Maybe String { abstract :: Maybe String
......
...@@ -23,6 +23,7 @@ import Gargantext.Components.ListSelection as ListSelection ...@@ -23,6 +23,7 @@ import Gargantext.Components.ListSelection as ListSelection
import Gargantext.Components.ListSelection.Types as ListSelection import Gargantext.Components.ListSelection.Types as ListSelection
import Gargantext.Config.Utils (handleRESTError) import Gargantext.Config.Utils (handleRESTError)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Sessions (Session(..)) import Gargantext.Sessions (Session(..))
import Gargantext.Types (FrontendError) import Gargantext.Types (FrontendError)
import Gargantext.Types as GT import Gargantext.Types as GT
...@@ -324,7 +325,16 @@ dataFieldNavCpt = here.component "dataFieldNav" cpt ...@@ -324,7 +325,16 @@ dataFieldNavCpt = here.component "dataFieldNav" cpt
pure $ R.fragment pure $ R.fragment
[ H.div { className: "text-primary text-bold p-1" } [ H.text "Search options:" ] [ H.div { className: "text-primary text-bold p-1" } [ H.text "Search options:" ]
, H.div { className: "nav nav-tabs" } ((liItem search') <$> dataFields) , Feature.feature
{ keys: [ "expert" ]
, render: \shouldRender ->
let
viewTabs d = H.div { className: "nav nav-tabs" } ((liItem search') <$> d)
in
if shouldRender then viewTabs dataFields
-- This hides the web tab in search
else viewTabs $ A.filter (\i -> i /= Web) dataFields
}
, H.div { className: "center p-1" } , H.div { className: "center p-1" }
[ H.text $ doc datafield [ H.text $ doc datafield
] ]
...@@ -673,7 +683,7 @@ datafieldInputCpt = here.component "datafieldInput" cpt ...@@ -673,7 +683,7 @@ datafieldInputCpt = here.component "datafieldInput" cpt
else else
H.div {} [] H.div {} []
, H.div {} [ searchIframes { iframeRef, search } [] ] , Feature.hide { keys: [ "expert" ], render: H.div {} [ searchIframes { iframeRef, search } [] ] }
] ]
type SearchInputProps = type SearchInputProps =
...@@ -741,11 +751,12 @@ submitButtonComponent = here.component "submitButton" cpt ...@@ -741,11 +751,12 @@ submitButtonComponent = here.component "submitButton" cpt
cpt { errors, onSearch, search, selection, session } _ = do cpt { errors, onSearch, search, selection, session } _ = do
search' <- T.useLive T.unequal search search' <- T.useLive T.unequal search
selection' <- T.useLive T.unequal selection selection' <- T.useLive T.unequal selection
{ datafield } <- T.read search
pure $ pure $
H.button H.button
{ className: "btn btn-primary" { className: "btn btn-primary " <> if datafield == External Empty then "disabled" else ""
, "type": "button" , "type": "button"
, "disabled": if datafield == External Empty then "true" else "false"
, on: { click: doSearch onSearch errors session selection' search' } , on: { click: doSearch onSearch errors session selection' search' }
, style: { width: "100%" } , style: { width: "100%" }
} }
......
...@@ -17,6 +17,7 @@ import Gargantext.Components.PhyloExplorer.API as Phylo ...@@ -17,6 +17,7 @@ import Gargantext.Components.PhyloExplorer.API as Phylo
import Gargantext.Components.PhyloExplorer.Config.ConfigForm as PhyloForm import Gargantext.Components.PhyloExplorer.Config.ConfigForm as PhyloForm
import Gargantext.Components.PhyloExplorer.ConfigFormParser as PhyloHook import Gargantext.Components.PhyloExplorer.ConfigFormParser as PhyloHook
import Gargantext.Config.REST (AffRESTError) import Gargantext.Config.REST (AffRESTError)
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post) import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID, NodeType(..)) import Gargantext.Types (ID, NodeType(..))
...@@ -263,16 +264,25 @@ updateNodeListCpt = here.component "updateNodeList" cpt ...@@ -263,16 +264,25 @@ updateNodeListCpt = here.component "updateNodeList" cpt
, iconName: "reload-with-settings" , iconName: "reload-with-settings"
, textTitle: "Update terms" , textTitle: "Update terms"
} }
[ Tools.formChoiceSafe [ Feature.feature
{ items: [ Basic, Advanced, WithModel ] { keys: [ "expert" ]
, default: methodList' , render: \shouldRender ->
, callback: \val -> T.write_ val methodList if shouldRender then viewUpdateTermsOptions methodList' methodList [ Basic, Advanced, WithModel ]
, print: show else viewUpdateTermsOptions methodList' methodList [ Basic ]
, label: "Update with:"
} }
[]
] ]
viewUpdateTermsOptions :: forall box11 t13. Show t13 => T.Write box11 t13 => t13 -> box11 -> Array t13 -> R.Element
viewUpdateTermsOptions methodList' methodList items =
Tools.formChoiceSafe
{ items: items
, default: methodList'
, callback: \val -> T.write_ val methodList
, print: show
, label: "Update with:"
}
[]
updateTexts :: R2.Component UpdateProps updateTexts :: R2.Component UpdateProps
updateTexts = R.createElement updateTextsCpt updateTexts = R.createElement updateTextsCpt
......
...@@ -92,7 +92,7 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument ...@@ -92,7 +92,7 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument
[ H.div [ H.div
{ className: "form-group__label" } { className: "form-group__label" }
[ B.label_ $ [ B.label_ $
"Please select the language of your current Notes:" "Select the language of your current Notes:"
] ]
, H.div , H.div
{ className: "form-group__field" } { className: "form-group__field" }
...@@ -111,7 +111,7 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument ...@@ -111,7 +111,7 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument
[ H.div [ H.div
{ className: "form-group__label" } { className: "form-group__label" }
[ B.label_ $ [ B.label_ $
"Please set the document size you require:" "Choose the length of the context window:"
] ]
, H.div , H.div
{ className: "form-group__field" } { className: "form-group__field" }
...@@ -130,7 +130,7 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument ...@@ -130,7 +130,7 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument
[ H.div [ H.div
{ className: "form-group__label" } { className: "form-group__label" }
[ B.label_ $ [ B.label_ $
"Please choose the list of terms to use:" "Choose the list of terms to use:"
] ]
, H.div , H.div
{ className: "form-group__field" } { className: "form-group__field" }
......
...@@ -23,6 +23,7 @@ import Reactix as R ...@@ -23,6 +23,7 @@ import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Record.Extra as RX import Record.Extra as RX
import Toestand as T import Toestand as T
import Gargantext.Hooks.UseFeatureFlag as Feature
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Tools" here = R2.here "Gargantext.Components.Forest.Tree.Node.Tools"
...@@ -280,7 +281,7 @@ formChoiceSafeCpt = here.component "formChoiceSafe" cpt ...@@ -280,7 +281,7 @@ formChoiceSafeCpt = here.component "formChoiceSafe" cpt
cpt { items, default, callback, print, label } _ = do cpt { items, default, callback, print, label } _ = do
pure $ case items of pure $ case items of
[] -> H.div {} [] [] -> H.div {} []
[ n ] -> formButton { item: n, callback, print } [] -- [ n ] -> formButton { item: n, callback, print } []
_ -> formChoice { items, default, callback, print, label } [] _ -> formChoice { items, default, callback, print, label } []
type FormChoiceProps item m = type FormChoiceProps item m =
...@@ -304,14 +305,23 @@ formChoiceCpt = here.component "formChoice" cpt ...@@ -304,14 +305,23 @@ formChoiceCpt = here.component "formChoice" cpt
cpt { items, callback, default, print, label } _ = do cpt { items, callback, default, print, label } _ = do
pure $ H.div { className: "form-group" } pure $ H.div { className: "form-group" }
[ H.label {} [ H.text label ] [ H.label {} [ H.text label ]
, R2.select , Feature.feature
{ className: "form-control with-icon-font" { keys: [ "expert" ]
, defaultValue: show default , render: \shouldRender ->
, on: { change } if shouldRender then viewSelectNodeOptions $ map option items
} $ map option items else viewSelectNodeOptions $ map option (A.filter (\i -> print i `A.notElem` [ "Visio", "Annuaire" ]) items)
}
] ]
where where
viewSelectNodeOptions options =
R2.select
{ className: "form-control with-icon-font"
, defaultValue: show default
, on: { change }
} $ options
change e = callback $ fromMaybe default $ reader $ R.unsafeEventValue e change e = callback $ fromMaybe default $ reader $ R.unsafeEventValue e
option opt = H.option { value: show opt } [ H.text $ print opt ] option opt = H.option { value: show opt } [ H.text $ print opt ]
......
...@@ -25,6 +25,7 @@ import Gargantext.Components.App.Store as AppStore ...@@ -25,6 +25,7 @@ import Gargantext.Components.App.Store as AppStore
import Gargantext.Components.Bootstrap as B import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Elevation(..), Variant(..)) import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Elevation(..), Variant(..))
import Gargantext.Components.GraphExplorer.Sidebar.ContactList (contactListWrapper) import Gargantext.Components.GraphExplorer.Sidebar.ContactList (contactListWrapper)
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Components.GraphExplorer.Sidebar.DocList (docListWrapper) import Gargantext.Components.GraphExplorer.Sidebar.DocList (docListWrapper)
import Gargantext.Components.GraphExplorer.Sidebar.Legend as Legend import Gargantext.Components.GraphExplorer.Sidebar.Legend as Legend
import Gargantext.Components.GraphExplorer.Store as GraphStore import Gargantext.Components.GraphExplorer.Store as GraphStore
...@@ -101,12 +102,22 @@ sidebarCpt = here.component "sidebar" cpt ...@@ -101,12 +102,22 @@ sidebarCpt = here.component "sidebar" cpt
, callback: closeCallback , callback: closeCallback
, className: "graph-sidebar__close" , className: "graph-sidebar__close"
} }
,
-- Menu -- Menu
B.tabs
{ value: sideTab' , Feature.feature
, list: sideTabs { keys: [ "expert" ]
, callback: flip T.write_ sideTab , render: \shouldRender ->
if shouldRender then B.tabs
{ value: sideTab'
, list: sideTabs
, callback: flip T.write_ sideTab
}
else B.tabs
{ value: sideTab'
, list: [ GET.SideTabLegend, GET.SideTabData ]
, callback: flip T.write_ sideTab
}
} }
, case sideTab' of , case sideTab' of
GET.SideTabLegend -> sideTabLegend props GET.SideTabLegend -> sideTabLegend props
......
...@@ -39,6 +39,7 @@ import Gargantext.Components.Bootstrap.Types (Elevation(..), Position(..), Toolt ...@@ -39,6 +39,7 @@ import Gargantext.Components.Bootstrap.Types (Elevation(..), Position(..), Toolt
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..)) import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.FolderView as FV import Gargantext.Components.FolderView as FV
import Gargantext.Components.Lang (LandingLang(..)) import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Components.Lang.Landing.EnUS as En import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Config as Config import Gargantext.Config as Config
...@@ -138,7 +139,7 @@ homeLayoutCpt = here.component "homeLayout" cpt ...@@ -138,7 +139,7 @@ homeLayoutCpt = here.component "homeLayout" cpt
] ]
-- @TODO -- @TODO
-- H.div { className: "home-research-form" } [] -- H.div { className: "home-research-form" } []
, blocksRandomText' landingData , Feature.hide { keys: [ "expert" ], render: blocksRandomText' landingData }
, B.wad , B.wad
[ "mt-8" ] [ "mt-8" ]
[ license [ license
......
module Gargantext.Components.TopBar (component) where module Gargantext.Components.TopBar (component) where
import Gargantext.Prelude
import Affjax.RequestBody (document)
import Data.Foldable (intercalate) import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..), isJust, fromMaybe)
import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Effect.Console (log)
import Gargantext.Components.App.Store as AppStore import Gargantext.Components.App.Store as AppStore
import Gargantext.Components.Bootstrap as B import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..)) import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..))
import Gargantext.Components.Themes (themeSwitcher, allThemes) import Gargantext.Components.Themes (themeSwitcher, allThemes)
import Gargantext.Prelude import Gargantext.Components.Themes as Themes
import Gargantext.Hooks.FirstEffect (useFirstEffect')
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Sessions.Types (update)
import Gargantext.Types (Handed(..), defaultCacheParams) import Gargantext.Types (Handed(..), defaultCacheParams)
import Gargantext.Utils (setter, (?)) import Gargantext.Utils (setter, (?))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix (Hooks)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
import Web.HTML (window)
import Web.HTML.Location (host, protocol)
import Web.HTML.Window as Window
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.TopBar" here = R2.here "Gargantext.Components.TopBar"
...@@ -31,9 +44,15 @@ componentCpt = here.component "main" cpt ...@@ -31,9 +44,15 @@ componentCpt = here.component "main" cpt
} <- AppStore.use } <- AppStore.use
showTree' <- R2.useLive' showTree showTree' <- R2.useLive' showTree
(windowLocation /\ updateWindowLocation) <- R.useState' Nothing
-- | Effects -- | Effects
-- | -- |
useFirstEffect' $ do
l <- window >>= Window.location >>= host
protocol <- window >>= Window.location >>= protocol
let url = protocol <> "//" <> l
updateWindowLocation (\_prev -> Just url)
-- | Behaviors -- | Behaviors
-- | -- |
...@@ -53,80 +72,19 @@ componentCpt = here.component "main" cpt ...@@ -53,80 +72,19 @@ componentCpt = here.component "main" cpt
, role: "navigation" , role: "navigation"
} }
[ logo [ logo
, divDropdownLeft {} [] , viewSideBar showTree' onTreeToggleClick
, H.li , viewChangeLayoutSide
{ title: "If you are Left Handed you can change\n" , viewInfoMenu { location: windowLocation } []
<> "the interface by clicking on me. Click\n" , Feature.hide
<> "again to come back to previous state." { keys: [ "expert" ]
, className: "nav-item main-topbar__hand-button" , render: viewQuestionMark
} }
[ handedChooser
{} , Feature.hide
] { keys: [ "expert" ]
, H.li , render: viewThemeSelector theme
{ title: "Hello! Looking for the tree?\n"
<> "Just watch on the other side!\n"
<> "Click on the hand again to see it back."
, className: "nav-item main-topbar__help-button"
} }
[ H.a
{ className: "nav-link navbar-text" }
[ H.span
{ className: "fa fa-question-circle-o" }
[]
]
]
, H.li { className: "nav-item" }
[ B.button
{ variant: showTree'
? ButtonVariant Light
$
OutlinedButtonVariant Light
, callback: onTreeToggleClick
, className: "main-topbar__tree-switcher rounded-circle-2"
, title:
if showTree' then "Hide Tree"
else "Show Tree"
}
[ B.icon
{ name: "sidebar"
, className: ""
}
-- ,
-- if showTree'
-- then H.text $ nbsp 1 <> "Hide Tree"
-- else H.text $ nbsp 1 <> "Show Tree"
]
]
, H.li
{ className: "nav-item main-topbar__theme-switcher" }
[ themeSwitcher
{ theme
, themes: allThemes
}
[]
]
{- ,
H.li { className: "nav-item main-topbar__lang-switcher" }
[ langSwitcher
{ lang
, langs: allFeLangs
} []
]-}
{- , B.button
{ variant: showTree' ?
ButtonVariant Light $
OutlinedButtonVariant Light
, callback: onTreeToggleClick
, className: "main-topbar__tree-switcher"
}
[
if showTree'
then H.text "Hide Tree"
else H.text "Show Tree"
]-}
, H.div , H.div
{ id: "portal-topbar" { id: "portal-topbar"
, className: "ml-1 w-100 h-100" , className: "ml-1 w-100 h-100"
...@@ -134,6 +92,71 @@ componentCpt = here.component "main" cpt ...@@ -134,6 +92,71 @@ componentCpt = here.component "main" cpt
[] []
] ]
viewChangeLayoutSide :: R.Element
viewChangeLayoutSide =
H.li
{ title: "If you are Left Handed you can change\n"
<> "the interface by clicking on me. Click\n"
<> "again to come back to previous state."
, className: "nav-item main-topbar__hand-button"
}
[ handedChooser
{}
]
viewSideBar :: Boolean -> (Unit -> Effect Unit) -> R.Element
viewSideBar showTree' onTreeToggleClick =
H.li { className: "nav-item" }
[ B.button
{ variant: showTree'
? ButtonVariant Light
$
OutlinedButtonVariant Light
, callback: onTreeToggleClick
, className: "main-topbar__tree-switcher rounded-circle-2"
, title:
if showTree' then "Hide Tree"
else "Show Tree"
}
[ B.icon
{ name: "sidebar"
, className: ""
}
]
]
viewThemeSelector :: T.Box Themes.Theme -> R.Element
viewThemeSelector theme =
H.li
{ className: "nav-item main-topbar__theme-switcher" }
[ themeSwitcher
{ theme
, themes: allThemes
}
[]
]
empty :: R.Element
empty =
H.text ""
viewQuestionMark :: R.Element
viewQuestionMark =
H.li
{ title: "Hello! Looking for the tree?\n"
<> "Just watch on the other side!\n"
<> "Click on the hand again to see it back."
, className: "nav-item main-topbar__help-button"
}
[ H.a
{ className: "nav-link navbar-text" }
[ H.span
{ className: "fa fa-question-circle-o" }
[]
]
]
-- SB.searchBar {session, databases: allDatabases} -- SB.searchBar {session, databases: allDatabases}
onTreeToggleChange :: Boolean -> Effect Unit onTreeToggleChange :: Boolean -> Effect Unit
...@@ -154,28 +177,28 @@ logo = ...@@ -154,28 +177,28 @@ logo =
src = "images/logoSmall.png" src = "images/logoSmall.png"
title = "Back to home" title = "Back to home"
divDropdownLeft :: R2.Component () viewInfoMenu :: R2.Component (location :: Maybe String)
divDropdownLeft = R.createElement divDropdownLeftCpt viewInfoMenu = R.createElement viewInfoMenu'
divDropdownLeftCpt :: R.Component () viewInfoMenu' :: R.Component (location :: Maybe String)
divDropdownLeftCpt = here.component "divDropdownLeft" cpt viewInfoMenu' = here.component "divDropdownLeft" cpt
where where
cpt {} _ = do cpt { location } _ = do
show <- T.useBox false show <- T.useBox false
pure $ H.li { className: "nav-item dropdown" } pure $ H.li { className: "nav-item dropdown" }
[ menuButton { element: menuElement, show } [] [ menuButton { element: menuElement, show } []
, menuElements { elements, show } [] , menuElements { elements: elements location, show } []
] ]
menuElement = LiNav menuElement = LiNav
{ title: "GarganText" { title: "GarganText"
, href: "#" , href: "#"
, icon: "fa fa-navicon" , icon: "fa fa-question-circle-o"
, text: "GarganText" , text: "infos"
} }
elements = elements location =
[ [ LiNav [ [ LiNav
{ title: "User documentation" { title: "User documentation"
, href: "https://write.frame.gargantext.org/s/649a6d7e1db3b365d6d0b1430d9700cc0bb4fdb1348dd1040a94c95f98979abe" , href: "https://write.frame.gargantext.org/s/649a6d7e1db3b365d6d0b1430d9700cc0bb4fdb1348dd1040a94c95f98979abe"
...@@ -228,7 +251,13 @@ divDropdownLeftCpt = here.component "divDropdownLeft" cpt ...@@ -228,7 +251,13 @@ divDropdownLeftCpt = here.component "divDropdownLeft" cpt
-} -}
, LiNav , LiNav
{ title: "API documentation" { title: "API documentation"
, href: "https://cnrs.gargantext.org/swagger-ui" , href: case location of
Just l ->
l <> "/swagger-ui"
Nothing ->
"https://cnrs.gargantext.org/swagger-ui"
, icon: "fa fa-code-fork" , icon: "fa fa-code-fork"
, text: "API documentation" , text: "API documentation"
} }
......
...@@ -53,6 +53,13 @@ feature = R2.renderLeaf "" $ ...@@ -53,6 +53,13 @@ feature = R2.renderLeaf "" $
render shouldRender render shouldRender
) )
hide = R2.renderLeaf "" $
( \{ keys, render } _ -> do
shouldRender <- useFeatureFlag keys
pure $
if shouldRender then render else H.text ""
)
hideBehind :: forall a. Array String -> R2.Component a -> R2.Component a hideBehind :: forall a. Array String -> R2.Component a -> R2.Component a
hideBehind keys cpt = R2.renderComponent "" \props children -> do hideBehind keys cpt = R2.renderComponent "" \props children -> do
shouldRender <- useFeatureFlag keys shouldRender <- useFeatureFlag keys
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment