Verified Commit 55e72aea authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev-spago-next' into dev-add-edge-weight-control

parents 5f3eeab6 de565b71
// Main Gargantext scripts
$(function () {
$('[data-toggle="tooltip"]').tooltip()
console.log("Gargantext is ready.");
})
\ No newline at end of file
This diff is collapsed.
...@@ -6696,9 +6696,16 @@ a:hover { ...@@ -6696,9 +6696,16 @@ a:hover {
font-family: ForkAwesome, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-family: ForkAwesome, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
} }
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link { .nav.nav-tabs .nav-link {
cursor: pointer; cursor: pointer;
} }
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a { .nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #DEE2E6; color: #DEE2E6;
} }
......
...@@ -6507,9 +6507,16 @@ a:hover { ...@@ -6507,9 +6507,16 @@ a:hover {
font-family: ForkAwesome, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-family: ForkAwesome, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
} }
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link { .nav.nav-tabs .nav-link {
cursor: pointer; cursor: pointer;
} }
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a { .nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057; color: #495057;
} }
......
...@@ -6350,9 +6350,16 @@ a:hover { ...@@ -6350,9 +6350,16 @@ a:hover {
font-family: ForkAwesome, "Mulish"; font-family: ForkAwesome, "Mulish";
} }
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link { .nav.nav-tabs .nav-link {
cursor: pointer; cursor: pointer;
} }
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a { .nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057; color: #495057;
} }
......
...@@ -6571,9 +6571,16 @@ a:hover { ...@@ -6571,9 +6571,16 @@ a:hover {
font-family: ForkAwesome, "Nunito"; font-family: ForkAwesome, "Nunito";
} }
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link { .nav.nav-tabs .nav-link {
cursor: pointer; cursor: pointer;
} }
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a { .nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057; color: #495057;
} }
......
...@@ -6644,9 +6644,16 @@ a:hover { ...@@ -6644,9 +6644,16 @@ a:hover {
font-family: ForkAwesome, "Montserrat"; font-family: ForkAwesome, "Montserrat";
} }
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link { .nav.nav-tabs .nav-link {
cursor: pointer; cursor: pointer;
} }
.nav.nav-tabs .nav-link .active {
font-weight: 500;
}
.nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a { .nav.nav-tabs .nav-tabs .nav-link.active, .nav.nav-tabs .nav-tabs .nav-item.show .nav-link, .nav.nav-tabs li a {
color: #495057; color: #495057;
} }
......
...@@ -5,4 +5,6 @@ ...@@ -5,4 +5,6 @@
nix-channel --update nix-channel --update
nix-env -iA nixpkgs.nix nixpkgs.cacert nix-env -iA nixpkgs.nix nixpkgs.cacert
nix-shell --show-trace --option build-fallback true --run 'bun install'
nix-shell --show-trace --option build-fallback true --run fix-bun
nix-shell --show-trace --option build-fallback true --run build nix-shell --show-trace --option build-fallback true --run build
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.7.1", "version": "0.0.7.1.2",
"scripts": { "scripts": {
"build": "spago build", "build": "spago build",
"bundle": "spago bundle --module Main --outfile dist/bundle.js", "bundle": "spago bundle --module Main --outfile dist/bundle.js",
......
...@@ -16,12 +16,14 @@ import Gargantext.Hooks.Session (useSession) ...@@ -16,12 +16,14 @@ import Gargantext.Hooks.Session (useSession)
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (sessionId) import Gargantext.Sessions (sessionId)
import Gargantext.Types (ID, defaultCacheParams) import Gargantext.Types (ID, defaultCacheParams)
import Gargantext.Types as GT
import Gargantext.Utils (setter, (?)) import Gargantext.Utils (setter, (?))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
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
type Props = type Props =
( nodeId :: ID ( nodeId :: ID
, nodeData :: Node , nodeData :: Node
...@@ -34,7 +36,7 @@ layout :: R2.Leaf Props ...@@ -34,7 +36,7 @@ layout :: R2.Leaf Props
layout = R2.leaf layoutCpt layout = R2.leaf layoutCpt
layoutCpt :: R.Component Props layoutCpt :: R.Component Props
layoutCpt = here.component "layout" cpt where layoutCpt = here.component "layout" cpt where
cpt { nodeId, nodeData: { name } } _ = do cpt { nodeId, nodeData: { name, node_type } } _ = do
-- | Hooks -- | Hooks
-- | -- |
boxes@{ boxes@{
...@@ -69,24 +71,37 @@ layoutCpt = here.component "layout" cpt where ...@@ -69,24 +71,37 @@ layoutCpt = here.component "layout" cpt where
pure $ pure $
H.div H.div
{ className: "corpus-layout" } { className: "node-layout corpus-layout" }
[ [
-- FV.backButtonSmart { nodeId, session } [] -- FV.backButtonSmart { nodeId, session } []
H.div H.div
{ className: "corpus-layout__title" } { className: "node-layout__title corpus-layout__title" }
[ [
B.div' H.div
{ className: "corpus-layout__title__text" } { className: "node-layout__title__content text-primary" }
name [
B.icon
{ className: "node-layout__title__icon"
, name: GT.getIcon node_type true
}
,
H.span
{ className: "node-layout__title__text mx-1" }
[ H.text name ]
]
, ,
-- B.div'
-- { className: "corpus-layout__title__text" }
-- name
-- ,
H.hr H.hr
{ className: "corpus-layout__title__line"} { className: "node-layout__title__line corpus-layout__title__line"}
, ,
B.iconButton B.iconButton
{ name: expandTableEdition' ? { name: expandTableEdition' ?
"caret-up" $ "caret-up" $
"caret-down" "caret-down"
, className: "corpos-layout__title__expand" , className: "node-layout__title__expand corpus-layout__title__expand"
, callback: onExpandClick , callback: onExpandClick
} }
] ]
...@@ -94,14 +109,14 @@ layoutCpt = here.component "layout" cpt where ...@@ -94,14 +109,14 @@ layoutCpt = here.component "layout" cpt where
R2.when expandTableEdition' $ R2.when expandTableEdition' $
H.div H.div
{ className: "corpus-layout__edition-block" } { className: "node-layout__edition-block corpus-layout__edition-block" }
[ [
editionBlock editionBlock
{ nodeId } { nodeId }
] ]
, ,
H.div H.div
{ className: "corpus-layout__code-section" } { className: "node-layout__code-section corpus-layout__code-section" }
[ [
tileMenu tileMenu
{ boxes { boxes
...@@ -129,7 +144,7 @@ layoutCpt = here.component "layout" cpt where ...@@ -129,7 +144,7 @@ layoutCpt = here.component "layout" cpt where
] ]
, ,
H.div H.div
{ className: "corpus-layout__folders" } { className: "node-layout__folders corpus-layout__folders" }
[ [
FV.folderView FV.folderView
{ nodeId { nodeId
......
module Gargantext.Components.GraphQL.Node where module Gargantext.Components.GraphQL.Node where
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Types (NodeType)
import Gargantext.Utils.GraphQL as GGQL import Gargantext.Utils.GraphQL as GGQL
import Gargantext.Types (NodeType) import Gargantext.Types (NodeType)
import GraphQL.Client.Args (Args, (=>>)) import GraphQL.Client.Args (Args, (=>>))
...@@ -12,13 +13,15 @@ type Corpus ...@@ -12,13 +13,15 @@ type Corpus
= { id :: Int = { id :: Int
, name :: String , name :: String
, parent_id :: Int , parent_id :: Int
, type_id :: Int } , type_id :: Int
, node_type :: NodeType }
type Node type Node
= { id :: Int = { id :: Int
, name :: String , name :: String
, parent_id :: Int , parent_id :: Int
, type_id :: Int } , type_id :: Int
, node_type :: NodeType }
type NodesCorpusQuery = type NodesCorpusQuery =
{ nodes_corpus :: Args { nodes_corpus :: Args
...@@ -26,7 +29,8 @@ type NodesCorpusQuery = ...@@ -26,7 +29,8 @@ type NodesCorpusQuery =
{ id :: Unit { id :: Unit
, name :: Unit , name :: Unit
, parent_id :: Unit , parent_id :: Unit
, type_id :: Unit } } , type_id :: Unit
, node_type :: Unit } }
type NodesQuery = type NodesQuery =
{ nodes :: Args { nodes :: Args
...@@ -34,7 +38,8 @@ type NodesQuery = ...@@ -34,7 +38,8 @@ type NodesQuery =
{ id :: Unit { id :: Unit
, name :: Unit , name :: Unit
, parent_id :: Unit , parent_id :: Unit
, type_id :: Unit } } , type_id :: Unit
, node_type :: Unit } }
nodesQuery :: NodesQuery nodesQuery :: NodesQuery
nodesQuery = { nodes: { node_id: Var :: _ "id" Int } =>> nodesQuery = { nodes: { node_id: Var :: _ "id" Int } =>>
......
...@@ -23,6 +23,6 @@ loadingSpinnerCpt = here.component "LoadingSpinner" cpt where ...@@ -23,6 +23,6 @@ loadingSpinnerCpt = here.component "LoadingSpinner" cpt where
-- cpt _ _ = H.i {className: "fa fa-circle-o-notch fa-spin fa-3x fa-fw"} [H.text ""] -- cpt _ _ = H.i {className: "fa fa-circle-o-notch fa-spin fa-3x fa-fw"} [H.text ""]
cpt { additionalClass } _ = do cpt { additionalClass } _ = do
pure $ H.i { className: "fa fa-spinner fa-pulse fa-3x fa-fw " <> c } [H.text ""] pure $ H.i { className: "fa fa-spinner fa-pulse fa-fw " <> c } [H.text ""]
where where
c = fromMaybe "" additionalClass c = fromMaybe "" additionalClass
...@@ -3,6 +3,8 @@ module Gargantext.Components.Tab where ...@@ -3,6 +3,8 @@ module Gargantext.Components.Tab where
import Data.FunctorWithIndex (mapWithIndex) import Data.FunctorWithIndex (mapWithIndex)
import Data.Tuple (Tuple) import Data.Tuple (Tuple)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Gargantext.Components.Bootstrap as B
import Gargantext.Types as GT
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
...@@ -49,10 +51,19 @@ tabsCpt = here.component "tabs" cpt where ...@@ -49,10 +51,19 @@ tabsCpt = here.component "tabs" cpt where
(mapWithIndex (item activeTab') tabs') (mapWithIndex (item activeTab') tabs')
] ]
button activeTab selected index (name /\ _) = button activeTab selected index (name /\ _) =
H.a { className, on: { click } } [ H.text name ] where H.a { className, on: { click } }
[
B.icon
{ className: "mx-1"
, name: iconName
}
,
H.span {} [ H.text name ]
] where
eq = index == selected eq = index == selected
className = "nav-item nav-link" <> (if eq then " active" else "") className = "tab-label_" <> name <> " nav-item nav-link" <> (if eq then " active" else "")
click _ = T.write_ index activeTab click _ = T.write_ index activeTab
iconName = GT.getTabIcon name
item selected index (_ /\ cpt') = tab { selected, index } [ cpt' ] item selected index (_ /\ cpt') = tab { selected, index } [ cpt' ]
-- TODO: document what these are (selection, item indices) -- TODO: document what these are (selection, item indices)
......
...@@ -166,11 +166,21 @@ tableHeaderWithRenameBoxedLayoutCpt = here.component "tableHeaderWithRenameBoxed ...@@ -166,11 +166,21 @@ tableHeaderWithRenameBoxedLayoutCpt = here.component "tableHeaderWithRenameBoxed
, ,
-} -}
H.div H.div
{ className: "table-header-rename__title" } { className: "table-header-rename__title text-primary" }
[ [
B.div' H.div { className: "table-header-rename__title__text" }
{ className: "table-header-rename__title__text" } [
name B.icon
{ className: "mx-1"
, name: "book"
}
,
H.span {}
[
H.text name
]
]
, ,
H.hr H.hr
{ className: "table-header-rename__title__line" } { className: "table-header-rename__title__line" }
......
...@@ -172,12 +172,10 @@ treeSearchRender = R2.leaf treeSearchRenderCpt ...@@ -172,12 +172,10 @@ treeSearchRender = R2.leaf treeSearchRenderCpt
treeSearchRenderCpt :: R.Component RenderProps treeSearchRenderCpt :: R.Component RenderProps
treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
cpt { visible, session, searchData, goToRoute } _ = do cpt { visible, session, searchData, goToRoute } _ = do
{ route } <- AppStore.use
route' <- T.useLive T.unequal route
pure $ H.div {className: "search-modal__results"} (results route' searchData) pure $ H.div {className: "search-modal__results"} (results searchData)
where where
results route' s = map searchResult s results s = map searchResult s
where where
searchResult sd = H.div searchResult sd = H.div
{ className: "result py-1"} { className: "result py-1"}
...@@ -197,7 +195,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where ...@@ -197,7 +195,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
[ [
H.text " Path: " H.text " Path: "
, breadcrumbView { format: "text" , breadcrumbView { format: "text"
, route: route' , route: getRouteFromSearchResult sd session
, session , session
} }
] ]
...@@ -207,7 +205,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where ...@@ -207,7 +205,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
{ className: "result__button" { className: "result__button"
, callback: \_ -> do , callback: \_ -> do
T.write_ false visible T.write_ false visible
goToRoute $ fromMaybe Home $ nodeTypeAppRoute sd.type (sessionId session) sd.id goToRoute $ getRouteFromSearchResult sd session
, variant: ButtonVariant Light } , variant: ButtonVariant Light }
[ [
B.icon {name: getIcon sd.type true} B.icon {name: getIcon sd.type true}
...@@ -220,7 +218,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where ...@@ -220,7 +218,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
[ [
H.text " — " H.text " — "
, breadcrumbView { format: "text" , breadcrumbView { format: "text"
, route: route' , route: getRouteFromSearchResult sd session
, session: session , session: session
} }
] ]
...@@ -231,3 +229,6 @@ type LoadProps = ( session :: Session, query :: String ) ...@@ -231,3 +229,6 @@ type LoadProps = ( session :: Session, query :: String )
loadSearch :: Record LoadProps -> AffRESTError (Array SearchData) loadSearch :: Record LoadProps -> AffRESTError (Array SearchData)
loadSearch { session: s, query: q} = get s $ appPath (TreeFlat (sessionId s) (sessionRoot s) q) loadSearch { session: s, query: q} = get s $ appPath (TreeFlat (sessionId s) (sessionRoot s) q)
where sessionRoot (Session {treeId}) = treeId where sessionRoot (Session {treeId}) = treeId
getRouteFromSearchResult :: SearchData -> Session -> AppRoute
getRouteFromSearchResult sd session = fromMaybe Home $ nodeTypeAppRoute sd.type (sessionId session) sd.id
...@@ -701,6 +701,15 @@ modeFromString "Sources" = Just Sources ...@@ -701,6 +701,15 @@ modeFromString "Sources" = Just Sources
modeFromString "Terms" = Just Terms modeFromString "Terms" = Just Terms
modeFromString _ = Nothing modeFromString _ = Nothing
getTabIcon :: String -> String
getTabIcon "Authors" = "list"
getTabIcon "Institutes" = "list"
getTabIcon "Sources" = "list"
getTabIcon "Terms" = "list"
getTabIcon "Documents" = "newspaper-o"
getTabIcon "Trash" = "trash"
getTabIcon _ = ""
-- Async tasks -- Async tasks
-- corresponds to /add/form/async or /add/query/async -- corresponds to /add/form/async or /add/query/async
......
.with-icon-font { .with-icon-font {
font-family: ForkAwesome, $font-family-base; font-family: ForkAwesome, $font-family-base;
} }
.node-layout {
&__title {
font-size: 1.75em;
}
}
\ No newline at end of file
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
.nav-link { .nav-link {
cursor: pointer; cursor: pointer;
.active {
font-weight: 500;
}
} }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link, li a { .nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link, li a {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment