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
2ba047b3
Commit
2ba047b3
authored
Dec 19, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/616-breadcrumb-remove-unnecessary-informations' into dev
parents
8ac33eb8
38bd8a9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
63 deletions
+28
-63
Breadcrumb.purs
src/Gargantext/Components/Forest/Breadcrumb.purs
+28
-63
No files found.
src/Gargantext/Components/Forest/Breadcrumb.purs
View file @
2ba047b3
...
@@ -6,6 +6,7 @@ import Control.Monad.Trans.Class
...
@@ -6,6 +6,7 @@ import Control.Monad.Trans.Class
import Data.String (Pattern(..), split)
import Data.String (Pattern(..), split)
import Data.Array as A
import Data.Array as A
import Data.Int (fromString)
import Data.Int (fromString)
import Data.List (head)
import Data.Map (Map)
import Data.Map (Map)
import Data.Map as Map
import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Maybe (Maybe(..), fromMaybe)
...
@@ -254,6 +255,8 @@ breadcrumbItemCpt = here.component "breadcrumbItemCpt" cpt where
...
@@ -254,6 +255,8 @@ breadcrumbItemCpt = here.component "breadcrumbItemCpt" cpt where
, disabled
, disabled
} _ = do
} _ = do
url <- R.unsafeHooksEffect GU.href
let sid = sessionId session
let sid = sessionId session
let rootId = treeId session
let rootId = treeId session
...
@@ -275,7 +278,21 @@ breadcrumbItemCpt = here.component "breadcrumbItemCpt" cpt where
...
@@ -275,7 +278,21 @@ breadcrumbItemCpt = here.component "breadcrumbItemCpt" cpt where
}
}
]
]
,
,
H.text props.text
if show nodeType == "NodeUser"
then
H.text $ getUserText url
else
H.text props.text
, H.span { className: "text-small" }
[
if show nodeType == "NodeUser"
then
H.text $ " (" <> getInstanceText url <> ")"
else
H.text ""
]
]
]
else
else
...
@@ -311,6 +328,16 @@ treeId (Session {treeId: tId}) = tId
...
@@ -311,6 +328,16 @@ treeId (Session {treeId: tId}) = tId
getLastUrlElement :: String -> String
getLastUrlElement :: String -> String
getLastUrlElement str = fromMaybe "" $ A.last $ split (Pattern "/") str
getLastUrlElement str = fromMaybe "" $ A.last $ split (Pattern "/") str
getFirstUrlElement :: String -> String
getFirstUrlElement str = fromMaybe "" $ A.head $ split (Pattern "/") str
getInstanceText :: String -> String
getInstanceText str = getFirstUrlElement $ fromMaybe "" $ A.last $ split (Pattern "@") str
getUserText :: String -> String
getUserText str = getLastUrlElement $ fromMaybe "" $ A.head $ split (Pattern "@") str
type LoadProps =
type LoadProps =
(
(
session :: Session
session :: Session
...
@@ -320,65 +347,3 @@ type LoadProps =
...
@@ -320,65 +347,3 @@ type LoadProps =
loadBreadcrumbData :: Record LoadProps -> AffRESTError BreadcrumbInfo
loadBreadcrumbData :: Record LoadProps -> AffRESTError BreadcrumbInfo
loadBreadcrumbData {nodeId, session} = getBreadcrumb session nodeId
loadBreadcrumbData {nodeId, session} = getBreadcrumb session nodeId
-- type BreadcrumbProps = ( nodeId :: NodeID )
-- breadcrumbLayout :: R2.Leaf BreadcrumbProps
-- breadcrumbLayout = R2.leaf breadcrumbLayoutCpt
-- breadcrumbLayoutCpt :: R.Component BreadcrumbProps
-- breadcrumbLayoutCpt = here.component "breadcrumbLayout" cpt where
-- cpt props@{ nodeId } _ = do
-- session <- useSession
-- let
-- breadcrumbData = getBreadcrumb session nodeId
-- pure $
-- -- breadcrumb layout
-- H.div {}
-- [
-- H.nav
-- { className: "breadcrumb-wrapper bg-light"
-- , "aria-label": "breadcrumb" }
-- [
-- H.ol { className: "breadcrumb text-small" }
-- [
-- H.li { className: "breadcrumb-item" }
-- [
-- H.a { href: "/" }
-- [ H.span { className: "" }
-- [
-- B.icon { name: "home" }
-- ]
-- , H.text "Home"
-- ]
-- ]
-- ,
-- H.li { className: "breadcrumb-item" }
-- [
-- H.a { href: "/" }
-- [ H.span { className: "" }
-- [
-- B.icon { name: "folder-open-o" }
-- ]
-- , H.text "parent folder"
-- ]
-- ]
-- ,
-- H.li { className: "breadcrumb-item" }
-- [ H.span { className: "active-page" }
-- [ H.span { className: "" }
-- [
-- B.icon { name: "book" }
-- ]
-- , H.text "current node"
-- ]
-- ]
-- ]
-- ]
-- ]
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