Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
326dd4e6
Commit
326dd4e6
authored
Nov 22, 2021
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] Add new document (4)
* #174: resolve doc tables refresh on add success
parent
deb6ba07
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
23 deletions
+68
-23
sass.css
dist/styles/sass.css
+1
-9
sass.css.map
dist/styles/sass.css.map
+1
-5
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+8
-1
Texts.purs
src/Gargantext/Components/Nodes/Texts.purs
+16
-5
Types.purs
src/Gargantext/Components/Nodes/Texts/Types.purs
+14
-3
Reload.purs
src/Gargantext/Components/Reload.purs
+28
-0
No files found.
dist/styles/sass.css
View file @
326dd4e6
...
@@ -1159,7 +1159,7 @@ select.form-control {
...
@@ -1159,7 +1159,7 @@ select.form-control {
grid-template-columns
:
repeat
(
15
,
1
fr
);
grid-template-columns
:
repeat
(
15
,
1
fr
);
grid-template-rows
:
2%
7%
7%
auto
1%
;
grid-template-rows
:
2%
7%
7%
auto
1%
;
grid-gap
:
10px
;
grid-gap
:
10px
;
height
:
calc
(
100vh
-
0px
)
;
height
:
100vh
;
color
:
#0d1824
;
color
:
#0d1824
;
}
}
...
@@ -1540,14 +1540,6 @@ i.how:hover span {
...
@@ -1540,14 +1540,6 @@ i.how:hover span {
fill
:
#f8381f
;
fill
:
#f8381f
;
}
}
.term-unfocus
{
/*fill: #A9A9A9;*/
}
.term-focus
{
/*fill: black;*/
}
.term-path
{
.term-path
{
fill
:
none
;
fill
:
none
;
stroke
:
#F0684D
;
stroke
:
#F0684D
;
...
...
dist/styles/sass.css.map
View file @
326dd4e6
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/DocsTable.purs
View file @
326dd4e6
...
@@ -34,6 +34,7 @@ import Gargantext.Components.DocsTable.DocumentFormCreation as DFC
...
@@ -34,6 +34,7 @@ import Gargantext.Components.DocsTable.DocumentFormCreation as DFC
import Gargantext.Components.DocsTable.Types (DocumentsView(..), Hyperdata(..), LocalUserScore, Query, Response(..), Year, sampleData, showSource)
import Gargantext.Components.DocsTable.Types (DocumentsView(..), Hyperdata(..), LocalUserScore, Query, Response(..), Year, sampleData, showSource)
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Nodes.Texts.Types as TextsT
import Gargantext.Components.Nodes.Texts.Types as TextsT
import Gargantext.Components.Reload (reloadContext, textsReloadContext)
import Gargantext.Components.Table as TT
import Gargantext.Components.Table as TT
import Gargantext.Components.Table.Types as TT
import Gargantext.Components.Table.Types as TT
import Gargantext.Config.REST (RESTError, logRESTError)
import Gargantext.Config.REST (RESTError, logRESTError)
...
@@ -146,6 +147,9 @@ docViewCpt = here.component "docView" cpt where
...
@@ -146,6 +147,9 @@ docViewCpt = here.component "docView" cpt where
onDocumentCreationPending /\ onDocumentCreationPendingBox <-
onDocumentCreationPending /\ onDocumentCreationPendingBox <-
R2.useBox' false
R2.useBox' false
-- Context
mReloadContext <- R.useContext textsReloadContext
-- @toggleModalCallback
-- @toggleModalCallback
toggleModal <- pure $ const $
toggleModal <- pure $ const $
T.modify_ not isDocumentModalVisibleBox
T.modify_ not isDocumentModalVisibleBox
...
@@ -155,7 +159,10 @@ docViewCpt = here.component "docView" cpt where
...
@@ -155,7 +159,10 @@ docViewCpt = here.component "docView" cpt where
here.log2 "[DocsTables] NodeDocument task:" asyncProgress
here.log2 "[DocsTables] NodeDocument task:" asyncProgress
T.write_ false onDocumentCreationPendingBox
T.write_ false onDocumentCreationPendingBox
toggleModal unit
toggleModal unit
T2.reload boxes.reloadMainPage
case mReloadContext of
Nothing -> pure unit
Just b -> T2.reload b
-- @createDocumentCallback
-- @createDocumentCallback
createDocumentCallback <- pure $ \fdata -> launchAff_ do
createDocumentCallback <- pure $ \fdata -> launchAff_ do
...
...
src/Gargantext/Components/Nodes/Texts.purs
View file @
326dd4e6
...
@@ -20,6 +20,7 @@ import Gargantext.Components.Nodes.Corpus.Document as D
...
@@ -20,6 +20,7 @@ import Gargantext.Components.Nodes.Corpus.Document as D
import Gargantext.Components.Nodes.Corpus.Types (CorpusData, CorpusInfo(..), Hyperdata(..), getCorpusInfo)
import Gargantext.Components.Nodes.Corpus.Types (CorpusData, CorpusInfo(..), Hyperdata(..), getCorpusInfo)
import Gargantext.Components.Nodes.Lists.Types as LT
import Gargantext.Components.Nodes.Lists.Types as LT
import Gargantext.Components.Nodes.Texts.Types as TT
import Gargantext.Components.Nodes.Texts.Types as TT
import Gargantext.Components.Reload (textsReloadContext)
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Table as Table
import Gargantext.Components.Table as Table
import Gargantext.Config.REST (logRESTError)
import Gargantext.Config.REST (logRESTError)
...
@@ -28,6 +29,7 @@ import Gargantext.Hooks.Loader (useLoader)
...
@@ -28,6 +29,7 @@ import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Sessions (WithSession, Session, getCacheState)
import Gargantext.Sessions (WithSession, Session, getCacheState)
import Gargantext.Types (CTabNgramType(..), ListId, NodeID, SidePanelState(..), TabSubType(..), TabType(..))
import Gargantext.Types (CTabNgramType(..), ListId, NodeID, SidePanelState(..), TabSubType(..), TabType(..))
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
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
...
@@ -52,11 +54,20 @@ textsLayout = R.createElement textsLayoutCpt
...
@@ -52,11 +54,20 @@ textsLayout = R.createElement textsLayoutCpt
textsLayoutCpt :: R.Component Props
textsLayoutCpt :: R.Component Props
textsLayoutCpt = here.component "textsLayout" cpt where
textsLayoutCpt = here.component "textsLayout" cpt where
cpt { boxes, frontends, nodeId, session } children = do
cpt { boxes, frontends, nodeId, session } children = do
pure $ textsLayoutWithKey { key
, boxes
_ /\ reloadBox <- R2.useBox' T2.newReload
, frontends
, nodeId
pure $
, session } children
R.provideContext textsReloadContext (Just reloadBox)
[
textsLayoutWithKey
{ key
, boxes
, frontends
, nodeId
, session } children
]
where
where
key = show nodeId
key = show nodeId
-- key = show sid <> "-" <> show nodeId
-- key = show sid <> "-" <> show nodeId
...
...
src/Gargantext/Components/Nodes/Texts/Types.purs
View file @
326dd4e6
module Gargantext.Components.Nodes.Texts.Types where
module Gargantext.Components.Nodes.Texts.Types where
import Data.Maybe (Maybe(..))
import Reactix as R
import Gargantext.Prelude
import Gargantext.Prelude
import Data.Maybe (Maybe(..))
import Gargantext.Types (ListId, NodeID)
import Gargantext.Types (ListId, NodeID)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Reactix as R
import Toestand as T
data SidePanelState = InitialClosed | Opened | Closed
data SidePanelState = InitialClosed | Opened | Closed
derive instance Eq SidePanelState
derive instance Eq SidePanelState
...
@@ -67,3 +68,13 @@ type SidePanel =
...
@@ -67,3 +68,13 @@ type SidePanel =
initialSidePanel :: Maybe (Record SidePanel)
initialSidePanel :: Maybe (Record SidePanel)
initialSidePanel = Nothing
initialSidePanel = Nothing
-----------------------------------------------------------------
-- @XXX: This custom context solves a wrong monolithic front design where
-- "DocsTable" component is used for many different use cases
-- Normally we would have use the classic "Gargantext.Components.Reload",
-- but we limit side-effects by using another context reference
textsReloadContext :: R.Context (Maybe (T.Box T2.Reload))
textsReloadContext = R.createContext Nothing
src/Gargantext/Components/Reload.purs
0 → 100644
View file @
326dd4e6
module Gargantext.Components.Reload
( reloadContext
, textsReloadContext ) where
import Data.Maybe (Maybe(..))
import Gargantext.Utils.Toestand as T2
import Reactix as R
import Toestand as T
-- | Reload Context
-- |
-- | Use with `R.provideContext` as a (nested) context
-- |
-- | https://medium.com/@NickIannelli/nested-context-the-underrated-aspect-thats-probably-missing-from-your-react-app-16e73f7d1
reloadContext :: R.Context (Maybe (T.Box T2.Reload))
reloadContext = R.createContext Nothing
-----------------------------------------------------------------
-- @XXX: This custom context solves a wrong monolithic front design where
-- "DocsTable" component is used for many different use cases
-- Normally we would have use the classic "Gargantext.Components.Reload",
-- but we limit side-effects by using another context reference
--
-- See its use in "Gargantext.Components.Nodes.Texts"
textsReloadContext :: R.Context (Maybe (T.Box T2.Reload))
textsReloadContext = R.createContext Nothing
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment