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 {
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 {
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 {
color: #DEE2E6;
}
......
......@@ -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";
}
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link {
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 {
color: #495057;
}
......
......@@ -6350,9 +6350,16 @@ a:hover {
font-family: ForkAwesome, "Mulish";
}
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link {
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 {
color: #495057;
}
......
......@@ -6571,9 +6571,16 @@ a:hover {
font-family: ForkAwesome, "Nunito";
}
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link {
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 {
color: #495057;
}
......
......@@ -6644,9 +6644,16 @@ a:hover {
font-family: ForkAwesome, "Montserrat";
}
.node-layout__title {
font-size: 1.75em;
}
.nav.nav-tabs .nav-link {
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 {
color: #495057;
}
......
......@@ -5,4 +5,6 @@
nix-channel --update
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
{
"name": "Gargantext",
"version": "0.0.7.1",
"version": "0.0.7.1.2",
"scripts": {
"build": "spago build",
"bundle": "spago bundle --module Main --outfile dist/bundle.js",
......
......@@ -16,12 +16,14 @@ import Gargantext.Hooks.Session (useSession)
import Gargantext.Routes as GR
import Gargantext.Sessions (sessionId)
import Gargantext.Types (ID, defaultCacheParams)
import Gargantext.Types as GT
import Gargantext.Utils (setter, (?))
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
type Props =
( nodeId :: ID
, nodeData :: Node
......@@ -34,7 +36,7 @@ layout :: R2.Leaf Props
layout = R2.leaf layoutCpt
layoutCpt :: R.Component Props
layoutCpt = here.component "layout" cpt where
cpt { nodeId, nodeData: { name } } _ = do
cpt { nodeId, nodeData: { name, node_type } } _ = do
-- | Hooks
-- |
boxes@{
......@@ -69,24 +71,37 @@ layoutCpt = here.component "layout" cpt where
pure $
H.div
{ className: "corpus-layout" }
{ className: "node-layout corpus-layout" }
[
-- FV.backButtonSmart { nodeId, session } []
H.div
{ className: "corpus-layout__title" }
{ className: "node-layout__title corpus-layout__title" }
[
H.div
{ className: "node-layout__title__content text-primary" }
[
B.div'
{ className: "corpus-layout__title__text" }
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
{ className: "corpus-layout__title__line"}
{ className: "node-layout__title__line corpus-layout__title__line"}
,
B.iconButton
{ name: expandTableEdition' ?
"caret-up" $
"caret-down"
, className: "corpos-layout__title__expand"
, className: "node-layout__title__expand corpus-layout__title__expand"
, callback: onExpandClick
}
]
......@@ -94,14 +109,14 @@ layoutCpt = here.component "layout" cpt where
R2.when expandTableEdition' $
H.div
{ className: "corpus-layout__edition-block" }
{ className: "node-layout__edition-block corpus-layout__edition-block" }
[
editionBlock
{ nodeId }
]
,
H.div
{ className: "corpus-layout__code-section" }
{ className: "node-layout__code-section corpus-layout__code-section" }
[
tileMenu
{ boxes
......@@ -129,7 +144,7 @@ layoutCpt = here.component "layout" cpt where
]
,
H.div
{ className: "corpus-layout__folders" }
{ className: "node-layout__folders corpus-layout__folders" }
[
FV.folderView
{ nodeId
......
module Gargantext.Components.GraphQL.Node where
import Gargantext.Prelude
import Gargantext.Types (NodeType)
import Gargantext.Utils.GraphQL as GGQL
import Gargantext.Types (NodeType)
import GraphQL.Client.Args (Args, (=>>))
......@@ -12,13 +13,15 @@ type Corpus
= { id :: Int
, name :: String
, parent_id :: Int
, type_id :: Int }
, type_id :: Int
, node_type :: NodeType }
type Node
= { id :: Int
, name :: String
, parent_id :: Int
, type_id :: Int }
, type_id :: Int
, node_type :: NodeType }
type NodesCorpusQuery =
{ nodes_corpus :: Args
......@@ -26,7 +29,8 @@ type NodesCorpusQuery =
{ id :: Unit
, name :: Unit
, parent_id :: Unit
, type_id :: Unit } }
, type_id :: Unit
, node_type :: Unit } }
type NodesQuery =
{ nodes :: Args
......@@ -34,7 +38,8 @@ type NodesQuery =
{ id :: Unit
, name :: Unit
, parent_id :: Unit
, type_id :: Unit } }
, type_id :: Unit
, node_type :: Unit } }
nodesQuery :: NodesQuery
nodesQuery = { nodes: { node_id: Var :: _ "id" Int } =>>
......
......@@ -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 { 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
c = fromMaybe "" additionalClass
......@@ -3,6 +3,8 @@ module Gargantext.Components.Tab where
import Data.FunctorWithIndex (mapWithIndex)
import Data.Tuple (Tuple)
import Data.Tuple.Nested ((/\))
import Gargantext.Components.Bootstrap as B
import Gargantext.Types as GT
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
......@@ -49,10 +51,19 @@ tabsCpt = here.component "tabs" cpt where
(mapWithIndex (item activeTab') tabs')
]
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
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
iconName = GT.getTabIcon name
item selected index (_ /\ cpt') = tab { selected, index } [ cpt' ]
-- TODO: document what these are (selection, item indices)
......
......@@ -166,11 +166,21 @@ tableHeaderWithRenameBoxedLayoutCpt = here.component "tableHeaderWithRenameBoxed
,
-}
H.div
{ className: "table-header-rename__title" }
{ className: "table-header-rename__title text-primary" }
[
B.div'
{ className: "table-header-rename__title__text" }
name
H.div { className: "table-header-rename__title__text" }
[
B.icon
{ className: "mx-1"
, name: "book"
}
,
H.span {}
[
H.text name
]
]
,
H.hr
{ className: "table-header-rename__title__line" }
......
......@@ -172,12 +172,10 @@ treeSearchRender = R2.leaf treeSearchRenderCpt
treeSearchRenderCpt :: R.Component RenderProps
treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
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
results route' s = map searchResult s
results s = map searchResult s
where
searchResult sd = H.div
{ className: "result py-1"}
......@@ -197,7 +195,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
[
H.text " Path: "
, breadcrumbView { format: "text"
, route: route'
, route: getRouteFromSearchResult sd session
, session
}
]
......@@ -207,7 +205,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
{ className: "result__button"
, callback: \_ -> do
T.write_ false visible
goToRoute $ fromMaybe Home $ nodeTypeAppRoute sd.type (sessionId session) sd.id
goToRoute $ getRouteFromSearchResult sd session
, variant: ButtonVariant Light }
[
B.icon {name: getIcon sd.type true}
......@@ -220,7 +218,7 @@ treeSearchRenderCpt = here.component "treeSearchRenderCpt" cpt where
[
H.text " — "
, breadcrumbView { format: "text"
, route: route'
, route: getRouteFromSearchResult sd session
, session: session
}
]
......@@ -231,3 +229,6 @@ type LoadProps = ( session :: Session, query :: String )
loadSearch :: Record LoadProps -> AffRESTError (Array SearchData)
loadSearch { session: s, query: q} = get s $ appPath (TreeFlat (sessionId s) (sessionRoot s) q)
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
modeFromString "Terms" = Just Terms
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
-- corresponds to /add/form/async or /add/query/async
......
.with-icon-font {
font-family: ForkAwesome, $font-family-base;
}
.node-layout {
&__title {
font-size: 1.75em;
}
}
\ No newline at end of file
......@@ -2,6 +2,11 @@
.nav-link {
cursor: pointer;
.active {
font-weight: 500;
}
}
.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