Commit c32921b0 authored by Fabien Maniere's avatar Fabien Maniere

change term column co-occurrence + document content changes + call a new package url-validator

parent e97e7b30
Pipeline #6689 canceled with stages
......@@ -10,3 +10,6 @@
# nix-shell --show-trace --option build-fallback true --run build
#nix run .#install
nix run .#build
nix-shell --run "npm run css-default-theme"
nix-shell --run "npm run css-dark-theme"
nix-shell --run "npm run css-herbie-theme"
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -82,6 +82,7 @@ workspace:
- unordered-collections: ">=3.1.0 <4.0.0"
- unsafe-coerce: ">=6.0.0 <7.0.0"
- uri: ">=9.0.0 <10.0.0"
- url-validator
- uuid: ">=9.0.0 <10.0.0"
- validation: ">=6.0.0 <7.0.0"
- var
......@@ -228,6 +229,7 @@ workspace:
- unsafe-coerce
- unsafe-reference
- uri
- url-validator
- uuid
- validation
- var
......@@ -768,6 +770,9 @@ workspace:
tuples-native:
git: https://github.com/garganscript/purescript-tuples-native.git
ref: v2.3.0-spago-next
url-validator:
git: https://github.com/bbarker/purescript-url-validator
ref: master
var:
git: https://github.com/garganscript/purescript-var
ref: v3.0.1-spago-next
......@@ -2295,6 +2300,15 @@ packages:
- these
- transformers
- unfoldable
url-validator:
type: git
url: https://github.com/bbarker/purescript-url-validator
rev: 3514fc80cc277c44dc5b5bd30898f4a866bf6795
dependencies:
- either
- maybe
- prelude
- strings
uuid:
type: registry
version: 9.0.0
......
......@@ -37,6 +37,11 @@ workspace:
git: https://github.com/garganscript/purescript-websocket-simple
ref: v3.0.2-spago-next
# other external packages
url-validator:
git: https://github.com/bbarker/purescript-url-validator
ref: master
# for tests
spec-discovery:
git: https://github.com/purescript-spec/purescript-spec-discovery.git
......@@ -125,6 +130,7 @@ package:
- unordered-collections: ">=3.1.0 <4.0.0"
- unsafe-coerce: ">=6.0.0 <7.0.0"
- uri: ">=9.0.0 <10.0.0"
- url-validator
- uuid: ">=9.0.0 <10.0.0"
- validation: ">=6.0.0 <7.0.0"
- var
......
......@@ -22,6 +22,7 @@ import Gargantext.Components.NgramsTable.AutoSync (useAutoSync)
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Core.NgramsTable.Functions (addNewNgramA, applyNgramsPatches, coreDispatch, findNgramRoot, setTermListA, computeCache)
import Gargantext.Core.NgramsTable.Types (CoreAction(..), NgramsTerm, Versioned(..), replace)
import Gargantext.Hooks.LinkHandler (useLinkHandler)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Sessions (Session)
import Gargantext.Utils as U
......@@ -29,6 +30,7 @@ import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Record as Record
import Text.URL.Validate as TUV
import Toestand as T
-------------------------------------------------------------------------
......@@ -91,6 +93,8 @@ layoutWithContextNgramsCpt = here.component "layoutWithContextNgrams" cpt where
-- | States
-- |
{ goToURLInNewTab } <- useLinkHandler
contextNgramsS <- T.useBox contextNgrams
contextNgrams' <- T.useLive T.unequal contextNgramsS
......@@ -282,83 +286,127 @@ layoutWithContextNgramsCpt = here.component "layoutWithContextNgrams" cpt where
[
annotate doc.title
]
-- ,
-- btnSeeMore "title"
]
,
H.hr {}
,
R2.fromMaybe doc.authors \authors ->
H.div
{ className: "document-layout__authors justify-content-space-between" }
{ className: "document-layout__hdata justify-content-space-between" }
[
B.div'
{ className: "document-layout__authors__label" }
{ className: "document-layout__hdata__label" }
"Authors"
,
H.div
{ className: "document-layout__authors__content w-100" -- <> collapsibleClasses
B.div'
{ className: "document-layout__hdata__content w-100"
, id: getIdName "authors" }
[
-- @NOTE #386: annotate for "Authors" ngrams list
annotate (Just authors)
]
-- ,
-- btnSeeMore "authors"
authors
]
,
R2.fromMaybe doc.source \source ->
H.div
{ className: "document-layout__source justify-content-space-between" }
{ className: "document-layout__hdata justify-content-space-between" }
[
B.div'
{ className: "document-layout__source__label" }
{ className: "document-layout__hdata__label" }
"Source"
,
B.div'
{ className: "document-layout__source__content w-100" -- <> collapsibleClasses
{ className: "document-layout__hdata__content w-100"
, id: getIdName "sources" }
source
-- ,
-- btnSeeMore "sources"
]
,
H.div
{ className: "document-layout__date" }
{ className: "document-layout__hdata" }
[
B.div'
{ className: "document-layout__date__label" }
{ className: "document-layout__hdata__label" }
"Date"
,
B.div'
{ className: "document-layout__date__content" }
{ className: "document-layout__hdata__content" }
(publicationDate $ Document doc)
]
, R2.fromMaybe doc.institutes \institutes ->
,
R2.fromMaybe doc.institutes \institutes ->
H.div
{ className: "document-layout__institutes justify-content-space-between" }
{ className: "document-layout__hdata justify-content-space-between" }
[
B.div'
{ className: "document-layout__institutes__label" }
{ className: "document-layout__hdata__label" }
"Institutes"
,
H.div
{ className: "document-layout__institutes__content w-100" -- <> collapsibleClasses
B.div'
{ className: "document-layout__hdata__content w-100"
, id: getIdName "institutes" }
[
annotate (Just institutes)
]
institutes
-- ,
-- btnSeeMore "institutes"
]
,
R2.fromMaybe doc.doi \doi ->
, case path.mCorpusId of
Nothing -> H.div {} []
Just corpusId -> ratingSimpleLoader { docId: path.nodeId
, corpusId
, session: path.session } []
H.div
{ className: "document-layout__hdata justify-content-space-between" }
[
H.div
{ className: "document-layout__hdata__label" }
[
R2.acronym { title: "Digital object identifier" } [ H.text "DOI" ]
]
,
H.div
{ className: "document-layout__hdata__content w-100"
, id: getIdName "doi" }
[
if (TUV.validateURL doi) then
H.a {classname: "", on: { click: goToURLInNewTab $ doi }} [ H.text doi ]
else
H.text doi
]
]
,
R2.fromMaybe doc.bdd \bdd ->
H.div
{ className: "document-layout__hdata justify-content-space-between" }
[
B.div'
{ className: "document-layout__hdata__label" }
"Data source"
,
B.div'
{ className: "document-layout__hdata__content w-100"
, id: getIdName "bdd" }
bdd
]
,
H.div
{ className: "document-layout__hdata" }
[
B.div'
{ className: "document-layout__hdata__label" }
"Tag"
,
case path.mCorpusId of
Nothing -> H.div {} []
Just corpusId -> ratingSimpleLoader { docId: path.nodeId
, corpusId
, session: path.session } []
]
-- , case path.mCorpusId of
-- Nothing -> H.div {} []
-- Just corpusId -> ratingSimpleLoader { docId: path.nodeId
-- , corpusId
-- , session: path.session } []
,
H.hr {}
,
R2.when hasAbstract $
......@@ -390,19 +438,5 @@ publicationDate (Document {publication_year: Just py, publication_month: Nothing
publicationDate (Document {publication_year: Just py, publication_month: Just pm, publication_day: Nothing}) = (U.zeroPad 2 py) <> "-" <> (U.zeroPad 2 pm)
publicationDate (Document {publication_year: Just py, publication_month: Just pm, publication_day: Just pd}) = (U.zeroPad 2 py) <> "-" <> (U.zeroPad 2 pm) <> "-" <> (U.zeroPad 2 pd)
-- btnSeeMore :: String -> R.Element
-- btnSeeMore idStr =
-- H.a { role: "button"
-- , className: "collapsed btn-seemore text-primary"
-- , data: { toggle: "collapse" }
-- , aria: { expanded: false, controls: getIdName idStr }
-- , href: "#" <> getIdName idStr
-- }
-- [ H.text "" ]
getIdName :: String -> String
getIdName str = "annotated-field-expand__" <> str
-- collapsibleClasses :: String
-- collapsibleClasses = " annotated-field-expand collapse"
......@@ -664,7 +664,7 @@ ngramsTableOrderWith orderBy =
-- This is used to *decorate* the Select header with the checkbox.
wrapColElts scProps _ (TT.ColumnName "Select") = const [NTSC.selectionCheckbox scProps]
wrapColElts _ scoreType (TT.ColumnName "Score") = (_ <> [H.text (" (" <> show scoreType <> ")")])
wrapColElts _ scoreType (TT.ColumnName "Score") = (_ <> [H.text (" (co-occurrences)")])
wrapColElts _ _ _ = identity
type MkDispatchProps =
......
......@@ -761,8 +761,8 @@ tableCpt = here.component "table" cpt
cs =
wrapColElts c $
case state.orderBy of
Just (ASC d) | c == d -> [lnk (Just (DESC c)) "ASC " , lnk Nothing (columnName c)]
Just (DESC d) | c == d -> [lnk (Just (ASC c)) "DESC ", lnk Nothing (columnName c)]
Just (ASC d) | c == d -> [lnk (Just (DESC c)) ("ASC " <> (columnName c))]
Just (DESC d) | c == d -> [lnk (Just (ASC c)) ("DESC " <> (columnName c))]
_ -> [lnk (Just (ASC c)) (columnName c)]
pure $ container
{ pageSizeControl: sizeDD { params }
......
......@@ -229,6 +229,9 @@ named = flip $ defineProperty "name"
overState :: forall t. (t -> t) -> R.State t -> Effect Unit
overState f (_state /\ setState) = setState f
acronym :: ElemFactory
acronym = createDOM "acronym"
small :: ElemFactory
small = createDOM "small"
......
......@@ -15,7 +15,7 @@ $document-container-width: 780px
justify-content: space-between
padding: $card-spacer-y $card-spacer-x
border-bottom: 1px solid $border-color
margin-bottom: $card-spacer-y
// margin-bottom: $card-spacer-y
&__main-controls
display: flex
......@@ -57,41 +57,25 @@ $document-container-width: 780px
font-weight: bold
line-height: 1.4
word-wrap: break-word
margin-bottom: space-x(3)
// margin-bottom: space-x(3)
font-family: $headings-font-family
&__authors
display: flex
margin-bottom: space-x(0.5)
&__label
font-weight: bold
flex-basis: $label-column-size
flex-shrink: 0
font-size: 15px
&__content
line-height: 1.2
color: $gray-800
&__source,
&__institutes,
&__date
&__hdata
display: flex
margin-bottom: space-x(0.5)
line-height: 1.3em
font-size: 15px
&__label
font-weight: bold
flex-basis: $label-column-size
flex-shrink: 0
font-size: 15px
&__content
font-size: 15px
color: $gray-600
&__abstract
margin-top: space-x(4)
margin-top: space-x(3)
margin-bottom: space-x(3)
&__content
......
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