Commit 07ecded6 authored by Fabien Manière's avatar Fabien Manière

WIP, part1

parent d180ce86
Pipeline #4500 failed with stage
in 0 seconds
...@@ -6382,6 +6382,10 @@ h3 { ...@@ -6382,6 +6382,10 @@ h3 {
text-align: center; text-align: center;
} }
.range-simple__input:focus {
box-shadow: none;
}
.b-tabs .nav-item:first-child { .b-tabs .nav-item:first-child {
margin-left: 16px; margin-left: 16px;
} }
......
...@@ -6193,6 +6193,10 @@ h3 { ...@@ -6193,6 +6193,10 @@ h3 {
text-align: center; text-align: center;
} }
.range-simple__input:focus {
box-shadow: none;
}
.b-tabs .nav-item:first-child { .b-tabs .nav-item:first-child {
margin-left: 16px; margin-left: 16px;
} }
......
...@@ -5948,6 +5948,10 @@ h3 { ...@@ -5948,6 +5948,10 @@ h3 {
text-align: center; text-align: center;
} }
.range-simple__input:focus {
box-shadow: none;
}
.b-tabs .nav-item:first-child { .b-tabs .nav-item:first-child {
margin-left: 16px; margin-left: 16px;
} }
......
...@@ -6196,6 +6196,10 @@ h3 { ...@@ -6196,6 +6196,10 @@ h3 {
text-align: center; text-align: center;
} }
.range-simple__input:focus {
box-shadow: none;
}
.b-tabs .nav-item:first-child { .b-tabs .nav-item:first-child {
margin-left: 16px; margin-left: 16px;
} }
......
...@@ -6197,6 +6197,10 @@ h3 { ...@@ -6197,6 +6197,10 @@ h3 {
text-align: center; text-align: center;
} }
.range-simple__input:focus {
box-shadow: none;
}
.b-tabs .nav-item:first-child { .b-tabs .nav-item:first-child {
margin-left: 16px; margin-left: 16px;
} }
......
...@@ -22,6 +22,9 @@ type Options = ...@@ -22,6 +22,9 @@ type Options =
, type :: String , type :: String
, placeholder :: String , placeholder :: String
, size :: Sizing , size :: Sizing
, step :: String
, min :: String
, max :: String
) )
options :: Record Options options :: Record Options
...@@ -31,6 +34,9 @@ options = ...@@ -31,6 +34,9 @@ options =
, type : "text" , type : "text"
, placeholder : "" , placeholder : ""
, size : MediumSize , size : MediumSize
, step : ""
, min : ""
, max : ""
} }
-- | Structural Component for the Bootstrap input -- | Structural Component for the Bootstrap input
...@@ -73,6 +79,9 @@ component = R.hooksComponent componentName cpt where ...@@ -73,6 +79,9 @@ component = R.hooksComponent componentName cpt where
, readOnly: elem status [ Idled ] , readOnly: elem status [ Idled ]
, placeholder: props.placeholder , placeholder: props.placeholder
, type: props.type , type: props.type
, step: props.step
, min: props.min
, max: props.max
, autoComplete: "off" , autoComplete: "off"
, value: props.value , value: props.value
} }
......
...@@ -343,6 +343,7 @@ panelActionCpt = here.component "panelAction" cpt ...@@ -343,6 +343,7 @@ panelActionCpt = here.component "panelAction" cpt
cpt { action: Config, nodeType } _ = cpt { action: Config, nodeType } _ =
pure $ fragmentPT $ "Config " <> show nodeType pure $ fragmentPT $ "Config " <> show nodeType
-- Functions using SubTree -- Functions using SubTree
cpt { action: Reconstruct , dispatch, nodeType } _ = pure $ update { dispatch, nodeType } []
cpt { action: Merge {subTreeParams}, boxes, dispatch, id, nodeType, session } _ = cpt { action: Merge {subTreeParams}, boxes, dispatch, id, nodeType, session } _ =
pure $ mergeNode { boxes, dispatch, id, nodeType, session, subTreeParams } [] pure $ mergeNode { boxes, dispatch, id, nodeType, session, subTreeParams } []
cpt { action: Move {subTreeParams}, boxes, dispatch, id, nodeType, session } _ = cpt { action: Move {subTreeParams}, boxes, dispatch, id, nodeType, session } _ =
......
...@@ -13,7 +13,7 @@ if user has access to node then he can do all his related actions ...@@ -13,7 +13,7 @@ if user has access to node then he can do all his related actions
------------------------------------------------------------------------ ------------------------------------------------------------------------
data NodeAction = Documentation NodeType data NodeAction = Documentation NodeType
| SearchBox | SearchBox
| Download | Upload | Refresh | Config | Download | Upload | Refresh | Config | Reconstruct
| Delete | Delete
| Share | Share
| ManageTeam | ManageTeam
...@@ -43,6 +43,7 @@ instance Eq NodeAction where ...@@ -43,6 +43,7 @@ instance Eq NodeAction where
eq (Add x) (Add y) = x == y eq (Add x) (Add y) = x == y
eq (Merge x) (Merge y) = x == y eq (Merge x) (Merge y) = x == y
eq Config Config = true eq Config Config = true
eq Reconstruct Reconstruct = true
eq (Publish x) (Publish y) = x == y eq (Publish x) (Publish y) = x == y
eq AddingContact AddingContact = true eq AddingContact AddingContact = true
eq CloseNodePopover CloseNodePopover = true eq CloseNodePopover CloseNodePopover = true
...@@ -61,6 +62,7 @@ instance Show NodeAction where ...@@ -61,6 +62,7 @@ instance Show NodeAction where
show Share = "Share" show Share = "Share"
show ManageTeam = "Team" show ManageTeam = "Team"
show Config = "Config" show Config = "Config"
show Reconstruct = "Reconstruct"
show (Link _) = "Link to " -- <> show x show (Link _) = "Link to " -- <> show x
show (Add _) = "Add Child" -- foldl (\a b -> a <> show b) "Add " xs show (Add _) = "Add Child" -- foldl (\a b -> a <> show b) "Add " xs
show (Merge _) = "Merge with subtree" -- <> show t show (Merge _) = "Merge with subtree" -- <> show t
...@@ -80,6 +82,7 @@ glyphiconNodeAction Download = "download" ...@@ -80,6 +82,7 @@ glyphiconNodeAction Download = "download"
glyphiconNodeAction (Merge _) = "random" glyphiconNodeAction (Merge _) = "random"
glyphiconNodeAction Refresh = "refresh" glyphiconNodeAction Refresh = "refresh"
glyphiconNodeAction Config = "wrench" glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Reconstruct = "cogs"
glyphiconNodeAction Share = "user-plus" glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction ManageTeam = "users" glyphiconNodeAction ManageTeam = "users"
glyphiconNodeAction AddingContact = "user-plus" glyphiconNodeAction AddingContact = "user-plus"
...@@ -224,7 +227,7 @@ settingsBox Phylo = ...@@ -224,7 +227,7 @@ settingsBox Phylo =
SettingsBox { show : true SettingsBox { show : true
, edit : true , edit : true
, doc : Documentation Phylo , doc : Documentation Phylo
, buttons : [ Refresh , buttons : [ Reconstruct
, Delete , Delete
] ]
} }
......
...@@ -11,6 +11,7 @@ hasStatus :: NodeType -> NodeAction -> Status ...@@ -11,6 +11,7 @@ hasStatus :: NodeType -> NodeAction -> Status
hasStatus _ SearchBox = Test hasStatus _ SearchBox = Test
hasStatus _ Refresh = Dev hasStatus _ Refresh = Dev
hasStatus _ Config = Dev hasStatus _ Config = Dev
hasStatus _ Reconstruct = Dev
hasStatus _ (Merge _) = Dev hasStatus _ (Merge _) = Dev
hasStatus _ (Documentation _) = Dev hasStatus _ (Documentation _) = Dev
hasStatus Annuaire Upload = Dev hasStatus Annuaire Upload = Dev
......
...@@ -64,28 +64,27 @@ component = R.hooksComponent "configForm" cpt where ...@@ -64,28 +64,27 @@ component = R.hooksComponent "configForm" cpt where
let modeChoice = let modeChoice =
B.fieldset H.div
{ className: "phylo-config-form__group" { className: "phylo-config-form__group" }
, titleSlot: H.text "Mode Choice"
}
[ [
H.div -- H.div
{ className: "phylo-config-form__row" } -- { className: "phylo-config-form__row" }
[ -- [
H.div -- H.div
{ className: "phylo-config-form__col" } -- { className: "phylo-config-form__col" }
[ -- [
-- Clique type -- Clique type
H.div H.div
{ className: intercalate " " { className: intercalate " "
[ "form-group" [ "form-group"
, "text-center"
] ]
} }
[ [
H.div H.div
{ className: "form-group__label" } { className: "form-group__label" }
[ [
H.label {} [ H.text "Easy or Advanced:" ] H.label {} [ H.text "Mode choice" ]
] ]
, ,
H.div H.div
...@@ -117,17 +116,581 @@ component = R.hooksComponent "configForm" cpt where ...@@ -117,17 +116,581 @@ component = R.hooksComponent "configForm" cpt where
"" ""
} }
[ [
H.text "Expert" H.text "Advanced"
] ]
] ]
] ]
] ]
] -- ]
] -- ]
] ]
-- Render -- Render
let
formAdvanced =
H.form
{ className: "phylo-config-form" }
[
H.div
{ className: "phylo-config-form__group" }
[
H.div
{ className: "" }
[
H.div
{ className: "" }
[
-- Time Unit
B.fieldset
{ className: "phylo-config-form__group mx-0"
, titleSlot: H.text "Time unit"
}
[
-- H.div
-- { className: "phylo-config-form__row" }
-- [
-- H.div { className: "" }
-- [
-- ]
-- ]
-- ,
H.div
{ className: "phylo-config-form__row" }
[
H.div { className: "w-auto phylo-config-form__col text-nowrap" }
[
-- Granularity
H.div
{ className: intercalate " "
[ "form-group"
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Granularity" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formSelect
(bindStateKey "granularity")
[
H.option
{ value: show Year_ }
[ H.text "Year" ]
,
H.option
{ value: show Month_ }
[ H.text "Month" ]
,
H.option
{ value: show Week_ }
[ H.text "Week" ]
,
H.option
{ value: show Day_ }
[ H.text "Day" ]
]
]
]
]
,
H.div
{ className: "w-10 ml-1" }
[
-- Period
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "period") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Period" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "period"
,
R2.when (fv.hasError' "period") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
,
H.div
{ className: "w-10 ml-1" }
[
-- Step
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "step") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Step" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "step"
,
R2.when (fv.hasError' "step") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
,
H.div
{ className: "w-10 ml-1 text-nowrap" }
[
-- Matching frame
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "matchingFrame") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Matching frame" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "matchingFrame"
,
R2.when (fv.hasError' "matchingFrame") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
]
]
,
-- Quality
B.fieldset
{ className: "phylo-config-form__group mx-0"
, titleSlot: H.text "Zoom"
}
[
H.div
{ className: intercalate " "
[ "form-group my-1 text-center"
, (fv.hasError' "quality") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Level of observation" ]
]
,
H.div
{ className: "form-group__field" }
[
H.div { className: "range-simple" }
[
H.div { className: "range-simple__field d-flex" }
[
H.div { className: "col-9 p-0 mx-1 mt-1" } [
B.formInput $
{ className: "range-simple__input p-0 h-auto border-0"
, type: "range"
, step: "0.1"
, min: "0"
, max: "1"
} `merge` bindStateKey "quality"
]
,
H.div { className: "col-3 p-0 mx-1" } [
B.formInput $
{ className: "range-simple__witness text-small"
, type: "number"
, step: "0.1"
, min: "0"
, max: "1"
, status: Disabled
-- , readOnly: Disabled
} `merge` bindStateKey "quality"
]
]
]
]
-- ,
-- B.formInput $
-- { type: "number"
-- , step: "0.1"
-- , min: "0"
-- , max: "1"
-- } `merge` bindStateKey "quality"
]
]
,
B.fieldset
{ className: "phylo-config-form__group"
, titleSlot: H.text "Clusterisation algorythm"
}
[
-- Support
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "support") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Support" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "support"
,
R2.when (fv.hasError' "support") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Size
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Size" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "size"
,
R2.when (fv.hasError' "sjze") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
,
-- Clique
B.fieldset
{ className: "phylo-config-form__group"
, titleSlot: H.text "Clique algorithm"
}
[
H.div
{ className: "phylo-config-form__row" }
[
H.div
{ className: "phylo-config-form__col" }
[
-- Clique type
H.div
{ className: intercalate " "
[ "form-group"
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Type" ]
]
,
H.div
{ className: "form-group__field" }
[
H.div
{ className: "btn-group"
, role: "group"
}
[
B.button
{ callback: \_ -> setter stateBox "cliqueType" $ show FIS_
-- , variant: OutlinedButtonVariant Secondary
, variant: ButtonVariant Light
, className: state.cliqueType == show FIS_ ?
"active" $
""
}
[
H.text "FIS"
]
,
B.button
{ callback: \_ -> setter stateBox "cliqueType" $ show MaxClique_
-- , variant: OutlinedButtonVariant Secondary
, variant: ButtonVariant Light
, className: state.cliqueType == show MaxClique_ ?
"active" $
""
}
[
H.text "MaxClique"
]
]
]
]
]
,
-- TYPE::FIS_
R2.when (state.cliqueType == show FIS_) $
H.div
{ className: "phylo-config-form__col" }
[
-- Support
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "support") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Support" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "support"
,
R2.when (fv.hasError' "support") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Size
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Size" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "size"
,
R2.when (fv.hasError' "sjze") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
,
-- TYPE::MaxClique_
R2.when (state.cliqueType == show MaxClique_) $
H.div
{ className: "phylo-config-form__col" }
[
-- Size
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Size" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "size"
,
R2.when (fv.hasError' "size") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Treshold
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "threshold") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Treshold" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "threshold"
,
R2.when (fv.hasError' "threshold") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter a `Double` value (eg. 0.5)"
]
]
]
,
-- Clique filter
H.div
{ className: intercalate " "
[ "form-group"
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Filter type" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formSelect
( bindStateKey "cliqueFilter" )
[
H.option
{ value: show ByThreshold }
[ H.text "By threshold" ]
,
H.option
{ value: show ByNeighbours }
[ H.text "By neighbours" ]
]
]
]
]
]
]
,
H.text "end new form"
]
]
]
]
let let
form = form =
H.form H.form
...@@ -238,6 +801,9 @@ component = R.hooksComponent "configForm" cpt where ...@@ -238,6 +801,9 @@ component = R.hooksComponent "configForm" cpt where
[ [
B.formInput $ B.formInput $
{ type: "number" { type: "number"
, step: "0.1"
, min: "0"
, max: "1"
} `merge` bindStateKey "quality" } `merge` bindStateKey "quality"
, ,
R2.when (fv.hasError' "quality") $ R2.when (fv.hasError' "quality") $
...@@ -685,15 +1251,16 @@ component = R.hooksComponent "configForm" cpt where ...@@ -685,15 +1251,16 @@ component = R.hooksComponent "configForm" cpt where
, type: "submit" , type: "submit"
} }
[ [
B.icon { name: "refresh" } B.icon { name: "cogs" }
, ,
H.text $ nbsp 1 H.text $ nbsp 1
, ,
H.text "Update!" H.text "Reconstruct the phylomemy!"
] ]
] ]
pure $ H.div {} [ modeChoice pure $ H.div {} [ modeChoice
, R2.when (state.defaultMode == show false) formAdvanced
, R2.when (state.defaultMode == show false) form , R2.when (state.defaultMode == show false) form
, submit , submit
] ]
......
...@@ -372,6 +372,12 @@ ...@@ -372,6 +372,12 @@
} }
} }
.range-simple__input {
&:focus {
box-shadow: none;
}
}
/// Tabs /// Tabs
///----------------------------------------------------------------------------- ///-----------------------------------------------------------------------------
......
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