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
141
Issues
141
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
gargantext
purescript-gargantext
Commits
66cfeb1f
Verified
Commit
66cfeb1f
authored
Sep 13, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-searx-parser
parents
263c5db9
27737199
Pipeline
#1822
canceled with stage
Changes
41
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
110 additions
and
158 deletions
+110
-158
shell.nix
shell.nix
+1
-1
AnnotatedField.purs
src/Gargantext/Components/Annotation/AnnotatedField.purs
+2
-2
Menu.purs
src/Gargantext/Components/Annotation/Menu.purs
+0
-1
Series.purs
src/Gargantext/Components/Charts/Options/Series.purs
+1
-6
CodeEditor.purs
src/Gargantext/Components/CodeEditor.purs
+2
-2
ContextMenu.purs
src/Gargantext/Components/ContextMenu/ContextMenu.purs
+2
-2
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+3
-3
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+2
-2
FolderView.purs
src/Gargantext/Components/FolderView.purs
+2
-2
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+5
-5
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+5
-6
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+0
-2
Delete.purs
...Gargantext/Components/Forest/Tree/Node/Action/Delete.purs
+2
-2
Download.purs
...rgantext/Components/Forest/Tree/Node/Action/Download.purs
+1
-1
Search.purs
...Gargantext/Components/Forest/Tree/Node/Action/Search.purs
+3
-4
Frame.purs
...text/Components/Forest/Tree/Node/Action/Search/Frame.purs
+0
-4
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+3
-5
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+4
-4
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+13
-13
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+5
-9
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+1
-3
FTree.purs
src/Gargantext/Components/Forest/Tree/Node/Tools/FTree.purs
+0
-3
Sync.purs
src/Gargantext/Components/Forest/Tree/Node/Tools/Sync.purs
+1
-2
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+1
-1
TopBar.purs
src/Gargantext/Components/GraphExplorer/TopBar.purs
+1
-6
Login.purs
src/Gargantext/Components/Login.purs
+1
-1
Form.purs
src/Gargantext/Components/Login/Form.purs
+1
-1
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+9
-9
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+6
-5
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+14
-16
Tree.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Tree.purs
+1
-1
Types.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Types.purs
+1
-2
Phylo.purs
src/Gargantext/Components/Nodes/Corpus/Phylo.purs
+0
-3
Types.purs
src/Gargantext/Components/Nodes/Corpus/Types.purs
+1
-4
File.purs
src/Gargantext/Components/Nodes/File.purs
+1
-1
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+4
-5
Texts.purs
src/Gargantext/Components/Nodes/Texts.purs
+4
-5
SidePanelToggleButton.purs
...gantext/Components/Nodes/Texts/SidePanelToggleButton.purs
+0
-1
Renameable.purs
src/Gargantext/Components/Renameable.purs
+3
-9
Router.purs
src/Gargantext/Components/Router.purs
+3
-3
TopBar.purs
src/Gargantext/Components/TopBar.purs
+1
-1
No files found.
shell.nix
View file @
66cfeb1f
...
@@ -62,7 +62,7 @@ let
...
@@ -62,7 +62,7 @@ let
repl
=
pkgs
.
writeShellScriptBin
"repl"
''
repl
=
pkgs
.
writeShellScriptBin
"repl"
''
#!/usr/bin/env bash
#!/usr/bin/env bash
pulp
repl
spago
repl
''
;
''
;
test-ps
=
pkgs
.
writeShellScriptBin
"test-ps"
''
test-ps
=
pkgs
.
writeShellScriptBin
"test-ps"
''
...
...
src/Gargantext/Components/Annotation/AnnotatedField.purs
View file @
66cfeb1f
...
@@ -70,7 +70,7 @@ annotatedFieldInner p = R.createElement annotatedFieldInnerCpt p []
...
@@ -70,7 +70,7 @@ annotatedFieldInner p = R.createElement annotatedFieldInnerCpt p []
annotatedFieldInnerCpt :: R.Component InnerProps
annotatedFieldInnerCpt :: R.Component InnerProps
annotatedFieldInnerCpt = here.component "annotatedFieldInner" cpt where
annotatedFieldInnerCpt = here.component "annotatedFieldInner" cpt where
cpt { menuRef, ngrams, redrawMenu, setTermList, text: fieldText } _ = do
cpt { menuRef, ngrams, redrawMenu, setTermList, text: fieldText } _ = do
redrawMenu' <- T.useLive T.unequal redrawMenu
_
redrawMenu' <- T.useLive T.unequal redrawMenu
-- menu <- T.useBox (Nothing :: Maybe (Record AnnotationMenu))
-- menu <- T.useBox (Nothing :: Maybe (Record AnnotationMenu))
...
@@ -109,7 +109,7 @@ onAnnotationSelect { menuRef, ngrams, redrawMenu, setTermList } Nothing event =
...
@@ -109,7 +109,7 @@ onAnnotationSelect { menuRef, ngrams, redrawMenu, setTermList } Nothing event =
, redrawMenu
, redrawMenu
, setTermList }
, setTermList }
Nothing -> hideMenu { menuRef, redrawMenu }
Nothing -> hideMenu { menuRef, redrawMenu }
onAnnotationSelect { menuRef,
ngrams,
redrawMenu, setTermList } (Just (Tuple ngram list)) event = do
onAnnotationSelect { menuRef, redrawMenu, setTermList } (Just (Tuple ngram list)) event = do
showMenu { event
showMenu { event
, getList: const (Just list)
, getList: const (Just list)
, menuRef
, menuRef
...
...
src/Gargantext/Components/Annotation/Menu.purs
View file @
66cfeb1f
...
@@ -7,7 +7,6 @@ import Data.Generic.Rep (class Generic)
...
@@ -7,7 +7,6 @@ import Data.Generic.Rep (class Generic)
import Data.Eq.Generic (genericEq)
import Data.Eq.Generic (genericEq)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Effect (Effect)
import Effect (Effect)
import Effect.Uncurried (mkEffectFn1)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as HTML
import Reactix.DOM.HTML as HTML
import Toestand as T
import Toestand as T
...
...
src/Gargantext/Components/Charts/Options/Series.purs
View file @
66cfeb1f
module Gargantext.Components.Charts.Options.Series where
module Gargantext.Components.Charts.Options.Series where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, (.:), (~>), (:=))
import Data.Argonaut.Core (jsonEmptyObject)
import Data.Array (foldl)
import Data.Array (foldl)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..), maybe)
import Data.Maybe (Maybe(..), maybe)
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Data.Symbol (SProxy(..))
import Data.Symbol (SProxy(..))
import Gargantext.Components.Charts.Options.Data (DataD1, DataD2)
import Gargantext.Components.Charts.Options.Data (DataD1, DataD2)
import Gargantext.Components.Charts.Options.Data (DataD1, DataD2)
import Gargantext.Components.Charts.Options.Font (ItemStyle, Tooltip)
import Gargantext.Components.Charts.Options.Font (ItemStyle, Tooltip)
import Gargantext.Components.Charts.Options.Font (ItemStyle, Tooltip)
import Gargantext.Components.Charts.Options.Legend (SelectedMode)
import Gargantext.Components.Charts.Options.Legend (SelectedMode)
import Gargantext.Prelude
import Gargantext.Types (class Optional)
import Gargantext.Types (class Optional)
import Prelude (class Eq, class Show, bind, map, pure, show, ($), (+), (<<<), (<>)
, eq
)
import Prelude (class Eq, class Show, bind, map, pure, show, ($), (+), (<<<), (<>))
import Record as Record
import Record as Record
import Record.Unsafe (unsafeSet)
import Record.Unsafe (unsafeSet)
import Simple.JSON as JSON
import Simple.JSON as JSON
...
...
src/Gargantext/Components/CodeEditor.purs
View file @
66cfeb1f
module Gargantext.Components.CodeEditor where
module Gargantext.Components.CodeEditor where
import DOM.Simple.Types (Element)
import Data.Argonaut.Parser (jsonParser)
import Data.Argonaut.Parser (jsonParser)
import Data.Either (either, Either(..))
import Data.Either (either, Either(..))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
...
@@ -9,6 +8,7 @@ import Data.Show.Generic (genericShow)
...
@@ -9,6 +8,7 @@ import Data.Show.Generic (genericShow)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Nullable (Nullable, null, toMaybe)
import Data.Nullable (Nullable, null, toMaybe)
import Data.String.Utils (endsWith)
import Data.String.Utils (endsWith)
import DOM.Simple.Types (Element)
import Effect (Effect)
import Effect (Effect)
import FFI.Simple ((.=))
import FFI.Simple ((.=))
import Reactix as R
import Reactix as R
...
@@ -355,7 +355,7 @@ initControls code defaultCodeType = do
...
@@ -355,7 +355,7 @@ initControls code defaultCodeType = do
}
}
reinitControls :: Record Controls -> Code -> CodeType -> Effect Unit
reinitControls :: Record Controls -> Code -> CodeType -> Effect Unit
reinitControls
c@
{ codeType, codeS, error } code defaultCodeType = do
reinitControls { codeType, codeS, error } code defaultCodeType = do
T.write_ defaultCodeType codeType
T.write_ defaultCodeType codeType
T.write_ code codeS
T.write_ code codeS
T.write_ Nothing error
T.write_ Nothing error
src/Gargantext/Components/ContextMenu/ContextMenu.purs
View file @
66cfeb1f
...
@@ -65,7 +65,7 @@ contextMenuCpt = here.component "contextMenu" cpt
...
@@ -65,7 +65,7 @@ contextMenuCpt = here.component "contextMenu" cpt
, style: position menu rect
, style: position menu rect
, data: { placement: "right", toggle: "popover" }
, data: { placement: "right", toggle: "popover" }
}
}
elems ref menu Nothing = HTML.div
elems ref
_
menu Nothing = HTML.div
{ ref
{ ref
, key: "context-menu"
, key: "context-menu"
, className: "context-menu"
, className: "context-menu"
...
@@ -98,7 +98,7 @@ documentClickHandler onClose menu =
...
@@ -98,7 +98,7 @@ documentClickHandler onClose menu =
documentScrollHandler :: Effect Unit -> Callback DE.MouseEvent
documentScrollHandler :: Effect Unit -> Callback DE.MouseEvent
documentScrollHandler onClose =
documentScrollHandler onClose =
R2.named "hideMenuOnScroll" $ callback $ \
e
-> onClose
R2.named "hideMenuOnScroll" $ callback $ \
_
-> onClose
position :: forall t. Record (Props t) -> DOMRect -> { left :: Number, top :: Number }
position :: forall t. Record (Props t) -> DOMRect -> { left :: Number, top :: Number }
position mouse {width: menuWidth, height: menuHeight} = {left, top}
position mouse {width: menuWidth, height: menuHeight} = {left, top}
...
...
src/Gargantext/Components/DocsTable.purs
View file @
66cfeb1f
...
@@ -193,13 +193,13 @@ searchBarCpt = here.component "searchBar" cpt
...
@@ -193,13 +193,13 @@ searchBarCpt = here.component "searchBar" cpt
searchButton query queryText' =
searchButton query queryText' =
H.button { className: "btn btn-primary"
H.button { className: "btn btn-primary"
, on: { click: \
e
-> T.write_ queryText' query }
, on: { click: \
_
-> T.write_ queryText' query }
, type: "submit" }
, type: "submit" }
[ H.span {className: "fa fa-search"} [] ]
[ H.span {className: "fa fa-search"} [] ]
clearButton query =
clearButton query =
H.button { className: "btn btn-danger"
H.button { className: "btn btn-danger"
, on: { click: \
e
-> T.write_ "" query } }
, on: { click: \
_
-> T.write_ "" query } }
[ H.span {className: "fa fa-times"} [] ]
[ H.span {className: "fa fa-times"} [] ]
mock :: Boolean
mock :: Boolean
...
@@ -273,7 +273,7 @@ pageLayoutCpt = here.component "pageLayout" cpt where
...
@@ -273,7 +273,7 @@ pageLayoutCpt = here.component "pageLayout" cpt where
let path = { listId, mCorpusId, nodeId, params, query, tabType, yearFilter: yearFilter' }
let path = { listId, mCorpusId, nodeId, params, query, tabType, yearFilter: yearFilter' }
handleResponse :: HashedResponse (TableResult Response) -> Tuple Int (Array DocumentsView)
handleResponse :: HashedResponse (TableResult Response) -> Tuple Int (Array DocumentsView)
handleResponse (HashedResponse {
hash,
value: res }) = ret
handleResponse (HashedResponse { value: res }) = ret
where
where
filterDocs' q ds = case cacheState' of
filterDocs' q ds = case cacheState' of
NT.CacheOff -> ds
NT.CacheOff -> ds
...
...
src/Gargantext/Components/FacetsTable.purs
View file @
66cfeb1f
...
@@ -333,14 +333,14 @@ pageCpt = here.component "page" cpt
...
@@ -333,14 +333,14 @@ pageCpt = here.component "page" cpt
let isDeleted (DocumentsView {id}) = Set.member id deletions'.deleted
let isDeleted (DocumentsView {id}) = Set.member id deletions'.deleted
rows
path'
= case rowsLoaded of
rows = case rowsLoaded of
Docs {docs} -> docRow path' <$> Seq.filter (not <<< isDeleted) docs
Docs {docs} -> docRow path' <$> Seq.filter (not <<< isDeleted) docs
Contacts {contacts} -> contactRow path' <$> contacts
Contacts {contacts} -> contactRow path' <$> contacts
pure $ T.table { colNames
pure $ T.table { colNames
, container
, container
, params
, params
, rows
: rows path'
, rows
, syncResetButton : [ H.div {} [] ]
, syncResetButton : [ H.div {} [] ]
, totalRecords
, totalRecords
, wrapColElts
, wrapColElts
...
...
src/Gargantext/Components/FolderView.purs
View file @
66cfeb1f
...
@@ -299,9 +299,9 @@ performAction = performAction' where
...
@@ -299,9 +299,9 @@ performAction = performAction' where
deleteNode' nt p@{ nodeId: id, parentId: parent_id, session } = do
deleteNode' nt p@{ nodeId: id, parentId: parent_id, session } = do
case nt of
case nt of
NodePublic FolderPublic -> void $ deleteNode session
nt
id
NodePublic FolderPublic -> void $ deleteNode session id
NodePublic _ -> void $ unpublishNode session (Just parent_id) id
NodePublic _ -> void $ unpublishNode session (Just parent_id) id
_ -> void $ deleteNode session
nt
id
_ -> void $ deleteNode session id
refreshFolders p
refreshFolders p
doSearch task { boxes: { tasks }, nodeId: id } = liftEffect $ do
doSearch task { boxes: { tasks }, nodeId: id } = liftEffect $ do
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
66cfeb1f
...
@@ -229,13 +229,13 @@ refreshTree p@{ reloadTree } = liftEffect $ T2.reload reloadTree *> closePopover
...
@@ -229,13 +229,13 @@ refreshTree p@{ reloadTree } = liftEffect $ T2.reload reloadTree *> closePopover
deleteNode' nt p@{ boxes: { forestOpen }, session, tree: (NTree (LNode {id, parent_id}) _) } = do
deleteNode' nt p@{ boxes: { forestOpen }, session, tree: (NTree (LNode {id, parent_id}) _) } = do
case nt of
case nt of
GT.NodePublic GT.FolderPublic -> void $ deleteNode session
nt
id
GT.NodePublic GT.FolderPublic -> void $ deleteNode session id
GT.NodePublic _ -> void $ unpublishNode session parent_id id
GT.NodePublic _ -> void $ unpublishNode session parent_id id
_ -> void $ deleteNode session
nt
id
_ -> void $ deleteNode session id
liftEffect $ T.modify_ (openNodesDelete (mkNodeId session id)) forestOpen
liftEffect $ T.modify_ (openNodesDelete (mkNodeId session id)) forestOpen
refreshTree p
refreshTree p
doSearch task
p@
{ boxes: { tasks }, tree: NTree (LNode {id}) _ } = liftEffect $ do
doSearch task { boxes: { tasks }, tree: NTree (LNode {id}) _ } = liftEffect $ do
GAT.insert id task tasks
GAT.insert id task tasks
here.log2 "[doSearch] DoSearch task:" task
here.log2 "[doSearch] DoSearch task:" task
...
@@ -250,7 +250,7 @@ renameNode name p@{ boxes: { errors }, session, tree: (NTree (LNode {id}) _) } =
...
@@ -250,7 +250,7 @@ renameNode name p@{ boxes: { errors }, session, tree: (NTree (LNode {id}) _) } =
handleRESTError errors eTask $ \_task -> pure unit
handleRESTError errors eTask $ \_task -> pure unit
refreshTree p
refreshTree p
shareTeam username
p@
{ boxes: { errors }, session, tree: (NTree (LNode {id}) _)} = do
shareTeam username { boxes: { errors }, session, tree: (NTree (LNode {id}) _)} = do
eTask <- Share.shareReq session id $ Share.ShareTeamParams { username }
eTask <- Share.shareReq session id $ Share.ShareTeamParams { username }
handleRESTError errors eTask $ \_task -> pure unit
handleRESTError errors eTask $ \_task -> pure unit
...
@@ -261,7 +261,7 @@ sharePublic params p@{ boxes: { errors, forestOpen }, session } = traverse_ f pa
...
@@ -261,7 +261,7 @@ sharePublic params p@{ boxes: { errors, forestOpen }, session } = traverse_ f pa
liftEffect $ T.modify_ (openNodesInsert (mkNodeId p.session out)) forestOpen
liftEffect $ T.modify_ (openNodesInsert (mkNodeId p.session out)) forestOpen
refreshTree p
refreshTree p
addContact params
p@
{ boxes: { errors }, session, tree: (NTree (LNode {id}) _) } = do
addContact params { boxes: { errors }, session, tree: (NTree (LNode {id}) _) } = do
eTask <- Contact.contactReq session id params
eTask <- Contact.contactReq session id params
handleRESTError errors eTask $ \_task -> pure unit
handleRESTError errors eTask $ \_task -> pure unit
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
66cfeb1f
...
@@ -113,7 +113,7 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
...
@@ -113,7 +113,7 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
pure $ H.span (dropProps droppedFile droppedFile' isDragOver isDragOver')
pure $ H.span (dropProps droppedFile droppedFile' isDragOver isDragOver')
$ reverseHanded handed'
$ reverseHanded handed'
[ folderIcon { folderOpen, nodeType } []
[ folderIcon { folderOpen, nodeType } []
, chevronIcon { folderOpen, handed, isLeaf
, nodeType
} []
, chevronIcon { folderOpen, handed, isLeaf } []
, nodeLink { boxes
, nodeLink { boxes
, folderOpen
, folderOpen
, frontends
, frontends
...
@@ -201,14 +201,14 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
...
@@ -201,14 +201,14 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
{ className: "leaf " <> (dropClass droppedFile' isDragOver')
{ className: "leaf " <> (dropClass droppedFile' isDragOver')
, on: { dragLeave: onDragLeave isDragOver
, on: { dragLeave: onDragLeave isDragOver
, dragOver: onDragOverHandler isDragOver
, dragOver: onDragOverHandler isDragOver
, drop: dropHandler
droppedFile
}
, drop: dropHandler }
}
}
where
where
dropClass (Just _) _ = "file-dropped"
dropClass (Just _) _ = "file-dropped"
dropClass _ true = "file-dropped"
dropClass _ true = "file-dropped"
dropClass Nothing _ = ""
dropClass Nothing _ = ""
dropHandler
droppedFile e
= do
dropHandler
e
= do
-- prevent redirection when file is dropped
-- prevent redirection when file is dropped
E.preventDefault e
E.preventDefault e
E.stopPropagation e
E.stopPropagation e
...
@@ -248,7 +248,6 @@ type ChevronIconProps = (
...
@@ -248,7 +248,6 @@ type ChevronIconProps = (
folderOpen :: T.Box Boolean
folderOpen :: T.Box Boolean
, handed :: T.Box GT.Handed
, handed :: T.Box GT.Handed
, isLeaf :: Boolean
, isLeaf :: Boolean
, nodeType :: GT.NodeType
)
)
chevronIcon :: R2.Component ChevronIconProps
chevronIcon :: R2.Component ChevronIconProps
...
@@ -256,9 +255,9 @@ chevronIcon = R.createElement chevronIconCpt
...
@@ -256,9 +255,9 @@ chevronIcon = R.createElement chevronIconCpt
chevronIconCpt :: R.Component ChevronIconProps
chevronIconCpt :: R.Component ChevronIconProps
chevronIconCpt = here.component "chevronIcon" cpt
chevronIconCpt = here.component "chevronIcon" cpt
where
where
cpt {
folderOpen, handed, isLeaf: true, nodeTyp
e } _ = do
cpt {
isLeaf: tru
e } _ = do
pure $ H.div {} []
pure $ H.div {} []
cpt { folderOpen, handed, isLeaf: false
, nodeType
} _ = do
cpt { folderOpen, handed, isLeaf: false } _ = do
handed' <- T.useLive T.unequal handed
handed' <- T.useLive T.unequal handed
open <- T.useLive T.unequal folderOpen
open <- T.useLive T.unequal folderOpen
pure $ H.a { className: "chevron-icon"
pure $ H.a { className: "chevron-icon"
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
66cfeb1f
...
@@ -77,8 +77,6 @@ addNodeView = R.createElement addNodeViewCpt
...
@@ -77,8 +77,6 @@ addNodeView = R.createElement addNodeViewCpt
addNodeViewCpt :: R.Component CreateNodeProps
addNodeViewCpt :: R.Component CreateNodeProps
addNodeViewCpt = here.component "addNodeView" cpt where
addNodeViewCpt = here.component "addNodeView" cpt where
cpt { dispatch
cpt { dispatch
, id
, name
, nodeTypes } _ = do
, nodeTypes } _ = do
nodeName <- T.useBox "Name"
nodeName <- T.useBox "Name"
nodeName' <- T.useLive T.unequal nodeName
nodeName' <- T.useLive T.unequal nodeName
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Delete.purs
View file @
66cfeb1f
...
@@ -23,8 +23,8 @@ here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Delete"
...
@@ -23,8 +23,8 @@ here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Delete"
-- TODO Delete with asyncTaskWithType
-- TODO Delete with asyncTaskWithType
deleteNode :: Session ->
NodeType ->
GT.ID -> Aff (Either RESTError GT.ID)
deleteNode :: Session -> GT.ID -> Aff (Either RESTError GT.ID)
deleteNode session n
t n
odeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
deleteNode session nodeId = delete session $ NodeAPI GT.Node (Just nodeId) ""
{-
{-
case nt of
case nt of
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Download.purs
View file @
66cfeb1f
...
@@ -77,5 +77,5 @@ actionDownloadOther :: R2.Component ActionDownload
...
@@ -77,5 +77,5 @@ actionDownloadOther :: R2.Component ActionDownload
actionDownloadOther = R.createElement actionDownloadOtherCpt
actionDownloadOther = R.createElement actionDownloadOtherCpt
actionDownloadOtherCpt :: R.Component ActionDownload
actionDownloadOtherCpt :: R.Component ActionDownload
actionDownloadOtherCpt = here.component "actionDownloadOther" cpt where
actionDownloadOtherCpt = here.component "actionDownloadOther" cpt where
cpt
{ id, session }
_ = do
cpt
_
_ = do
pure $ fragmentPT $ "Soon, you will be able to download your file here "
pure $ fragmentPT $ "Soon, you will be able to download your file here "
src/Gargantext/Components/Forest/Tree/Node/Action/Search.purs
View file @
66cfeb1f
...
@@ -6,10 +6,9 @@ import Data.Maybe (Maybe)
...
@@ -6,10 +6,9 @@ import Data.Maybe (Maybe)
import Effect (Effect)
import Effect (Effect)
import Effect.Aff (Aff, launchAff)
import Effect.Aff (Aff, launchAff)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.Forest.Tree.Node.Action.Types (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup)
import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar (searchBar)
import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar (searchBar)
import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField (defaultSearch)
import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField (defaultSearch)
import Gargantext.Components.Forest.Tree.Node.Action.Types (Action(..))
import Gargantext.Components.Lang (allLangs)
import Gargantext.Components.Lang (allLangs)
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (ID)
import Gargantext.Types (ID)
...
@@ -50,8 +49,8 @@ actionSearchCpt = here.component "actionSearch" cpt
...
@@ -50,8 +49,8 @@ actionSearchCpt = here.component "actionSearch" cpt
]
]
where
where
searchOn :: (Action -> Aff Unit)
searchOn :: (Action -> Aff Unit)
-> GT.AsyncTaskWithType
-> GT.AsyncTaskWithType
-> Effect Unit
-> Effect Unit
searchOn dispatch' task = do
searchOn dispatch' task = do
_ <- launchAff $ dispatch' (DoSearch task)
_ <- launchAff $ dispatch' (DoSearch task)
-- close popup
-- close popup
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/Frame.purs
View file @
66cfeb1f
...
@@ -9,7 +9,6 @@ import Data.Show.Generic (genericShow)
...
@@ -9,7 +9,6 @@ import Data.Show.Generic (genericShow)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Nullable (Nullable)
import Data.Nullable (Nullable)
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
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
...
@@ -44,7 +43,6 @@ type SearchIFramesProps = (
...
@@ -44,7 +43,6 @@ type SearchIFramesProps = (
searchIframes :: R2.Component SearchIFramesProps
searchIframes :: R2.Component SearchIFramesProps
searchIframes = R.createElement searchIframesCpt
searchIframes = R.createElement searchIframesCpt
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = here.component "searchIframes" cpt
searchIframesCpt = here.component "searchIframes" cpt
where
where
...
@@ -67,7 +65,6 @@ type IFrameProps = (
...
@@ -67,7 +65,6 @@ type IFrameProps = (
divIframe :: R2.Component IFrameProps
divIframe :: R2.Component IFrameProps
divIframe = R.createElement divIframeCpt
divIframe = R.createElement divIframeCpt
divIframeCpt :: R.Component IFrameProps
divIframeCpt :: R.Component IFrameProps
divIframeCpt = here.component "divIframe" cpt
divIframeCpt = here.component "divIframe" cpt
where
where
...
@@ -82,7 +79,6 @@ frameUrl Searx = "https://searx.frame.gargantext.org" -- 192.168.1.4:8080"
...
@@ -82,7 +79,6 @@ frameUrl Searx = "https://searx.frame.gargantext.org" -- 192.168.1.4:8080"
iframeWith :: R2.Component IFrameProps
iframeWith :: R2.Component IFrameProps
iframeWith = R.createElement iframeWithCpt
iframeWith = R.createElement iframeWithCpt
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = here.component "iframeWith" cpt
iframeWithCpt = here.component "iframeWith" cpt
where
where
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
66cfeb1f
...
@@ -99,7 +99,6 @@ componentIMTCpt = here.component "componentIMT" cpt
...
@@ -99,7 +99,6 @@ componentIMTCpt = here.component "componentIMT" cpt
componentCNRS :: R2.Component ComponentProps
componentCNRS :: R2.Component ComponentProps
componentCNRS = R.createElement componentCNRSCpt
componentCNRS = R.createElement componentCNRSCpt
componentCNRSCpt :: R.Component ComponentProps
componentCNRSCpt :: R.Component ComponentProps
componentCNRSCpt = here.component "componentCNRS" cpt
componentCNRSCpt = here.component "componentCNRS" cpt
where
where
...
@@ -234,15 +233,14 @@ langNavCpt = here.component "langNav" cpt
...
@@ -234,15 +233,14 @@ langNavCpt = here.component "langNav" cpt
------------------------------------------------------------------------
------------------------------------------------------------------------
type DataFieldNavProps =
type DataFieldNavProps =
( datafields :: Array DataField
( search :: T.Box Search )
, search :: T.Box Search )
dataFieldNav :: R2.Component DataFieldNavProps
dataFieldNav :: R2.Component DataFieldNavProps
dataFieldNav = R.createElement dataFieldNavCpt
dataFieldNav = R.createElement dataFieldNavCpt
dataFieldNavCpt :: R.Component DataFieldNavProps
dataFieldNavCpt :: R.Component DataFieldNavProps
dataFieldNavCpt = here.component "dataFieldNav" cpt
dataFieldNavCpt = here.component "dataFieldNav" cpt
where
where
cpt {
datafields,
search } _ = do
cpt { search } _ = do
search'@{ datafield } <- T.useLive T.unequal search
search'@{ datafield } <- T.useLive T.unequal search
pure $ R.fragment
pure $ R.fragment
...
@@ -367,7 +365,7 @@ datafieldInputCpt = here.component "datafieldInput" cpt where
...
@@ -367,7 +365,7 @@ datafieldInputCpt = here.component "datafieldInput" cpt where
iframeRef <- R.useRef null
iframeRef <- R.useRef null
pure $ H.div {}
pure $ H.div {}
[ dataFieldNav {
datafields: dataFields,
search } []
[ dataFieldNav { search } []
, if isExternal search'.datafield
, if isExternal search'.datafield
then databaseInput { databases, search } []
then databaseInput { databases, search } []
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
66cfeb1f
...
@@ -236,7 +236,7 @@ fileTypeViewCpt = here.component "fileTypeView" cpt
...
@@ -236,7 +236,7 @@ fileTypeViewCpt = here.component "fileTypeView" cpt
case droppedFile' of
case droppedFile' of
Nothing -> pure $ H.div {} []
Nothing -> pure $ H.div {} []
Just df@(DroppedFile
{ blob, fileType }
) ->
Just df@(DroppedFile
_
) ->
pure $ H.div tooltipProps [ H.div { className: "card"}
pure $ H.div tooltipProps [ H.div { className: "card"}
[ panelHeading
[ panelHeading
, panelBody df
, panelBody df
...
@@ -270,12 +270,12 @@ fileTypeViewCpt = here.component "fileTypeView" cpt
...
@@ -270,12 +270,12 @@ fileTypeViewCpt = here.component "fileTypeView" cpt
panelBody (DroppedFile { blob }) =
panelBody (DroppedFile { blob }) =
H.div {className: "card-body"}
H.div {className: "card-body"}
[ R2.select {className: "col-md-12 form-control"
[ R2.select {className: "col-md-12 form-control"
, on: {change: onChange
blob
}
, on: {change: onChange}
}
}
(map renderOption [CSV, CSV_HAL, WOS])
(map renderOption [CSV, CSV_HAL, WOS])
]
]
where
where
onChange
blob
e l =
onChange e l =
T.write_ (Just $ DroppedFile $ { blob
T.write_ (Just $ DroppedFile $ { blob
, fileType: read $ R.unsafeEventValue e
, fileType: read $ R.unsafeEventValue e
, lang : fromMaybe EN $ read $ R.unsafeEventValue l
, lang : fromMaybe EN $ read $ R.unsafeEventValue l
...
@@ -477,7 +477,7 @@ uploadTermButtonCpt = here.component "uploadTermButton" cpt
...
@@ -477,7 +477,7 @@ uploadTermButtonCpt = here.component "uploadTermButton" cpt
, on: { click: onClick mFile' uploadType' }
, on: { click: onClick mFile' uploadType' }
} [ H.text "Upload" ]
} [ H.text "Upload" ]
where
where
onClick mFile' uploadType'
e
= do
onClick mFile' uploadType'
_
= do
let {name, blob} = unsafePartial $ fromJust mFile'
let {name, blob} = unsafePartial $ fromJust mFile'
void $ launchAff do
void $ launchAff do
contents <- readUFBAsText blob
contents <- readUFBAsText blob
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
66cfeb1f
...
@@ -90,7 +90,7 @@ nodePopupCpt = here.component "nodePopupView" cpt where
...
@@ -90,7 +90,7 @@ nodePopupCpt = here.component "nodePopupView" cpt where
, title : "Rename", on: { click: \_ -> T.write_ true isOpen } } []
, title : "Rename", on: { click: \_ -> T.write_ true isOpen } } []
panelBody :: T.Box (Maybe NodeAction) -> Record NodePopupProps -> R.Element
panelBody :: T.Box (Maybe NodeAction) -> Record NodePopupProps -> R.Element
panelBody nodePopupState { nodeType } =
panelBody nodePopupState { nodeType } =
let (SettingsBox { doc, buttons}) = settingsBox nodeType in
let (SettingsBox { doc, buttons
}) = settingsBox nodeType in
H.div {className: "card-body flex-space-between"}
H.div {className: "card-body flex-space-between"}
$ [ H.p { className: "spacer" } []
$ [ H.p { className: "spacer" } []
, H.div { className: "flex-center" }
, H.div { className: "flex-center" }
...
@@ -181,25 +181,25 @@ panelAction p = R.createElement panelActionCpt p []
...
@@ -181,25 +181,25 @@ panelAction p = R.createElement panelActionCpt p []
panelActionCpt :: R.Component PanelActionProps
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = here.component "panelAction" cpt
panelActionCpt = here.component "panelAction" cpt
where
where
cpt {action: Documentation nodeType} _ = pure $ actionDoc { nodeType } []
cpt {
action: Documentation nodeType} _ = pure $ actionDoc { nodeType } []
cpt {action: Download, id, nodeType, session} _ = pure $ actionDownload { id, nodeType, session } []
cpt {
action: Download, id, nodeType, session} _ = pure $ actionDownload { id, nodeType, session } []
cpt {action: Upload, dispatch, id, nodeType, session} _ = pure $ actionUpload { dispatch, id, nodeType, session } []
cpt {
action: Upload, dispatch, id, nodeType, session} _ = pure $ actionUpload { dispatch, id, nodeType, session } []
cpt {action: Delete, nodeType, dispatch} _ = pure $ actionDelete { dispatch, nodeType } []
cpt {
action: Delete, nodeType, dispatch} _ = pure $ actionDelete { dispatch, nodeType } []
cpt {
action: Add xs, dispatch, id, name, nodeType} _
=
cpt {
action: Add xs, dispatch, id, name, nodeType} _
=
pure $ addNodeView {dispatch, id, name, nodeType, nodeTypes: xs} []
pure $ addNodeView {dispatch, id, name, nodeType, nodeTypes: xs} []
cpt {
action: Refresh , dispatch, nodeType} _
= pure $ update { dispatch, nodeType } []
cpt {
action: Refresh , dispatch, nodeType } _
= pure $ update { dispatch, nodeType } []
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: 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 } _ =
pure $ moveNode { boxes, dispatch, id, nodeType, session, subTreeParams } []
pure $ moveNode { boxes, dispatch, id, nodeType, session, subTreeParams } []
cpt {action: Link {subTreeParams}, boxes, dispatch, id, nodeType, session } _ =
cpt {
action: Link {subTreeParams}, boxes, dispatch, id, nodeType, session } _ =
pure $ linkNode { boxes, dispatch, id, nodeType, session, subTreeParams } []
pure $ linkNode { boxes, dispatch, id, nodeType, session, subTreeParams } []
cpt {action : Share, dispatch, id } _ = pure $ Share.shareNode { dispatch, id } []
cpt {
action : Share, dispatch, id } _ = pure $ Share.shareNode { dispatch, id } []
cpt {action : AddingContact, dispatch, id } _ = pure $ Contact.actionAddContact { dispatch, id } []
cpt {
action : AddingContact, dispatch, id } _ = pure $ Contact.actionAddContact { dispatch, id } []
cpt {action : Publish {subTreeParams}, boxes, dispatch, id, nodeType, session } _ =
cpt {
action : Publish {subTreeParams}, boxes, dispatch, id, nodeType, session } _ =
pure $ Share.publishNode { boxes, dispatch, id, nodeType, session, subTreeParams } []
pure $ Share.publishNode { boxes, dispatch, id, nodeType, session, subTreeParams } []
cpt { action: SearchBox, boxes, dispatch, id, session } _ =
cpt { action: SearchBox, boxes, dispatch, id, session } _ =
pure $ actionSearch { boxes, dispatch, id: (Just id), session } []
pure $ actionSearch { boxes, dispatch, id: (Just id), session } []
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
66cfeb1f
module Gargantext.Components.Forest.Tree.Node.Settings where
module Gargantext.Components.Forest.Tree.Node.Settings where
import Data.Generic.Rep (class Generic)
import Data.Show.Generic (genericShow)
import Data.Eq.Generic (genericEq)
import Gargantext.Prelude (class Eq, class Show, show, (&&), (<>), (==))
import Gargantext.Prelude (class Eq, class Show, show, (&&), (<>), (==))
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree.Types (SubTreeParams(..))
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree.Types (SubTreeParams(..))
import Data.Array (foldl)
import Gargantext.Types
import Gargantext.Types
------------------------------------------------------------------------
------------------------------------------------------------------------
...
@@ -55,15 +51,15 @@ instance Show NodeAction where
...
@@ -55,15 +51,15 @@ instance Show NodeAction where
show Download = "Download"
show Download = "Download"
show Upload = "Upload"
show Upload = "Upload"
show Refresh = "Refresh"
show Refresh = "Refresh"
show (Move
t
) = "Move with subtree params" -- <> show t
show (Move
_
) = "Move with subtree params" -- <> show t
show Clone = "Clone"
show Clone = "Clone"
show Delete = "Delete"
show Delete = "Delete"
show Share = "Share"
show Share = "Share"
show Config = "Config"
show Config = "Config"
show (Link
x
) = "Link to " -- <> show x
show (Link
_
) = "Link to " -- <> show x
show (Add
xs
) = "Add Child" -- foldl (\a b -> a <> show b) "Add " xs
show (Add
_
) = "Add Child" -- foldl (\a b -> a <> show b) "Add " xs
show (Merge
t
) = "Merge with subtree" -- <> show t
show (Merge
_
) = "Merge with subtree" -- <> show t
show (Publish
x
) = "Publish" -- <> show x
show (Publish
_
) = "Publish" -- <> show x
show AddingContact = "AddingContact"
show AddingContact = "AddingContact"
show CloseNodePopover = "CloseNodePopover"
show CloseNodePopover = "CloseNodePopover"
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
66cfeb1f
...
@@ -223,11 +223,10 @@ type CheckboxesListGroup a =
...
@@ -223,11 +223,10 @@ type CheckboxesListGroup a =
checkboxesListGroup :: forall a. Ord a => Show a => R2.Component (CheckboxesListGroup a)
checkboxesListGroup :: forall a. Ord a => Show a => R2.Component (CheckboxesListGroup a)
checkboxesListGroup = R.createElement checkboxesListGroupCpt
checkboxesListGroup = R.createElement checkboxesListGroupCpt
checkboxesListGroupCpt :: forall a. Ord a => Show a => R.Component (CheckboxesListGroup a)
checkboxesListGroupCpt :: forall a. Ord a => Show a => R.Component (CheckboxesListGroup a)
checkboxesListGroupCpt = here.component "checkboxesListGroup" cpt
checkboxesListGroupCpt = here.component "checkboxesListGroup" cpt
where
where
cpt {
groups,
options } _ = do
cpt { options } _ = do
options' <- T.useLive T.unequal options
options' <- T.useLive T.unequal options
let one a =
let one a =
...
@@ -278,7 +277,6 @@ nodeLinkCpt = here.component "nodeLink" cpt
...
@@ -278,7 +277,6 @@ nodeLinkCpt = here.component "nodeLink" cpt
, nodeType
, nodeType
, session
, session
} _ = do
} _ = do
pure $
pure $
H.div { className: "node-link"
H.div { className: "node-link"
, on: { click } }
, on: { click } }
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools/FTree.purs
View file @
66cfeb1f
module Gargantext.Components.Forest.Tree.Node.Tools.FTree where
module Gargantext.Components.Forest.Tree.Node.Tools.FTree where