Verified Commit ade52a93 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into 698-dev-ws-host-fix

parents 49d35d5e f3a3eb98
Pipeline #6774 passed with stages
in 12 minutes and 34 seconds
# Fixing the nixos image saves CI time so it doesn't have to pull new
#image every time (nixos/nix updates quite often).
# image: nixos/nix:latest
image: nixos/nix:2.22.0
image: nixos/nix:2.24.8
#before_script:
#- nix-env -iA nixpkgs.nix nixpkgs.cacert
......@@ -32,6 +32,7 @@ compile:
- .spago/
script:
- nix --extra-experimental-features "nix-command flakes" run .#ci
- nix --extra-experimental-features "nix-command flakes" run .#compile
test:
......@@ -46,6 +47,7 @@ test:
- .spago/
script:
- nix --extra-experimental-features "nix-command flakes" run .#compile
- nix --extra-experimental-features "nix-command flakes" run .#test-ps
- nix-collect-garbage --delete-older-than 14d
......@@ -8,5 +8,11 @@
# 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 run .#install
nix run .#install
nix run .#build
nix run .#build-css
# nix-shell --run "npm run css-default-theme"
# nix-shell --run "npm run css-dark-theme"
# nix-shell --run "npm run css-herbie-theme"
# nix-shell --run "npm run css-monotony-theme"
# nix-shell --run "npm run css-greyson-theme"
with (import <nixpkgs> {});
let
nodejs-with-packages = with nodePackages; [
bower
yarn
]; in
stdenv.mkDerivation rec {
name = "env";
env = buildEnv {
name = name;
paths = buildInputs;
};
buildInputs = [
nodejs-with-packages
yarn
yarn2nix
];
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
touch $out
'';
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,11 +21,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
......@@ -36,15 +36,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1701282334,
"narHash": "sha256-MxCVrXY6v4QmfTwIysjjaX0XUhqBbxTWWB4HXtDYsdk=",
"lastModified": 1717179513,
"narHash": "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "057f9aecfb71c4437d2b27d3323df7f93c010b7e",
"rev": "63dacb46bf939521bdc93981b4cbb7ecb58427a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "24.05",
"repo": "nixpkgs",
"type": "github"
}
......@@ -58,11 +59,11 @@
"slimlock": "slimlock"
},
"locked": {
"lastModified": 1720786645,
"narHash": "sha256-eiuWqQ9xTA2E76XDg13TQBecnLV1g+ahdauC0FYSD7U=",
"lastModified": 1727269424,
"narHash": "sha256-uoVjAkKbuJSA7++kyBjxLozICDdukZ+Mjj5Z/K5qMak=",
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"rev": "c46925ec09fdf54b5bb4ba38b40e19918d3be7be",
"rev": "5a28abe663758634b1e5ca7053e08af62fd3be80",
"type": "github"
},
"original": {
......
......@@ -3,7 +3,7 @@
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=24.05";
inputs.purescript-overlay = {
url = "github:thomashoneyman/purescript-overlay";
......@@ -24,6 +24,7 @@
spago-bin.spago-0_93_37
#purescript
#spago-unstable
esbuild
nodejs
nodePackages.npm
];
......@@ -59,13 +60,37 @@
in
{
packages = rec {
ci = pkgs.writeShellApplication {
name = "install";
runtimeInputs = dependencies;
text = ''
set -e
echo "Installing JS Dependencies (CI)"
# https://docs.npmjs.com/cli/v9/commands/npm-ci
npm ci
'';
};
install = pkgs.writeShellApplication {
name = "install";
runtimeInputs = dependencies;
text = ''
set -e
echo "Installing JS Dependencies"
npm install
# https://docs.npmjs.com/cli/v9/commands/npm-ci
#npm ci
#npm/bin/npm install --dev
'';
};
compile = pkgs.writeShellApplication {
name = "compile";
runtimeInputs = dependencies;
text = ''
set -e
echo "Installing JS Dependencies"
#echo "Installing JS Dependencies"
#npm install
# https://docs.npmjs.com/cli/v9/commands/npm-ci
#npm ci
......
This diff is collapsed.
{
"name": "Gargantext",
"version": "0.0.7.2.8",
"version": "0.0.7.3.1",
"scripts": {
"build": "spago build",
"bundle": "spago bundle --module Main --outfile dist/bundle.min.js --minify --source-maps",
"css": "$npm_execpath css-themes",
"css-themes": "$npm_execpath css-default-theme && $npm_execpath css-dark-theme && $npm_execpath css-darkster-theme && $npm_execpath css-greyson-theme && $npm_execpath css-herbie-theme && $npm_execpath css-monotony-theme",
"css": "$npm_execpath run css-themes",
"css-themes": "$npm_execpath run css-default-theme && $npm_execpath run css-dark-theme && $npm_execpath run css-darkster-theme && $npm_execpath run css-greyson-theme && $npm_execpath run css-herbie-theme && $npm_execpath run css-monotony-theme",
"css-default-theme": "sass src/sass/themes/default.scss:dist/styles/bootstrap-default.css",
"css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css",
"css-darkster-theme": "sass src/sass/themes/darkster.scss:dist/styles/bootstrap-darkster.css",
......
......@@ -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,131 @@ 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
, H.i { className: "fa fa-external-link mx-1 small" } []
]
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 +442,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"
......@@ -88,7 +88,7 @@ actionDownloadNodeList = R.createElement actionDownloadNodeListCpt
actionDownloadNodeListCpt :: R.Component ActionDownload
actionDownloadNodeListCpt = here.component "actionDownloadNodeList" cpt where
cpt { id, session } _ = do
downloadFormat <- T.useBox NL_JSON_ZIP
downloadFormat <- T.useBox NL_JSON
downloadFormat' <- T.useLive T.unequal downloadFormat
pure $
......
......@@ -78,6 +78,7 @@ inputWithAutocompleteCpt = here.component "inputWithAutocomplete" cpt
, on: { focus: onFocus completions state'
, input: onInput completions
, change: onInput completions
, keyDown: onInputKeyDown inputRef
, keyUp: onInputKeyUp inputRef
, blur: onBlur completions containerRef
}
......@@ -140,7 +141,16 @@ inputWithAutocompleteCpt = here.component "inputWithAutocomplete" cpt
R2.blur input
pure false
else
pure $ false
pure false
onInputKeyDown :: R.Ref (Nullable DOM.Element) -> DE.KeyboardEvent -> Effect Boolean
onInputKeyDown _ e = do
if DE.key e == "Enter" then do
R2.preventDefault e
R2.stopPropagation e
pure false
else
pure false
---------------------------------------------------------
......
......@@ -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 (" (occurrences)")])
wrapColElts _ _ _ = identity
type MkDispatchProps =
......
......@@ -119,5 +119,5 @@ nodeCpt = R2.hereComponent here "node" hCpt where
]
_ -> H.p
{ className: "text-center pt-10" }
[ H.text "Phylo not generated yet, please update the node settings to see your phylonometry." ]
[ H.text "Phylo not generated yet, please update the node settings to see your phylomemy." ]
}
......@@ -2062,7 +2062,9 @@ function setGroup(g, xScale, yScale, wScale) {
fdt = lines[i].fdt,
roles = lines[i].role,
terms = mergeLists(words,fdt,roles),
toSpan = (acc, w) => acc + "<tspan fdt=" + w[1]
toSpan = (acc, w, index) => {
let separator = index < terms.length - 1 ? "<tspan class='separator'> | </tspan>" : "";
return acc + "<tspan fdt=" + w[1]
+ " class='term fdt-" + w[1] + " " + "g-" + g.gId + findRole(w[2]) + "'"
+ " gy=" + yScale(g.to)
+ " gx=" + xScale(g.x)
......@@ -2071,7 +2073,9 @@ function setGroup(g, xScale, yScale, wScale) {
+ " gid=" + g.gId
+ " bid=" + g.bId
+ " from=" + (g.to).getFullYear()
+ ">" + w[0] + "</tspan>";
+ ">" + w[0] + "</tspan>"
+ separator;
};
panel
.append("text")
......
......@@ -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
......
......@@ -209,7 +209,10 @@ $decreasing-color: #11638F;
.term:hover {
font-weight: bold;
}
.separator {
fill: $graph-heading-color;
}
// .term-unfocus {
// fill: #A9A9A9;
// }
......
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