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
122
Issues
122
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
gargantext
purescript-gargantext
Commits
85f4f9f2
Commit
85f4f9f2
authored
Aug 10, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[errors] implement errorsView
parent
613a0217
Pipeline
#1709
failed with stage
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
74 deletions
+60
-74
Data.purs
src/Gargantext/Components/App/Data.purs
+4
-4
Router.purs
src/Gargantext/Components/Router.purs
+4
-3
SimpleLayout.purs
src/Gargantext/Components/SimpleLayout.purs
+0
-32
TopBar.purs
src/Gargantext/Components/TopBar.purs
+29
-28
REST.purs
src/Gargantext/Config/REST.purs
+0
-1
Types.purs
src/Gargantext/Types.purs
+4
-2
ReactBootstrap.js
src/Gargantext/Utils/ReactBootstrap.js
+2
-0
ReactBootstrap.purs
src/Gargantext/Utils/ReactBootstrap.purs
+17
-4
No files found.
src/Gargantext/Components/App/Data.purs
View file @
85f4f9f2
module Gargantext.Components.App.Data (App, Boxes, emptyApp) where
import Gargantext.Prelude
import Data.Maybe (Maybe(..))
import Data.Set as Set
import Toestand as T
import Gargantext.Prelude
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.Nodes.Lists.Types as ListsT
import Gargantext.Components.Nodes.Texts.Types as TextsT
import Gargantext.Ends (Backend)
import Gargantext.Routes (AppRoute(Home))
import Gargantext.Sessions as Sessions
import Gargantext.Sessions (Session, Sessions)
import Gargantext.Sessions as Sessions
import Gargantext.Sessions.Types (OpenNodes(..))
import Gargantext.Types (FrontendError, Handed(RightHanded), SidePanelState(..))
import Gargantext.Types (FrontendError
(..)
, Handed(RightHanded), SidePanelState(..))
import Gargantext.Utils.Toestand as T2
type App =
...
...
src/Gargantext/Components/Router.purs
View file @
85f4f9f2
...
...
@@ -12,6 +12,7 @@ import Record.Extra as RE
import Toestand as T
import Gargantext.Components.App.Data (Boxes)
import Gargantext.Components.ErrorsView (errorsView)
import Gargantext.Components.Footer (footer)
import Gargantext.Components.Forest as Forest
import Gargantext.Components.GraphExplorer as GraphExplorer
...
...
@@ -43,7 +44,6 @@ import Gargantext.Sessions as Sessions
import Gargantext.Types (CorpusId, Handed(..), ListId, NodeID, NodeType(..), SessionId, SidePanelState(..), reverseHanded)
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.Router"
...
...
@@ -67,8 +67,9 @@ routerCpt = here.component "router" cpt where
pure $ R.fragment
([ loginModal { boxes }
, topBar { boxes } ] <>
[ H.div { className: handedClassName <> " router-inner" } $ reverseHanded handed' $
, topBar { boxes }
, errorsView { errors: boxes.errors } []
, H.div { className: handedClassName <> " router-inner" } $ reverseHanded handed' $
[ forest { boxes }
, mainPage { boxes }
, sidePanel { boxes }
...
...
src/Gargantext/Components/SimpleLayout.purs
deleted
100644 → 0
View file @
613a0217
module Gargantext.Components.SimpleLayout where
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Components.TopBar (topBar)
import Gargantext.License (license)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.SimpleLayout"
-- Simple layout does not accommodate the tree
type SimpleLayoutProps = (
handed :: T.Box GT.Handed
, showTree :: T.Box Boolean
)
simpleLayout :: R2.Component SimpleLayoutProps
simpleLayout = R.createElement simpleLayoutCpt
simpleLayoutCpt :: R.Component SimpleLayoutProps
simpleLayoutCpt = here.component "simpleLayout" cpt
where
cpt { handed, showTree } children = do
pure $ H.div { className: "simple-layout" } (
[ topBar { handed, showTree } [] ] <> children <> [ license ]
)
src/Gargantext/Components/TopBar.purs
View file @
85f4f9f2
module Gargantext.Components.TopBar where
import Gargantext.Prelude
import Data.Foldable (intercalate)
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Components.GraphExplorer.ToggleButton as Toggle
import Gargantext.Components.Themes (themeSwitcher, defaultTheme, allThemes)
import Gargantext.Types (Handed(..), reverseHanded)
import Gargantext.Types (
FrontendError(..),
Handed(..), reverseHanded)
import Gargantext.Utils.Reactix as R2
import Gargantext.Components.GraphExplorer.ToggleButton as Toggle
here :: R2.Here
here = R2.here "Gargantext.Components.TopBar"
type TopBarProps = ( handed :: T.Box Handed, showTree :: T.Box Boolean )
type TopBarProps =
( handed :: T.Box Handed
, showTree :: T.Box Boolean )
topBar :: R2.Component TopBarProps
topBar = R.createElement topBarCpt
topBarCpt :: R.Component TopBarProps
topBarCpt = here.component "topBar" cpt
where
...
...
@@ -30,29 +31,30 @@ topBarCpt = here.component "topBar" cpt
, id: "dafixedtop"
, role: "navigation"
}
[ H.div { className: "container-fluid" } $ reverseHanded handed' [
-- NOTE: first (and only) entry in the sorted array should have the "ml-auto class"
-- https://stackoverflow.com/questions/19733447/bootstrap-navbar-with-left-center-or-right-aligned-items
-- In practice: only apply "ml-auto" to the last element of this list, if handed == LeftHanded
logo
, H.div { className: "collapse navbar-collapse" }
[ H.ul { className: "navbar-nav " <> if handed' == LeftHanded then "ml-auto" else "" } $ reverseHanded handed'
([ divDropdownLeft {} []
, handButton handed'
, smiley
, H.li { className: "nav-item" } [ themeSwitcher { theme: defaultTheme
, themes: allThemes } [] ]
, Toggle.treeToggleButton { state: showTree } []
] <> children)
]
]
[ H.div { className: "container-fluid" } $ reverseHanded handed'
[
-- NOTE: first (and only) entry in the sorted array should have the "ml-auto class"
-- https://stackoverflow.com/questions/19733447/bootstrap-navbar-with-left-center-or-right-aligned-items
-- In practice: only apply "ml-auto" to the last element of this list, if handed == LeftHanded
logo
, H.div { className: "collapse navbar-collapse" }
[ H.ul { className: "navbar-nav " <> if handed' == LeftHanded then "ml-auto" else "" } $ reverseHanded handed'
([ divDropdownLeft {} []
, handButton
, smiley
, H.li { className: "nav-item" } [ themeSwitcher { theme: defaultTheme
, themes: allThemes } [] ]
, Toggle.treeToggleButton { state: showTree } []
] <> children)
]
]
]
where
handButton
handed'
= H.li { title: "If you are Left Handed you can change\n"
<> "the interface by clicking on me. Click\n"
<> "again to come back to previous state."
, className: "nav-item"
} [handedChooser { handed } []]
handButton = H.li { title: "If you are Left Handed you can change\n"
<> "the interface by clicking on me. Click\n"
<> "again to come back to previous state."
, className: "nav-item"
} [handedChooser { handed } []]
smiley = H.li { title: "Hello! Looking for the tree ?\n"
<> "Just watch on the other side!\n"
...
...
@@ -71,7 +73,6 @@ topBarCpt = here.component "topBar" cpt
-- SB.searchBar {session, databases: allDatabases}
logo :: R.Element
logo =
H.a { className, href: "#/" } [
...
...
src/Gargantext/Config/REST.purs
View file @
85f4f9f2
...
...
@@ -82,7 +82,6 @@ send m mtoken url reqbody = do
let cookie = "JWT-Cookie=" <> token <> "; Path=/;" --" HttpOnly; Secure; SameSite=Lax"
R2.setCookie cookie
affResp <- request req
liftEffect $ log2 "affResp" affResp
pure $ readJSON affResp
noReqBody :: Maybe String
...
...
src/Gargantext/Types.purs
View file @
85f4f9f2
...
...
@@ -2,13 +2,12 @@ module Gargantext.Types where
import Gargantext.Prelude
import CSS.Cursor (Cursor(..))
import Data.Array as A
import Data.Either (Either)
import Data.Eq.Generic (genericEq)
import Data.Generic.Rep (class Generic)
import Data.Int (toNumber)
import Data.Maybe (Maybe(..),
fromMaybe,
maybe)
import Data.Maybe (Maybe(..), maybe)
import Data.Newtype (class Newtype)
import Data.Ord.Generic (genericCompare)
import Data.Show.Generic (genericShow)
...
...
@@ -783,3 +782,6 @@ toggleSidePanelState Opened = Closed
newtype FrontendError = FrontendError
{ error :: String
}
derive instance Generic FrontendError _
instance Eq FrontendError where eq = genericEq
src/Gargantext/Utils/ReactBootstrap.js
View file @
85f4f9f2
...
...
@@ -6,9 +6,11 @@ if (typeof window !== 'undefined') {
window
.
ReactBootstrap
=
ReactBootstrap
;
}
const
Alert
=
require
(
'react-bootstrap/Alert'
);
const
OverlayTrigger
=
require
(
'react-bootstrap/OverlayTrigger'
);
const
Popover
=
require
(
'react-bootstrap/Popover'
);
exports
.
alertCpt
=
Alert
;
exports
.
overlayTriggerCpt
=
OverlayTrigger
;
exports
.
popoverCpt
=
Popover
;
exports
.
popoverContentCpt
=
Popover
.
Content
;
...
...
src/Gargantext/Utils/ReactBootstrap.purs
View file @
85f4f9f2
module Gargantext.Utils.ReactBootstrap where
import Effect (Effect)
import Reactix as R
import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2
type OverlayTriggerProps =
(
overlay :: R.Element
...
...
@@ -15,6 +18,12 @@ type Props =
(
)
type AlertProps =
( dismissible :: Boolean
, onClose :: Effect Unit
, variant :: String
)
type ContentProps =
(
)
...
...
@@ -24,21 +33,25 @@ type TitleProps =
"as" :: String
)
foreign import alertCpt :: R.Component AlertProps
foreign import overlayTriggerCpt :: R.Component OverlayTriggerProps
foreign import popoverCpt :: R.Component Props
foreign import popoverContentCpt :: R.Component ContentProps
foreign import popoverTitleCpt :: R.Component TitleProps
overlayTrigger :: Record OverlayTriggerProps -> Array R.Element -> R.Element
alert :: R2.Component AlertProps
alert = R.rawCreateElement alertCpt
overlayTrigger :: R2.Component OverlayTriggerProps
overlayTrigger = R.rawCreateElement overlayTriggerCpt
popover :: R
ecord Props -> Array R.Element -> R.Element
popover :: R
2.Component Props
popover = R.rawCreateElement popoverCpt
popoverContent :: R
ecord ContentProps -> Array R.Element -> R.Element
popoverContent :: R
2.Component ContentProps
popoverContent = R.rawCreateElement popoverContentCpt
popoverTitle :: R
ecord TitleProps -> Array R.Element -> R.Element
popoverTitle :: R
2.Component TitleProps
popoverTitle = R.rawCreateElement popoverTitleCpt
...
...
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