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