Commit 3984c493 authored by arturo's avatar arturo

>>> continue

parent 23b8d2ed
Pipeline #2978 failed with stage
in 0 seconds
......@@ -8777,19 +8777,19 @@ a:focus, a:hover {
}
.ngrams-tree-edit-real {
padding: 1.5rem 1.5rem;
padding: 0.75rem 1.25rem;
margin-left: 2.5em;
margin-right: 2.5em;
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.ngrams-tree-edit-real__header {
margin-bottom: 4px;
margin-bottom: 8px;
}
.ngrams-tree-edit-real__body {
min-width: 400px;
width: fit-content;
margin-bottom: 8px;
margin-bottom: 12px;
padding: 0.75rem 1.25rem;
}
.ngrams-tree-edit-real__footer {
......
......@@ -8730,19 +8730,19 @@ a:focus, a:hover {
}
.ngrams-tree-edit-real {
padding: 1.5rem 1.5rem;
padding: 0.75rem 1.25rem;
margin-left: 2.5em;
margin-right: 2.5em;
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.ngrams-tree-edit-real__header {
margin-bottom: 4px;
margin-bottom: 8px;
}
.ngrams-tree-edit-real__body {
min-width: 400px;
width: fit-content;
margin-bottom: 8px;
margin-bottom: 12px;
padding: 0.75rem 1.25rem;
}
.ngrams-tree-edit-real__footer {
......
......@@ -8486,19 +8486,19 @@ a:focus, a:hover {
}
.ngrams-tree-edit-real {
padding: 1.5rem 1.5rem;
padding: 0.75rem 1.25rem;
margin-left: 2.5em;
margin-right: 2.5em;
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.ngrams-tree-edit-real__header {
margin-bottom: 4px;
margin-bottom: 8px;
}
.ngrams-tree-edit-real__body {
min-width: 400px;
width: fit-content;
margin-bottom: 8px;
margin-bottom: 12px;
padding: 0.75rem 1.25rem;
}
.ngrams-tree-edit-real__footer {
......
......@@ -8734,19 +8734,19 @@ a:focus, a:hover {
}
.ngrams-tree-edit-real {
padding: 1.5rem 1.5rem;
padding: 0.75rem 1.25rem;
margin-left: 2.5em;
margin-right: 2.5em;
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.ngrams-tree-edit-real__header {
margin-bottom: 4px;
margin-bottom: 8px;
}
.ngrams-tree-edit-real__body {
min-width: 400px;
width: fit-content;
margin-bottom: 8px;
margin-bottom: 12px;
padding: 0.75rem 1.25rem;
}
.ngrams-tree-edit-real__footer {
......
......@@ -8735,19 +8735,19 @@ a:focus, a:hover {
}
.ngrams-tree-edit-real {
padding: 1.5rem 1.5rem;
padding: 0.75rem 1.25rem;
margin-left: 2.5em;
margin-right: 2.5em;
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.ngrams-tree-edit-real__header {
margin-bottom: 4px;
margin-bottom: 8px;
}
.ngrams-tree-edit-real__body {
min-width: 400px;
width: fit-content;
margin-bottom: 8px;
margin-bottom: 12px;
padding: 0.75rem 1.25rem;
}
.ngrams-tree-edit-real__footer {
......
......@@ -166,7 +166,7 @@ tableContainerCpt { addCallback
}
[ R2.row
[ H.div { className: "col-md-2", style: {marginTop: "6px" } }
[ H.div {} syncResetButton
[ H.li { className: "list-group-item" } syncResetButton
, if (not queryExactMatches || A.null props.tableBody) && searchQuery /= "" then
-- , if (not $ Set.member (normNgram tabNgramType searchQuery) ngramsSelection) && searchQuery /= "" then
H.li { className: "list-group-item" }
......@@ -201,7 +201,7 @@ tableContainerCpt { addCallback
[
props.pageSizeControl
,
B.wad_ [ "mr-1", "d-inline-block" ]
B.wad_ [ "mr-2", "d-inline-block" ]
,
H.label {} [ H.text "items" ]
-- H.div { className: "col-md-6" } [ props.pageSizeControl ]
......
module Gargantext.Components.NgramsTable.SyncResetButton where
import Gargantext.Prelude
import Effect.Aff (Aff)
import Effect.Class (liftEffect)
import FFI.Simple.Functions (delay)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), ComponentStatus(..), Variant(..))
import Gargantext.Core.NgramsTable.Types (CoreAction(..), CoreDispatch, NgramsTablePatch)
import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
......@@ -32,9 +35,14 @@ syncResetButtonsCpt = here.component "syncResetButtons" cpt
let
hasChanges = ngramsLocalPatch /= mempty
hasChangesClass = if hasChanges then "" else " disabled"
synchronizingClass = if synchronizing' then " disabled" else ""
statusReset _ true = Disabled
statusReset false _ = Disabled
statusReset _ _ = Enabled
statusSync _ true = Deferred
statusSync false _ = Disabled
statusSync _ _ = Enabled
resetClick _ = do
performAction ResetPatches
......@@ -47,15 +55,24 @@ syncResetButtonsCpt = here.component "syncResetButtons" cpt
afterSync x
liftEffect $ T.write_ false synchronizing
pure $ H.div { className: "btn-toolbar" }
[ H.div { className: "btn-group mr-2" }
[ H.button { className: "btn btn-danger " <> hasChangesClass <> synchronizingClass
, on: { click: resetClick }
} [ H.text "Reset" ]
]
, H.div { className: "btn-group mr-2" }
[ H.button { className: "btn btn-primary " <> hasChangesClass <> synchronizingClass
, on: { click: synchronizeClick }
} [ H.text "Sync" ]
]
pure $
B.wad
[ "d-flex" ]
[
B.button
{ variant: ButtonVariant Light
, callback: resetClick
, status: statusReset hasChanges synchronizing'
}
[ H.text "Reset" ]
,
B.wad_ [ "mr-1", "d-inline-block" ]
,
B.button
{ variant: ButtonVariant Primary
, callback: synchronizeClick
, status: statusSync hasChanges synchronizing'
}
[ H.text "Sync" ]
]
......@@ -103,14 +103,14 @@
// is a deep feature reveals to zim
$gutter: 2.5em
padding: ($card-spacer-y * 2) ($card-spacer-y * 2)
padding: $card-spacer-y $card-spacer-x
margin-left: $gutter
margin-right: $gutter
border-left: 1px solid $border-color
border-right: 1px solid $border-color
&__header
margin-bottom: space-x(0.5)
margin-bottom: space-x(1)
&__body
// empirical value fitting the best size of the render tree
......@@ -118,7 +118,7 @@
min-width: 400px
width: fit-content
margin-bottom: space-x(1)
margin-bottom: space-x(1.5)
padding: $card-spacer-y $card-spacer-x
......
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