Commit 566c0a59 authored by Karen Konou's avatar Karen Konou

Merge branch 'dev' into 272-dev-folder-view

parents 710142ee 57258f2d
This diff is collapsed.
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
lastUpdateCheck 1611671086951
...@@ -4,13 +4,12 @@ ...@@ -4,13 +4,12 @@
### Social contract ### Social contract
1. Use and promote welcoming behavior to respect the [Code of Conduct](https://gitlab.iscpif.fr/humanities/gargantext/blob/master/CODE_OF_CONDUCT.md) 1. Be nice, welcome and treat others with respect: [Code of Conduct](https://gitlab.iscpif.fr/humanities/gargantext/blob/master/CODE_OF_CONDUCT.md)
2. We are a team as whole: here to help each others 2. We are a team as whole: here to help each other
- knowing the unknown is a value but ignoring the unknown is a failure - knowing the unknown is a value but ignoring the unknown is a failure
- do not ask to ask: just ask - do not ask to ask: just ask
- there is no stupid question(s) - there are no stupid questions
- there is no unique solution(s)
3. Watch deadlines individually and collectively 3. Watch deadlines individually and collectively
- at 0% of the time of the task, agree on the /estimate of time to fix the issue. - at 0% of the time of the task, agree on the /estimate of time to fix the issue.
...@@ -82,30 +81,38 @@ Main branches are: ...@@ -82,30 +81,38 @@ Main branches are:
## Technicals ## Technicals
Please configure your editor accordingly (ask for tips if needed or put your tips here)
### Code main guidelines ### Code guidelines
#### Code Design #### Basics
Please configure your editor accordingly (ask for tips if needed or put your tips here) Line length:
* Good lines of code are no more than 80 characters long.
* Acceptable lines of code are no more than 100
* Bad lines of code are no more than 120.
Whitespace:
* 2 spaces per indentation stop, or more if needed by the compiler
* Do not use tab characters.
* Remove trailing whitespace from lines. Includes blank lines.
#### Layout
##### Line length
* all line length should be < 120 chars
##### Identation
* 2 spaces or more if needed by the compiler
* i.e. Tab character is avoided
* avoid trailing spaces, mostly spaces at the end of lines (remove it)
* HTML nodes: * HTML nodes:
``` ```
div [] div {...}
[ div [] [ div {...} [ a {} [...], a {...} [...] ]
[ a [] [...] , div {...}
, a [] [...] , div
] { ...
, div [] , ...
}
[ ... [ ...
, ... , ...
] ]
......
This diff is collapsed.
...@@ -385,9 +385,10 @@ li .leaf:hover a.settings { ...@@ -385,9 +385,10 @@ li .leaf:hover a.settings {
visibility: visible; visibility: visible;
} }
.tree { .forest > .tree {
margin-top: 20px; margin-top: 20px;
} }
.tree ul li { .tree ul li {
position: relative; position: relative;
} }
...@@ -534,6 +535,10 @@ li .leaf:hover a.settings { ...@@ -534,6 +535,10 @@ li .leaf:hover a.settings {
color: black; color: black;
} }
.forest-layout-raw-tree {
padding-top: 60px;
}
.code-editor .editor .code-area { .code-editor .editor .code-area {
flex-grow: 1; flex-grow: 1;
max-height: 200px; max-height: 200px;
...@@ -722,6 +727,9 @@ ul li { ...@@ -722,6 +727,9 @@ ul li {
color: #005a9aff; color: #005a9aff;
} }
.frame {
height: 100vh;
}
.frame iframe { .frame iframe {
border: 0; border: 0;
} }
......
{"version":3,"sourceRoot":"","sources":["../../src/sass/_menu.sass","../../src/sass/_context_menu.sass","../../src/sass/_graph.sass","../../src/sass/_login.sass","../../src/sass/_tree.sass","../../src/sass/_code_editor.sass","../../src/sass/_styles.sass","../../src/sass/_range_slider.sass","../../src/sass/_annotation.sass","../../src/sass/_folder_view.sass"],"names":[],"mappings":"AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;;;AAEF;AACI;EACA;;;AAEJ;AACI;EACA;;;AAGJ;AACA;EACI;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;EACA;;;AAEF;EACE;;;AC7CF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;;;AClBF;EACE;EACA;EACA;;;AAEF;AAkCE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAxCA;EAZA;EACA;EAEA;EAWE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AACN;EACE;;AACF;EACE;;AAEF;EApCA;EACA;EAEA;EAmCE;EACA;;AACF;EACE;;AACF;EACE;;AAWF;EAEE;EACA;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AAEJ;EACE;;AAEA;EACE;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACrFJ;EACE;;;AAOF;EACE;;AACA;EACE;EACA;;;AAEJ;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;;AAEE;EACE;EACA;;AACA;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;;AAKJ;EACE;EACA;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;;AACF;EACE;EACA;EACA;EACA;;AACA;EACE;;AACN;EACE;EACA;EACA;EACA;;;AAGN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAGF;EACE;;;AAEJ;EACI;EACA;;;AAGF;EACE;;;AAEJ;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;ACvKF;EACE;;;AAGA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGA;EACE;;AACF;EACE;;AAEJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAER;EACE;;AAEE;EACE;;AACA;EACE;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;EACA;EACA;;AACF;EACE;;AACF;EACE;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AACF;EACE;;AAGN;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AAIR;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAEV;EACE;;AACF;EACE;;AAEE;EACE;;AACF;EACE;;AACN;EACE;;AAEE;EACE;;;AAGR;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAIF;EACE;;AAEA;EACE;;;AAGN;EACE;;AACF;EACE;;AACF;EACE;;;AC9IA;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EApCR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA0CM;EACE;EACA;EACA;EACA;EACA;EA5CR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAkDE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;ACrFV;EACE;;AACF;EAEE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;EACE;;AACF;EACE;EACA;EACA;;;AAIA;EACE;;AACA;EACE;EACA;;AACF;EACE;;AACA;EACE;;AACJ;EACE;;;AAER;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;AAGI;EACE;;AACF;EACE;;;AAEN;EACE;EACA;EACA;;;AAIA;EACE;;AACF;EACE;;;AAGF;EACE;;;AAEJ;EACE;EACA;;;ACjFF;EACE;AACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;;AAEA;EACE;EAEA;EACA;EACA;;;AAGN;EACE;;;ACxBJ;EACE;;AAEA;EANE;EACA;;AAQF;EAbE;EACA;;AAeF;EAhBE;EACA;;AAkBF;EAnBE;EACA;;AAqBF;EA1BE;EACA,kBANyB;;AAkC3B;EA7BE;EACA,kBAPqB;;AAsCvB;EAhCE;EACA,kBAJoB;;;AAuCtB;EApCE;EACA,kBANyB;;AA4C3B;EAvCE;EACA,kBAPqB;;AAgDvB;EA1CE;EACA,kBAJoB;;;ACRxB;EACE;EACA;EACA;EACA","file":"sass.css"} {"version":3,"sourceRoot":"","sources":["../../src/sass/_menu.sass","../../src/sass/_context_menu.sass","../../src/sass/_graph.sass","../../src/sass/_login.sass","../../src/sass/_tree.sass","../../src/sass/_code_editor.sass","../../src/sass/_styles.sass","../../src/sass/_range_slider.sass","../../src/sass/_annotation.sass"],"names":[],"mappings":"AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;;;AAEF;AACI;EACA;;;AAEJ;AACI;EACA;;;AAGJ;AACA;EACI;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;EACA;;;AAEF;EACE;;;AC7CF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;;;AClBF;EACE;EACA;EACA;;;AAEF;AAkCE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAxCA;EAZA;EACA;EAEA;EAWE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AACN;EACE;;AACF;EACE;;AAEF;EApCA;EACA;EAEA;EAmCE;EACA;;AACF;EACE;;AACF;EACE;;AAWF;EAEE;EACA;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AAEJ;EACE;;AAEA;EACE;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACrFJ;EACE;;;AAOF;EACE;;AACA;EACE;EACA;;;AAEJ;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;;AAEE;EACE;EACA;;AACA;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;;AAKJ;EACE;EACA;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;;AACF;EACE;EACA;EACA;EACA;;AACA;EACE;;AACN;EACE;EACA;EACA;EACA;;;AAGN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAGF;EACE;;;AAEJ;EACI;EACA;;;AAGF;EACE;;;AAEJ;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;ACvKF;EACE;;;AAGA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGA;EACE;;AACF;EACE;;AAEJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAGN;EACE;;;AAIA;EACE;;AACA;EACE;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;EACA;EACA;;AACF;EACE;;AACF;EACE;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AACF;EACE;;AAGN;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AAIR;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAEV;EACE;;AACF;EACE;;AAEE;EACE;;AACF;EACE;;AACN;EACE;;AAEE;EACE;;;AAGR;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAIF;EACE;;AAEA;EACE;;;AAGN;EACE;;AACF;EACE;;AACF;EACE;;;AAEJ;EACE;;;ACpJE;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EApCR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA0CM;EACE;EACA;EACA;EACA;EACA;EA5CR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAkDE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;ACrFV;EACE;;AACF;EAEE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;EACE;;AACF;EACE;EACA;EACA;;;AAIA;EACE;;AACA;EACE;EACA;;AACF;EACE;;AACA;EACE;;AACJ;EACE;;;AAER;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;AAGI;EACE;;AACF;EACE;;;AAEN;EACE;EACA;EACA;;;AAIA;EACE;;AACF;EACE;;;AAEJ;EACE;;AACA;EACE;;;AAEJ;EACE;EACA;;;AClFF;EACE;AACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;;AAEA;EACE;EAEA;EACA;EACA;;;AAGN;EACE;;;ACxBJ;EACE;;AAEA;EANE;EACA;;AAQF;EAbE;EACA;;AAeF;EAhBE;EACA;;AAkBF;EAnBE;EACA;;AAqBF;EA1BE;EACA,kBANyB;;AAkC3B;EA7BE;EACA,kBAPqB;;AAsCvB;EAhCE;EACA,kBAJoB;;;AAuCtB;EApCE;EACA,kBANyB;;AA4C3B;EAvCE;EACA,kBAPqB;;AAgDvB;EA1CE;EACA,kBAJoB","file":"sass.css"}
\ No newline at end of file
#!/usr/bin/env bash
set -e
## You should use the `shell.nix` file in our project, or install dhall-to-json yourself: https://github.com/dhall-lang/dhall-haskell/releases
dhall-to-json --file packages.dhall --output ./.psc-package/local/.set/packages.json
echo "generated packages.json"
#!/usr/bin/env nix-shell
#!nix-shell ./generate-packages-json.nix --run 'exit'
{ pkgs ? import ./pinned.nix { } }:
let
easy-dhall = import (
pkgs.fetchFromGitHub {
owner = "justinwoo";
repo = "easy-dhall-nix";
rev = "90957969850a44481c6e150350c56e8b53b29e1e";
sha256 = "1hsmp3cb0k554kh0jlfzpdzx2b8ndyh2gdykmw9hw41haaw16mmi";
}
) {
inherit pkgs;
};
in
pkgs.mkShell {
buildInputs = [ easy-dhall.dhall-simple easy-dhall.dhall-json-simple ];
shellHook = ''
dhall-to-json --file packages.dhall --output ./.psc-package/local/.set/packages.json
echo "generated packages.json"
'';
}
...@@ -163,15 +163,6 @@ ...@@ -163,15 +163,6 @@
sha256 = "1nm45khn2dvlyv059nzpz1w7d3nfsvq45hnb2qllrbzyv7rlxmi8"; sha256 = "1nm45khn2dvlyv059nzpz1w7d3nfsvq45hnb2qllrbzyv7rlxmi8";
}; };
}; };
"coroutines" = {
name = "coroutines";
version = "v5.0.1";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-coroutines.git";
rev = "v5.0.1";
sha256 = "1is83blf44sflhwsaixpd1irlm33fsd1p919gbcn79mmmwi4bxdl";
};
};
"css" = { "css" = {
name = "css"; name = "css";
version = "v4.0.0"; version = "v4.0.0";
...@@ -221,7 +212,7 @@ ...@@ -221,7 +212,7 @@
name = "dom-simple"; name = "dom-simple";
version = "v0.2.7"; version = "v0.2.7";
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-dom-simple"; url = "https://github.com/poorscript/purescript-dom-simple";
rev = "v0.2.7"; rev = "v0.2.7";
sha256 = "02f1vsjk5frva3p3xpbrnj2zg4rg01l07dnvc3i6axvc5k30i282"; sha256 = "02f1vsjk5frva3p3xpbrnj2zg4rg01l07dnvc3i6axvc5k30i282";
}; };
...@@ -275,7 +266,7 @@ ...@@ -275,7 +266,7 @@
name = "ffi-simple"; name = "ffi-simple";
version = "v0.2.10"; version = "v0.2.10";
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-ffi-simple"; url = "https://github.com/poorscript/purescript-ffi-simple";
rev = "v0.2.10"; rev = "v0.2.10";
sha256 = "14slcccmy96ml7r8rzhhqnw486qj1b385i9095fdymms78g5gnj5"; sha256 = "14slcccmy96ml7r8rzhhqnw486qj1b385i9095fdymms78g5gnj5";
}; };
...@@ -334,6 +325,15 @@ ...@@ -334,6 +325,15 @@
sha256 = "1kl937qxnbn9m1bn0ijpnfiizgpcvcrnzqcc1scwq2kxvxh8kqap"; sha256 = "1kl937qxnbn9m1bn0ijpnfiizgpcvcrnzqcc1scwq2kxvxh8kqap";
}; };
}; };
"formula" = {
name = "formula";
version = "v0.2.1";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-formula";
rev = "v0.2.1";
sha256 = "0511r2n51sz59ksalzvrcbwwhbpj42h2dj2zknns7dnhkdkmf4a6";
};
};
"free" = { "free" = {
name = "free"; name = "free";
version = "v5.2.0"; version = "v5.2.0";
...@@ -343,15 +343,6 @@ ...@@ -343,15 +343,6 @@
sha256 = "1bwj0ay7q9lm4ir29jy549m05jvaqik1s615biv23y51ngx3fn49"; sha256 = "1bwj0ay7q9lm4ir29jy549m05jvaqik1s615biv23y51ngx3fn49";
}; };
}; };
"freet" = {
name = "freet";
version = "v5.0.0";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-freet.git";
rev = "v5.0.0";
sha256 = "0j8y47x672z8h809hxl1n502yj0y3yv8zsln8bk17rcz06x8frv9";
};
};
"functions" = { "functions" = {
name = "functions"; name = "functions";
version = "v4.0.0"; version = "v4.0.0";
...@@ -757,22 +748,13 @@ ...@@ -757,22 +748,13 @@
sha256 = "1agpsxwz1i8pavcrpgnir5sk9vwrwk406psykjxmyahxby1dhwqi"; sha256 = "1agpsxwz1i8pavcrpgnir5sk9vwrwk406psykjxmyahxby1dhwqi";
}; };
}; };
"react-dom" = {
name = "react-dom";
version = "v6.1.0";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-react-dom.git";
rev = "v6.1.0";
sha256 = "19kzsahx3kvgbi9bhnnz50fjmqvvgslsg6rk028bj4v28m8gra40";
};
};
"reactix" = { "reactix" = {
name = "reactix"; name = "reactix";
version = "v0.4.6"; version = "v0.4.11";
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-reactix"; url = "https://github.com/poorscript/purescript-reactix";
rev = "v0.4.6"; rev = "v0.4.11";
sha256 = "0q3cq3d9385jq9dlpjhfqdc4b4nvxxlmjncs3fr4xk8vv24j3kns"; sha256 = "1prxqww81lk32cp4mr318yanvf51kf9hz7x4n6rxdbcprj27710d";
}; };
}; };
"read" = { "read" = {
...@@ -928,15 +910,6 @@ ...@@ -928,15 +910,6 @@
sha256 = "0n0sxr44d1lwlrgv8b48ml6vg0r5abfvyywn50jb0i1agnm53i4n"; sha256 = "0n0sxr44d1lwlrgv8b48ml6vg0r5abfvyywn50jb0i1agnm53i4n";
}; };
}; };
"thermite" = {
name = "thermite";
version = "hide-2020-03-04";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-thermite.git";
rev = "hide-2020-03-04";
sha256 = "1s0fj6f7kqafiw027yw65f5193kph51x6dxw0wv3g6j77yxmk92i";
};
};
"these" = { "these" = {
name = "these"; name = "these";
version = "v4.0.0"; version = "v4.0.0";
...@@ -946,6 +919,15 @@ ...@@ -946,6 +919,15 @@
sha256 = "0ywwpbcz1d0pdi3f9h9kla52vq1if8zwdz7jq7lqz5s8zj8kyg5r"; sha256 = "0ywwpbcz1d0pdi3f9h9kla52vq1if8zwdz7jq7lqz5s8zj8kyg5r";
}; };
}; };
"toestand" = {
name = "toestand";
version = "v0.6.1";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-toestand";
rev = "v0.6.1";
sha256 = "007g6h7q1d7pzh5c4dp00367kym0wycwxnryps94r6w09fyhkmis";
};
};
"transformers" = { "transformers" = {
name = "transformers"; name = "transformers";
version = "v4.2.0"; version = "v4.2.0";
...@@ -1000,6 +982,15 @@ ...@@ -1000,6 +982,15 @@
sha256 = "1kp1b35y8wzin9m5lfyp239nclq703xz2b4373x3075xfp6qdcwf"; sha256 = "1kp1b35y8wzin9m5lfyp239nclq703xz2b4373x3075xfp6qdcwf";
}; };
}; };
"typisch" = {
name = "typisch";
version = "v0.2.1";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-typisch";
rev = "v0.2.1";
sha256 = "1jccgfayh20qsmqgbh54knl4dwbwk3144mkzzv2pi07jprp8mzbf";
};
};
"uint" = { "uint" = {
name = "uint"; name = "uint";
version = "v5.1.1"; version = "v5.1.1";
......
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.2.7.1", "version": "0.0.2.8",
"scripts": { "scripts": {
"rebase-set": "spago package-set-upgrade && spago psc-package-insdhall", "generate-purs-packages-nix": "./nix/generate-purs-packages.nix",
"rebuild-set": "spago psc-package-insdhall", "generate-psc-packages-nix": "./nix/generate-packages-json.bash",
"rebase-set": "spago upgrade-set && yarn generate-psc-packages-nix",
"rebuild-set": "yarn generate-psc-packages-nix",
"install-ps": "psc-package install", "install-ps": "psc-package install",
"compile": "pulp build", "compile": "pulp build",
"build": "pulp browserify -t dist/bundle.js", "build": "pulp browserify -t dist/bundle.js",
...@@ -30,7 +32,9 @@ ...@@ -30,7 +32,9 @@
"echarts": "^4.1.0", "echarts": "^4.1.0",
"echarts-for-react": "^2.0.14", "echarts-for-react": "^2.0.14",
"highlightjs": "^9.16.2", "highlightjs": "^9.16.2",
"prop-types": "15.6.2", "immer": "^8.0.1",
"prop-types": "^15.6.2",
"pullstate": "^1.20.6",
"react": "^16.10", "react": "^16.10",
"react-awesome-popover": "^6.1.1", "react-awesome-popover": "^6.1.1",
"react-dom": "^16.10", "react-dom": "^16.10",
...@@ -49,7 +53,7 @@ ...@@ -49,7 +53,7 @@
"react-testing-library": "^6.1.2", "react-testing-library": "^6.1.2",
"sass": "^1.23.7", "sass": "^1.23.7",
"serve": "^11.3.1", "serve": "^11.3.1",
"spago": "^0.10.0", "spago": "^0.19.1",
"vscode-languageserver": "^6.0.0", "vscode-languageserver": "^6.0.0",
"xhr2": "^0.1.4" "xhr2": "^0.1.4"
} }
......
let upstream = let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20201021/packages.dhall https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20210226/packages.dhall sha256:7e973070e323137f27e12af93bc2c2f600d53ce4ae73bb51f34eb7d7ce0a43ea
let overrides = let overrides =
{ thermite = { thermite =
{ dependencies = { dependencies =
[ "aff" [ "aff"
, "coroutines" , "coroutines"
, "web-dom" , "web-dom"
, "freet" , "freet"
, "profunctor-lenses" , "profunctor-lenses"
, "react" , "react"
, "react-dom" , "react-dom"
] ]
, repo = "https://github.com/poorscript/purescript-thermite.git" , repo = "https://github.com/poorscript/purescript-thermite.git"
, version = "hide-2020-03-04" , version = "hide-2020-03-04"
} }
, globals = , globals =
{ dependencies = [ "functions", "maybe" ] { dependencies = [ "functions", "maybe" ]
, repo = "https://github.com/purescript/purescript-globals" , repo = "https://github.com/purescript/purescript-globals"
, version = "v4.1.0" , version = "v4.1.0"
} }
} }
let additions = let additions =
{ sequences = { sequences =
{ dependencies = { dependencies =
[ "prelude" [ "prelude"
, "unsafe-coerce" , "unsafe-coerce"
, "partial" , "partial"
, "unfoldable" , "unfoldable"
, "lazy" , "lazy"
, "arrays" , "arrays"
, "profunctor" , "profunctor"
, "maybe" , "maybe"
, "tuples" , "tuples"
, "newtype" , "newtype"
] ]
, repo = "https://github.com/hdgarrood/purescript-sequences.git" , repo = "https://github.com/hdgarrood/purescript-sequences.git"
, version = "v2.1.0" , version = "v2.1.0"
} }
, spec-discovery = , spec-discovery =
{ dependencies = { dependencies = [ "prelude", "effect", "arrays", "spec", "node-fs" ]
[ "prelude", "effect", "arrays", "spec", "node-fs" ] , repo = "https://github.com/purescript-spec/purescript-spec-discovery"
, repo = "https://github.com/purescript-spec/purescript-spec-discovery" , version = "v4.0.0"
, version = "v4.0.0" }
}
, spec-quickcheck = , spec-quickcheck =
{ dependencies = { dependencies = [ "prelude", "aff", "random", "quickcheck", "spec" ]
[ "prelude", "aff", "random", "quickcheck", "spec" ] , repo = "https://github.com/purescript-spec/purescript-spec-quickcheck"
, repo = "https://github.com/purescript-spec/purescript-spec-quickcheck" , version = "v3.1.0"
, version = "v3.1.0" }
}
, ffi-simple = , ffi-simple =
{ dependencies = { dependencies =
[ "prelude" [ "prelude"
, "effect" , "effect"
, "maybe" , "maybe"
, "functions" , "functions"
, "nullable" , "nullable"
, "unsafe-coerce" , "unsafe-coerce"
] ]
, repo = "https://github.com/irresponsible/purescript-ffi-simple" , repo = "https://github.com/irresponsible/purescript-ffi-simple"
, version = "v0.2.10" , version = "v0.2.10"
} }
, dom-simple = , dom-simple =
{ dependencies = { dependencies =
[ "arrays" [ "arrays"
, "console" , "console"
, "effect" , "effect"
, "ffi-simple" , "ffi-simple"
, "functions" , "functions"
, "nullable" , "nullable"
, "prelude" , "prelude"
, "unsafe-coerce" , "unsafe-coerce"
] ]
, repo = "https://github.com/irresponsible/purescript-dom-simple" , repo = "https://github.com/irresponsible/purescript-dom-simple"
, version = "v0.2.7" , version = "v0.2.7"
} }
, dom-filereader = , dom-filereader =
{ dependencies = { dependencies = [ "aff", "arraybuffer-types", "web-file", "web-html" ]
[ "aff", "arraybuffer-types", "web-file", "web-html" ] , repo = "https://github.com/nwolverson/purescript-dom-filereader"
, repo = "https://github.com/nwolverson/purescript-dom-filereader" , version = "v5.0.0"
, version = "v5.0.0" }
}
, markdown = , markdown =
{ dependencies = { dependencies = [ "precise" ]
[ "precise" ] , repo = "https://github.com/poorscript/purescript-markdown"
, repo = "https://github.com/poorscript/purescript-markdown" , version = "2020-03-04"
, version = "2020-03-04" }
}
, markdown-smolder = , markdown-smolder =
{ dependencies = { dependencies = [ "markdown", "smolder" ]
[ "markdown", "smolder" ] , repo = "https://github.com/poorscript/purescript-markdown-smolder"
, repo = "https://github.com/poorscript/purescript-markdown-smolder" , version = "2020-03-04"
, version = "2020-03-04" }
}
, precise = , precise =
{ dependencies = { dependencies = [ "prelude" ]
[ "prelude" ] , repo = "https://github.com/purescript-contrib/purescript-precise"
, repo = "https://github.com/purescript-contrib/purescript-precise" , version = "v4.0.0"
, version = "v4.0.0" }
}
, reactix = , reactix =
{ dependencies = { dependencies =
[ "aff" [ "aff"
, "dom-simple" , "dom-simple"
, "effect" , "effect"
, "ffi-simple" , "ffi-simple"
, "functions" , "functions"
, "nullable" , "nullable"
, "prelude" , "prelude"
, "unsafe-coerce" , "unsafe-coerce"
] ]
, repo = "https://github.com/irresponsible/purescript-reactix" , repo = "https://github.com/irresponsible/purescript-reactix"
, version = "v0.4.6" , version = "v0.4.6"
} }
, tuples-native = , tuples-native =
{ dependencies = { dependencies =
[ "generics-rep", "prelude", "typelevel", "unsafe-coerce" ] [ "generics-rep", "prelude", "typelevel", "unsafe-coerce" ]
, repo = "https://github.com/athanclark/purescript-tuples-native" , repo = "https://github.com/athanclark/purescript-tuples-native"
, version = "v2.0.1" , version = "v2.0.1"
} }
, uint = , uint =
{ dependencies = { dependencies = [ "maybe", "math", "generics-rep" ]
[ "maybe", "math", "generics-rep" ] , repo = "https://github.com/zaquest/purescript-uint"
, repo = "https://github.com/zaquest/purescript-uint" , version = "v5.1.1"
, version = "v5.1.1" }
}
, uri = , uri =
{ dependencies = { dependencies =
[ "these" [ "these"
, "arrays" , "arrays"
, "profunctor-lenses" , "profunctor-lenses"
, "unfoldable" , "unfoldable"
, "parsing" , "parsing"
, "integers" , "integers"
, "globals" , "globals"
, "generics-rep" , "generics-rep"
] ]
, repo = "https://github.com/slamdata/purescript-uri" , repo = "https://github.com/slamdata/purescript-uri"
, version = "v7.0.0" , version = "v7.0.0"
} }
, read = , read =
{ dependencies = { dependencies = [ "prelude", "maybe", "strings" ]
[ "prelude", "maybe", "strings" ] , repo = "https://github.com/truqu/purescript-read"
, repo = "https://github.com/truqu/purescript-read" , version = "v1.0.1"
, version = "v1.0.1" }
}
, versions = , versions =
{ dependencies = { dependencies = [ "prelude" ]
[ "prelude" ] , repo = "https://github.com/hdgarrood/purescript-versions.git"
, repo = "https://github.com/hdgarrood/purescript-versions.git" , version = "v5.0.1"
, version = "v5.0.1" }
}
, simplecrypto = , simplecrypto =
{ dependencies = { dependencies = [ "prelude", "maybe", "node-buffer" ]
[ "prelude", "maybe", "node-buffer"] , repo = "https://github.com/alpacaaa/purescript-simplecrypto"
, repo = "https://github.com/alpacaaa/purescript-simplecrypto" , version = "v1.0.1"
, version = "v1.0.1" }
}
} }
in upstream ⫽ overrides ⫽ additions in upstream // overrides // additions
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"effect", "effect",
"foreign-generic", "foreign-generic",
"foreign-object", "foreign-object",
"formula",
"generics-rep", "generics-rep",
"globals", "globals",
"integers", "integers",
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
"prelude", "prelude",
"psci-support", "psci-support",
"random", "random",
"react",
"reactix", "reactix",
"read", "read",
"record-extra", "record-extra",
...@@ -41,8 +43,9 @@ ...@@ -41,8 +43,9 @@
"string-parsers", "string-parsers",
"strings", "strings",
"stringutils", "stringutils",
"thermite", "toestand",
"tuples-native", "tuples-native",
"typisch",
"uint", "uint",
"uri", "uri",
"versions", "versions",
......
...@@ -43,6 +43,7 @@ pkgs.mkShell { ...@@ -43,6 +43,7 @@ pkgs.mkShell {
buildInputs = [ buildInputs = [
easy-ps.purs easy-ps.purs
easy-ps.psc-package easy-ps.psc-package
easy-ps.dhall-json-simple
build-purs build-purs
build build
repl repl
......
module Gargantext.AsyncTasks where module Gargantext.AsyncTasks where
import Gargantext.Prelude
import DOM.Simple.Console (log2)
import Data.Argonaut (decodeJson) import Data.Argonaut (decodeJson)
import Data.Argonaut.Parser (jsonParser) import Data.Argonaut.Parser (jsonParser)
import Data.Array as A import Data.Array as A
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Map as Map import Data.Map as Map
import Data.Maybe (Maybe(..), maybe, fromMaybe) import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Tuple (snd) import Data.Tuple (fst)
import DOM.Simple.Console (log2)
import Effect (Effect) import Effect (Effect)
import Reactix as R import Reactix as R
import Toestand as T
import Web.Storage.Storage as WSS import Web.Storage.Storage as WSS
import Gargantext.Prelude
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils as GU import Gargantext.Utils as GU
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reload as GUR import Gargantext.Utils.Toestand as T2
localStorageKey :: String localStorageKey :: String
localStorageKey = "garg-async-tasks" localStorageKey = "garg-async-tasks"
...@@ -44,27 +45,32 @@ getAsyncTasks = R2.getls >>= WSS.getItem localStorageKey >>= handleMaybe ...@@ -44,27 +45,32 @@ getAsyncTasks = R2.getls >>= WSS.getItem localStorageKey >>= handleMaybe
getTasks :: Record ReductorProps -> GT.NodeID -> Array GT.AsyncTaskWithType getTasks :: Record ReductorProps -> GT.NodeID -> Array GT.AsyncTaskWithType
getTasks { storage } nodeId = fromMaybe [] $ Map.lookup nodeId storage getTasks { storage } nodeId = fromMaybe [] $ Map.lookup nodeId storage
getTasksMaybe :: Maybe Reductor -> GT.NodeID -> Array GT.AsyncTaskWithType
getTasksMaybe mTasks nodeId = case mTasks of
Just tasks -> getTasks (fst tasks) nodeId
Nothing -> []
removeTaskFromList :: Array GT.AsyncTaskWithType -> GT.AsyncTaskWithType -> Array GT.AsyncTaskWithType removeTaskFromList :: Array GT.AsyncTaskWithType -> GT.AsyncTaskWithType -> Array GT.AsyncTaskWithType
removeTaskFromList ts (GT.AsyncTaskWithType { task: GT.AsyncTask { id: id' } }) = removeTaskFromList ts (GT.AsyncTaskWithType { task: GT.AsyncTask { id: id' } }) =
A.filter (\(GT.AsyncTaskWithType { task: GT.AsyncTask { id: id'' } }) -> id' /= id'') ts A.filter (\(GT.AsyncTaskWithType { task: GT.AsyncTask { id: id'' } }) -> id' /= id'') ts
type ReductorProps = ( type ReductorProps = (
appReload :: GUR.ReloadS reloadForest :: T.Box T2.Reload
, treeReload :: GUR.ReloadS , reloadRoot :: T.Box T2.Reload
, storage :: Storage , storage :: Storage
) )
type Reductor = R2.Reductor (Record ReductorProps) Action type Reductor = R2.Reductor (Record ReductorProps) Action
type ReductorAction = Action -> Effect Unit type ReductorAction = Action -> Effect Unit
useTasks :: GUR.ReloadS -> GUR.ReloadS -> R.Hooks Reductor useTasks :: T.Box T2.Reload -> T.Box T2.Reload -> R.Hooks Reductor
useTasks appReload treeReload = R2.useReductor act initializer unit useTasks reloadRoot reloadForest = R2.useReductor act initializer unit
where where
act :: R2.Actor (Record ReductorProps) Action act :: R2.Actor (Record ReductorProps) Action
act a s = action s a act a s = action s a
initializer _ = do initializer _ = do
storage <- getAsyncTasks storage <- getAsyncTasks
pure { appReload, treeReload, storage } pure { reloadRoot, reloadForest, storage }
data Action = data Action =
Insert GT.NodeID GT.AsyncTaskWithType Insert GT.NodeID GT.AsyncTaskWithType
...@@ -72,19 +78,19 @@ data Action = ...@@ -72,19 +78,19 @@ data Action =
| Remove GT.NodeID GT.AsyncTaskWithType | Remove GT.NodeID GT.AsyncTaskWithType
action :: Record ReductorProps -> Action -> Effect (Record ReductorProps) action :: Record ReductorProps -> Action -> Effect (Record ReductorProps)
action p@{ treeReload, storage } (Insert nodeId t) = do action p@{ reloadForest, storage } (Insert nodeId t) = do
_ <- GUR.bump treeReload _ <- T2.reload reloadForest
let newStorage = Map.alter (maybe (Just [t]) (\ts -> Just $ A.cons t ts)) nodeId storage let newStorage = Map.alter (maybe (Just [t]) (\ts -> Just $ A.cons t ts)) nodeId storage
pure $ p { storage = newStorage } pure $ p { storage = newStorage }
action p (Finish nodeId t) = do action p (Finish nodeId t) = do
action p (Remove nodeId t) action p (Remove nodeId t)
action p@{ appReload, treeReload, storage } (Remove nodeId t@(GT.AsyncTaskWithType { typ })) = do action p@{ reloadRoot, reloadForest, storage } (Remove nodeId t@(GT.AsyncTaskWithType { typ })) = do
_ <- if GT.asyncTaskTriggersAppReload typ then _ <- if GT.asyncTaskTriggersAppReload typ then
GUR.bump appReload T2.reload reloadRoot
else else
pure unit pure unit
_ <- if GT.asyncTaskTriggersTreeReload typ then _ <- if GT.asyncTaskTriggersTreeReload typ then
GUR.bump treeReload T2.reload reloadForest
else else
pure unit pure unit
let newStorage = Map.alter (maybe Nothing $ (\ts -> Just $ removeTaskFromList ts t)) nodeId storage let newStorage = Map.alter (maybe Nothing $ (\ts -> Just $ removeTaskFromList ts t)) nodeId storage
......
module Gargantext.Classes where
textCenter = "text-center"
formControl = "formControl"
...@@ -19,7 +19,7 @@ import Data.Tuple (Tuple(..), snd) ...@@ -19,7 +19,7 @@ import Data.Tuple (Tuple(..), snd)
import Data.Tuple.Nested ( (/\) ) import Data.Tuple.Nested ( (/\) )
--import DOM.Simple.Console (log2) --import DOM.Simple.Console (log2)
import DOM.Simple.Event as DE import DOM.Simple.Event as DE
import Effect ( Effect ) import Effect (Effect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as HTML import Reactix.DOM.HTML as HTML
import Reactix.SyntheticEvent as E import Reactix.SyntheticEvent as E
...@@ -33,8 +33,8 @@ import Gargantext.Utils.Reactix as R2 ...@@ -33,8 +33,8 @@ import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Selection as Sel import Gargantext.Utils.Selection as Sel
import Gargantext.Types (CTabNgramType(..), TermList) import Gargantext.Types (CTabNgramType(..), TermList)
thisModule :: String here :: R2.Here
thisModule = "Gargantext.Components.Annotation.AnnotatedField" here = R2.here "Gargantext.Components.Annotation.AnnotatedField"
type Props = type Props =
( ngrams :: NgramsTable ( ngrams :: NgramsTable
...@@ -51,7 +51,7 @@ annotatedField :: R2.Component Props ...@@ -51,7 +51,7 @@ annotatedField :: R2.Component Props
annotatedField = R.createElement annotatedFieldComponent annotatedField = R.createElement annotatedFieldComponent
annotatedFieldComponent :: R.Component Props annotatedFieldComponent :: R.Component Props
annotatedFieldComponent = R.hooksComponentWithModule thisModule "annotatedField" cpt annotatedFieldComponent = here.component "annotatedField" cpt
where where
cpt {ngrams, setTermList, text: fieldText} _ = do cpt {ngrams, setTermList, text: fieldText} _ = do
(_ /\ setRedrawMenu) <- R.useState' false (_ /\ setRedrawMenu) <- R.useState' false
......
...@@ -16,8 +16,8 @@ import Gargantext.Components.Annotation.Utils (termBootstrapClass) ...@@ -16,8 +16,8 @@ import Gargantext.Components.Annotation.Utils (termBootstrapClass)
import Gargantext.Components.ContextMenu.ContextMenu as CM import Gargantext.Components.ContextMenu.ContextMenu as CM
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String here :: R2.Here
thisModule = "Gargantext.Components.Annotation.Menu" here = R2.here "Gargantext.Components.Annotation.Menu"
data MenuType = NewNgram | SetTermListItem data MenuType = NewNgram | SetTermListItem
...@@ -43,7 +43,7 @@ annotationMenu {x, y, list, menuType, onClose, setList} = ...@@ -43,7 +43,7 @@ annotationMenu {x, y, list, menuType, onClose, setList} =
] ]
annotationMenuCpt :: R.Component Props annotationMenuCpt :: R.Component Props
annotationMenuCpt = R.hooksComponentWithModule thisModule "annotationMenu" cpt annotationMenuCpt = here.component "annotationMenu" cpt
where where
cpt props _ = pure $ R.fragment $ children props cpt props _ = pure $ R.fragment $ children props
children props = A.mapMaybe (addToList props) [ MapTerm, CandidateTerm, StopTerm ] children props = A.mapMaybe (addToList props) [ MapTerm, CandidateTerm, StopTerm ]
......
This diff is collapsed.
module Gargantext.Components.App.Data (App, Boxes, emptyApp) where
import Data.Set as Set
import Data.Maybe (Maybe(..))
import Toestand as T
import Gargantext.Ends (Backend)
import Gargantext.Sessions as Sessions
import Gargantext.Sessions (OpenNodes, Sessions)
import Gargantext.Routes (AppRoute(Home))
import Gargantext.Types (Handed(RightHanded))
import Gargantext.Utils.Toestand as T2
type App =
{ backend :: Maybe Backend
, handed :: Handed
, forestOpen :: OpenNodes
, reloadRoot :: Int
, reloadForest :: Int
, route :: AppRoute
, sessions :: Sessions
, showCorpus :: Boolean
, showLogin :: Boolean
}
emptyApp :: App
emptyApp =
{ backend: Nothing
, handed: RightHanded
, route: Home
, forestOpen: Set.empty
, reloadRoot: T2.newReload
, reloadForest: T2.newReload
, sessions: Sessions.empty
, showCorpus: false
, showLogin: false
}
type Boxes =
{ backend :: T.Box (Maybe Backend)
, handed :: T.Box Handed
, forestOpen :: T.Box OpenNodes
, reloadRoot :: T.Box T2.Reload
, reloadForest :: T.Box T2.Reload
, route :: T.Box AppRoute
, sessions :: T.Box Sessions
, showCorpus :: T.Box Boolean
, showLogin :: T.Box Boolean
}
...@@ -13,7 +13,7 @@ import Reactix.DOM.HTML as H ...@@ -13,7 +13,7 @@ import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.AutoUpdate" here = R2.here "Gargantext.Components.AutoUpdate"
data Action = Update data Action = Update
...@@ -49,7 +49,7 @@ autoUpdate :: Record PropsRow -> R.Element ...@@ -49,7 +49,7 @@ autoUpdate :: Record PropsRow -> R.Element
autoUpdate props = R.createElement autoUpdateCpt props [] autoUpdate props = R.createElement autoUpdateCpt props []
autoUpdateCpt :: R.Component PropsRow autoUpdateCpt :: R.Component PropsRow
autoUpdateCpt = R.hooksComponentWithModule thisModule "autoUpdate" cpt autoUpdateCpt = here.component "autoUpdate" cpt
where where
cpt { duration, effect } _ = do cpt { duration, effect } _ = do
intervalRef <- R.useRef Nothing intervalRef <- R.useRef Nothing
......
-- TODO: this module should be replaced by FacetsTable -- TODO: this module should be replaced by FacetsTable
module Gargantext.Components.Category where module Gargantext.Components.Category where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>), encodeJson) import Gargantext.Prelude (discard, map, pure, void, ($), (-), (<), (<>), (==))
import Data.Argonaut (class EncodeJson, encodeJson, jsonEmptyObject, (:=), (~>))
import Data.Array as A import Data.Array as A
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.Lens ((^.))
import Data.Lens.At (at)
import Data.Lens.Record (prop)
import Data.Map (Map)
import Data.Map as Map import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe, isJust) import Data.Maybe (Maybe(..))
import Data.Ord.Down (Down(..))
import Data.Set (Set)
import Data.Set as Set
import Data.String as Str
import Data.Symbol (SProxy(..))
import Data.Tuple (Tuple(..), fst)
import Data.Tuple.Nested ((/\))
import DOM.Simple.Event as DE
import Effect (Effect)
import Effect.Aff (Aff, launchAff) import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.Category.Types import Gargantext.Components.Category.Types
import Gargantext.Components.DocsTable.Types (DocumentsView(..), LocalCategories, LocalUserScore) ( Category(..), Star(..), cat2score, categories, clickAgain, star2score, stars )
import Gargantext.Ends (Frontends, url) import Gargantext.Components.DocsTable.Types
import Gargantext.Hooks.Loader (useLoaderWithCacheAPI, HashedResponse(..)) ( DocumentsView(..), LocalCategories, LocalUserScore )
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Routes as Routes
import Gargantext.Routes (SessionRoute(NodeAPI)) import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, sessionId, get, delete, put) import Gargantext.Sessions (Session, put)
import Gargantext.Types (NodeID, NodeType(..), OrderBy(..), TableResult, TabType, showTabType') import Gargantext.Types (NodeID, NodeType(..))
import Gargantext.Utils.CacheAPI as GUC
thisModule :: String here :: R2.Here
thisModule = "Gargantext.Components.Category" here = R2.here "Gargantext.Components.Category"
------------------------------------------------------------------------
type RatingProps = type RatingProps =
( score :: Star ( score :: Star
, nodeId :: NodeID , nodeId :: NodeID
...@@ -55,30 +34,23 @@ rating :: R2.Component RatingProps ...@@ -55,30 +34,23 @@ rating :: R2.Component RatingProps
rating = R.createElement ratingCpt rating = R.createElement ratingCpt
ratingCpt :: R.Component RatingProps ratingCpt :: R.Component RatingProps
ratingCpt = R.hooksComponentWithModule thisModule "rating" cpt ratingCpt = here.component "rating" cpt where
where cpt { nodeId, row: DocumentsView r, score, session, setLocalCategories } _ =
cpt { score, nodeId, row: DocumentsView r, session, setLocalCategories } _ = do pure $ H.div { className:"flex" } divs where
pure $ H.div {className:"flex"} divs divs = map (\s -> H.div { className : icon' score s
where , on: { click: onClick s } } []) stars
divs = map (\s -> H.div { className : icon score s icon' Star_0 Star_0 = "fa fa-times-circle"
, on: {click: onClick score s} icon' _ Star_0 = "fa fa-times"
} []) stars icon' c s = if star2score c < star2score s then "fa fa-star-o" else "fa fa-star"
onClick c _ = do
icon Star_0 Star_0 = "fa fa-times-circle" let c' = if score == c
icon _ Star_0 = "fa fa-times" then clickAgain c
icon c s = if star2score c < star2score s else c
then "fa fa-star-o"
else "fa fa-star" setLocalCategories $ Map.insert r._id c'
void $ launchAff
onClick score c = \_-> do $ putRating session nodeId
let c' = if score == c $ RatingQuery { nodeIds: [r._id], rating: c' }
then clickAgain c
else c
setLocalCategories $ Map.insert r._id c'
void $ launchAff
$ putRating session nodeId
$ RatingQuery {nodeIds: [r._id], rating: c'}
newtype RatingQuery = newtype RatingQuery =
RatingQuery { nodeIds :: Array Int RatingQuery { nodeIds :: Array Int
...@@ -92,14 +64,9 @@ instance encodeJsonRatingQuery :: EncodeJson RatingQuery where ...@@ -92,14 +64,9 @@ instance encodeJsonRatingQuery :: EncodeJson RatingQuery where
~> jsonEmptyObject ~> jsonEmptyObject
putRating :: Session -> Int -> RatingQuery -> Aff (Array Int) putRating :: Session -> Int -> RatingQuery -> Aff (Array Int)
putRating session nodeId = put session $ ratingRoute nodeId putRating session nodeId = put session $ ratingRoute where
where ratingRoute = NodeAPI Node (Just nodeId) "category"
ratingRoute :: Int -> SessionRoute
ratingRoute nodeId = NodeAPI Node (Just nodeId) "category"
------------------------------------------------------------------------
type CarousselProps = type CarousselProps =
( category :: Category ( category :: Category
, nodeId :: NodeID , nodeId :: NodeID
...@@ -108,12 +75,11 @@ type CarousselProps = ...@@ -108,12 +75,11 @@ type CarousselProps =
, setLocalCategories :: R.Setter LocalCategories , setLocalCategories :: R.Setter LocalCategories
) )
caroussel :: R2.Component CarousselProps caroussel :: R2.Component CarousselProps
caroussel = R.createElement carousselCpt caroussel = R.createElement carousselCpt
carousselCpt :: R.Component CarousselProps carousselCpt :: R.Component CarousselProps
carousselCpt = R.hooksComponentWithModule thisModule "caroussel" cpt carousselCpt = here.component "caroussel" cpt
where where
cpt { category, nodeId, row: DocumentsView r, session, setLocalCategories } _ = do cpt { category, nodeId, row: DocumentsView r, session, setLocalCategories } _ = do
pure $ H.div {className:"flex"} divs pure $ H.div {className:"flex"} divs
......
module Gargantext.Components.Charts.Options.Series where module Gargantext.Components.Charts.Options.Series where
import Prelude (class Show, bind, map, pure, show, ($), (+), (<<<), (<>)) import Prelude (class Eq, class Show, bind, map, pure, show, ($), (+), (<<<), (<>), eq)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, (.:), (~>), (:=)) import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, encodeJson, (.:), (~>), (:=))
import Data.Argonaut.Core (jsonEmptyObject) import Data.Argonaut.Core (jsonEmptyObject)
import Data.Array (foldl) import Data.Array (foldl)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..), maybe) import Data.Maybe (Maybe(..), maybe)
import Record.Unsafe (unsafeSet) import Record.Unsafe (unsafeSet)
import Unsafe.Coerce (unsafeCoerce) import Unsafe.Coerce (unsafeCoerce)
...@@ -186,11 +187,14 @@ toJsTree maybeSurname (TreeNode x) = ...@@ -186,11 +187,14 @@ toJsTree maybeSurname (TreeNode x) =
name = maybe "" (\x' -> x' <> ">") maybeSurname <> x.name name = maybe "" (\x' -> x' <> ">") maybeSurname <> x.name
data TreeNode = TreeNode { data TreeNode = TreeNode {
name :: String children :: Array TreeNode
, name :: String
, value :: Int , value :: Int
, children :: Array TreeNode
} }
derive instance genericTreeNode :: Generic TreeNode _
instance eqTreeNode :: Eq TreeNode where
eq (TreeNode n1) (TreeNode n2) = eq n1 n2
instance decodeTreeNode :: DecodeJson TreeNode where instance decodeTreeNode :: DecodeJson TreeNode where
decodeJson json = do decodeJson json = do
obj <- decodeJson json obj <- decodeJson json
......
This diff is collapsed.
...@@ -21,8 +21,8 @@ import Reactix.DOM.HTML as HTML ...@@ -21,8 +21,8 @@ import Reactix.DOM.HTML as HTML
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String here :: R2.Here
thisModule = "Gargantext.Components.ContextMenu.ContextMenu" here = R2.here "Gargantext.Components.ContextMenu.ContextMenu"
type Props t = ( type Props t = (
x :: Number x :: Number
...@@ -34,7 +34,7 @@ contextMenu :: forall t. R2.Component (Props t) ...@@ -34,7 +34,7 @@ contextMenu :: forall t. R2.Component (Props t)
contextMenu = R.createElement contextMenuCpt contextMenu = R.createElement contextMenuCpt
contextMenuCpt :: forall t. R.Component (Props t) contextMenuCpt :: forall t. R.Component (Props t)
contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt contextMenuCpt = here.component "contextMenu" cpt
where where
cpt menu@{ x, y, onClose } children = do cpt menu@{ x, y, onClose } children = do
host <- R2.getPortalHost host <- R2.getPortalHost
...@@ -108,7 +108,7 @@ contextMenuItem :: Array R.Element -> R.Element ...@@ -108,7 +108,7 @@ contextMenuItem :: Array R.Element -> R.Element
contextMenuItem = R.createElement contextMenuItemCpt {} contextMenuItem = R.createElement contextMenuItemCpt {}
contextMenuItemCpt :: R.Component () contextMenuItemCpt :: R.Component ()
contextMenuItemCpt = R.hooksComponentWithModule thisModule "contextMenuItem" cpt contextMenuItemCpt = here.component "contextMenuItem" cpt
where where
cpt _props children = pure $ HTML.li { className: "context-menu-item" } children cpt _props children = pure $ HTML.li { className: "context-menu-item" } children
......
This diff is collapsed.
module Gargantext.Components.DocsTable.Types where module Gargantext.Components.DocsTable.Types where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>)) import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Map (Map) import Data.Map (Map)
import Data.Map as Map import Data.Map as Map
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
...@@ -24,6 +26,9 @@ newtype DocumentsView ...@@ -24,6 +26,9 @@ newtype DocumentsView
, title :: String , title :: String
, url :: String , url :: String
} }
derive instance genericDocumentsView :: Generic DocumentsView _
instance eqDocumentsView :: Eq DocumentsView where
eq = genericEq
{- {-
derive instance genericDocumentsView :: Generic DocumentsView _ derive instance genericDocumentsView :: Generic DocumentsView _
......
This diff is collapsed.
module Gargantext.Components.Footer where module Gargantext.Components.Footer where
import Gargantext.Prelude
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 Gargantext.Prelude
import Gargantext.Sessions as Sessions
thisModule :: String here :: R2.Here
thisModule = "Gargantext.Components.Footer" here = R2.here "Gargantext.Components.Footer"
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
type FooterProps = type FooterProps = ( )
(
session :: Sessions.Session
)
footer :: Record FooterProps -> R.Element footer :: R2.Component FooterProps
footer props = R.createElement footerCpt props [] footer = R.createElement footerCpt
footerCpt :: R.Component FooterProps footerCpt :: R.Component FooterProps
footerCpt = R.hooksComponentWithModule thisModule "footer" cpt footerCpt = here.component "footer" cpt where
where cpt { } _ = do
cpt { session } _ = do pure $ H.div { className: "container" } [ H.hr {}, H.footer {} [] ]
pure $ H.div
{ className: "container" }
[ H.hr {}
, H.footer {} []
]
This diff is collapsed.
This diff is collapsed.
module Gargantext.Components.Forest.Tree.Node.Action where module Gargantext.Components.Forest.Tree.Node.Action where
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Gargantext.Prelude (class Show, Unit) import Gargantext.Prelude
import Gargantext.Sessions (Session)
import Gargantext.Types as GT
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree.Types (SubTreeOut, SubTreeParams(..)) import Gargantext.Components.Forest.Tree.Node.Tools.SubTree.Types (SubTreeOut, SubTreeParams(..))
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), glyphiconNodeAction) import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), glyphiconNodeAction)
import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType, UploadFileBlob) import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType, UploadFileBlob)
import Gargantext.Components.Forest.Tree.Node.Action.Update.Types (UpdateNodeParams) import Gargantext.Components.Forest.Tree.Node.Action.Update.Types (UpdateNodeParams)
import Gargantext.Components.Forest.Tree.Node.Action.Contact.Types (AddContactParams) import Gargantext.Components.Forest.Tree.Node.Action.Contact.Types (AddContactParams)
import Gargantext.Sessions (Session)
import Gargantext.Types as GT
type Props = type Props =
( dispatch :: Action -> Aff Unit ( dispatch :: Action -> Aff Unit
...@@ -55,8 +58,29 @@ setTreeOut (LinkNode {nodeType, params:_}) p = LinkNode {nodeType, params: p} ...@@ -55,8 +58,29 @@ setTreeOut (LinkNode {nodeType, params:_}) p = LinkNode {nodeType, params: p}
setTreeOut (SharePublic {params:_}) p = SharePublic {params: p} setTreeOut (SharePublic {params:_}) p = SharePublic {params: p}
setTreeOut a _ = a setTreeOut a _ = a
derive instance genericAction :: Generic Action _
instance showShow :: Show Action where
instance eqAction :: Eq Action where
eq (AddNode s1 nt1) (AddNode s2 nt2) = (eq s1 s2) && (eq nt1 nt2)
eq (DeleteNode nt1) (DeleteNode nt2) = eq nt1 nt2
eq (RenameNode s1) (RenameNode s2) = eq s1 s2
eq (UpdateNode un1) (UpdateNode un2) = eq un1 un2
eq (DoSearch at1) (DoSearch at2) = eq at1 at2
eq (UploadFile nt1 ft1 s1 _) (UploadFile nt2 ft2 s2 _) = (eq nt1 nt2) && (eq ft1 ft2) && (eq s1 s2)
eq (UploadArbitraryFile s1 _) (UploadArbitraryFile s2 _) = eq s1 s2
eq DownloadNode DownloadNode = true
eq RefreshTree RefreshTree = true
eq ClosePopover ClosePopover = true
eq (ShareTeam s1) (ShareTeam s2) = eq s1 s2
eq (AddContact ac1) (AddContact ac2) = eq ac1 ac2
eq (SharePublic p1) (SharePublic p2) = eq p1 p2
eq (MoveNode p1) (MoveNode p2) = eq p1 p2
eq (MergeNode p1) (MergeNode p2) = eq p1 p2
eq (LinkNode l1) (LinkNode l2) = eq l1 l2
eq NoAction NoAction = true
eq _ _ = false
instance showAction :: Show Action where
show (AddNode _ _ ) = "AddNode" show (AddNode _ _ ) = "AddNode"
show (DeleteNode _ ) = "DeleteNode" show (DeleteNode _ ) = "DeleteNode"
show (RenameNode _ ) = "RenameNode" show (RenameNode _ ) = "RenameNode"
......
...@@ -20,10 +20,9 @@ import Gargantext.Types as GT ...@@ -20,10 +20,9 @@ import Gargantext.Types as GT
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String here :: R2.Here
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Add" here = R2.here "Gargantext.Components.Forest.Tree.Node.Action.Add"
----------------------------------------------------------------------
addNode :: Session -> GT.ID -> AddNodeValue -> Aff (Array GT.ID) addNode :: Session -> GT.ID -> AddNodeValue -> Aff (Array GT.ID)
addNode session parentId = post session $ GR.NodeAPI GT.Node (Just parentId) "" addNode session parentId = post session $ GR.NodeAPI GT.Node (Just parentId) ""
...@@ -34,8 +33,7 @@ addNodeAsync :: Session ...@@ -34,8 +33,7 @@ addNodeAsync :: Session
addNodeAsync session parentId q = do addNodeAsync session parentId q = do
task <- post session p q task <- post session p q
pure $ GT.AsyncTaskWithType {task, typ: GT.AddNode} pure $ GT.AsyncTaskWithType {task, typ: GT.AddNode}
where where p = GR.NodeAPI GT.Node (Just parentId) (GT.asyncTaskTypePath GT.AddNode)
p = GR.NodeAPI GT.Node (Just parentId) (GT.asyncTaskTypePath GT.AddNode)
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- TODO AddNodeParams -- TODO AddNodeParams
...@@ -65,7 +63,7 @@ addNodeView :: Record CreateNodeProps ...@@ -65,7 +63,7 @@ addNodeView :: Record CreateNodeProps
-> R.Element -> R.Element
addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p [] addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
where where
el = R.hooksComponentWithModule thisModule "addNodeView" cpt el = here.component "addNodeView" cpt
cpt {id, name} _ = do cpt {id, name} _ = do
nodeName@(name' /\ setNodeName) <- R.useState' "Name" nodeName@(name' /\ setNodeName) <- R.useState' "Name"
nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes
......
...@@ -12,20 +12,17 @@ import Gargantext.Prelude (class Read, class Show, class Eq) ...@@ -12,20 +12,17 @@ import Gargantext.Prelude (class Read, class Show, class Eq)
data FileType = CSV | CSV_HAL | WOS | PresseRIS | Arbitrary data FileType = CSV | CSV_HAL | WOS | PresseRIS | Arbitrary
derive instance genericFileType :: Generic FileType _ derive instance genericFileType :: Generic FileType _
instance eqFileType :: Eq FileType where instance eqFileType :: Eq FileType where
eq = genericEq eq = genericEq
instance showFileType :: Show FileType where instance showFileType :: Show FileType where
show = genericShow show = genericShow
instance readFileType :: Read FileType where instance readFileType :: Read FileType where
read :: String -> Maybe FileType read :: String -> Maybe FileType
read "Arbitrary" = Just Arbitrary
read "CSV" = Just CSV read "CSV" = Just CSV
read "CSV_HAL" = Just CSV_HAL read "CSV_HAL" = Just CSV_HAL
read "PresseRIS" = Just PresseRIS read "PresseRIS" = Just PresseRIS
read "WOS" = Just WOS read "WOS" = Just WOS
read "Arbitrary" = Just Arbitrary
read _ = Nothing read _ = Nothing
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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