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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
1ca6ea40
Commit
1ca6ea40
authored
Jul 01, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-doc-table-optimization
parents
dff26819
fbeac876
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
243 additions
and
47 deletions
+243
-47
package.json
package.json
+1
-1
App.purs
src/Gargantext/Components/App.purs
+19
-18
Merge.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
+1
-1
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+21
-7
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+40
-5
Status.purs
src/Gargantext/Components/Forest/Tree/Node/Status.purs
+1
-1
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+3
-2
Dashboard.purs
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
+2
-4
Types.purs
src/Gargantext/Components/Nodes/Dashboard/Types.purs
+4
-5
Frame.purs
src/Gargantext/Components/Nodes/Frame.purs
+119
-0
Router.purs
src/Gargantext/Router.purs
+6
-3
Routes.purs
src/Gargantext/Routes.purs
+9
-0
Types.purs
src/Gargantext/Types.purs
+17
-0
No files found.
package.json
View file @
1ca6ea40
{
"name"
:
"Gargantext"
,
"version"
:
"0.0.1.6.
3
"
,
"version"
:
"0.0.1.6.
4
"
,
"scripts"
:
{
"rebase-set"
:
"spago package-set-upgrade && spago psc-package-insdhall"
,
"rebuild-set"
:
"spago psc-package-insdhall"
,
...
...
src/Gargantext/Components/App.purs
View file @
1ca6ea40
...
...
@@ -20,6 +20,7 @@ import Gargantext.Components.Login (login)
import Gargantext.Components.Nodes.Annuaire (annuaireLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contacts (annuaireUserLayout, userLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Frame (frameLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentLayout)
import Gargantext.Components.Nodes.Home (homeLayout)
...
...
@@ -77,6 +78,8 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
FolderPublic sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
Team sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
RouteFrameWrite sid nodeId -> withSession sid $ \session -> forested $ frameLayout { key: show nodeId, nodeId, session }
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested $ frameLayout { key: show nodeId, nodeId, session }
Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
Texts sid nodeId -> withSession sid $ \session -> forested $ textsLayout { nodeId, session, frontends }
Lists sid nodeId -> withSession sid $ \session -> forested $ listsLayout { nodeId, session }
...
...
@@ -84,8 +87,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
Annuaire sid nodeId -> withSession sid $ \session -> forested $ annuaireLayout { frontends, nodeId, session }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout { frontends, nodeId, session }
ContactPage sid aId nodeId -> withSession sid $ \session -> forested $ annuaireUserLayout { annuaireId: aId, frontends, nodeId, session }
CorpusDocument sid corpusId listId nodeId ->
withSession sid $ \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Just corpusId }
CorpusDocument sid corpusId listId nodeId -> withSession sid $ \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Just corpusId }
Document sid listId nodeId ->
withSession sid $
\session -> forested $ documentLayout { nodeId, listId, session, corpusId: Nothing }
...
...
@@ -102,8 +104,7 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
, treeReload }
type ForestLayoutProps =
(
child :: R.Element
( child :: R.Element
, frontends :: Frontends
, reload :: R.State Int
, route :: AppRoute
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
View file @
1ca6ea40
...
...
@@ -5,7 +5,7 @@ import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel, checkbox, checkboxes
, divider
)
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel, checkbox, checkboxes)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..))
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
1ca6ea40
module Gargantext.Components.Forest.Tree.Node.Box where
import Data.Array as A
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..)
, isJust
)
import Data.String as S
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
...
...
@@ -162,7 +162,14 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
mPanelAction :: R.State (Record NodePopupS)
-> Record NodePopupProps
-> R.Element
mPanelAction ({action: Nothing } /\ _) _ = H.div {} []
mPanelAction ({action: Nothing } /\ _) _ =
H.div {className:"center fa-hand-pointer-o"}
[ H.h4 {} [H.text " Select available actions of this node"]
, H.ul {} [ H.h5 {style:{color:"black"} , className: "fa-thumbs-o-up" } [H.text " Black: yes you can use it" ]
, H.h5 {style:{color:"orange"}, className: "fa-exclamation-triangle"} [H.text " Orange: almost useable" ]
, H.h5 {style:{color:"red"} , className: "fa-rocket" } [H.text " Red: development in progress" ]
]
]
mPanelAction ({action: Just action} /\ _) props =
panelAction { action
, dispatch : props.dispatch
...
...
@@ -199,20 +206,27 @@ buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt
(action == (Just todo) )
, id: show todo
, title: show todo
, onClick : mkEffectFn1 $ \_ ->
undo *>
doToDo
, onClick : mkEffectFn1 $ \_ ->
{-undo *>-}
doToDo
}
[]
]
where
action' = if action == (Just todo)
-- FIXME
-- If uncommenting the code below
-- then mpanelAction state is not
-- updated and leads to some bug (state of subtree
-- not updated and search value not initilized)
-- else current action' forces the user to click twice when
-- changing the action button.
action' = if isJust action {-== (Just todo)-}
then Nothing
else (Just todo)
{- -- This shows the Help of this button
undo = setNodePopup
$ const (node { action = Nothing })
-}
doToDo = setNodePopup
$ const (node { action = action' })
doToDo = setNodePopup $ const (node { action = action' })
iconAStyle :: GT.NodeType -> NodeAction -> { color :: String
, paddingTop :: String
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
1ca6ea40
...
...
@@ -89,7 +89,9 @@ settingsBox NodeUser =
SettingsBox { show : true
, edit : false
, doc : Documentation NodeUser
, buttons : [ Delete ]
, buttons : [ Delete
-- , Add [FolderPublic]
]
}
settingsBox FolderPrivate =
...
...
@@ -99,6 +101,8 @@ settingsBox FolderPrivate =
, buttons : [ Add [ Corpus
, Folder
, Annuaire
, NodeFrameWrite
, NodeFrameCalc
]
]
}
...
...
@@ -110,16 +114,19 @@ settingsBox Team =
, buttons : [ Add [ Corpus
, Folder
, Annuaire
, NodeFrameWrite
, NodeFrameCalc
]
, Share
, Delete]
, Delete
]
}
settingsBox FolderShared =
SettingsBox { show : true
, edit : true
, doc : Documentation FolderShared
, buttons : [ Add [Team, Folder
Shared
]
, buttons : [ Add [Team, Folder]
-- , Delete
]
}
...
...
@@ -131,6 +138,7 @@ settingsBox FolderPublic =
, buttons : [ Add [ Corpus
, Folder
]
-- , Delete
]
}
...
...
@@ -141,6 +149,8 @@ settingsBox Folder =
, buttons : [ Add [ Corpus
, Folder
, Annuaire
, NodeFrameWrite
, NodeFrameCalc
]
, Move moveParameters
, Delete
...
...
@@ -154,6 +164,8 @@ settingsBox Corpus =
, buttons : [ Add [ NodeList
, Graph
, Dashboard
, NodeFrameWrite
, NodeFrameCalc
]
, SearchBox
, Upload
...
...
@@ -229,6 +241,29 @@ settingsBox Annuaire =
]
}
settingsBox NodeFrameWrite =
SettingsBox { show : true
, edit : true
, doc : Documentation NodeFrameWrite
, buttons : [ Add [ NodeFrameWrite
, NodeFrameCalc
]
]
}
settingsBox NodeFrameCalc =
SettingsBox { show : true
, edit : true
, doc : Documentation NodeFrameCalc
, buttons : [ Add [ NodeFrameCalc
, NodeFrameWrite
]
]
}
settingsBox _ =
SettingsBox { show : false
, edit : false
...
...
src/Gargantext/Components/Forest/Tree/Node/Status.purs
View file @
1ca6ea40
...
...
@@ -8,7 +8,7 @@ import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..))
data Status = Stable | Test | Dev
hasStatus :: NodeType -> NodeAction -> Status
hasStatus _ SearchBox =
Dev
hasStatus _ SearchBox =
Test
hasStatus _ Refresh = Dev
hasStatus _ Config = Dev
hasStatus _ (Link _) = Dev
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
1ca6ea40
...
...
@@ -263,6 +263,7 @@ nodeTextCpt = R.hooksComponent "G.C.F.T.N.B.nodeText" cpt
------------------------------------------------------------------------
divider :: R.Element
divider = H.div {className:"divider"} []
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
View file @
1ca6ea40
...
...
@@ -53,8 +53,7 @@ dashboardLayoutCpt = R.hooksComponent "G.C.N.C.D.dashboardLayout" cpt
liftEffect $ setReload $ (+) 1
type LoadedProps =
(
charts :: Array P.PredefinedChart
( charts :: Array P.PredefinedChart
, corpusId :: NodeID
, defaultListId :: Int
, key :: String
...
...
@@ -91,8 +90,7 @@ dashboardLayoutLoadedCpt = R.hooksComponent "G.C.N.C.D.dashboardLayoutLoaded" cp
onRemove _ = onChange $ fromMaybe charts $ A.deleteAt idx charts
type PredefinedChartProps =
(
chart :: P.PredefinedChart
( chart :: P.PredefinedChart
, corpusId :: NodeID
, defaultListId :: Int
, onChange :: P.PredefinedChart -> Effect Unit
...
...
src/Gargantext/Components/Nodes/Dashboard/Types.purs
View file @
1ca6ea40
...
...
@@ -13,8 +13,7 @@ type Preferences = Maybe String
newtype Hyperdata =
Hyperdata
{
charts :: Array P.PredefinedChart
{ charts :: Array P.PredefinedChart
, preferences :: Preferences
}
instance decodeHyperdata :: DecodeJson Hyperdata where
...
...
@@ -52,8 +51,8 @@ saveDashboard {hyperdata, nodeId, session} = do
id_ <- (put session (NodeAPI Node (Just nodeId) "") hyperdata) :: Aff Int
pure unit
type DashboardData =
{
id :: Int
type DashboardData =
{
id :: Int
, hyperdata :: Hyperdata
, parentId :: Int
}
src/Gargantext/Components/Nodes/Frame.purs
0 → 100644
View file @
1ca6ea40
module Gargantext.Components.Nodes.Frame where
import Data.Maybe (Maybe(..))
import Data.Tuple (fst)
import Effect.Aff (Aff)
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, get)
import Gargantext.Types (NodeType(..))
import Reactix as R
import Reactix.DOM.HTML as H
import Data.Argonaut as Argonaut
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
--import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson, genericEnumDecodeJson, genericEnumEncodeJson)
import Gargantext.Utils.Argonaut (genericSumEncodeJson)
import Data.Argonaut (decodeJson, (.:))
data Hyperdata =
Hyperdata { base :: String
, frame_id :: String
}
derive instance eqHyperdata :: Eq Hyperdata
derive instance genericHyperdata :: Generic Hyperdata _
instance showHyperdata :: Show Hyperdata where
show = genericShow
instance decodeJsonHyperdata :: Argonaut.DecodeJson Hyperdata where
-- TODO
-- decodeJson = genericSumDecodeJson
decodeJson json = do
obj <- decodeJson json
base <- obj .: "base"
frame_id <- obj .: "frame_id"
pure $ Hyperdata {base, frame_id}
instance encodeJsonHyperdata :: Argonaut.EncodeJson Hyperdata where
encodeJson = genericSumEncodeJson
type Props =
( nodeId :: Int
, session :: Session
)
type Reload = R.State Int
type KeyProps =
( key :: String
| Props
)
frameLayout :: Record KeyProps -> R.Element
frameLayout props = R.createElement frameLayoutCpt props []
frameLayoutCpt :: R.Component KeyProps
frameLayoutCpt = R.hooksComponent "G.C.N.C.writeLayout" cpt
where
cpt {nodeId, session} _ = do
reload <- R.useState' 0
useLoader {nodeId, reload: fst reload, session} loadframeWithReload $
\frame -> frameLayoutView {frame, nodeId, reload, session}
type ViewProps =
( frame :: NodePoly Hyperdata
, reload :: Reload
| Props
)
data FrameType = Calc | Write
type Base = String
type FrameId = String
hframe :: FrameType -> String
hframe ft = "https://" <> hframe' ft <> ".frame.gargantext.org/test"
where
hframe' Calc = "calc"
hframe' Write = "write"
hframeUrl :: Base -> FrameId -> String
hframeUrl base frame_id = base <> "/" <> frame_id <> "?both"
frameLayoutView :: Record ViewProps -> R.Element
frameLayoutView props = R.createElement frameLayoutViewCpt props []
frameLayoutViewCpt :: R.Component ViewProps
frameLayoutViewCpt = R.hooksComponent "G.C.N.C.frameLayoutView" cpt
where
cpt {frame: (NodePoly {hyperdata: Hyperdata {base, frame_id}}), nodeId, reload, session} _ = do
pure $ H.div { className : "istex-search" }
[ H.iframe { src: hframeUrl base frame_id
, width: "100%"
, height: "100%"
-- , ref: "https://write.frame.gargantext.org/test"
} []
]
type LoadProps =
( nodeId :: Int
, session :: Session
)
loadframe' :: Record LoadProps -> Aff (NodePoly Hyperdata)
loadframe' {nodeId, session} = get session $ NodeAPI Node (Just nodeId) ""
-- Just to make reloading effective
loadframeWithReload :: {reload :: Int | LoadProps} -> Aff (NodePoly Hyperdata)
loadframeWithReload {nodeId, session} = loadframe' {nodeId, session}
src/Gargantext/Router.purs
View file @
1ca6ea40
...
...
@@ -29,6 +29,9 @@ router = oneOf
<*> (lit "contact" *> int)
, Annuaire <$> (route "annuaire" *> sid) <*> int
, UserPage <$> (route "user" *> sid) <*> int
, RouteFrameWrite <$> (route "write" *> sid) <*> int
, RouteFrameCalc <$> (route "calc" *> sid) <*> int
, Home <$ lit ""
]
where
...
...
src/Gargantext/Routes.purs
View file @
1ca6ea40
...
...
@@ -23,6 +23,9 @@ data AppRoute
| Annuaire SessionId Int
| UserPage SessionId Int
| ContactPage SessionId Int Int
| RouteFrameWrite SessionId Int
| RouteFrameCalc SessionId Int
derive instance eqAppRoute :: Eq AppRoute
...
...
@@ -66,6 +69,9 @@ instance showAppRoute :: Show AppRoute where
show (Annuaire s i) = "Annuaire" <> show i <> " (" <> show s <> ")"
show (UserPage s i) = "User" <> show i <> " (" <> show s <> ")"
show (ContactPage s a i) = "Contact" <> show a <> "::" <> show i <> " (" <> show s <> ")"
show (RouteFrameWrite s i) = "write" <> show i <> " (" <> show s <> ")"
show (RouteFrameCalc s i) = "calc" <> show i <> " (" <> show s <> ")"
appPath :: AppRoute -> String
appPath Home = ""
...
...
@@ -85,3 +91,6 @@ appPath (Lists s i) = "lists/" <> show s <> "/" <> show i
appPath (Annuaire s i) = "annuaire/" <> show s <> "/" <> show i
appPath (UserPage s i) = "user/" <> show s <> "/" <> show i
appPath (ContactPage s a i) = "annuaire/" <> show s <> "/" <> show a <> "/contact/" <> show i
appPath (RouteFrameWrite s i) = "write/" <> show s <> "/" <> show i
appPath (RouteFrameCalc s i) = "calc/" <> show s <> "/" <> show i
src/Gargantext/Types.purs
View file @
1ca6ea40
...
...
@@ -151,6 +151,9 @@ data NodeType = NodeUser
| Tree
| NodeList
| Texts
-- TODO Optional Nodes
| NodeFrameWrite
| NodeFrameCalc
derive instance eqNodeType :: Eq NodeType
...
...
@@ -177,6 +180,9 @@ instance showNodeType :: Show NodeType where
show Team = "NodeTeam"
show NodeList = "NodeList"
show Texts = "NodeTexts"
show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc"
instance readNodeType :: Read NodeType where
read "NodeUser" = Just NodeUser
...
...
@@ -199,6 +205,8 @@ instance readNodeType :: Read NodeType where
read "NodeList" = Just NodeList
read "NodeTexts" = Just Texts
read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc
read _ = Nothing
...
...
@@ -237,6 +245,12 @@ fldr Annuaire false = "fa fa-address-card"
fldr NodeContact true = "fa fa-address-card-o"
fldr NodeContact false = "fa fa-address-card"
fldr NodeFrameWrite true = "fa fa-file-word-o"
fldr NodeFrameWrite false = "fa fa-file-word-o"
fldr NodeFrameCalc true = "fa fa-file-excel-o"
fldr NodeFrameCalc false = "fa fa-file-excel-o"
fldr _ false = "fa fa-folder-o"
fldr _ true = "fa fa-folder-open"
...
...
@@ -280,6 +294,9 @@ nodeTypePath Tree = "tree"
nodeTypePath NodeList = "lists"
nodeTypePath Texts = "texts"
nodeTypePath Team = "team"
nodeTypePath NodeFrameWrite = "write"
nodeTypePath NodeFrameCalc = "calc"
------------------------------------------------------------
type ListId = Int
...
...
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