Commit b3fad287 authored by Yoelis Acourt's avatar Yoelis Acourt

hide stuff behind feature flags:

update terms options
landing page stuff
community side
parent 463bc224
Pipeline #7617 passed with stages
in 30 minutes and 21 seconds
......@@ -17,6 +17,7 @@ import Gargantext.Components.PhyloExplorer.API as Phylo
import Gargantext.Components.PhyloExplorer.Config.ConfigForm as PhyloForm
import Gargantext.Components.PhyloExplorer.ConfigFormParser as PhyloHook
import Gargantext.Config.REST (AffRESTError)
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID, NodeType(..))
......@@ -263,16 +264,25 @@ updateNodeListCpt = here.component "updateNodeList" cpt
, iconName: "reload-with-settings"
, textTitle: "Update terms"
}
[ Tools.formChoiceSafe
{ items: [ Basic, Advanced, WithModel ]
, default: methodList'
, callback: \val -> T.write_ val methodList
, print: show
, label: "Update with:"
[ Feature.feature
{ keys: [ "expert" ]
, render: \shouldRender ->
if shouldRender then viewUpdateTermsOptions methodList' methodList [ Basic, Advanced, WithModel ]
else viewUpdateTermsOptions methodList' methodList [ Basic ]
}
[]
]
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 = R.createElement updateTextsCpt
......
......@@ -23,6 +23,7 @@ import Reactix as R
import Reactix.DOM.HTML as H
import Record.Extra as RX
import Toestand as T
import Gargantext.Hooks.UseFeatureFlag as Feature
here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Tools"
......@@ -280,7 +281,7 @@ formChoiceSafeCpt = here.component "formChoiceSafe" cpt
cpt { items, default, callback, print, label } _ = do
pure $ case items of
[] -> H.div {} []
[ n ] -> formButton { item: n, callback, print } []
-- [ n ] -> formButton { item: n, callback, print } []
_ -> formChoice { items, default, callback, print, label } []
type FormChoiceProps item m =
......@@ -304,14 +305,23 @@ formChoiceCpt = here.component "formChoice" cpt
cpt { items, callback, default, print, label } _ = do
pure $ H.div { className: "form-group" }
[ H.label {} [ H.text label ]
, R2.select
{ className: "form-control with-icon-font"
, defaultValue: show default
, on: { change }
} $ map option items
, Feature.feature
{ keys: [ "expert" ]
, render: \shouldRender ->
if shouldRender then viewSelectNodeOptions $ map option items
else viewSelectNodeOptions $ map option (A.filter (\i -> print i `A.notElem` [ "Visio", "Annuaire" ]) items)
}
]
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
option opt = H.option { value: show opt } [ H.text $ print opt ]
......
......@@ -25,6 +25,7 @@ import Gargantext.Components.App.Store as AppStore
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Elevation(..), Variant(..))
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.Legend as Legend
import Gargantext.Components.GraphExplorer.Store as GraphStore
......@@ -101,12 +102,22 @@ sidebarCpt = here.component "sidebar" cpt
, callback: closeCallback
, className: "graph-sidebar__close"
}
,
-- Menu
B.tabs
{ value: sideTab'
, list: sideTabs
, callback: flip T.write_ sideTab
-- Menu
, Feature.feature
{ keys: [ "expert" ]
, 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
GET.SideTabLegend -> sideTabLegend props
......
......@@ -39,6 +39,7 @@ import Gargantext.Components.Bootstrap.Types (Elevation(..), Position(..), Toolt
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.FolderView as FV
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Hooks.UseFeatureFlag as Feature
import Gargantext.Components.Lang.Landing.EnUS as En
import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Config as Config
......@@ -138,7 +139,7 @@ homeLayoutCpt = here.component "homeLayout" cpt
]
-- @TODO
-- H.div { className: "home-research-form" } []
, blocksRandomText' landingData
, Feature.hide { keys: [ "expert" ], render: blocksRandomText' landingData }
, B.wad
[ "mt-8" ]
[ license
......
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