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
57f2c0d5
Verified
Commit
57f2c0d5
authored
1 year ago
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ngrams] side panel is ok now
parent
f4d58b57
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
12 deletions
+45
-12
DocList.purs
src/Gargantext/Components/GraphExplorer/Sidebar/DocList.purs
+0
-1
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+2
-1
Tree.purs
src/Gargantext/Components/NgramsTable/Tree.purs
+6
-1
Lists.purs
src/Gargantext/Components/Nodes/Lists.purs
+35
-8
SidePanel.purs
src/Gargantext/Components/Nodes/Lists/SidePanel.purs
+2
-1
No files found.
src/Gargantext/Components/GraphExplorer/Sidebar/DocList.purs
View file @
57f2c0d5
...
...
@@ -273,7 +273,6 @@ type ItemProps =
item :: R2.Leaf ItemProps
item = R2.leaf itemCpt
itemCpt :: R.Component ItemProps
itemCpt = here.component "item" cpt where
cpt { documentView: dv@(DocumentsView { id, title, source })
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/NgramsTable.purs
View file @
57f2c0d5
...
...
@@ -568,12 +568,13 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where
, getNgramsChildrenAff
, getNgramsChildren
, isEditing
, mListId: A.head path'.listIds
, ngrams: ngramsElement ^. _NgramsElement <<< _ngrams
, ngramsElement
, ngramsLocalPatch
, ngramsSelection
, ngramsTable
, session
, session
: path'.session
, sidePanel } []
, delete: false
}
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/NgramsTable/Tree.purs
View file @
57f2c0d5
...
...
@@ -233,6 +233,7 @@ type RenderNgramsItem =
, getNgramsChildrenAff :: Maybe (NgramsTerm -> Aff (Array NgramsTerm))
, getNgramsChildren :: Maybe (NgramsTerm -> Array NgramsTerm)
, isEditing :: T.Box Boolean
, mListId :: Maybe GT.ListId
, ngrams :: NgramsTerm
, ngramsElement :: NgramsElement
, ngramsLocalPatch :: NgramsTablePatch
...
...
@@ -252,6 +253,7 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
, dispatch
--, getNgramsChildren
, isEditing
, mListId
, ngrams
, ngramsElement
, ngramsLocalPatch
...
...
@@ -275,6 +277,7 @@ renderNgramsItemCpt = here.component "renderNgramsItem" cpt
[
ngramsContext { boxes
, corpusId
, mListId
, ngrams
, session
, sidePanel } []
...
...
@@ -416,6 +419,7 @@ nextTermList GT.CandidateTerm = GT.MapTerm
type NgramsContextProps =
( boxes :: Boxes
, corpusId :: GT.CorpusId
, mListId :: Maybe GT.ListId
, ngrams :: NgramsTerm
, session :: Session
, sidePanel :: T.Box (Maybe (Record SidePanel)))
...
...
@@ -427,6 +431,7 @@ ngramsContextCpt = here.component "ngramsContext" cpt where
cpt { ngrams
, boxes: { sidePanelState }
, corpusId
, mListId
, session
, sidePanel } _ = do
mCurrentNgrams <-
...
...
@@ -450,10 +455,10 @@ ngramsContextCpt = here.component "ngramsContext" cpt where
T.write_ GT.Closed sidePanelState
else do
T.write_ (Just { mCorpusId: Just corpusId
, mListId
, mCurrentNgrams: Just ngrams }) sidePanel
T.write_ GT.Opened sidePanelState
pure $ H.div { className: "doc-chooser"}
[ B.iconButton
{ name: eyeClass
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Nodes/Lists.purs
View file @
57f2c0d5
...
...
@@ -2,7 +2,7 @@ module Gargantext.Components.Nodes.Lists where
import Gargantext.Prelude
import Data.Maybe (Maybe(..), maybe)
import Data.Maybe (Maybe(..),
fromMaybe,
maybe)
import Effect (Effect)
import Effect.Aff (launchAff_)
import Gargantext.Components.App.Store (Boxes)
...
...
@@ -15,9 +15,12 @@ import Gargantext.Components.Nodes.Lists.SidePanel (SidePanel)
import Gargantext.Components.Nodes.Lists.Tabs as Tabs
import Gargantext.Components.Nodes.Lists.Types (CacheState(..))
import Gargantext.Components.Table as Table
import Gargantext.Config (defaultFrontends)
import Gargantext.Config.REST (logRESTError, AffRESTError)
import Gargantext.Core.NgramsTable.Types (NgramsTerm(..))
import Gargantext.Ends (url)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes as Routes
import Gargantext.Sessions (WithSession, WithSessionContext, Session, sessionId, getCacheState, setCacheState)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
...
...
@@ -151,14 +154,18 @@ sidePanelNgramsContextViewCpt = here.component "sidePanelNgramsContextView" cpt
case mSidePanel' of
Nothing -> pure $ H.div {} []
Just sidePanel' ->
pure $ H.div {} [ H.text $ show sidePanel'
Just sidePanel' -> do
let ngrams = maybe "" (\(NormNgramsTerm n) -> n) sidePanel'.mCurrentNgrams
pure $ H.div {} [ H.h3 {} [ H.text ngrams ]
, ngramsDocList { mCorpusId: sidePanel'.mCorpusId
, mListId: sidePanel'.mListId
, mNgrams: sidePanel'.mCurrentNgrams
, session } [] ]
type NgramsDocListProps =
( mCorpusId :: Maybe GT.CorpusId
, mListId :: Maybe GT.ListId
, mNgrams :: Maybe NgramsTerm
, session :: Session )
...
...
@@ -168,9 +175,12 @@ ngramsDocListCpt :: R.Component NgramsDocListProps
ngramsDocListCpt = here.component "ngramsDocList" cpt where
cpt { mCorpusId: Nothing } _ = do
pure $ H.div {} []
cpt { mListId: Nothing } _ = do
pure $ H.div {} []
cpt { mNgrams: Nothing } _ = do
pure $ H.div {} []
cpt { mCorpusId: Just corpusId
, mListId: Just listId
, mNgrams: Just ngrams
, session } _ = do
useLoader { errorHandler
...
...
@@ -178,6 +188,7 @@ ngramsDocListCpt = here.component "ngramsDocList" cpt where
, loader: loaderNgramsDocList
, render: \ctx -> ngramsDocListLoaded { contexts: ctx
, corpusId
, listId
, ngrams
, session } []
}
...
...
@@ -196,6 +207,7 @@ loaderNgramsDocList { corpusId, ngrams: NormNgramsTerm ngrams, session } =
type NgramsDocListLoadedProps =
( contexts :: Array GQLCTX.Context
, corpusId :: GT.CorpusId
, listId :: GT.ListId
, ngrams :: NgramsTerm
, session :: Session )
...
...
@@ -205,22 +217,37 @@ ngramsDocListLoadedCpt :: R.Component NgramsDocListLoadedProps
ngramsDocListLoadedCpt = here.component "ngramsDocListLoaded" cpt where
cpt { contexts
, corpusId
, listId
, ngrams
, session } _ = do
pure $ H.div { className: "ngrams-doc-list" }
[ H.text "contexts"
, H.ul { className: "list-group" } ((\item -> contextItem { item } [] ) <$> contexts)
[ H.ul { className: "list-group" } ((\item -> contextItem { corpusId
, item
, listId
, session } [] ) <$> contexts)
]
type ContextItemProps =
( item :: GQLCTX.Context )
( corpusId :: GT.CorpusId
, item :: GQLCTX.Context
, listId :: GT.ListId
, session :: Session )
contextItem :: R2.Component ContextItemProps
contextItem = R.createElement contextItemCpt
contextItemCpt :: R.Component ContextItemProps
contextItemCpt = here.component "contextItem" cpt where
cpt { item } _ = do
pure $ H.a { className: "list-group-item text-decoration-none" }
cpt { corpusId
, item
, listId
, session } _ = do
let route = Routes.CorpusDocument (sessionId session) corpusId listId item.c_id
href = url defaultFrontends route
pure $ H.a { className: "list-group-item text-decoration-none"
, href
, target: "_blank" }
[ H.div { className: "context-item-title" }
[ H.text $ maybe "" (_.hrd_title) item.c_hyperdata ]
, H.div { className: "context-item-source"}
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Nodes/Lists/SidePanel.purs
View file @
57f2c0d5
...
...
@@ -2,13 +2,14 @@ module Gargantext.Components.Nodes.Lists.SidePanel where
import Data.Maybe (Maybe(..))
import Gargantext.Core.NgramsTable.Types (NgramsTerm)
import Gargantext.Types (CorpusId)
import Gargantext.Types (CorpusId
, ListId
)
-- type SidePanel :: forall k. Row k
type SidePanel = (
mCorpusId :: Maybe CorpusId
, mCurrentNgrams :: Maybe NgramsTerm
, mListId :: Maybe ListId
)
initialSidePanel :: Maybe (Record SidePanel)
...
...
This diff is collapsed.
Click to expand it.
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