Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
b142da83
Commit
b142da83
authored
Jan 29, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-css
parents
0f07fe61
83a1f2c7
Changes
57
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
1587 additions
and
918 deletions
+1587
-918
sass.css
dist/styles/sass.css
+48
-14
sass.css.map
dist/styles/sass.css.map
+1
-1
package.json
package.json
+1
-1
AnnotatedField.purs
src/Gargantext/Components/Annotation/AnnotatedField.purs
+3
-2
App.purs
src/Gargantext/Components/App.purs
+19
-13
CodeEditor.purs
src/Gargantext/Components/CodeEditor.purs
+29
-26
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+102
-63
Forest.purs
src/Gargantext/Components/Forest.purs
+18
-18
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+84
-62
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+9
-9
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+0
-1
Link.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs
+2
-2
Merge.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
+5
-5
Move.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
+6
-5
Frame.purs
...text/Components/Forest/Tree/Node/Action/Search/Frame.purs
+9
-9
SearchBar.purs
.../Components/Forest/Tree/Node/Action/Search/SearchBar.purs
+3
-3
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+9
-10
Share.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
+3
-3
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+3
-3
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+9
-9
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+1
-1
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+12
-13
SubTree.purs
...Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
+3
-3
Sync.purs
src/Gargantext/Components/Forest/Tree/Node/Tools/Sync.purs
+2
-1
Graph.purs
src/Gargantext/Components/Graph.purs
+57
-57
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+41
-34
SlideButton.purs
src/Gargantext/Components/GraphExplorer/SlideButton.purs
+3
-2
InputWithEnter.purs
src/Gargantext/Components/InputWithEnter.purs
+7
-11
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+10
-12
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+3
-3
Annuaire.purs
src/Gargantext/Components/Nodes/Annuaire.purs
+15
-14
Tabs.purs
src/Gargantext/Components/Nodes/Annuaire/Tabs.purs
+179
-0
User.purs
src/Gargantext/Components/Nodes/Annuaire/User.purs
+14
-63
Contact.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
+244
-0
Tabs.purs
...gantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
+5
-5
Types.purs
...antext/Components/Nodes/Annuaire/User/Contacts/Types.purs
+96
-29
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+57
-66
Common.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Common.purs
+7
-6
Histo.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Histo.purs
+3
-3
Dashboard.purs
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
+133
-49
Document.purs
src/Gargantext/Components/Nodes/Corpus/Document.purs
+3
-3
Types.purs
src/Gargantext/Components/Nodes/Corpus/Types.purs
+17
-191
Types.purs
src/Gargantext/Components/Nodes/Dashboard/Types.purs
+8
-2
Lists.purs
src/Gargantext/Components/Nodes/Lists.purs
+19
-19
Types.purs
src/Gargantext/Components/Nodes/Types.purs
+189
-0
Search.purs
src/Gargantext/Components/Search.purs
+3
-3
Tab.purs
src/Gargantext/Components/Tab.purs
+12
-6
Table.purs
src/Gargantext/Components/Table.purs
+7
-9
TopBar.purs
src/Gargantext/Components/TopBar.purs
+6
-6
Ends.purs
src/Gargantext/Ends.purs
+1
-0
Routes.purs
src/Gargantext/Routes.purs
+13
-15
Types.purs
src/Gargantext/Types.purs
+5
-2
Reactix.purs
src/Gargantext/Utils/Reactix.purs
+29
-0
Reload.purs
src/Gargantext/Utils/Reload.purs
+1
-1
_annotation.sass
src/sass/_annotation.sass
+15
-19
_code_editor.sass
src/sass/_code_editor.sass
+3
-11
sass.sass
src/sass/sass.sass
+1
-0
No files found.
dist/styles/sass.css
View file @
b142da83
...
@@ -533,7 +533,9 @@ li .leaf:hover a.settings {
...
@@ -533,7 +533,9 @@ li .leaf:hover a.settings {
}
}
.code-editor-heading
{
.code-editor-heading
{
display
:
flex
;
/* .buttons-right */
/* display: flex */
/* justify-content: flex-end */
}
}
.code-editor-heading
.renameable
{
.code-editor-heading
.renameable
{
flex-grow
:
2
;
flex-grow
:
2
;
...
@@ -541,20 +543,7 @@ li .leaf:hover a.settings {
...
@@ -541,20 +543,7 @@ li .leaf:hover a.settings {
.code-editor-heading
.renameable
.text
{
.code-editor-heading
.renameable
.text
{
padding-right
:
10px
;
padding-right
:
10px
;
}
}
.code-editor-heading
.buttons-right
{
display
:
flex
;
justify-content
:
flex-end
;
}
.code-editor
.toolbar
{
display
:
flex
;
justify-content
:
flex-start
;
width
:
100%
;
}
.code-editor
.editor
{
display
:
flex
;
width
:
100%
;
}
.code-editor
.editor
.code-area
{
.code-editor
.editor
.code-area
{
flex-grow
:
1
;
flex-grow
:
1
;
max-height
:
200px
;
max-height
:
200px
;
...
@@ -785,4 +774,49 @@ ul li {
...
@@ -785,4 +774,49 @@ ul li {
width
:
85%
;
width
:
85%
;
}
}
.annotation-run
{
cursor
:
pointer
;
}
.annotation-run.candidate-term.graph-term.stop-term
{
color
:
#000
;
background-image
:
linear-gradient
(
rgba
(
184
,
184
,
184
,
0.34
),
rgba
(
184
,
184
,
184
,
0.34
)),
linear-gradient
(
rgba
(
149
,
210
,
149
,
0.33
),
rgba
(
149
,
210
,
149
,
0.33
)),
linear-gradient
(
rgba
(
245
,
148
,
153
,
0.33
),
rgba
(
245
,
148
,
153
,
0.33
));
}
.annotation-run.candidate-term.graph-term
{
color
:
#000
;
background-image
:
linear-gradient
(
rgba
(
184
,
184
,
184
,
0.5
),
rgba
(
184
,
184
,
184
,
0.5
)),
linear-gradient
(
rgba
(
149
,
210
,
149
,
0.5
),
rgba
(
149
,
210
,
149
,
0.5
));
}
.annotation-run.candidate-term.stop-term
{
color
:
#000
;
background-image
:
linear-gradient
(
rgba
(
184
,
184
,
184
,
0.5
),
rgba
(
184
,
184
,
184
,
0.5
)),
linear-gradient
(
rgba
(
245
,
148
,
153
,
0.5
),
rgba
(
245
,
148
,
153
,
0.5
));
}
.annotation-run.graph-term.stop-term
{
color
:
#000
;
background-image
:
linear-gradient
(
rgba
(
149
,
210
,
149
,
0.5
),
rgba
(
149
,
210
,
149
,
0.5
)),
linear-gradient
(
rgba
(
245
,
148
,
153
,
0.5
),
rgba
(
245
,
148
,
153
,
0.5
));
}
.annotation-run.candidate-term
{
color
:
#000
;
background-color
:
#B8B8B876
;
}
.annotation-run.graph-term
{
color
:
#000
;
background-color
:
#95D29593
;
}
.annotation-run.stop-term
{
color
:
#000
;
background-color
:
#F5949931
;
}
.context-menu
.candidate-term
{
color
:
#000
;
background-color
:
#B8B8B876
;
}
.context-menu
.graph-term
{
color
:
#000
;
background-color
:
#95D29593
;
}
.context-menu
.stop-term
{
color
:
#000
;
background-color
:
#F5949931
;
}
/*# sourceMappingURL=sass.css.map */
/*# sourceMappingURL=sass.css.map */
dist/styles/sass.css.map
View file @
b142da83
{"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"],"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;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEJ;EACE;;AAEA;EACE;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACpFJ;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;;AAEF;EACE;;AAEF;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;;;AC7IJ;EACE;;AAEA;EACE;;AACA;EACE;;AACJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AACF;EACE;EACA;;AACA;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;EArDR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA2DM;EACE;EACA;EACA;EACA;EACA;EA7DR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAmEE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;ACtGV;EACE;;AACF;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;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;;;ACtEJ;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","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;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEJ;EACE;;AAEA;EACE;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACpFJ;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;;AAEF;EACE;;AAEF;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;;;AC7IJ;AAKE;AACA;AACA;;AANA;EACE;;AACA;EACE;;;AAOF;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;EA7CR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAmDM;EACE;EACA;EACA;EACA;EACA;EArDR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA2DE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;AC9FV;EACE;;AACF;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;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;;;ACtEJ;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;;;ACzBJ;EACE;;AAEA;EANE;EACA;;AAQF;EAbE;EACA;;AAeF;EAhBE;EACA;;AAkBF;EAnBE;EACA;;AAqBF;EA1BE;EACA,kBALyB;;AAiC3B;EA7BE;EACA,kBANqB;;AAqCvB;EAhCE;EACA,kBAJoB;;;AAuCtB;EApCE;EACA,kBALyB;;AA2C3B;EAvCE;EACA,kBANqB;;AA+CvB;EA1CE;EACA,kBAJoB","file":"sass.css"}
\ No newline at end of file
\ No newline at end of file
package.json
View file @
b142da83
{
{
"name"
:
"Gargantext"
,
"name"
:
"Gargantext"
,
"version"
:
"0.0.2.
6
"
,
"version"
:
"0.0.2.
7
"
,
"scripts"
:
{
"scripts"
:
{
"rebase-set"
:
"spago package-set-upgrade && spago psc-package-insdhall"
,
"rebase-set"
:
"spago package-set-upgrade && spago psc-package-insdhall"
,
"rebuild-set"
:
"spago psc-package-insdhall"
,
"rebuild-set"
:
"spago psc-package-insdhall"
,
...
...
src/Gargantext/Components/Annotation/AnnotatedField.purs
View file @
b142da83
...
@@ -23,7 +23,7 @@ import Reactix.DOM.HTML as HTML
...
@@ -23,7 +23,7 @@ import Reactix.DOM.HTML as HTML
import Reactix.SyntheticEvent as E
import Reactix.SyntheticEvent as E
import Gargantext.Types (CTabNgramType(..), TermList)
import Gargantext.Types (CTabNgramType(..), TermList)
import Gargantext.Components.Annotation.Utils ( termBootstrapClass )
import Gargantext.Components.Annotation.Utils ( termBootstrapClass
, termClass
)
import Gargantext.Components.NgramsTable.Core
import Gargantext.Components.NgramsTable.Core
import Gargantext.Components.Annotation.Menu ( annotationMenu, MenuType(..) )
import Gargantext.Components.Annotation.Menu ( annotationMenu, MenuType(..) )
import Gargantext.Utils.Selection as Sel
import Gargantext.Utils.Selection as Sel
...
@@ -131,6 +131,7 @@ annotatedRunComponent = R.staticComponent "AnnotatedRun" cpt
...
@@ -131,6 +131,7 @@ annotatedRunComponent = R.staticComponent "AnnotatedRun" cpt
elt =
elt =
case list of
case list of
Nothing -> HTML.span { on: { mouseUp: cb } }
Nothing -> HTML.span { on: { mouseUp: cb } }
Just l -> HTML.span { className: "annotation-run bg-" <> termBootstrapClass l
Just l -> HTML.span { -- className: "annotation-run bg-" <> termBootstrapClass l
className: "annotation-run " <> termClass l
, on: { click: cb }
, on: { click: cb }
}
}
src/Gargantext/Components/App.purs
View file @
b142da83
...
@@ -13,7 +13,8 @@ import Gargantext.Components.GraphExplorer (explorerLayout)
...
@@ -13,7 +13,8 @@ import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Login (login)
import Gargantext.Components.Login (login)
import Gargantext.Components.Nodes.Annuaire (annuaireLayout)
import Gargantext.Components.Nodes.Annuaire (annuaireLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contacts (annuaireUserLayout, userLayout)
import Gargantext.Components.Nodes.Annuaire.User (userLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contact (contactLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentMainLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentMainLayout)
...
@@ -101,17 +102,6 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
...
@@ -101,17 +102,6 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
Annuaire sid nodeId -> withSession sid $ \session -> forested [
Annuaire sid nodeId -> withSession sid $ \session -> forested [
annuaireLayout { frontends, nodeId, session }
annuaireLayout { frontends, nodeId, session }
]
]
ContactPage sid aId nodeId -> withSession sid $ \session -> forested [
annuaireUserLayout {
annuaireId: aId
, appReload
, asyncTasksRef
, frontends
, nodeId
, session
, treeReloadRef
}
]
Corpus sid nodeId -> withSession sid $ \session -> forested [
Corpus sid nodeId -> withSession sid $ \session -> forested [
corpusLayout { nodeId, session }
corpusLayout { nodeId, session }
]
]
...
@@ -119,7 +109,7 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
...
@@ -119,7 +109,7 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
documentMainLayout { listId, mCorpusId: Just corpusId, nodeId, session } []
documentMainLayout { listId, mCorpusId: Just corpusId, nodeId, session } []
]
]
Dashboard sid nodeId -> withSession sid $ \session -> forested [
Dashboard sid nodeId -> withSession sid $ \session -> forested [
dashboardLayout { nodeId, session }
dashboardLayout { nodeId, session }
[]
]
]
Document sid listId nodeId ->
Document sid listId nodeId ->
withSession sid $
withSession sid $
...
@@ -204,6 +194,8 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
...
@@ -204,6 +194,8 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, sessionUpdate
, sessionUpdate
}
}
} []
} []
----------------------------------------------------------------------------------------
-- | TODO refact UserPage and ContactPage
UserPage sid nodeId -> withSession sid $ \session -> forested [
UserPage sid nodeId -> withSession sid $ \session -> forested [
userLayout {
userLayout {
appReload
appReload
...
@@ -214,3 +206,17 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
...
@@ -214,3 +206,17 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, treeReloadRef
, treeReloadRef
}
}
]
]
ContactPage sid aId nodeId -> withSession sid $ \session -> forested [
contactLayout {
annuaireId: aId
, appReload
, asyncTasksRef
, frontends
, nodeId
, session
, treeReloadRef
}
]
src/Gargantext/Components/CodeEditor.purs
View file @
b142da83
...
@@ -24,6 +24,7 @@ import Gargantext.Prelude
...
@@ -24,6 +24,7 @@ import Gargantext.Prelude
import Gargantext.Utils.HighlightJS as HLJS
import Gargantext.Utils.HighlightJS as HLJS
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.CodeEditor"
thisModule = "Gargantext.Components.CodeEditor"
type Code = String
type Code = String
...
@@ -117,15 +118,14 @@ codeEditorCpt = R.hooksComponentWithModule thisModule "codeEditor" cpt
...
@@ -117,15 +118,14 @@ codeEditorCpt = R.hooksComponentWithModule thisModule "codeEditor" cpt
setCodeOverlay controls code'
setCodeOverlay controls code'
renderHtml code' controls
renderHtml code' controls
pure $ H.div { className: "code-editor" } [
pure $ H.div { className: "code-editor" }
toolbar {controls, onChange}
[ toolbar {controls, onChange}
, H.div { className: "row error" } [
, H.div { className: "row error" }
errorComponent {error: controls.error}
[ errorComponent {error: controls.error} ]
]
, H.div { className: "row editor" }
, H.div { className: "row editor" } [
[ H.div { className: "code-area " <> (codeHidden $ fst controls.viewType) }
H.div { className: "code-area " <> (codeHidden $ fst controls.viewType) } [
[ H.div { className: "code-container" }
H.div { className: "code-container" } [
[ H.textarea { defaultValue: code
H.textarea { defaultValue: code
, on: { change: onEditChange controls onChange }
, on: { change: onEditChange controls onChange }
, placeholder: "Type some code..."
, placeholder: "Type some code..."
, ref: controls.codeElRef } [ ]
, ref: controls.codeElRef } [ ]
...
@@ -208,12 +208,15 @@ toolbarCpt = R.hooksComponentWithModule thisModule "toolbar" cpt
...
@@ -208,12 +208,15 @@ toolbarCpt = R.hooksComponentWithModule thisModule "toolbar" cpt
where
where
cpt props@{controls: {codeType, error, viewType}} _ = do
cpt props@{controls: {codeType, error, viewType}} _ = do
pure $
pure $
H.div { className: "row toolbar" } [
H.div { className: "row toolbar" }
codeTypeSelector {
[ H.div { className: "col-2" }
[ codeTypeSelector {
codeType
codeType
, onChange: onChangeCodeType props
, onChange: onChangeCodeType props
}
}
, viewTypeSelector {state: viewType}
]
, H.div { className: "col-1" }
[ viewTypeSelector {state: viewType} ]
]
]
-- Handle rerendering of preview when viewType changed
-- Handle rerendering of preview when viewType changed
...
...
src/Gargantext/Components/FacetsTable.purs
View file @
b142da83
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest.purs
View file @
b142da83
...
@@ -38,10 +38,10 @@ type Props = (
...
@@ -38,10 +38,10 @@ type Props = (
forest :: R2.Component Props
forest :: R2.Component Props
forest = R.createElement forestCpt
forest = R.createElement forestCpt
where
forestCpt :: R.Component Props
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt
forestCpt :: R.Component Props
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt
where
cpt { appReload
cpt { appReload
, asyncTasksRef
, asyncTasksRef
, backend
, backend
...
@@ -124,10 +124,10 @@ type ForestLayoutProps = (
...
@@ -124,10 +124,10 @@ type ForestLayoutProps = (
forestLayout :: R2.Component ForestLayoutProps
forestLayout :: R2.Component ForestLayoutProps
forestLayout props = R.createElement forestLayoutCpt props
forestLayout props = R.createElement forestLayoutCpt props
where
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
where
cpt props@{ handed } children = do
cpt props@{ handed } children = do
pure $ R.fragment [ topBar { handed } [], forestLayoutMain props children ]
pure $ R.fragment [ topBar { handed } [], forestLayoutMain props children ]
...
@@ -135,10 +135,10 @@ forestLayout props = R.createElement forestLayoutCpt props
...
@@ -135,10 +135,10 @@ forestLayout props = R.createElement forestLayoutCpt props
-- while the remaining ones are put into the main view
-- while the remaining ones are put into the main view
forestLayoutWithTopBar :: R2.Component ForestLayoutProps
forestLayoutWithTopBar :: R2.Component ForestLayoutProps
forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props
forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props
where
forestLayoutWithTopBarCpt :: R.Component ForestLayoutProps
forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutWithTopBar" cpt
forestLayoutWithTopBarCpt :: R.Component ForestLayoutProps
forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutWithTopBar" cpt
where
cpt props@{ handed } children = do
cpt props@{ handed } children = do
let { head: topBarChild, tail: mainChildren } =
let { head: topBarChild, tail: mainChildren } =
fromMaybe { head: H.div {} [], tail: [] } $ A.uncons children
fromMaybe { head: H.div {} [], tail: [] } $ A.uncons children
...
@@ -149,10 +149,10 @@ forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props
...
@@ -149,10 +149,10 @@ forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props
forestLayoutMain :: R2.Component ForestLayoutProps
forestLayoutMain :: R2.Component ForestLayoutProps
forestLayoutMain props = R.createElement forestLayoutMainCpt props
forestLayoutMain props = R.createElement forestLayoutMainCpt props
where
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
where
cpt props children = do
cpt props children = do
pure $ forestLayoutRaw props [
pure $ forestLayoutRaw props [
mainPage {} children
mainPage {} children
...
@@ -160,10 +160,10 @@ forestLayoutMain props = R.createElement forestLayoutMainCpt props
...
@@ -160,10 +160,10 @@ forestLayoutMain props = R.createElement forestLayoutMainCpt props
forestLayoutRaw :: R2.Component ForestLayoutProps
forestLayoutRaw :: R2.Component ForestLayoutProps
forestLayoutRaw props = R.createElement forestLayoutRawCpt props
forestLayoutRaw props = R.createElement forestLayoutRawCpt props
where
forestLayoutRawCpt :: R.Component ForestLayoutProps
forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
forestLayoutRawCpt :: R.Component ForestLayoutProps
forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
where
cpt { appReload
cpt { appReload
, asyncTasksRef
, asyncTasksRef
, backend
, backend
...
@@ -194,10 +194,10 @@ forestLayoutRaw props = R.createElement forestLayoutRawCpt props
...
@@ -194,10 +194,10 @@ forestLayoutRaw props = R.createElement forestLayoutRawCpt props
mainPage :: R2.Component ()
mainPage :: R2.Component ()
mainPage = R.createElement mainPageCpt
mainPage = R.createElement mainPageCpt
where
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
where
cpt {} children = do
cpt {} children = do
pure $ H.div {className: "col-md-10"} [
pure $ H.div {className: "col-md-10"} [
H.div {id: "page-wrapper"} [
H.div {id: "page-wrapper"} [
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
b142da83
...
@@ -63,11 +63,11 @@ type Props = (
...
@@ -63,11 +63,11 @@ type Props = (
)
)
treeView :: R2.Component Props
treeView :: R2.Component Props
treeView = R.createElement elCpt
treeView = R.createElement treeViewCpt
where
elCpt :: R.Component Props
elCpt = R.hooksComponentWithModule thisModule "treeView" cpt
treeViewCpt :: R.Component Props
treeViewCpt = R.hooksComponentWithModule thisModule "treeView" cpt
where
cpt { appReload
cpt { appReload
, asyncTasks
, asyncTasks
, currentRoute
, currentRoute
...
@@ -90,11 +90,11 @@ treeView = R.createElement elCpt
...
@@ -90,11 +90,11 @@ treeView = R.createElement elCpt
} []
} []
treeLoadView :: R2.Component Props
treeLoadView :: R2.Component Props
treeLoadView = R.createElement elCpt
treeLoadView = R.createElement treeLoadViewCpt
where
elCpt :: R.Component Props
elCpt = R.hooksComponentWithModule thisModule "treeLoadView" cpt
treeLoadViewCpt :: R.Component Props
treeLoadViewCpt = R.hooksComponentWithModule thisModule "treeLoadView" cpt
where
cpt { appReload
cpt { appReload
, asyncTasks
, asyncTasks
, currentRoute
, currentRoute
...
@@ -135,11 +135,11 @@ type TreeViewProps = (
...
@@ -135,11 +135,11 @@ type TreeViewProps = (
)
)
loadedTreeViewFirstLevel :: R2.Component TreeViewProps
loadedTreeViewFirstLevel :: R2.Component TreeViewProps
loadedTreeViewFirstLevel = R.createElement elCpt
loadedTreeViewFirstLevel = R.createElement loadedTreeViewFirstLevelCpt
where
elCpt :: R.Component TreeViewProps
elCpt = R.hooksComponentWithModule thisModule "loadedTreeViewFirstLevel" cpt
loadedTreeViewFirstLevelCpt :: R.Component TreeViewProps
loadedTreeViewFirstLevelCpt = R.hooksComponentWithModule thisModule "loadedTreeViewFirstLevel" cpt
where
cpt { appReload
cpt { appReload
, asyncTasks
, asyncTasks
, currentRoute
, currentRoute
...
@@ -153,7 +153,7 @@ loadedTreeViewFirstLevel = R.createElement elCpt
...
@@ -153,7 +153,7 @@ loadedTreeViewFirstLevel = R.createElement elCpt
} _ = do
} _ = do
pure $ H.ul { className: "tree " <> if handed == GT.RightHanded then "mr-auto" else "ml-auto" } [
pure $ H.ul { className: "tree " <> if handed == GT.RightHanded then "mr-auto" else "ml-auto" } [
H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [
H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [
toHtmlFirstLevel { appReload
toHtmlFirstLevel
(ToHtmlProps
{ appReload
, asyncTasks
, asyncTasks
, currentRoute
, currentRoute
, frontends
, frontends
...
@@ -161,31 +161,40 @@ loadedTreeViewFirstLevel = R.createElement elCpt
...
@@ -161,31 +161,40 @@ loadedTreeViewFirstLevel = R.createElement elCpt
, openNodes
, openNodes
, reload
, reload
, reloadTree: reload
, reloadTree: reload
, render: toHtmlFirstLevel
, session
, session
-- , tasks
-- , tasks
, tree
, tree
}
[]
})
[]
]
]
]
]
------------------------------------------------------------------------
------------------------------------------------------------------------
type ToHtmlProps = (
newtype ToHtmlProps = ToHtmlProps {
asyncTasks :: GAT.Reductor
asyncTasks :: GAT.Reductor
, reloadTree :: GUR.ReloadS
, reloadTree :: GUR.ReloadS
, render :: ToHtmlProps -> Array R.Element -> R.Element
-- , tasks :: Record Tasks
-- , tasks :: Record Tasks
, tree :: FTree
, tree :: FTree
| CommonProps
-- | CommonProps
)
, appReload :: GUR.ReloadS
, currentRoute :: AppRoute
, frontends :: Frontends
, handed :: GT.Handed
, openNodes :: R.State OpenNodes
, reload :: GUR.ReloadS
, session :: Session
}
toHtmlFirstLevel :: R2.Component ToHtmlProps
toHtmlFirstLevel :: ToHtmlProps -> Array R.Element -> R.Element
toHtmlFirstLevel = R.createElement elCpt
toHtmlFirstLevel = R2.ntCreateElement toHtmlFirstLevelCpt
where
elCpt :: R.Component ToHtmlProps
elCpt = R.hooksComponentWithModule thisModule "toHtmlFirstLevel" cpt
cpt p@{ appReload
toHtmlFirstLevelCpt :: R2.NTComponent ToHtmlProps
toHtmlFirstLevelCpt = R2.ntHooksComponentWithModule thisModule "toHtmlFirstLevel" cpt
where
cpt (ToHtmlProps p@{ appReload
, asyncTasks
, asyncTasks
, currentRoute
, currentRoute
, frontends
, frontends
...
@@ -193,6 +202,7 @@ toHtmlFirstLevel = R.createElement elCpt
...
@@ -193,6 +202,7 @@ toHtmlFirstLevel = R.createElement elCpt
, openNodes
, openNodes
, reload
, reload
, reloadTree
, reloadTree
, render
, session
, session
, tree: tree@(NTree (LNode { id
, tree: tree@(NTree (LNode { id
, name
, name
...
@@ -200,7 +210,7 @@ toHtmlFirstLevel = R.createElement elCpt
...
@@ -200,7 +210,7 @@ toHtmlFirstLevel = R.createElement elCpt
}
}
) ary
) ary
)
)
}
_ = do
})
_ = do
setPopoverRef <- R.useRef Nothing
setPopoverRef <- R.useRef Nothing
let pAction a = performAction a (RecordE.pick (Record.merge p { setPopoverRef }) :: Record PerformActionProps)
let pAction a = performAction a (RecordE.pick (Record.merge p { setPopoverRef }) :: Record PerformActionProps)
...
@@ -250,6 +260,7 @@ toHtmlFirstLevel = R.createElement elCpt
...
@@ -250,6 +260,7 @@ toHtmlFirstLevel = R.createElement elCpt
, handed
, handed
, id: cId
, id: cId
, reloadTree
, reloadTree
, render
}
}
) []
) []
) $ sorted publicizedChildren
) $ sorted publicizedChildren
...
@@ -264,15 +275,19 @@ type ChildNodeFirstLevelProps = (
...
@@ -264,15 +275,19 @@ type ChildNodeFirstLevelProps = (
, folderOpen :: R.State Boolean
, folderOpen :: R.State Boolean
, id :: ID
, id :: ID
, reloadTree :: GUR.ReloadS
, reloadTree :: GUR.ReloadS
, render :: ToHtmlProps -> Array R.Element -> R.Element
| CommonProps
| CommonProps
)
)
childNodeFirstLevel :: R2.Component ChildNodeFirstLevelProps
childNodeFirstLevel :: R2.Component ChildNodeFirstLevelProps
childNodeFirstLevel = R.createElement elCpt
childNodeFirstLevel = R.createElement childNodeFirstLevelCpt
where
elCpt :: R.Component ChildNodeFirstLevelProps
elCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevel" cpt
-- TODO This shouldn't be here: make it a top-level function but be careful
-- about cyclic defines
-- https://discourse.purescript.org/t/strange-compiler-error-with-an-undefined-reference/2060/3
childNodeFirstLevelCpt :: R.Component ChildNodeFirstLevelProps
childNodeFirstLevelCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevel" cpt
where
cpt props@{ appReload
cpt props@{ appReload
, asyncTasks
, asyncTasks
, currentRoute
, currentRoute
...
@@ -283,6 +298,7 @@ childNodeFirstLevel = R.createElement elCpt
...
@@ -283,6 +298,7 @@ childNodeFirstLevel = R.createElement elCpt
, openNodes
, openNodes
, reload
, reload
, reloadTree
, reloadTree
, render
, session } _ = do
, session } _ = do
cptReload <- GUR.new
cptReload <- GUR.new
...
@@ -296,6 +312,7 @@ childNodeFirstLevel = R.createElement elCpt
...
@@ -296,6 +312,7 @@ childNodeFirstLevel = R.createElement elCpt
, openNodes
, openNodes
, reload: cptReload
, reload: cptReload
, reloadTree
, reloadTree
, render
, session
, session
, tree: loaded } []
, tree: loaded } []
...
@@ -308,28 +325,33 @@ type ChildNodeFirstLevelPaintProps = (
...
@@ -308,28 +325,33 @@ type ChildNodeFirstLevelPaintProps = (
asyncTasks :: GAT.Reductor
asyncTasks :: GAT.Reductor
, folderOpen :: R.State Boolean
, folderOpen :: R.State Boolean
, reloadTree :: GUR.ReloadS
, reloadTree :: GUR.ReloadS
, render :: ToHtmlProps -> Array R.Element -> R.Element
, tree :: FTree
, tree :: FTree
| CommonProps
| CommonProps
)
)
childNodeFirstLevelPaint :: R2.Component ChildNodeFirstLevelPaintProps
childNodeFirstLevelPaint :: R2.Component ChildNodeFirstLevelPaintProps
childNodeFirstLevelPaint = R.createElement elCpt
childNodeFirstLevelPaint = R.createElement childNodeFirstLevelPaintCpt
-- TODO This shouldn't be here: make it a top-level function but be careful
-- about cyclic defines
-- https://discourse.purescript.org/t/strange-compiler-error-with-an-undefined-reference/2060/3
childNodeFirstLevelPaintCpt :: R.Component ChildNodeFirstLevelPaintProps
childNodeFirstLevelPaintCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevelPaint" cpt
-- TODO folderOpen is unused
where
where
elCpt :: R.Component ChildNodeFirstLevelPaintProps
elCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevelPaint" cpt
-- TODO folderOpen is unused
cpt props@{ asyncTasks
cpt props@{ asyncTasks
, handed
, handed
, reload
, reload
, reloadTree
, reloadTree
, render
, tree: ctree@(NTree (LNode { id }) _) } _ = do
, tree: ctree@(NTree (LNode { id }) _) } _ = do
pure $ H.ul {} [
pure $ H.ul {} [
toHtmlFirstLevel
(Record.merge commonProps { asyncTasks
render (ToHtmlProps
(Record.merge commonProps { asyncTasks
, handed
, handed
, reloadTree
, reloadTree
, tree: ctree }
, render
, tree: ctree })
) []
) []
]
]
-- pure $ H.div { } [ H.text $ "[closed] Node id " <> show id ]
-- pure $ H.div { } [ H.text $ "[closed] Node id " <> show id ]
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
b142da83
...
@@ -60,19 +60,19 @@ type IsLeaf = Boolean
...
@@ -60,19 +60,19 @@ type IsLeaf = Boolean
nodeSpan :: R2.Component NodeMainSpanProps
nodeSpan :: R2.Component NodeMainSpanProps
nodeSpan = R.createElement nodeSpanCpt
nodeSpan = R.createElement nodeSpanCpt
where
nodeSpanCpt :: R.Component NodeMainSpanProps
nodeSpanCpt = R.hooksComponentWithModule thisModule "nodeSpan" cpt
nodeSpanCpt :: R.Component NodeMainSpanProps
nodeSpanCpt = R.hooksComponentWithModule thisModule "nodeSpan" cpt
where
cpt props children = do
cpt props children = do
pure $ H.div {} ([ nodeMainSpan props [] ] <> children)
pure $ H.div {} ([ nodeMainSpan props [] ] <> children)
nodeMainSpan :: R2.Component NodeMainSpanProps
nodeMainSpan :: R2.Component NodeMainSpanProps
nodeMainSpan = R.createElement nodeMainSpanCpt
nodeMainSpan = R.createElement nodeMainSpanCpt
where
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
where
cpt props@{ appReload
cpt props@{ appReload
, asyncTasks: (asyncTasks /\ dispatchAsyncTasks)
, asyncTasks: (asyncTasks /\ dispatchAsyncTasks)
, currentRoute
, currentRoute
...
@@ -249,10 +249,10 @@ type NodeActionsProps =
...
@@ -249,10 +249,10 @@ type NodeActionsProps =
nodeActions :: Record NodeActionsProps -> R.Element
nodeActions :: Record NodeActionsProps -> R.Element
nodeActions p = R.createElement nodeActionsCpt p []
nodeActions p = R.createElement nodeActionsCpt p []
where
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
where
cpt { id
cpt { id
, nodeType: GT.Graph
, nodeType: GT.Graph
, session
, session
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
b142da83
...
@@ -86,7 +86,6 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
...
@@ -86,7 +86,6 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
onEnter: \_ -> launchAff_ $ dispatch (AddNode name' nt')
onEnter: \_ -> launchAff_ $ dispatch (AddNode name' nt')
, onValueChanged: \val -> setNodeName $ const val
, onValueChanged: \val -> setNodeName $ const val
, autoFocus: true
, autoFocus: true
, autoSave: false
, className: "form-control"
, className: "form-control"
, defaultValue: name'
, defaultValue: name'
, placeholder: name'
, placeholder: name'
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs
View file @
b142da83
...
@@ -55,8 +55,8 @@ linkNodeType (Just GT.Annuaire) = GT.Corpus
...
@@ -55,8 +55,8 @@ linkNodeType (Just GT.Annuaire) = GT.Corpus
linkNodeType _ = GT.Error
linkNodeType _ = GT.Error
linkNode :: R
ecord SubTreeParamsIn -> R.Element
linkNode :: R
2.Component SubTreeParamsIn
linkNode
p = R.createElement linkNodeCpt p []
linkNode
= R.createElement linkNodeCpt
linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt = R.hooksComponentWithModule thisModule "linkNode" cpt
linkNodeCpt = R.hooksComponentWithModule thisModule "linkNode" cpt
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
View file @
b142da83
...
@@ -22,12 +22,12 @@ mergeNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
...
@@ -22,12 +22,12 @@ mergeNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
mergeNodeReq session fromId toId =
mergeNodeReq session fromId toId =
put_ session $ NodeAPI GT.Node (Just fromId) ("merge/" <> show toId)
put_ session $ NodeAPI GT.Node (Just fromId) ("merge/" <> show toId)
mergeNode :: Record SubTreeParamsIn -> R.Element
mergeNode :: R2.Component SubTreeParamsIn
mergeNode p = R.createElement mergeNodeCpt p []
mergeNode = R.createElement mergeNodeCpt
where
mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt = R.hooksComponentWithModule thisModule "mergeNode" cpt
mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt = R.hooksComponentWithModule thisModule "mergeNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing})
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing})
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
View file @
b142da83
...
@@ -14,6 +14,7 @@ import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTre
...
@@ -14,6 +14,7 @@ import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTre
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, put_)
import Gargantext.Sessions (Session, put_)
import Gargantext.Types as GT
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Move"
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Move"
...
@@ -22,12 +23,12 @@ moveNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
...
@@ -22,12 +23,12 @@ moveNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
moveNodeReq session fromId toId =
moveNodeReq session fromId toId =
put_ session $ NodeAPI GT.Node (Just fromId) ("move/" <> show toId)
put_ session $ NodeAPI GT.Node (Just fromId) ("move/" <> show toId)
moveNode :: Record SubTreeParamsIn -> R.Element
moveNode :: R2.Component SubTreeParamsIn
moveNode p = R.createElement moveNodeCpt p []
moveNode = R.createElement moveNodeCpt
where
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponentWithModule thisModule "moveNode" cpt
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponentWithModule thisModule "moveNode" cpt
where
cpt { dispatch, handed, id, nodeType, session, subTreeParams } _ = do
cpt { dispatch, handed, id, nodeType, session, subTreeParams } _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/Frame.purs
View file @
b142da83
...
@@ -41,10 +41,10 @@ type SearchIFramesProps = (
...
@@ -41,10 +41,10 @@ type SearchIFramesProps = (
searchIframes :: Record SearchIFramesProps -> R.Element
searchIframes :: Record SearchIFramesProps -> R.Element
searchIframes props = R.createElement searchIframesCpt props []
searchIframes props = R.createElement searchIframesCpt props []
where
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = R.hooksComponentWithModule thisModule "searchIframes" cpt
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = R.hooksComponentWithModule thisModule "searchIframes" cpt
where
cpt { iframeRef, search: search@(search' /\ _) } _ = do
cpt { iframeRef, search: search@(search' /\ _) } _ = do
pure $ if isIsTex_Advanced search'.datafield
pure $ if isIsTex_Advanced search'.datafield
then divIframe { frameSource: Istex, iframeRef, search }
then divIframe { frameSource: Istex, iframeRef, search }
...
@@ -62,10 +62,10 @@ type IFrameProps = (
...
@@ -62,10 +62,10 @@ type IFrameProps = (
divIframe :: Record IFrameProps -> R.Element
divIframe :: Record IFrameProps -> R.Element
divIframe props = R.createElement divIframeCpt props []
divIframe props = R.createElement divIframeCpt props []
where
divIframeCpt :: R.Component IFrameProps
divIframeCpt = R.hooksComponentWithModule thisModule "divIframe" cpt
divIframeCpt :: R.Component IFrameProps
divIframeCpt = R.hooksComponentWithModule thisModule "divIframe" cpt
where
cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do
cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do
pure $ H.div { className: "frame-search card" }
pure $ H.div { className: "frame-search card" }
[ iframeWith { frameSource, iframeRef, search } ]
[ iframeWith { frameSource, iframeRef, search } ]
...
@@ -77,10 +77,10 @@ frameUrl Searx = "https://searx.frame.gargantext.org" -- 192.168.1.4:8080"
...
@@ -77,10 +77,10 @@ frameUrl Searx = "https://searx.frame.gargantext.org" -- 192.168.1.4:8080"
iframeWith :: Record IFrameProps -> R.Element
iframeWith :: Record IFrameProps -> R.Element
iframeWith props = R.createElement iframeWithCpt props []
iframeWith props = R.createElement iframeWithCpt props []
where
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = R.hooksComponentWithModule thisModule "iframeWith" cpt
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = R.hooksComponentWithModule thisModule "iframeWith" cpt
where
cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ =
cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ =
pure $ H.iframe { src: src frameSource search.term
pure $ H.iframe { src: src frameSource search.term
, width: "100%"
, width: "100%"
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchBar.purs
View file @
b142da83
...
@@ -26,10 +26,10 @@ type Props = ( langs :: Array Lang
...
@@ -26,10 +26,10 @@ type Props = ( langs :: Array Lang
searchBar :: Record Props -> R.Element
searchBar :: Record Props -> R.Element
searchBar props = R.createElement searchBarCpt props []
searchBar props = R.createElement searchBarCpt props []
where
searchBarCpt :: R.Component Props
searchBarCpt = R.hooksComponentWithModule thisModule "searchBar" cpt
searchBarCpt :: R.Component Props
searchBarCpt = R.hooksComponentWithModule thisModule "searchBar" cpt
where
cpt {langs, onSearch, search: search@(s /\ _), session} _ = do
cpt {langs, onSearch, search: search@(s /\ _), session} _ = do
--onSearchChange session s
--onSearchChange session s
pure $ H.div { className: "search-bar" }
pure $ H.div { className: "search-bar" }
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
b142da83
...
@@ -266,10 +266,10 @@ type DatabaseInputProps = (
...
@@ -266,10 +266,10 @@ type DatabaseInputProps = (
databaseInput :: R2.Component DatabaseInputProps
databaseInput :: R2.Component DatabaseInputProps
databaseInput = R.createElement databaseInputCpt
databaseInput = R.createElement databaseInputCpt
where
databaseInputCpt :: R.Component DatabaseInputProps
databaseInputCpt = R.hooksComponentWithModule thisModule "databaseInput" cpt
databaseInputCpt :: R.Component DatabaseInputProps
databaseInputCpt = R.hooksComponentWithModule thisModule "databaseInput" cpt
where
cpt { databases
cpt { databases
, search: (search /\ setSearch) } _ = do
, search: (search /\ setSearch) } _ = do
pure $
pure $
...
@@ -338,10 +338,10 @@ type SearchInputProps =
...
@@ -338,10 +338,10 @@ type SearchInputProps =
searchInput :: Record SearchInputProps -> R.Element
searchInput :: Record SearchInputProps -> R.Element
searchInput p = R.createElement searchInputCpt p []
searchInput p = R.createElement searchInputCpt p []
where
searchInputCpt :: R.Component SearchInputProps
searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
searchInputCpt :: R.Component SearchInputProps
searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
where
cpt {search: (search@{ term } /\ setSearch)} _ = do
cpt {search: (search@{ term } /\ setSearch)} _ = do
valueRef <- R.useRef term
valueRef <- R.useRef term
...
@@ -349,7 +349,6 @@ searchInput p = R.createElement searchInputCpt p []
...
@@ -349,7 +349,6 @@ searchInput p = R.createElement searchInputCpt p []
inputWithEnter { onEnter: onEnter valueRef setSearch
inputWithEnter { onEnter: onEnter valueRef setSearch
, onValueChanged: onValueChanged valueRef
, onValueChanged: onValueChanged valueRef
, autoFocus: false
, autoFocus: false
, autoSave: true
, className: "form-control"
, className: "form-control"
, defaultValue: R.readRef valueRef
, defaultValue: R.readRef valueRef
, placeholder: "Your query here"
, placeholder: "Your query here"
...
@@ -380,10 +379,10 @@ type SubmitButtonProps =
...
@@ -380,10 +379,10 @@ type SubmitButtonProps =
submitButton :: Record SubmitButtonProps -> R.Element
submitButton :: Record SubmitButtonProps -> R.Element
submitButton p = R.createElement submitButtonComponent p []
submitButton p = R.createElement submitButtonComponent p []
where
submitButtonComponent :: R.Component SubmitButtonProps
submitButtonComponent = R.hooksComponentWithModule thisModule "submitButton" cpt
submitButtonComponent :: R.Component SubmitButtonProps
submitButtonComponent = R.hooksComponentWithModule thisModule "submitButton" cpt
where
cpt {onSearch, search: (mySearch /\ _), session} _ =
cpt {onSearch, search: (mySearch /\ _), session} _ =
pure $
pure $
H.button { className: "btn btn-primary"
H.button { className: "btn btn-primary"
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
View file @
b142da83
...
@@ -57,10 +57,10 @@ instance encodeJsonShareNodeParams :: Argonaut.EncodeJson ShareNodeParams where
...
@@ -57,10 +57,10 @@ instance encodeJsonShareNodeParams :: Argonaut.EncodeJson ShareNodeParams where
------------------------------------------------------------------------
------------------------------------------------------------------------
shareNode :: Record SubTreeParamsIn -> R.Element
shareNode :: Record SubTreeParamsIn -> R.Element
shareNode p = R.createElement shareNodeCpt p []
shareNode p = R.createElement shareNodeCpt p []
where
shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R.hooksComponentWithModule thisModule "shareNode" cpt
shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R.hooksComponentWithModule thisModule "shareNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing})
action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing})
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
b142da83
...
@@ -71,10 +71,10 @@ type UploadFile =
...
@@ -71,10 +71,10 @@ type UploadFile =
uploadFileView :: Record Props -> R.Element
uploadFileView :: Record Props -> R.Element
uploadFileView props = R.createElement uploadFileViewCpt props []
uploadFileView props = R.createElement uploadFileViewCpt props []
where
uploadFileViewCpt :: R.Component Props
uploadFileViewCpt = R.hooksComponentWithModule thisModule "uploadFileView" cpt
uploadFileViewCpt :: R.Component Props
uploadFileViewCpt = R.hooksComponentWithModule thisModule "uploadFileView" cpt
where
cpt {dispatch, id, nodeType} _ = do
cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
fileType@(_ /\ setFileType) <- R.useState' CSV
fileType@(_ /\ setFileType) <- R.useState' CSV
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
b142da83
...
@@ -48,10 +48,10 @@ type CommonProps =
...
@@ -48,10 +48,10 @@ type CommonProps =
nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView p = R.createElement nodePopupCpt p []
nodePopupView p = R.createElement nodePopupCpt p []
where
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R.hooksComponentWithModule thisModule "nodePopupView" cpt
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R.hooksComponentWithModule thisModule "nodePopupView" cpt
where
cpt p _ = do
cpt p _ = do
renameIsOpen <- R.useState' false
renameIsOpen <- R.useState' false
...
@@ -254,10 +254,10 @@ type PanelActionProps =
...
@@ -254,10 +254,10 @@ type PanelActionProps =
panelAction :: Record PanelActionProps -> R.Element
panelAction :: Record PanelActionProps -> R.Element
panelAction p = R.createElement panelActionCpt p []
panelAction p = R.createElement panelActionCpt p []
where
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R.hooksComponentWithModule thisModule "panelAction" cpt
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R.hooksComponentWithModule thisModule "panelAction" cpt
where
cpt {action: Documentation nodeType} _ = actionDoc nodeType
cpt {action: Documentation nodeType} _ = actionDoc nodeType
cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session
cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session
cpt {action: Upload, dispatch, id, nodeType, session} _ = actionUpload nodeType id session dispatch
cpt {action: Upload, dispatch, id, nodeType, session} _ = actionUpload nodeType id session dispatch
...
@@ -274,13 +274,13 @@ panelAction p = R.createElement panelActionCpt p []
...
@@ -274,13 +274,13 @@ panelAction p = R.createElement panelActionCpt p []
-----------
-----------
-- Functions using SubTree
-- Functions using SubTree
cpt {action: Merge {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
cpt {action: Merge {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
pure $ mergeNode {dispatch, id, nodeType, session, subTreeParams, handed}
pure $ mergeNode {dispatch, id, nodeType, session, subTreeParams, handed}
[]
cpt {action: Move {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
cpt {action: Move {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
pure $ moveNode {dispatch, id, nodeType, session, subTreeParams, handed}
pure $ moveNode {dispatch, id, nodeType, session, subTreeParams, handed}
[]
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
cpt {action: Link {subTreeParams}, dispatch, id, nodeType, session, handed} _ = do
pure $ linkNode {dispatch, id, nodeType, session, subTreeParams, handed}
pure $ linkNode {dispatch, id, nodeType, session, subTreeParams, handed}
[]
-----------
-----------
cpt {action : Share, dispatch, id, name } _ = do
cpt {action : Share, dispatch, id, name } _ = do
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
b142da83
...
@@ -130,7 +130,7 @@ settingsBox Team =
...
@@ -130,7 +130,7 @@ settingsBox Team =
, Annuaire
, Annuaire
, NodeFrameWrite
, NodeFrameWrite
, NodeFrameCalc
, NodeFrameCalc
, NodeFrameNotebook
--
, NodeFrameNotebook
, Team
, Team
, FolderShared
, FolderShared
]
]
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
b142da83
...
@@ -65,12 +65,12 @@ type TextInputBoxProps =
...
@@ -65,12 +65,12 @@ type TextInputBoxProps =
)
)
textInputBox :: R2.Component TextInputBoxProps
textInputBox :: R2.Component TextInputBoxProps
textInputBox props@{ boxName } = R.createElement el props
textInputBox = R.createElement textInputBoxCpt
where
el :: R.Component TextInputBoxProps
el = R.hooksComponentWithModule thisModule (boxName <> "Box") cpt
cpt p@{ boxAction, dispatch, id, isOpen: (true /\ setIsOpen), text } _ = do
textInputBoxCpt :: R.Component TextInputBoxProps
textInputBoxCpt = R.hooksComponentWithModule thisModule "textInputBox" cpt
where
cpt p@{ boxAction, boxName, dispatch, id, isOpen: (true /\ setIsOpen), text } _ = do
renameNodeNameRef <- R.useRef text
renameNodeNameRef <- R.useRef text
pure $ H.div { className: "from-group row" }
pure $ H.div { className: "from-group row" }
...
@@ -85,7 +85,6 @@ textInputBox props@{ boxName } = R.createElement el props
...
@@ -85,7 +85,6 @@ textInputBox props@{ boxName } = R.createElement el props
onEnter: submit renameNodeNameRef
onEnter: submit renameNodeNameRef
, onValueChanged: R.setRef renameNodeNameRef
, onValueChanged: R.setRef renameNodeNameRef
, autoFocus: true
, autoFocus: true
, autoSave: false
, className: "form-control"
, className: "form-control"
, defaultValue: text
, defaultValue: text
, placeholder: (boxName <> " Node")
, placeholder: (boxName <> " Node")
...
@@ -105,8 +104,8 @@ textInputBox props@{ boxName } = R.createElement el props
...
@@ -105,8 +104,8 @@ textInputBox props@{ boxName } = R.createElement el props
, title: "Cancel"
, title: "Cancel"
} []
} []
submit renameNodeNameRef _ = do
submit renameNodeNameRef _ = do
setIsOpen $ const false
launchAff_ $ dispatch ( boxAction $ R.readRef renameNodeNameRef )
launchAff_ $ dispatch ( boxAction $ R.readRef renameNodeNameRef )
setIsOpen $ const false
cpt { isOpen: (false /\ _) } _ = pure $ H.div {} []
cpt { isOpen: (false /\ _) } _ = pure $ H.div {} []
-- | END Rename Box
-- | END Rename Box
...
@@ -292,10 +291,10 @@ type NodeLinkProps = (
...
@@ -292,10 +291,10 @@ type NodeLinkProps = (
nodeLink :: R2.Component NodeLinkProps
nodeLink :: R2.Component NodeLinkProps
nodeLink = R.createElement nodeLinkCpt
nodeLink = R.createElement nodeLinkCpt
where
nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
where
cpt { folderOpen: (_ /\ setFolderOpen)
cpt { folderOpen: (_ /\ setFolderOpen)
, frontends
, frontends
, handed
, handed
...
@@ -348,10 +347,10 @@ type NodeTextProps =
...
@@ -348,10 +347,10 @@ type NodeTextProps =
nodeText :: Record NodeTextProps -> R.Element
nodeText :: Record NodeTextProps -> R.Element
nodeText p = R.createElement nodeTextCpt p []
nodeText p = R.createElement nodeTextCpt p []
where
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponentWithModule thisModule "nodeText" cpt
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponentWithModule thisModule "nodeText" cpt
where
cpt { isSelected: true, name } _ = do
cpt { isSelected: true, name } _ = do
pure $ H.u {} [
pure $ H.u {} [
H.b {} [
H.b {} [
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
View file @
b142da83
...
@@ -36,10 +36,10 @@ type SubTreeParamsProps =
...
@@ -36,10 +36,10 @@ type SubTreeParamsProps =
subTreeView :: Record SubTreeParamsProps -> R.Element
subTreeView :: Record SubTreeParamsProps -> R.Element
subTreeView props = R.createElement subTreeViewCpt props []
subTreeView props = R.createElement subTreeViewCpt props []
where
subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeView" cpt
subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeView" cpt
where
cpt params@{ action
cpt params@{ action
, dispatch
, dispatch
, handed
, handed
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools/Sync.purs
View file @
b142da83
...
@@ -110,7 +110,7 @@ nodeListUpdateButtonCpt = R.hooksComponentWithModule thisModule "nodeListUpdateB
...
@@ -110,7 +110,7 @@ nodeListUpdateButtonCpt = R.hooksComponentWithModule thisModule "nodeListUpdateB
cpt { listId, nodeId, nodeType, session, triggerRefresh } _ = do
cpt { listId, nodeId, nodeType, session, triggerRefresh } _ = do
enabled <- R.useState' true
enabled <- R.useState' true
pure $ H.div { className: "update-button "
pure $ H.div {
} [] {- {
className: "update-button "
<> if (fst enabled) then "enabled" else "disabled text-muted"
<> if (fst enabled) then "enabled" else "disabled text-muted"
} [ H.span { className: "fa fa-refresh"
} [ H.span { className: "fa fa-refresh"
, on: { click: onClick enabled } } []
, on: { click: onClick enabled } } []
...
@@ -124,3 +124,4 @@ nodeListUpdateButtonCpt = R.hooksComponentWithModule thisModule "nodeListUpdateB
...
@@ -124,3 +124,4 @@ nodeListUpdateButtonCpt = R.hooksComponentWithModule thisModule "nodeListUpdateB
liftEffect $ setEnabled $ const true
liftEffect $ setEnabled $ const true
triggerRefresh unit
triggerRefresh unit
pure unit
pure unit
-}
src/Gargantext/Components/Graph.purs
View file @
b142da83
...
@@ -225,45 +225,45 @@ type SigmaSettings =
...
@@ -225,45 +225,45 @@ type SigmaSettings =
-- selected nodes <=> special label
-- selected nodes <=> special label
sigmaSettings :: {|SigmaSettings}
sigmaSettings :: {|SigmaSettings}
sigmaSettings =
sigmaSettings =
{ animationsTime: 30000.0
{ animationsTime
: 30000.0
, autoRescale: true
, autoRescale
: true
, autoResize: true
, autoResize
: true
, batchEdgesDrawing: true
, batchEdgesDrawing
: true
, borderSize: 1.0 -- for ex, bigger border when hover
, borderSize
: 1.0 -- for ex, bigger border when hover
, defaultEdgeHoverColor: "#f00"
, defaultEdgeHoverColor
: "#f00"
, defaultEdgeType: "curve" -- 'curve' or 'line' (curve iff ourRendering)
, defaultEdgeType
: "curve" -- 'curve' or 'line' (curve iff ourRendering)
, defaultHoverLabelBGColor: "#fff"
, defaultHoverLabelBGColor
: "#fff"
, defaultHoverLabelColor: "#000"
, defaultHoverLabelColor
: "#000"
, defaultLabelColor: "#000" -- labels text color
, defaultLabelColor
: "#000" -- labels text color
, defaultLabelSize: 15.0 -- (old tina: showLabelsIfZoom)
, defaultLabelSize
: 15.0 -- (old tina: showLabelsIfZoom)
, defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default'
, defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default'
, defaultNodeColor: "#FFF"
, defaultNodeColor
: "#FFF"
, doubleClickEnabled: false -- indicates whether or not the graph can be zoomed on double-click
, doubleClickEnabled
: false -- indicates whether or not the graph can be zoomed on double-click
, drawEdgeLabels: true
, drawEdgeLabels
: true
, drawEdges: true
, drawEdges
: true
, drawLabels: true
, drawLabels
: true
, drawNodes: true
, drawNodes
: true
, enableEdgeHovering: false
, enableEdgeHovering
: false
, edgeHoverExtremities: true
, edgeHoverExtremities
: true
, edgeHoverColor: "edge"
, edgeHoverColor
: "edge"
, edgeHoverPrecision: 2.0
, edgeHoverPrecision
: 2.0
, edgeHoverSizeRatio: 2.0
, edgeHoverSizeRatio
: 2.0
, enableHovering: true
, enableHovering
: true
, font
: "arial" -- font params
, font
: "arial"
, fontStyle
: "bold
"
, fontStyle
: "
"
, hideEdgesOnMove: true
, hideEdgesOnMove
: true
--, labelSize
: "proportional" -- alt : proportional, fixed
, labelSize
: "proportional" -- alt : proportional, fixed
, labelSize
: "fixed"
-- , labelSize
: "fixed"
, labelSizeRatio: 2.0 -- label size in ratio of node size
, labelSizeRatio
: 2.0 -- label size in ratio of node size
, labelThreshold
: 7.0
-- min node cam size to start showing label
, labelThreshold
: 9.0 -- 5.0 for more labels
-- min node cam size to start showing label
, maxEdgeSize: 1.0
, maxEdgeSize
: 1.0
, maxNodeSize
: 8
.0
, maxNodeSize
: 10
.0
, minEdgeSize: 0.5 -- in fact used in tina as edge size
, minEdgeSize
: 0.5 -- in fact used in tina as edge size
, minNodeSize: 1.0
, minNodeSize
: 1.0
, mouseEnabled: true
, mouseEnabled
: true
, mouseSelectorSize: 15.0
, mouseSelectorSize
: 15.0
, mouseZoomDuration: 150.0
, mouseZoomDuration
: 150.0
, nodeBorderColor: "default" -- choices: "default" color vs. "node" color
, nodeBorderColor
: "default" -- choices: "default" color vs. "node" color
--, nodesPowRatio : 10.8
--, nodesPowRatio : 10.8
, rescaleIgnoreSize : false
, rescaleIgnoreSize : false
, singleHover : true
, singleHover : true
...
@@ -276,9 +276,9 @@ sigmaSettings =
...
@@ -276,9 +276,9 @@ sigmaSettings =
, twNodesGreyOpacity : 5.5 -- smaller value: more grey
, twNodesGreyOpacity : 5.5 -- smaller value: more grey
, twSelectedColor : "node" -- "node" for a label bg like the node color, "default" for white background
, twSelectedColor : "node" -- "node" for a label bg like the node color, "default" for white background
, verbose : true
, verbose : true
, zoomMax: 1.7
, zoomMax
: 1.7
, zoomMin: 0.0
, zoomMin
: 0.0
, zoomingRatio
: 1.7
, zoomingRatio
: 1.4
}
}
type ForceAtlas2Settings =
type ForceAtlas2Settings =
...
@@ -306,11 +306,11 @@ forceAtlas2Settings =
...
@@ -306,11 +306,11 @@ forceAtlas2Settings =
, barnesHutOptimize : true
, barnesHutOptimize : true
, edgeWeightInfluence : 1.0
, edgeWeightInfluence : 1.0
-- fixedY : false
-- fixedY : false
, gravity :
1.0
, gravity :
0.01
, iterationsPerRender : 10.0
, iterationsPerRender :
50.0 --
10.0
, linLogMode : false -- false
, linLogMode : false -- false
, outboundAttractionDistribution: false
, outboundAttractionDistribution: false
, scalingRatio : 10.0
, scalingRatio : 10
00
.0
, skipHidden: false
, skipHidden: false
, slowDown : 1.0
, slowDown : 1.0
, startingIterations : 10.0
, startingIterations : 10.0
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
b142da83
...
@@ -54,10 +54,10 @@ type Props =
...
@@ -54,10 +54,10 @@ type Props =
sidebar :: Record Props -> R.Element
sidebar :: Record Props -> R.Element
sidebar props = R.createElement sidebarCpt props []
sidebar props = R.createElement sidebarCpt props []
where
sidebarCpt :: R.Component Props
sidebarCpt = R.hooksComponentWithModule thisModule "sidebar" cpt
sidebarCpt :: R.Component Props
sidebarCpt = R.hooksComponentWithModule thisModule "sidebar" cpt
where
cpt {showSidePanel: (GET.Closed /\ _)} _children = do
cpt {showSidePanel: (GET.Closed /\ _)} _children = do
pure $ RH.div {} []
pure $ RH.div {} []
cpt {showSidePanel: (GET.InitialClosed /\ _)} _children = do
cpt {showSidePanel: (GET.InitialClosed /\ _)} _children = do
...
@@ -70,7 +70,7 @@ sidebar props = R.createElement sidebarCpt props []
...
@@ -70,7 +70,7 @@ sidebar props = R.createElement sidebarCpt props []
sideTabNav :: R.State SidePanelState -> Array SideTab -> R.Element
sideTabNav :: R.State SidePanelState -> Array SideTab -> R.Element
sideTabNav (sidePanel /\ setSidePanel) sideTabs =
sideTabNav (sidePanel /\ setSidePanel) sideTabs =
R.fragment [ H.div { className: "text-primary center"} [H.text "
SideTab
"]
R.fragment [ H.div { className: "text-primary center"} [H.text ""]
, H.div {className: "nav nav-tabs"} (liItem <$> sideTabs)
, H.div {className: "nav nav-tabs"} (liItem <$> sideTabs)
-- , H.div {className: "center"} [ H.text "Doc sideTabs"]
-- , H.div {className: "center"} [ H.text "Doc sideTabs"]
]
]
...
@@ -133,36 +133,46 @@ sideTab _ _ = H.div {} []
...
@@ -133,36 +133,46 @@ sideTab _ _ = H.div {} []
-------------------------------------------
-------------------------------------------
-- TODO
-- TODO
-- selectedNodes :: Record Props -> Map.Map String Nodes -> R.Element
-- selectedNodes :: Record Props -> Map.Map String Nodes -> R.Element
selectedNodes props nodesMap = R2.row [ R2.col 12
selectedNodes props nodesMap =
[ RH.ul { id: "myTab", className: "nav nav-tabs", role: "tablist"}
R2.row [ R2.col 12
[ RH.ul { className: "nav nav-tabs d-flex justify-content-center"
, id: "myTab"
, role: "tablist" }
[ RH.div { className: "tab-content" }
[ RH.div { className: "tab-content" }
[ RH.div { className: "", role: "tabpanel" }
[ RH.div { className: "d-flex flex-wrap justify-content-center"
, role: "tabpanel" }
( Seq.toUnfoldable
( Seq.toUnfoldable
$ ( Seq.map (badge props.selectedNodeIds)
$ ( Seq.map (badge props.selectedNodeIds)
(badges props.graph props.selectedNodeIds)
(badges props.graph props.selectedNodeIds)
)
)
)
)
, H.br {}
]
]
, RH.div { className: "tab-content flex-space-between" }
[ removeButton "Move as candidate" CandidateTerm props nodesMap
, removeButton "Move as stop" StopTerm props nodesMap
]
]
, RH.div { className: "tab-content flex-space-between" }
[ removeButton "primary" "Move as candidate" CandidateTerm props nodesMap
, H.br {}
, removeButton "danger" "Move as stop" StopTerm props nodesMap
]
]
]
]
]
]
neighborhood props = RH.div { className: "tab-content", id: "myTabContent" }
neighborhood props = RH.div { className: "tab-content", id: "myTabContent" }
[ RH.div { className: "", id: "home", role: "tabpanel" }
[ RH.div { -- className: "flex-space-around d-flex justify-content-center"
className: "d-flex flex-wrap flex-space-around"
, id: "home"
, role: "tabpanel"
}
(Seq.toUnfoldable $ Seq.map (badge props.selectedNodeIds)
(Seq.toUnfoldable $ Seq.map (badge props.selectedNodeIds)
$ neighbourBadges props.graph props.selectedNodeIds
$ neighbourBadges props.graph props.selectedNodeIds
)
)
]
]
removeButton text rType props' nodesMap' =
removeButton
btnType
text rType props' nodesMap' =
if Set.isEmpty $ fst props'.selectedNodeIds then
if Set.isEmpty $ fst props'.selectedNodeIds then
RH.div {} []
RH.div {} []
else
else
RH.button { className: "btn btn-
info"
RH.button { className: "btn btn-
sm btn-" <> btnType
, on: { click: onClickRemove rType props' nodesMap' }
, on: { click: onClickRemove rType props' nodesMap' }
}
}
[ RH.text text ]
[ RH.text text ]
...
@@ -183,9 +193,9 @@ onClickRemove rType props' nodesMap' e = do
...
@@ -183,9 +193,9 @@ onClickRemove rType props' nodesMap' e = do
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge (_ /\ setNodeIds) {id, label} =
badge (_ /\ setNodeIds) {id, label} =
RH.a { className: "badge badge-light"
RH.a { className: "badge badge-
pill badge-
light"
, on: { click: onClick }
, on: { click: onClick }
} [ RH.
text label
]
} [ RH.
h6 {} [ RH.text label ]
]
where
where
onClick e = do
onClick e = do
setNodeIds $ const $ Set.singleton id
setNodeIds $ const $ Set.singleton id
...
@@ -332,6 +342,3 @@ Global/local view:
...
@@ -332,6 +342,3 @@ Global/local view:
To explore the neighborhood of a selection click on the 'change level' button.
To explore the neighborhood of a selection click on the 'change level' button.
-}
-}
src/Gargantext/Components/GraphExplorer/SlideButton.purs
View file @
b142da83
...
@@ -51,7 +51,7 @@ labelSizeButton sigmaRef state =
...
@@ -51,7 +51,7 @@ labelSizeButton sigmaRef state =
sizeButton {
sizeButton {
state
state
, caption: "Label Size"
, caption: "Label Size"
, min:
5
.0
, min:
1
.0
, max: 30.0
, max: 30.0
, onChange: \e -> do
, onChange: \e -> do
let sigma = R.readRef sigmaRef
let sigma = R.readRef sigmaRef
...
@@ -61,7 +61,8 @@ labelSizeButton sigmaRef state =
...
@@ -61,7 +61,8 @@ labelSizeButton sigmaRef state =
Sigma.setSettings s {
Sigma.setSettings s {
defaultLabelSize: newValue
defaultLabelSize: newValue
, drawLabels: true
, drawLabels: true
, labelSizeRatio: newValue / 2.5
, maxNodeSize: newValue / 2.5
--, labelSizeRatio: newValue / 2.5
}
}
setValue $ const newValue
setValue $ const newValue
}
}
...
...
src/Gargantext/Components/InputWithEnter.purs
View file @
b142da83
module Gargantext.Components.InputWithEnter where
module Gargantext.Components.InputWithEnter where
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect (Effect)
import Effect (Effect)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
...
@@ -9,6 +7,7 @@ import Reactix.DOM.HTML as H
...
@@ -9,6 +7,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 :: String
thisModule = "Gargantext.Components.InputWithEnter"
thisModule = "Gargantext.Components.InputWithEnter"
type Props a = (
type Props a = (
...
@@ -16,7 +15,6 @@ type Props a = (
...
@@ -16,7 +15,6 @@ type Props a = (
, onValueChanged :: String -> Effect Unit
, onValueChanged :: String -> Effect Unit
, autoFocus :: Boolean
, autoFocus :: Boolean
, autoSave :: Boolean
, className :: String
, className :: String
, defaultValue :: String
, defaultValue :: String
, placeholder :: String
, placeholder :: String
...
@@ -25,14 +23,13 @@ type Props a = (
...
@@ -25,14 +23,13 @@ type Props a = (
inputWithEnter :: forall a. Record (Props a) -> R.Element
inputWithEnter :: forall a. Record (Props a) -> R.Element
inputWithEnter props = R.createElement inputWithEnterCpt props []
inputWithEnter props = R.createElement inputWithEnterCpt props []
where
inputWithEnterCpt :: forall a. R.Component (Props a)
inputWithEnterCpt = R.hooksComponentWithModule thisModule "inputWithEnter" cpt
inputWithEnterCpt :: forall a. R.Component (Props a)
inputWithEnterCpt = R.hooksComponentWithModule thisModule "inputWithEnter" cpt
where
cpt props@{ onEnter, onValueChanged
cpt props@{ onEnter, onValueChanged
, autoFocus, autoSave, className, defaultValue, placeholder } _ = do
, autoFocus, className, defaultValue, placeholder } _ = do
pure $ H.input { on: { blur: \_ -> if autoSave then onEnter unit else pure unit
pure $ H.input { on: { input: onInput
, input: onInput
, keyPress: onKeyPress }
, keyPress: onKeyPress }
, autoFocus
, autoFocus
, className
, className
...
@@ -41,8 +38,7 @@ inputWithEnter props = R.createElement inputWithEnterCpt props []
...
@@ -41,8 +38,7 @@ inputWithEnter props = R.createElement inputWithEnterCpt props []
, type: props.type }
, type: props.type }
where
where
onInput e = do
onInput e = onValueChanged $ R.unsafeEventValue e
onValueChanged $ R.unsafeEventValue e
onKeyPress e = do
onKeyPress e = do
char <- R2.keyCode e
char <- R2.keyCode e
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
b142da83
...
@@ -274,10 +274,9 @@ type Props = (
...
@@ -274,10 +274,9 @@ type Props = (
loadedNgramsTable :: R2.Component Props
loadedNgramsTable :: R2.Component Props
loadedNgramsTable = R.createElement loadedNgramsTableCpt
loadedNgramsTable = R.createElement loadedNgramsTableCpt
loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt
where
where
loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt
cpt props@{ afterSync
cpt props@{ afterSync
, appReload
, appReload
, asyncTasksRef
, asyncTasksRef
...
@@ -524,10 +523,9 @@ type MainNgramsTableProps = (
...
@@ -524,10 +523,9 @@ type MainNgramsTableProps = (
mainNgramsTable :: R2.Component MainNgramsTableProps
mainNgramsTable :: R2.Component MainNgramsTableProps
mainNgramsTable = R.createElement mainNgramsTableCpt
mainNgramsTable = R.createElement mainNgramsTableCpt
mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
where
where
mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
cpt props@{ afterSync
cpt props@{ afterSync
, appReload
, appReload
, asyncTasksRef
, asyncTasksRef
...
@@ -631,10 +629,10 @@ type MainNgramsTablePaintProps = (
...
@@ -631,10 +629,10 @@ type MainNgramsTablePaintProps = (
mainNgramsTablePaint :: R2.Component MainNgramsTablePaintProps
mainNgramsTablePaint :: R2.Component MainNgramsTablePaintProps
mainNgramsTablePaint = R.createElement mainNgramsTablePaintCpt
mainNgramsTablePaint = R.createElement mainNgramsTablePaintCpt
where
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt
where
cpt props@{ afterSync
cpt props@{ afterSync
, appReload
, appReload
, asyncTasksRef
, asyncTasksRef
...
@@ -670,10 +668,10 @@ type MainNgramsTablePaintNoCacheProps = (
...
@@ -670,10 +668,10 @@ type MainNgramsTablePaintNoCacheProps = (
mainNgramsTablePaintNoCache :: R2.Component MainNgramsTablePaintNoCacheProps
mainNgramsTablePaintNoCache :: R2.Component MainNgramsTablePaintNoCacheProps
mainNgramsTablePaintNoCache = R.createElement mainNgramsTablePaintNoCacheCpt
mainNgramsTablePaintNoCache = R.createElement mainNgramsTablePaintNoCacheCpt
where
mainNgramsTablePaintNoCacheCpt :: R.Component MainNgramsTablePaintNoCacheProps
mainNgramsTablePaintNoCacheCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaintNoCache" cpt
mainNgramsTablePaintNoCacheCpt :: R.Component MainNgramsTablePaintNoCacheProps
mainNgramsTablePaintNoCacheCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaintNoCache" cpt
where
cpt props@{ afterSync
cpt props@{ afterSync
, appReload
, appReload
, asyncTasksRef
, asyncTasksRef
...
...
src/Gargantext/Components/NgramsTable/Core.purs
View file @
b142da83
...
@@ -1129,10 +1129,10 @@ type SyncResetButtonsProps =
...
@@ -1129,10 +1129,10 @@ type SyncResetButtonsProps =
syncResetButtons :: Record SyncResetButtonsProps -> R.Element
syncResetButtons :: Record SyncResetButtonsProps -> R.Element
syncResetButtons p = R.createElement syncResetButtonsCpt p []
syncResetButtons p = R.createElement syncResetButtonsCpt p []
where
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = R.hooksComponentWithModule thisModule "syncResetButtons" cpt
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = R.hooksComponentWithModule thisModule "syncResetButtons" cpt
where
cpt { afterSync, ngramsLocalPatch, performAction } _ = do
cpt { afterSync, ngramsLocalPatch, performAction } _ = do
synchronizing@(s /\ setSynchronizing) <- R.useState' false
synchronizing@(s /\ setSynchronizing) <- R.useState' false
...
...
src/Gargantext/Components/Nodes/Annuaire.purs
View file @
b142da83
...
@@ -104,8 +104,7 @@ annuaireCpt = R.hooksComponentWithModule thisModule "annuaire" cpt
...
@@ -104,8 +104,7 @@ annuaireCpt = R.hooksComponentWithModule thisModule "annuaire" cpt
, title: name
, title: name
, user: "" }
, user: "" }
, H.p {} []
, H.p {} []
, H.div {className: "col-md-3"}
-- , H.div {className: "col-md-3"} [ H.text " Filter ", H.input { className: "form-control", style } ]
[ H.text " Filter ", H.input { className: "form-control", style } ]
, H.br {}
, H.br {}
, pageLayout { info, session, pagePath, frontends} ]
, pageLayout { info, session, pagePath, frontends} ]
where
where
...
@@ -164,7 +163,7 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
...
@@ -164,7 +163,7 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
, session }
, session }
, delete: false }) <$> Seq.fromFoldable docs
, delete: false }) <$> Seq.fromFoldable docs
container = T.defaultContainer { title: "Annuaire" } -- TODO
container = T.defaultContainer { title: "Annuaire" } -- TODO
colNames = T.ColumnName <$> [ "", "First Name", "Last Name", "Company", "
Lab", "
Role"]
colNames = T.ColumnName <$> [ "", "First Name", "Last Name", "Company", "Role"]
wrapColElts = const identity
wrapColElts = const identity
setParams f = snd pagePath $ \pp@{params: ps} ->
setParams f = snd pagePath $ \pp@{params: ps} ->
pp {params = f ps}
pp {params = f ps}
...
@@ -199,10 +198,12 @@ contactCellsCpt = R.hooksComponentWithModule thisModule "contactCells" cpt
...
@@ -199,10 +198,12 @@ contactCellsCpt = R.hooksComponentWithModule thisModule "contactCells" cpt
]
]
cpt { annuaireId
cpt { annuaireId
, contact: (CT.NodeContact { id
, contact: (CT.NodeContact { id
, hyperdata: ( CT.HyperdataContact { who : Just (CT.ContactWho { firstName
, hyperdata: ( CT.HyperdataContact
{ who : Just (CT.ContactWho { firstName
, lastName
, lastName
}
}
)
)
, ou : ou
}
}
)
)
}
}
...
@@ -212,13 +213,12 @@ contactCellsCpt = R.hooksComponentWithModule thisModule "contactCells" cpt
...
@@ -212,13 +213,12 @@ contactCellsCpt = R.hooksComponentWithModule thisModule "contactCells" cpt
pure $ T.makeRow [
pure $ T.makeRow [
H.text ""
H.text ""
, H.
text $ fromMaybe "First Name" firstName
, H.
a { target: "_blank", href: contactUrl annuaireId id} [H.text $ fromMaybe "First Name" firstName]
, H.text $ fromMaybe "First Name" lastName
, H.text $ fromMaybe "First Name" lastName
, H.text "CNRS"
-- , H.a { href } [ H.text $ fromMaybe "name" contact.title ]
-- , H.a { href } [ H.text $ fromMaybe "name" contact.title ]
--, H.a { href, target: "blank" } [ H.text $ fromMaybe "name" contact.title ]
--, H.a { href, target: "blank" } [ H.text $ fromMaybe "name" contact.title ]
--, H.text $ maybe "No ContactWhere"
contactWhereOrg (A.head $ ou)
, H.text $ maybe "No ContactWhere"
contactWhereOrg (A.head $ ou)
--
, H.text $ maybe "No ContactWhereDept" contactWhereDept (A.head $ ou)
, H.text $ maybe "No ContactWhereDept" contactWhereDept (A.head $ ou)
-- , H.div {className: "nooverflow"} [
-- , H.div {className: "nooverflow"} [
-- H.text $ maybe "No ContactWhereRole" contactWhereRole (A.head $ ou)
-- H.text $ maybe "No ContactWhereRole" contactWhereRole (A.head $ ou)
]
]
...
@@ -226,6 +226,7 @@ contactCellsCpt = R.hooksComponentWithModule thisModule "contactCells" cpt
...
@@ -226,6 +226,7 @@ contactCellsCpt = R.hooksComponentWithModule thisModule "contactCells" cpt
--nodepath = NodePath (sessionId session) NodeContact (Just id)
--nodepath = NodePath (sessionId session) NodeContact (Just id)
nodepath = Routes.ContactPage (sessionId session) annuaireId id
nodepath = Routes.ContactPage (sessionId session) annuaireId id
href = url frontends nodepath
href = url frontends nodepath
contactUrl aId id = url frontends $ Routes.ContactPage (sessionId session) annuaireId id
contactWhereOrg (CT.ContactWhere { organization: [] }) = "No Organization"
contactWhereOrg (CT.ContactWhere { organization: [] }) = "No Organization"
contactWhereOrg (CT.ContactWhere { organization: orga }) =
contactWhereOrg (CT.ContactWhere { organization: orga }) =
...
...
src/Gargantext/Components/Nodes/Annuaire/Tabs.purs
0 → 100644
View file @
b142da83
-- TODO copy of Gargantext.Components.Nodes.Corpus.Tabs.Specs
module Gargantext.Components.Nodes.Annuaire.User.Tabs where
import Prelude hiding (div)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..))
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Reactix as R
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.DocsTable as DT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (ContactData)
import Gargantext.Components.Nodes.Lists.Types as LTypes
import Gargantext.Components.Nodes.Texts.Types as TTypes
import Gargantext.Ends (Frontends)
import Gargantext.Sessions (Session)
import Gargantext.Types (CTabNgramType(..), NodeID, PTabNgramType(..), TabType(..), TabSubType(..))
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reload as GUR
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs"
data Mode = Patents | Books | Communication
derive instance genericMode :: Generic Mode _
instance showMode :: Show Mode where
show = genericShow
derive instance eqMode :: Eq Mode
modeTabType :: Mode -> PTabNgramType
modeTabType Patents = PTabPatents
modeTabType Books = PTabBooks
modeTabType Communication = PTabCommunication
-- TODO fix this type
modeTabType' :: Mode -> CTabNgramType
modeTabType' Patents = CTabAuthors
modeTabType' Books = CTabAuthors
modeTabType' Communication = CTabAuthors
type TabsProps = (
appReload :: GUR.ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, cacheState :: R.State LTypes.CacheState
, contactData :: ContactData
, frontends :: Frontends
, nodeId :: Int
, session :: Session
, sidePanelTriggers :: Record LTypes.SidePanelTriggers
, treeReloadRef :: GUR.ReloadWithInitializeRef
)
tabs :: Record TabsProps -> R.Element
tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt { appReload
, asyncTasksRef
, cacheState
, contactData: {defaultListId}
, frontends
, nodeId
, session
, sidePanelTriggers
, treeReloadRef } _ = do
active <- R.useState' 0
textsSidePanelTriggers <- TTypes.emptySidePanelTriggers
pure $ Tab.tabs { selected: fst active, tabs: tabs' textsSidePanelTriggers }
where
tabs' trg =
[ "Documents" /\ docs trg
, "Patents" /\ ngramsView patentsView []
, "Books" /\ ngramsView booksView []
, "Communication" /\ ngramsView commView []
, "Trash" /\ docs trg -- TODO pass-in trash mode
]
where
patentsView = { appReload
, asyncTasksRef
, cacheState
, defaultListId
, mode: Patents
, nodeId
, session
, sidePanelTriggers
, treeReloadRef }
booksView = { appReload
, asyncTasksRef
, cacheState
, defaultListId
, mode: Books
, nodeId
, session
, sidePanelTriggers
, treeReloadRef }
commView = { appReload, asyncTasksRef
, cacheState
, defaultListId
, mode: Communication
, nodeId
, session
, sidePanelTriggers
, treeReloadRef }
chart = mempty
totalRecords = 4736 -- TODO
docs sidePanelTriggers = DT.docViewLayout
{ cacheState
, chart
, frontends
, listId: defaultListId
, mCorpusId: Nothing
, nodeId
, session
, showSearch: true
, sidePanelTriggers
, tabType: TabPairing TabDocs
, totalRecords
}
type NgramsViewTabsProps = (
appReload :: GUR.ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, cacheState :: R.State LTypes.CacheState
, defaultListId :: Int
, mode :: Mode
, nodeId :: Int
, session :: Session
, sidePanelTriggers :: Record LTypes.SidePanelTriggers
, treeReloadRef :: GUR.ReloadWithInitializeRef
)
ngramsView :: R2.Component NgramsViewTabsProps
ngramsView = R.createElement ngramsViewCpt
ngramsViewCpt :: R.Component NgramsViewTabsProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
where
cpt { appReload
, asyncTasksRef
, cacheState
, defaultListId
, mode
, nodeId
, session
, sidePanelTriggers
, treeReloadRef } _ = do
pathS <- R.useState' $ NTC.initialPageParams session nodeId [defaultListId] (TabDocument TabDocs)
pure $ NT.mainNgramsTable {
appReload
, afterSync: \_ -> pure unit
, asyncTasksRef
, cacheState
, defaultListId
, nodeId
, pathS
, tabType
, session
, sidePanelTriggers
, tabNgramType
, treeReloadRef
, withAutoUpdate: false
} []
where
tabNgramType = modeTabType' mode
tabType = TabPairing $ TabNgramType $ modeTabType mode
src/Gargantext/Components/Nodes/Annuaire/User
/Contacts
.purs
→
src/Gargantext/Components/Nodes/Annuaire/User.purs
View file @
b142da83
module Gargantext.Components.Nodes.Annuaire.User
.Contacts
module Gargantext.Components.Nodes.Annuaire.User
( module Gargantext.Components.Nodes.Annuaire.User.Contacts.Types
( module Gargantext.Components.Nodes.Annuaire.User.Contacts.Types
,
annuaireU
serLayout
,
u
serLayout
, userLayout
)
)
where
where
import DOM.Simple.Console (log2)
import DOM.Simple.Console (log2)
...
@@ -17,7 +17,7 @@ import Reactix.DOM.HTML as H
...
@@ -17,7 +17,7 @@ import Reactix.DOM.HTML as H
import Gargantext.AsyncTasks as GAT
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Nodes.Annuaire.User.
Contacts.
Tabs as Tabs
import Gargantext.Components.Nodes.Annuaire.User.Tabs as Tabs
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (Contact(..), ContactData, ContactTouch(..), ContactWhere(..), ContactWho(..), HyperdataContact(..), HyperdataUser(..), _city, _country, _firstName, _labTeamDeptsJoinComma, _lastName, _mail, _office, _organizationJoinComma, _ouFirst, _phone, _role, _shared, _touch, _who, defaultContactTouch, defaultContactWhere, defaultContactWho, defaultHyperdataContact, defaultHyperdataUser)
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (Contact(..), ContactData, ContactTouch(..), ContactWhere(..), ContactWho(..), HyperdataContact(..), HyperdataUser(..), _city, _country, _firstName, _labTeamDeptsJoinComma, _lastName, _mail, _office, _organizationJoinComma, _ouFirst, _phone, _role, _shared, _touch, _who, defaultContactTouch, defaultContactWhere, defaultContactWho, defaultHyperdataContact, defaultHyperdataUser)
import Gargantext.Components.Nodes.Lists.Types as LT
import Gargantext.Components.Nodes.Lists.Types as LT
import Gargantext.Ends (Frontends)
import Gargantext.Ends (Frontends)
...
@@ -30,7 +30,7 @@ import Gargantext.Utils.Reactix as R2
...
@@ -30,7 +30,7 @@ import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reload as GUR
import Gargantext.Utils.Reload as GUR
thisModule :: String
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Annuaire.User
.Contacts
"
thisModule = "Gargantext.Components.Nodes.Annuaire.User"
type DisplayProps = (
type DisplayProps = (
title :: String
title :: String
...
@@ -128,7 +128,6 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
...
@@ -128,7 +128,6 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
H.div { className: "input-group col-sm-6" } [
H.div { className: "input-group col-sm-6" } [
inputWithEnter {
inputWithEnter {
autoFocus: true
autoFocus: true
, autoSave: false
, className: "form-control"
, className: "form-control"
, defaultValue: R.readRef valueRef
, defaultValue: R.readRef valueRef
, onEnter: onClick
, onEnter: onClick
...
@@ -150,8 +149,8 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
...
@@ -150,8 +149,8 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
listElement :: Array R.Element -> R.Element
listElement :: Array R.Element -> R.Element
listElement = H.li { className: "list-group-item justify-content-between" }
listElement = H.li { className: "list-group-item justify-content-between" }
type LayoutProps =
(
type LayoutProps =
appReload :: GUR.ReloadS
(
appReload :: GUR.ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, frontends :: Frontends
, frontends :: Frontends
, nodeId :: Int
, nodeId :: Int
...
@@ -196,10 +195,11 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
...
@@ -196,10 +195,11 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
sidePanelTriggers <- LT.emptySidePanelTriggers
sidePanelTriggers <- LT.emptySidePanelTriggers
useLoader {nodeId, reload: GUR.value reload, session} get
Contact
WithReload $
useLoader {nodeId, reload: GUR.value reload, session} get
User
WithReload $
\contactData@{contactNode: Contact {name, hyperdata}} ->
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
H.ul { className: "col-md-12 list-group" } [
display { title: fromMaybe "no name" name } (contactInfos hyperdata (onUpdateHyperdata reload))
display { title: fromMaybe "no name" name }
(contactInfos hyperdata (onUpdateHyperdata reload))
, Tabs.tabs {
, Tabs.tabs {
appReload
appReload
, asyncTasksRef
, asyncTasksRef
...
@@ -219,10 +219,10 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
...
@@ -219,10 +219,10 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
_ <- saveContactHyperdata session nodeId hd
_ <- saveContactHyperdata session nodeId hd
liftEffect $ GUR.bump reload
liftEffect $ GUR.bump reload
-- | toUrl to get data
-- | toUrl to get data
XXX
getContact :: Session -> Int -> Aff ContactData
getContact :: Session -> Int -> Aff ContactData
getContact session id = do
getContact session id = do
contactNode <- get session $ Routes.NodeAPI Node (Just id) ""
contactNode
:: Contact
<- get session $ Routes.NodeAPI Node (Just id) ""
-- TODO: we need a default list for the pairings
-- TODO: we need a default list for the pairings
--defaultListIds <- get $ toUrl endConfigStateful Back (Children NodeList 0 1 Nothing) $ Just id
--defaultListIds <- get $ toUrl endConfigStateful Back (Children NodeList 0 1 Nothing) $ Just id
--case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
--case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
...
@@ -232,59 +232,10 @@ getContact session id = do
...
@@ -232,59 +232,10 @@ getContact session id = do
-- throwError $ error "Missing default list"
-- throwError $ error "Missing default list"
pure {contactNode, defaultListId: 424242}
pure {contactNode, defaultListId: 424242}
get
Contact
WithReload :: {nodeId :: Int, reload :: GUR.Reload, session :: Session} -> Aff ContactData
get
User
WithReload :: {nodeId :: Int, reload :: GUR.Reload, session :: Session} -> Aff ContactData
get
Contact
WithReload {nodeId, session} = getContact session nodeId
get
User
WithReload {nodeId, session} = getContact session nodeId
saveContactHyperdata :: Session -> Int -> HyperdataUser -> Aff Int
saveContactHyperdata :: Session -> Int -> HyperdataUser -> Aff Int
saveContactHyperdata session id h = do
saveContactHyperdata session id h = do
put session (Routes.NodeAPI Node (Just id) "") h
put session (Routes.NodeAPI Node (Just id) "") h
type AnnuaireLayoutProps = (
annuaireId :: Int
| LayoutProps )
annuaireUserLayout :: Record AnnuaireLayoutProps -> R.Element
annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayout" cpt
where
cpt { annuaireId, appReload, asyncTasksRef, frontends, nodeId, session, treeReloadRef } _ = do
cacheState <- R.useState' LT.CacheOn
sidePanelTriggers <- LT.emptySidePanelTriggers
useLoader nodeId (getAnnuaireContact session annuaireId) $
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
display { title: fromMaybe "no name" name } (contactInfos hyperdata onUpdateHyperdata)
, Tabs.tabs {
appReload
, asyncTasksRef
, cacheState
, contactData
, frontends
, nodeId
, session
, sidePanelTriggers
, treeReloadRef
}
]
where
onUpdateHyperdata :: HyperdataUser -> Effect Unit
onUpdateHyperdata _ = pure unit
getAnnuaireContact :: Session -> Int -> Int -> Aff ContactData
getAnnuaireContact session annuaireId id = do
contactNode <- get session $ Routes.NodeAPI Annuaire (Just annuaireId) $ "contact/" <> (show id)
-- TODO: we need a default list for the pairings
--defaultListIds <- get $ toUrl endConfigStateful Back (Children NodeList 0 1 Nothing) $ Just id
--case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
-- Just (NodePoly { id: defaultListId }) ->
-- pure {contactNode, defaultListId}
-- Nothing ->
-- throwError $ error "Missing default list"
pure {contactNode, defaultListId: 424242}
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
0 → 100644
View file @
b142da83
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
View file @
b142da83
...
@@ -15,7 +15,7 @@ import Gargantext.Components.DocsTable as DT
...
@@ -15,7 +15,7 @@ import Gargantext.Components.DocsTable as DT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (ContactData)
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (ContactData
'
)
import Gargantext.Components.Nodes.Lists.Types as LTypes
import Gargantext.Components.Nodes.Lists.Types as LTypes
import Gargantext.Components.Nodes.Texts.Types as TTypes
import Gargantext.Components.Nodes.Texts.Types as TTypes
import Gargantext.Ends (Frontends)
import Gargantext.Ends (Frontends)
...
@@ -52,7 +52,7 @@ type TabsProps = (
...
@@ -52,7 +52,7 @@ type TabsProps = (
appReload :: GUR.ReloadS
appReload :: GUR.ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, cacheState :: R.State LTypes.CacheState
, cacheState :: R.State LTypes.CacheState
, contactData :: ContactData
, contactData :: ContactData
'
, frontends :: Frontends
, frontends :: Frontends
, nodeId :: Int
, nodeId :: Int
, session :: Session
, session :: Session
...
@@ -144,10 +144,10 @@ type NgramsViewTabsProps = (
...
@@ -144,10 +144,10 @@ type NgramsViewTabsProps = (
ngramsView :: R2.Component NgramsViewTabsProps
ngramsView :: R2.Component NgramsViewTabsProps
ngramsView = R.createElement ngramsViewCpt
ngramsView = R.createElement ngramsViewCpt
where
ngramsViewCpt :: R.Component NgramsViewTabsProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
ngramsViewCpt :: R.Component NgramsViewTabsProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
where
cpt { appReload
cpt { appReload
, asyncTasksRef
, asyncTasksRef
, cacheState
, cacheState
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts/Types.purs
View file @
b142da83
...
@@ -43,8 +43,43 @@ instance decodeNodeContact :: DecodeJson NodeContact where
...
@@ -43,8 +43,43 @@ instance decodeNodeContact :: DecodeJson NodeContact where
derive instance newtypeNodeContact :: Newtype NodeContact _
derive instance newtypeNodeContact :: Newtype NodeContact _
----------------------------------------------------------------------------
newtype Contact' =
Contact'
{ id :: Int
, date :: Maybe String
, hyperdata :: HyperdataContact
, name :: Maybe String
, parentId :: Maybe Int
, typename :: Maybe Int
, userId :: Maybe Int
}
instance decodeContact' :: DecodeJson Contact' where
decodeJson json = do
obj <- decodeJson json
date <- obj .?| "date"
hyperdata <- obj .: "hyperdata"
id <- obj .: "id"
name <- obj .:! "name"
parentId <- obj .?| "parentId"
typename <- obj .?| "typename"
userId <- obj .:! "userId"
pure $ Contact' { id
, date
, hyperdata
, name
, parentId
, typename
, userId
}
-- | TODO rename Contact with User
-- and fix shared decodeJson
newtype Contact =
newtype Contact =
Contact
Contact
{ id :: Int
{ id :: Int
...
@@ -57,8 +92,7 @@ newtype Contact =
...
@@ -57,8 +92,7 @@ newtype Contact =
}
}
instance decodeContact :: DecodeJson Contact where
instance decodeUser :: DecodeJson Contact where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
date <- obj .?| "date"
date <- obj .?| "date"
...
@@ -78,7 +112,39 @@ instance decodeUser :: DecodeJson Contact where
...
@@ -78,7 +112,39 @@ instance decodeUser :: DecodeJson Contact where
, userId
, userId
}
}
derive instance newtypeContact :: Newtype Contact _
----------------------------------------------------------------------------
newtype User =
User
{ id :: Int
, date :: Maybe String
, hyperdata :: HyperdataUser
, name :: Maybe String
, parentId :: Maybe Int
, typename :: Maybe Int
, userId :: Maybe Int
}
instance decodeUser :: DecodeJson User where
decodeJson json = do
obj <- decodeJson json
date <- obj .?| "date"
hyperdata <- obj .: "hyperdata"
id <- obj .: "id"
name <- obj .:! "name"
parentId <- obj .?| "parentId"
typename <- obj .?| "typename"
userId <- obj .:! "userId"
pure $ User { id
, date
, hyperdata
, name
, parentId
, typename
, userId
}
newtype ContactWho =
newtype ContactWho =
ContactWho
ContactWho
...
@@ -321,6 +387,7 @@ defaultHyperdataUser =
...
@@ -321,6 +387,7 @@ defaultHyperdataUser =
-- pure $ HyperData {common, shared, specific}
-- pure $ HyperData {common, shared, specific}
type ContactData = {contactNode :: Contact, defaultListId :: Int}
type ContactData = {contactNode :: Contact, defaultListId :: Int}
type ContactData' = {contactNode :: Contact', defaultListId :: Int}
_shared :: Lens' HyperdataUser HyperdataContact
_shared :: Lens' HyperdataUser HyperdataContact
_shared = lens getter setter
_shared = lens getter setter
...
...
src/Gargantext/Components/Nodes/Corpus.purs
View file @
b142da83
...
@@ -21,7 +21,8 @@ import Gargantext.Prelude
...
@@ -21,7 +21,8 @@ import Gargantext.Prelude
import Gargantext.Components.CodeEditor as CE
import Gargantext.Components.CodeEditor as CE
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Node (NodePoly(..), HyperdataList)
import Gargantext.Components.Node (NodePoly(..), HyperdataList)
import Gargantext.Components.Nodes.Corpus.Types (CorpusData, FTField, Field(..), FieldType(..), Hash, Hyperdata(..), defaultField, defaultHaskell', defaultPython', defaultJSON', defaultMarkdown')
import Gargantext.Components.Nodes.Types
import Gargantext.Components.Nodes.Corpus.Types (CorpusData, Hyperdata(..))
import Gargantext.Data.Array as GDA
import Gargantext.Data.Array as GDA
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(NodeAPI, Children))
import Gargantext.Routes (SessionRoute(NodeAPI, Children))
...
@@ -58,7 +59,6 @@ corpusLayoutCpt = R.hooksComponentWithModule thisModule "corpusLayout" cpt
...
@@ -58,7 +59,6 @@ corpusLayoutCpt = R.hooksComponentWithModule thisModule "corpusLayout" cpt
corpusLayoutWithKey :: Record KeyProps -> R.Element
corpusLayoutWithKey :: Record KeyProps -> R.Element
corpusLayoutWithKey props = R.createElement corpusLayoutWithKeyCpt props []
corpusLayoutWithKey props = R.createElement corpusLayoutWithKeyCpt props []
corpusLayoutWithKeyCpt :: R.Component KeyProps
corpusLayoutWithKeyCpt :: R.Component KeyProps
corpusLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "corpusLayoutWithKey" cpt
corpusLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "corpusLayoutWithKey" cpt
where
where
...
@@ -74,12 +74,6 @@ type ViewProps =
...
@@ -74,12 +74,6 @@ type ViewProps =
| Props
| Props
)
)
-- We need FTFields with indices because it's the only way to identify the
-- FTField element inside a component (there are no UUIDs and such)
type Index = Int
type FTFieldWithIndex = Tuple Index FTField
type FTFieldsWithIndex = List.List FTFieldWithIndex
corpusLayoutView :: Record ViewProps -> R.Element
corpusLayoutView :: Record ViewProps -> R.Element
corpusLayoutView props = R.createElement corpusLayoutViewCpt props []
corpusLayoutView props = R.createElement corpusLayoutViewCpt props []
...
@@ -99,22 +93,23 @@ corpusLayoutViewCpt = R.hooksComponentWithModule thisModule "corpusLayoutView" c
...
@@ -99,22 +93,23 @@ corpusLayoutViewCpt = R.hooksComponentWithModule thisModule "corpusLayoutView" c
R.setRef fieldsRef fields
R.setRef fieldsRef fields
snd fieldsS $ const fieldsWithIndex
snd fieldsS $ const fieldsWithIndex
pure $ H.div {}
[
pure $ H.div {}
H.div { className: "row" } [
[ H.div { className: "row" }
H.div { className: "btn btn-secondary " <> (saveEnabled fieldsWithIndex fieldsS)
[
H.div { className: "btn btn-secondary " <> (saveEnabled fieldsWithIndex fieldsS)
, on: { click: onClickSave {fields: fieldsS, nodeId, reload, session} }
, on: { click: onClickSave {fields: fieldsS, nodeId, reload, session} }
} [
}
H.span { className: "fa fa-floppy-o" } [ ]
[
H.span { className: "fa fa-floppy-o" } [ ]
]
]
]
]
, H.div {} [ fieldsCodeEditor { fields: fieldsS
, H.div {}
[ fieldsCodeEditor { fields: fieldsS
, nodeId
, nodeId
, session }
]
, session } []
]
, H.div { className: "row" }
[
, H.div { className: "row" }
H.div { className: "btn btn-secondary"
[
H.div { className: "btn btn-secondary"
, on: { click: onClickAdd fieldsS }
, on: { click: onClickAdd fieldsS }
} [
}
H.span { className: "fa fa-plus" } [ ]
[
H.span { className: "fa fa-plus" } [ ]
]
]
]
]
]
]
...
@@ -127,7 +122,6 @@ corpusLayoutViewCpt = R.hooksComponentWithModule thisModule "corpusLayoutView" c
...
@@ -127,7 +122,6 @@ corpusLayoutViewCpt = R.hooksComponentWithModule thisModule "corpusLayoutView" c
, reload :: GUR.ReloadS
, reload :: GUR.ReloadS
, session :: Session } -> e -> Effect Unit
, session :: Session } -> e -> Effect Unit
onClickSave {fields: (fieldsS /\ _), nodeId, reload, session} _ = do
onClickSave {fields: (fieldsS /\ _), nodeId, reload, session} _ = do
log2 "[corpusLayoutViewCpt] onClickSave fieldsS" fieldsS
launchAff_ do
launchAff_ do
saveCorpus $ { hyperdata: Hyperdata {fields: (\(Tuple _ f) -> f) <$> fieldsS}
saveCorpus $ { hyperdata: Hyperdata {fields: (\(Tuple _ f) -> f) <$> fieldsS}
, nodeId
, nodeId
...
@@ -144,14 +138,14 @@ type FieldsCodeEditorProps =
...
@@ -144,14 +138,14 @@ type FieldsCodeEditorProps =
| LoadProps
| LoadProps
)
)
fieldsCodeEditor :: R
ecord FieldsCodeEditorProps -> R.Element
fieldsCodeEditor :: R
2.Component FieldsCodeEditorProps
fieldsCodeEditor
props = R.createElement fieldsCodeEditorCpt props []
fieldsCodeEditor
= R.createElement fieldsCodeEditorCpt
fieldsCodeEditorCpt :: R.Component FieldsCodeEditorProps
fieldsCodeEditorCpt :: R.Component FieldsCodeEditorProps
fieldsCodeEditorCpt = R.hooksComponentWithModule thisModule "fieldsCodeEditorCpt" cpt
fieldsCodeEditorCpt = R.hooksComponentWithModule thisModule "fieldsCodeEditorCpt" cpt
where
where
cpt {nodeId, fields: fS@(fields /\ _), session} _ = do
cpt {nodeId, fields: fS@(fields /\ _), session} _ = do
masterKey <-
R.useState' 0
masterKey <-
GUR.new
pure $ H.div {} $ List.toUnfoldable (editors masterKey)
pure $ H.div {} $ List.toUnfoldable (editors masterKey)
where
where
...
@@ -175,13 +169,13 @@ fieldsCodeEditorCpt = R.hooksComponentWithModule thisModule "fieldsCodeEditorCpt
...
@@ -175,13 +169,13 @@ fieldsCodeEditorCpt = R.hooksComponentWithModule thisModule "fieldsCodeEditorCpt
List.modifyAt idx (\(Tuple _ (Field f)) -> Tuple idx (Field $ f { typ = typ })) fields
List.modifyAt idx (\(Tuple _ (Field f)) -> Tuple idx (Field $ f { typ = typ })) fields
onMoveDown :: GUR.ReloadS -> R.State FTFieldsWithIndex -> Index -> Unit -> Effect Unit
onMoveDown :: GUR.ReloadS -> R.State FTFieldsWithIndex -> Index -> Unit -> Effect Unit
onMoveDown
(_ /\ setMasterKey) (fs
/\ setFields) idx _ = do
onMoveDown
masterKey (_
/\ setFields) idx _ = do
setMasterKey $ (+) 1
GUR.bump masterKey
setFields $ recomputeIndices <<< (GDA.swapList idx (idx + 1))
setFields $ recomputeIndices <<< (GDA.swapList idx (idx + 1))
onMoveUp :: GUR.ReloadS -> R.State FTFieldsWithIndex -> Index -> Unit -> Effect Unit
onMoveUp :: GUR.ReloadS -> R.State FTFieldsWithIndex -> Index -> Unit -> Effect Unit
onMoveUp
(_ /\ setMasterKey)
(_ /\ setFields) idx _ = do
onMoveUp
masterKey
(_ /\ setFields) idx _ = do
setMasterKey $ (+) 1
GUR.bump masterKey
setFields $ recomputeIndices <<< (GDA.swapList idx (idx - 1))
setFields $ recomputeIndices <<< (GDA.swapList idx (idx - 1))
onRemove :: R.State FTFieldsWithIndex -> Index -> Unit -> Effect Unit
onRemove :: R.State FTFieldsWithIndex -> Index -> Unit -> Effect Unit
...
@@ -223,19 +217,17 @@ fieldCodeEditorWrapperCpt = R.hooksComponentWithModule thisModule "fieldCodeEdit
...
@@ -223,19 +217,17 @@ fieldCodeEditorWrapperCpt = R.hooksComponentWithModule thisModule "fieldCodeEdit
pure $ H.div { className: "row card" } [
pure $ H.div { className: "row card" } [
H.div { className: "card-header" } [
H.div { className: "card-header" } [
H.div { className: "code-editor-heading row" } [
H.div { className: "code-editor-heading row" } [
H.div { className: "col-
sm-
4" } [
H.div { className: "col-4" } [
renameable {onRename, text: name}
renameable {onRename, text: name}
]
]
, H.div { className: "col-
sm-
7" } []
, H.div { className: "col-7" } []
, H.div { className: "buttons-right col-
sm-1" }
[
, H.div { className: "buttons-right col-
1" } (
[
H.div { className: "btn btn-danger"
H.div { className: "btn btn-danger"
, on: { click: \_ -> onRemove unit }
, on: { click: \_ -> onRemove unit }
} [
} [
H.span { className: "fa fa-trash" } [ ]
H.span { className: "fa fa-trash" } [ ]
]
]
, moveDownButton canMoveDown
] <> moveButtons)
, moveUpButton canMoveUp
]
]
]
]
]
, H.div { className: "card-body" } [
, H.div { className: "card-body" } [
...
@@ -243,15 +235,15 @@ fieldCodeEditorWrapperCpt = R.hooksComponentWithModule thisModule "fieldCodeEdit
...
@@ -243,15 +235,15 @@ fieldCodeEditorWrapperCpt = R.hooksComponentWithModule thisModule "fieldCodeEdit
]
]
]
]
where
where
moveDownButton false = H.div {} []
moveButtons = [] <> (if canMoveDown then [moveDownButton] else [])
moveDownButton true =
<> (if canMoveUp then [moveUpButton] else [])
moveDownButton =
H.div { className: "btn btn-secondary"
H.div { className: "btn btn-secondary"
, on: { click: \_ -> onMoveDown unit }
, on: { click: \_ -> onMoveDown unit }
} [
} [
H.span { className: "fa fa-arrow-down" } [ ]
H.span { className: "fa fa-arrow-down" } [ ]
]
]
moveUpButton false = H.div {} []
moveUpButton =
moveUpButton true =
H.div { className: "btn btn-secondary"
H.div { className: "btn btn-secondary"
, on: { click: \_ -> onMoveUp unit }
, on: { click: \_ -> onMoveUp unit }
} [
} [
...
@@ -301,21 +293,20 @@ renameableTextCpt :: R.Component RenameableTextProps
...
@@ -301,21 +293,20 @@ renameableTextCpt :: R.Component RenameableTextProps
renameableTextCpt = R.hooksComponentWithModule thisModule "renameableTextCpt" cpt
renameableTextCpt = R.hooksComponentWithModule thisModule "renameableTextCpt" cpt
where
where
cpt {isEditing: (false /\ setIsEditing), state: (text /\ _)} _ = do
cpt {isEditing: (false /\ setIsEditing), state: (text /\ _)} _ = do
pure $ H.div { className: "input-group" }
[
pure $ H.div { className: "input-group" }
H.input { className: "form-control"
[
H.input { className: "form-control"
, defaultValue: text
, defaultValue: text
, disabled: 1
, disabled: 1
, type: "text" }
, type: "text" }
, H.div { className: "btn input-group-append"
, H.div { className: "btn input-group-append"
, on: { click: \_ -> setIsEditing $ const true } }
[
, on: { click: \_ -> setIsEditing $ const true } }
H.span { className: "fa fa-pencil" } []
[
H.span { className: "fa fa-pencil" } []
]
]
]
]
cpt {isEditing: (true /\ setIsEditing), onRename, state: (text /\ setText)} _ = do
cpt {isEditing: (true /\ setIsEditing), onRename, state: (text /\ setText)} _ = do
pure $ H.div { className: "input-group" }
[
pure $ H.div { className: "input-group" }
inputWithEnter {
[
inputWithEnter {
autoFocus: false
autoFocus: false
, autoSave: false
, className: "form-control text"
, className: "form-control text"
, defaultValue: text
, defaultValue: text
, onEnter: submit
, onEnter: submit
...
@@ -324,8 +315,8 @@ renameableTextCpt = R.hooksComponentWithModule thisModule "renameableTextCpt" cp
...
@@ -324,8 +315,8 @@ renameableTextCpt = R.hooksComponentWithModule thisModule "renameableTextCpt" cp
, type: "text"
, type: "text"
}
}
, H.div { className: "btn input-group-append"
, H.div { className: "btn input-group-append"
, on: { click: submit } } [
, on: { click: submit } }
H.span { className: "fa fa-floppy-o" } []
[
H.span { className: "fa fa-floppy-o" } []
]
]
]
]
where
where
...
...
src/Gargantext/Components/Nodes/Corpus/Chart/Common.purs
View file @
b142da83
...
@@ -29,10 +29,10 @@ cacheName = "metrics"
...
@@ -29,10 +29,10 @@ cacheName = "metrics"
metricsLoadView :: forall a. Record (MetricsLoadViewProps a) -> R.Element
metricsLoadView :: forall a. Record (MetricsLoadViewProps a) -> R.Element
metricsLoadView p = R.createElement metricsLoadViewCpt p []
metricsLoadView p = R.createElement metricsLoadViewCpt p []
where
metricsLoadViewCpt :: R.Component (MetricsLoadViewProps a)
metricsLoadViewCpt = R.hooksComponentWithModule thisModule "metricsLoadView" cpt
metricsLoadViewCpt :: forall a. R.Component (MetricsLoadViewProps a)
metricsLoadViewCpt = R.hooksComponentWithModule thisModule "metricsLoadView" cpt
where
cpt { getMetrics, loaded, path, reload, session } _ = do
cpt { getMetrics, loaded, path, reload, session } _ = do
useLoader (fst reload /\ path) (getMetrics session) $ \l ->
useLoader (fst reload /\ path) (getMetrics session) $ \l ->
loaded { path, reload, session } l
loaded { path, reload, session } l
...
@@ -48,10 +48,11 @@ type MetricsWithCacheLoadViewProps res ret = (
...
@@ -48,10 +48,11 @@ type MetricsWithCacheLoadViewProps res ret = (
metricsWithCacheLoadView :: forall res ret. DecodeJson res =>
metricsWithCacheLoadView :: forall res ret. DecodeJson res =>
Record (MetricsWithCacheLoadViewProps res ret) -> R.Element
Record (MetricsWithCacheLoadViewProps res ret) -> R.Element
metricsWithCacheLoadView p = R.createElement metricsWithCacheLoadViewCpt p []
metricsWithCacheLoadView p = R.createElement metricsWithCacheLoadViewCpt p []
where
metricsWithCacheLoadViewCpt :: R.Component (MetricsWithCacheLoadViewProps res ret)
metricsWithCacheLoadViewCpt = R.hooksComponentWithModule thisModule "metricsWithCacheLoadView" cpt
metricsWithCacheLoadViewCpt :: forall res ret. DecodeJson res =>
R.Component (MetricsWithCacheLoadViewProps res ret)
metricsWithCacheLoadViewCpt = R.hooksComponentWithModule thisModule "metricsWithCacheLoadView" cpt
where
cpt { getMetricsHash, handleResponse, loaded, mkRequest, path, reload, session } _ = do
cpt { getMetricsHash, handleResponse, loaded, mkRequest, path, reload, session } _ = do
useLoaderWithCacheAPI { cacheEndpoint: (getMetricsHash session)
useLoaderWithCacheAPI { cacheEndpoint: (getMetricsHash session)
, handleResponse
, handleResponse
...
...
src/Gargantext/Components/Nodes/Corpus/Chart/Histo.purs
View file @
b142da83
...
@@ -81,10 +81,10 @@ mkRequest session (_ /\ path@{ corpusId, limit, listId, tabType }) = GUC.makeGet
...
@@ -81,10 +81,10 @@ mkRequest session (_ /\ path@{ corpusId, limit, listId, tabType }) = GUC.makeGet
histo :: Record Props -> R.Element
histo :: Record Props -> R.Element
histo props = R.createElement histoCpt props []
histo props = R.createElement histoCpt props []
where
histoCpt :: R.Component Props
histoCpt = R.hooksComponentWithModule thisModule "histo" cpt
histoCpt :: R.Component Props
histoCpt = R.hooksComponentWithModule thisModule "histo" cpt
where
cpt { path, session } _ = do
cpt { path, session } _ = do
reload <- R.useState' 0
reload <- R.useState' 0
pure $ metricsWithCacheLoadView {
pure $ metricsWithCacheLoadView {
...
...
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
View file @
b142da83
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Nodes/Corpus/Document.purs
View file @
b142da83
...
@@ -54,10 +54,10 @@ type DocViewProps = (
...
@@ -54,10 +54,10 @@ type DocViewProps = (
docView :: R2.Component DocViewProps
docView :: R2.Component DocViewProps
docView = R.createElement docViewCpt
docView = R.createElement docViewCpt
where
docViewCpt :: R.Component DocViewProps
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
docViewCpt :: R.Component DocViewProps
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
where
cpt { path
cpt { path
, loaded: loaded@{ ngramsTable: Versioned { data: initTable }, document }
, loaded: loaded@{ ngramsTable: Versioned { data: initTable }, document }
, state: state@({ ngramsVersion: version, ngramsLocalPatch } /\ _)
, state: state@({ ngramsVersion: version, ngramsLocalPatch } /\ _)
...
...
src/Gargantext/Components/Nodes/Corpus/Types.purs
View file @
b142da83
module Gargantext.Components.Nodes.Corpus.Types where
module Gargantext.Components.Nodes.Corpus.Types where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, (.:), (:=), (~>), jsonEmptyObject)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, (.:), (:=), (~>), jsonEmptyObject)
import Data.Argonaut.Decode.Error (JsonDecodeError(..))
import Data.List as List
import Data.List as List
import Data.Either (Either(..))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.Components.Node (NodePoly)
import Gargantext.Components.Node (NodePoly)
import Gargantext.Prelude
import Gargantext.Components.Nodes.Types (FTField, Field(..), FieldType(..), isJSON)
import Gargantext.Prelude (bind, pure, ($))
type Author = String
type Description = String
type Query = String
type Tag = String
type Title = String
type HaskellCode = String
type MarkdownText = String
type Hash = String
newtype Hyperdata =
newtype Hyperdata =
Hyperdata { fields :: List.List FTField }
Hyperdata { fields :: List.List FTField }
...
@@ -35,182 +22,6 @@ instance encodeHyperdata :: EncodeJson Hyperdata where
...
@@ -35,182 +22,6 @@ instance encodeHyperdata :: EncodeJson Hyperdata where
"fields" := fields
"fields" := fields
~> jsonEmptyObject
~> jsonEmptyObject
newtype Field a =
Field { name :: String
, typ :: a
}
type FTField = Field FieldType
derive instance genericFTField :: Generic (Field FieldType) _
instance eqFTField :: Eq (Field FieldType) where
eq = genericEq
instance showFTField :: Show (Field FieldType) where
show = genericShow
data FieldType =
Haskell { haskell :: HaskellCode
, tag :: Tag
}
| Python { python :: HaskellCode
, tag :: Tag
}
| JSON { authors :: Author
, desc :: Description
, query :: Query
, tag :: Tag
, title :: Title
}
| Markdown { tag :: Tag
, text :: MarkdownText
}
isJSON :: FTField -> Boolean
isJSON (Field {typ}) = isJSON' typ
where
isJSON' (JSON _) = true
isJSON' _ = false
getCorpusInfo :: List.List FTField -> CorpusInfo
getCorpusInfo as = case List.head (List.filter isJSON as) of
Just (Field {typ: JSON {authors, desc, query, title}}) -> CorpusInfo { title
, desc
, query
, authors
, totalRecords: 0
}
_ -> CorpusInfo { title:"Empty"
, desc:""
, query:""
, authors:""
, totalRecords: 0
}
derive instance genericFieldType :: Generic FieldType _
instance eqFieldType :: Eq FieldType where
eq = genericEq
instance showFieldType :: Show FieldType where
show = genericShow
instance decodeFTField :: DecodeJson (Field FieldType) where
decodeJson json = do
obj <- decodeJson json
name <- obj .: "name"
type_ <- obj .: "type"
data_ <- obj .: "data"
typ <- case type_ of
"Haskell" -> do
haskell <- data_ .: "haskell"
tag <- data_ .: "tag"
pure $ Haskell {haskell, tag}
"Python" -> do
python <- data_ .: "python"
tag <- data_ .: "tag"
pure $ Python {python, tag}
"JSON" -> do
authors <- data_ .: "authors"
desc <- data_ .: "desc"
query <- data_ .: "query"
tag <- data_ .: "tag"
title <- data_ .: "title"
pure $ JSON {authors, desc, query, tag, title}
"Markdown" -> do
tag <- data_ .: "tag"
text <- data_ .: "text"
pure $ Markdown {tag, text}
_ -> Left $ TypeMismatch $ "Unsupported 'type' " <> type_
pure $ Field {name, typ}
instance encodeFTField :: EncodeJson (Field FieldType) where
encodeJson (Field {name, typ}) =
"data" := typ
~> "name" := name
~> "type" := typ' typ
~> jsonEmptyObject
where
typ' (Haskell _) = "Haskell"
typ' (Python _) = "Python"
typ' (JSON _) = "JSON"
typ' (Markdown _) = "Markdown"
instance encodeFieldType :: EncodeJson FieldType where
encodeJson (Haskell {haskell}) =
"haskell" := haskell
~> "tag" := "HaskellField"
~> jsonEmptyObject
encodeJson (Python {python}) =
"python" := python
~> "tag" := "PythonField"
~> jsonEmptyObject
encodeJson (JSON {authors, desc, query, tag, title}) =
"authors" := authors
~> "desc" := desc
~> "query" := query
~> "tag" := "JsonField"
~> "title" := title
~> jsonEmptyObject
encodeJson (Markdown {text}) =
"tag" := "MarkdownField"
~> "text" := text
~> jsonEmptyObject
defaultPython :: FieldType
defaultPython = Python defaultPython'
defaultPython' :: { python :: String, tag :: String }
defaultPython' = { python: "import Foo"
, tag : "PythonField"
}
defaultHaskell :: FieldType
defaultHaskell = Haskell defaultHaskell'
defaultHaskell' :: { haskell :: String, tag :: String }
defaultHaskell' = { haskell: ""
, tag : "HaskellField"
}
defaultJSON :: FieldType
defaultJSON = JSON defaultJSON'
defaultJSON' :: { authors :: String
, desc :: String
, query :: String
, tag :: String
, title :: String
}
defaultJSON' = { authors: ""
, desc: ""
, query: ""
, tag: "JSONField"
, title: ""
}
defaultMarkdown :: FieldType
defaultMarkdown = Markdown defaultMarkdown'
defaultMarkdown' :: { tag :: String
, text :: String
}
defaultMarkdown' = { tag: "MarkdownField"
, text: "# New file"
}
defaultField :: FTField
defaultField = Field { name: "New file"
, typ: defaultMarkdown
}
newtype CorpusInfo =
newtype CorpusInfo =
CorpusInfo { title :: String
CorpusInfo { title :: String
, authors :: String
, authors :: String
...
@@ -232,3 +43,18 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
...
@@ -232,3 +43,18 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
type CorpusData = { corpusId :: Int
type CorpusData = { corpusId :: Int
, corpusNode :: NodePoly Hyperdata -- CorpusInfo
, corpusNode :: NodePoly Hyperdata -- CorpusInfo
, defaultListId :: Int }
, defaultListId :: Int }
getCorpusInfo :: List.List FTField -> CorpusInfo
getCorpusInfo as = case List.head (List.filter isJSON as) of
Just (Field {typ: JSON {authors, desc, query, title}}) -> CorpusInfo { title
, desc
, query
, authors
, totalRecords: 0
}
_ -> CorpusInfo { title:"Empty"
, desc:""
, query:""
, authors:""
, totalRecords: 0
}
src/Gargantext/Components/Nodes/Dashboard/Types.purs
View file @
b142da83
module Gargantext.Components.Nodes.Dashboard.Types where
module Gargantext.Components.Nodes.Dashboard.Types where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, (.:), (.:?), (:=), (~>), jsonEmptyObject)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, (.:), (.:?), (:=), (~>), jsonEmptyObject)
import Data.List as List
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Gargantext.Components.Nodes.Corpus.Chart.Predefined as P
import Gargantext.Components.Nodes.Corpus.Chart.Predefined as P
import Gargantext.Components.Nodes.Types (FTField, Field(..), FieldType(..), isJSON)
import Gargantext.Prelude
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, get, put)
import Gargantext.Sessions (Session, get, put)
...
@@ -14,17 +17,20 @@ type Preferences = Maybe String
...
@@ -14,17 +17,20 @@ type Preferences = Maybe String
newtype Hyperdata =
newtype Hyperdata =
Hyperdata
Hyperdata
{ charts :: Array P.PredefinedChart
{ charts :: Array P.PredefinedChart
, fields :: List.List FTField
, preferences :: Preferences
, preferences :: Preferences
}
}
instance decodeHyperdata :: DecodeJson Hyperdata where
instance decodeHyperdata :: DecodeJson Hyperdata where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
charts <- obj .: "charts"
charts <- obj .: "charts"
fields <- obj .: "fields"
preferences <- obj .:? "preferences"
preferences <- obj .:? "preferences"
pure $ Hyperdata {charts, preferences}
pure $ Hyperdata {charts,
fields,
preferences}
instance encodeHyperdata :: EncodeJson Hyperdata where
instance encodeHyperdata :: EncodeJson Hyperdata where
encodeJson (Hyperdata {charts, preferences}) = do
encodeJson (Hyperdata {charts,
fields,
preferences}) = do
"charts" := charts
"charts" := charts
~> "fields" := fields
~> "preferences" := preferences
~> "preferences" := preferences
~> jsonEmptyObject
~> jsonEmptyObject
...
...
src/Gargantext/Components/Nodes/Lists.purs
View file @
b142da83
...
@@ -35,10 +35,10 @@ type ListsWithForest = (
...
@@ -35,10 +35,10 @@ type ListsWithForest = (
listsWithForest :: R2.Component ListsWithForest
listsWithForest :: R2.Component ListsWithForest
listsWithForest = R.createElement listsWithForestCpt
listsWithForest = R.createElement listsWithForestCpt
where
listsWithForestCpt :: R.Component ListsWithForest
listsWithForestCpt = R.hooksComponentWithModule thisModule "listsWithForest" cpt
listsWithForestCpt :: R.Component ListsWithForest
listsWithForestCpt = R.hooksComponentWithModule thisModule "listsWithForest" cpt
where
cpt { forestProps
cpt { forestProps
, listsProps: listsProps@{ session } } _ = do
, listsProps: listsProps@{ session } } _ = do
controls <- initialControls
controls <- initialControls
...
@@ -58,10 +58,10 @@ type TopBarProps = (
...
@@ -58,10 +58,10 @@ type TopBarProps = (
topBar :: R2.Component TopBarProps
topBar :: R2.Component TopBarProps
topBar = R.createElement topBarCpt
topBar = R.createElement topBarCpt
where
topBarCpt :: R.Component TopBarProps
topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
topBarCpt :: R.Component TopBarProps
topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
where
cpt { controls } _ = do
cpt { controls } _ = do
-- empty for now because the button is moved to the side panel
-- empty for now because the button is moved to the side panel
pure $ H.div {} []
pure $ H.div {} []
...
@@ -93,10 +93,10 @@ type WithTreeProps = (
...
@@ -93,10 +93,10 @@ type WithTreeProps = (
listsLayout :: R2.Component Props
listsLayout :: R2.Component Props
listsLayout = R.createElement listsLayoutCpt
listsLayout = R.createElement listsLayoutCpt
where
listsLayoutCpt :: R.Component Props
listsLayoutCpt = R.hooksComponentWithModule thisModule "listsLayout" cpt
listsLayoutCpt :: R.Component Props
listsLayoutCpt = R.hooksComponentWithModule thisModule "listsLayout" cpt
where
cpt path@{ nodeId, session } _ = do
cpt path@{ nodeId, session } _ = do
let sid = sessionId session
let sid = sessionId session
...
@@ -109,10 +109,10 @@ type KeyProps = (
...
@@ -109,10 +109,10 @@ type KeyProps = (
listsLayoutWithKey :: Record KeyProps -> R.Element
listsLayoutWithKey :: Record KeyProps -> R.Element
listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
where
listsLayoutWithKeyCpt :: R.Component KeyProps
listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKey" cpt
listsLayoutWithKeyCpt :: R.Component KeyProps
listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKey" cpt
where
cpt { appReload
cpt { appReload
, asyncTasksRef
, asyncTasksRef
, controls
, controls
...
@@ -122,7 +122,7 @@ listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
...
@@ -122,7 +122,7 @@ listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
, treeReloadRef } _ = do
, treeReloadRef } _ = do
let path = { nodeId, session }
let path = { nodeId, session }
cacheState <- R.useState' $ getCacheState CacheO
ff
session nodeId
cacheState <- R.useState' $ getCacheState CacheO
n
session nodeId
useLoader path loadCorpusWithChild $
useLoader path loadCorpusWithChild $
\corpusData@{ corpusId, corpusNode: NodePoly poly, defaultListId } ->
\corpusData@{ corpusId, corpusNode: NodePoly poly, defaultListId } ->
...
@@ -164,10 +164,10 @@ type SidePanelProps = (
...
@@ -164,10 +164,10 @@ type SidePanelProps = (
sidePanel :: R2.Component SidePanelProps
sidePanel :: R2.Component SidePanelProps
sidePanel = R.createElement sidePanelCpt
sidePanel = R.createElement sidePanelCpt
where
sidePanelCpt :: R.Component SidePanelProps
sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
sidePanelCpt :: R.Component SidePanelProps
sidePanelCpt = R.hooksComponentWithModule thisModule "sidePanel" cpt
where
cpt { controls: { triggers: { toggleSidePanel
cpt { controls: { triggers: { toggleSidePanel
, triggerSidePanel
, triggerSidePanel
} }
} }
...
@@ -208,10 +208,10 @@ type SidePanelDocView = (
...
@@ -208,10 +208,10 @@ type SidePanelDocView = (
sidePanelDocView :: R2.Component SidePanelDocView
sidePanelDocView :: R2.Component SidePanelDocView
sidePanelDocView = R.createElement sidePanelDocViewCpt
sidePanelDocView = R.createElement sidePanelDocViewCpt
where
sidePanelDocViewCpt :: R.Component SidePanelDocView
sidePanelDocViewCpt = R.hooksComponentWithModule thisModule "sidePanelDocView" cpt
sidePanelDocViewCpt :: R.Component SidePanelDocView
sidePanelDocViewCpt = R.hooksComponentWithModule thisModule "sidePanelDocView" cpt
where
cpt { session } _ = do
cpt { session } _ = do
-- pure $ H.h4 {} [ H.text txt ]
-- pure $ H.h4 {} [ H.text txt ]
pure $ H.div {} [ H.text "Hello ngrams" ]
pure $ H.div {} [ H.text "Hello ngrams" ]
src/Gargantext/Components/Nodes/Types.purs
0 → 100644
View file @
b142da83
module Gargantext.Components.Nodes.Types where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, (.:), (:=), (~>), jsonEmptyObject)
import Data.Argonaut.Decode.Error (JsonDecodeError(..))
import Data.Either (Either(..))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.List as List
import Data.Tuple (Tuple)
import Gargantext.Prelude
type Author = String
type Description = String
type HaskellCode = String
type Hash = String
type MarkdownText = String
type Query = String
type Tag = String
type Title = String
-- We need FTFields with indices because it's the only way to identify the
-- FTField element inside a component (there are no UUIDs and such)
type Index = Int
type FTFieldWithIndex = Tuple Index FTField
type FTFieldsWithIndex = List.List FTFieldWithIndex
newtype Field a =
Field { name :: String
, typ :: a
}
type FTField = Field FieldType
derive instance genericFTField :: Generic (Field FieldType) _
instance eqFTField :: Eq (Field FieldType) where
eq = genericEq
instance showFTField :: Show (Field FieldType) where
show = genericShow
data FieldType =
Haskell { haskell :: HaskellCode
, tag :: Tag
}
| Python { python :: HaskellCode
, tag :: Tag
}
| JSON { authors :: Author
, desc :: Description
, query :: Query
, tag :: Tag
, title :: Title
}
| Markdown { tag :: Tag
, text :: MarkdownText
}
isJSON :: FTField -> Boolean
isJSON (Field {typ}) = isJSON' typ
where
isJSON' (JSON _) = true
isJSON' _ = false
derive instance genericFieldType :: Generic FieldType _
instance eqFieldType :: Eq FieldType where
eq = genericEq
instance showFieldType :: Show FieldType where
show = genericShow
instance decodeFTField :: DecodeJson (Field FieldType) where
decodeJson json = do
obj <- decodeJson json
name <- obj .: "name"
type_ <- obj .: "type"
data_ <- obj .: "data"
typ <- case type_ of
"Haskell" -> do
haskell <- data_ .: "haskell"
tag <- data_ .: "tag"
pure $ Haskell {haskell, tag}
"Python" -> do
python <- data_ .: "python"
tag <- data_ .: "tag"
pure $ Python {python, tag}
"JSON" -> do
authors <- data_ .: "authors"
desc <- data_ .: "desc"
query <- data_ .: "query"
tag <- data_ .: "tag"
title <- data_ .: "title"
pure $ JSON {authors, desc, query, tag, title}
"Markdown" -> do
tag <- data_ .: "tag"
text <- data_ .: "text"
pure $ Markdown {tag, text}
_ -> Left $ TypeMismatch $ "Unsupported 'type' " <> type_
pure $ Field {name, typ}
instance encodeFTField :: EncodeJson (Field FieldType) where
encodeJson (Field {name, typ}) =
"data" := typ
~> "name" := name
~> "type" := typ' typ
~> jsonEmptyObject
where
typ' (Haskell _) = "Haskell"
typ' (Python _) = "Python"
typ' (JSON _) = "JSON"
typ' (Markdown _) = "Markdown"
instance encodeFieldType :: EncodeJson FieldType where
encodeJson (Haskell {haskell}) =
"haskell" := haskell
~> "tag" := "HaskellField"
~> jsonEmptyObject
encodeJson (Python {python}) =
"python" := python
~> "tag" := "PythonField"
~> jsonEmptyObject
encodeJson (JSON {authors, desc, query, tag, title}) =
"authors" := authors
~> "desc" := desc
~> "query" := query
~> "tag" := "JsonField"
~> "title" := title
~> jsonEmptyObject
encodeJson (Markdown {text}) =
"tag" := "MarkdownField"
~> "text" := text
~> jsonEmptyObject
defaultPython :: FieldType
defaultPython = Python defaultPython'
defaultPython' :: { python :: String, tag :: String }
defaultPython' = { python: "import Foo"
, tag : "PythonField"
}
defaultHaskell :: FieldType
defaultHaskell = Haskell defaultHaskell'
defaultHaskell' :: { haskell :: String, tag :: String }
defaultHaskell' = { haskell: ""
, tag : "HaskellField"
}
defaultJSON :: FieldType
defaultJSON = JSON defaultJSON'
defaultJSON' :: { authors :: String
, desc :: String
, query :: String
, tag :: String
, title :: String
}
defaultJSON' = { authors: ""
, desc: ""
, query: ""
, tag: "JSONField"
, title: ""
}
defaultMarkdown :: FieldType
defaultMarkdown = Markdown defaultMarkdown'
defaultMarkdown' :: { tag :: String
, text :: String
}
defaultMarkdown' = { tag: "MarkdownField"
, text: "# New file"
}
defaultField :: FTField
defaultField = Field { name: "New file"
, typ: defaultMarkdown
}
src/Gargantext/Components/Search.purs
View file @
b142da83
...
@@ -58,8 +58,7 @@ instance encodeJsonSearchResult :: Argonaut.EncodeJson SearchResult where
...
@@ -58,8 +58,7 @@ instance encodeJsonSearchResult :: Argonaut.EncodeJson SearchResult where
------------------------------------------------------------------------
------------------------------------------------------------------------
data SearchResultTypes =
data SearchResultTypes = SearchResultDoc { docs :: Array Document}
SearchResultDoc { docs :: Array Document}
| SearchNoResult { message :: String }
| SearchNoResult { message :: String }
| SearchResultContact { contacts :: Array Contact }
| SearchResultContact { contacts :: Array Contact }
...
@@ -132,6 +131,7 @@ data Contact =
...
@@ -132,6 +131,7 @@ data Contact =
, c_created :: String
, c_created :: String
, c_hyperdata :: HyperdataRowContact
, c_hyperdata :: HyperdataRowContact
, c_score :: Int
, c_score :: Int
, c_annuaireId :: Int
}
}
derive instance eqContact :: Eq Contact
derive instance eqContact :: Eq Contact
...
...
src/Gargantext/Components/Tab.purs
View file @
b142da83
...
@@ -29,17 +29,23 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
...
@@ -29,17 +29,23 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
pure $
pure $
H.div {}
H.div {}
[ H.nav {}
[ H.nav {}
[ H.div { className: "nav nav-tabs"
[ H.br {}
, title : "Tab for ngrams"
, H.div { className: "nav nav-tabs"
}
, title : "Search result"
(mapWithIndex (button setActiveTab activeTab) props.tabs) ]
} -- [H.text "" ]
, H.div { className: "tab-content" } $ mapWithIndex (item activeTab) props.tabs ]
(mapWithIndex (button setActiveTab activeTab) props.tabs)
]
, H.div { className: "tab-content" }
$ mapWithIndex (item activeTab) props.tabs
]
--{-
button setActiveTab selected index (name /\ _) =
button setActiveTab selected index (name /\ _) =
H.a { className, on: { click } } [ H.text name ]
H.a { className, on: { click } } [ H.text name ]
where
where
eq = index == selected
eq = index == selected
className = "nav-item nav-link" <> (if eq then " active" else "")
className = "nav-item nav-link" <> (if eq then " active" else "")
click e = setActiveTab (const index)
click e = setActiveTab (const index)
--}
item selected index (_ /\ cpt') = tab { selected, index } [ cpt' ]
item selected index (_ /\ cpt') = tab { selected, index } [ cpt' ]
-- TODO: document what these are (selection, item indices)
-- TODO: document what these are (selection, item indices)
...
...
src/Gargantext/Components/Table.purs
View file @
b142da83
...
@@ -58,10 +58,9 @@ initialParams = stateParams {page: 1, pageSize: PS10, orderBy: Nothing, searchTy
...
@@ -58,10 +58,9 @@ initialParams = stateParams {page: 1, pageSize: PS10, orderBy: Nothing, searchTy
tableHeaderLayout :: Record TableHeaderLayoutProps -> R.Element
tableHeaderLayout :: Record TableHeaderLayoutProps -> R.Element
tableHeaderLayout props = R.createElement tableHeaderLayoutCpt props []
tableHeaderLayout props = R.createElement tableHeaderLayoutCpt props []
tableHeaderLayoutCpt :: R.Component TableHeaderLayoutProps
tableHeaderLayoutCpt = R.hooksComponentWithModule thisModule "tableHeaderLayout" cpt
where
where
tableHeaderLayoutCpt :: R.Component TableHeaderLayoutProps
tableHeaderLayoutCpt = R.hooksComponentWithModule thisModule "tableHeaderLayout" cpt
cpt { afterCacheStateChange, cacheState, date, desc, query, title, user } _ =
cpt { afterCacheStateChange, cacheState, date, desc, query, title, user } _ =
pure $ R.fragment
pure $ R.fragment
[ R2.row
[ R2.row
...
@@ -115,10 +114,9 @@ tableHeaderLayout props = R.createElement tableHeaderLayoutCpt props []
...
@@ -115,10 +114,9 @@ tableHeaderLayout props = R.createElement tableHeaderLayoutCpt props []
table :: Record Props -> R.Element
table :: Record Props -> R.Element
table props = R.createElement tableCpt props []
table props = R.createElement tableCpt props []
tableCpt :: R.Component Props
tableCpt = R.hooksComponentWithModule thisModule "table" cpt
where
where
tableCpt :: R.Component Props
tableCpt = R.hooksComponentWithModule thisModule "table" cpt
cpt {container, syncResetButton, colNames, wrapColElts, totalRecords, rows, params} _ = do
cpt {container, syncResetButton, colNames, wrapColElts, totalRecords, rows, params} _ = do
let
let
state = paramsState $ fst params
state = paramsState $ fst params
...
@@ -194,10 +192,10 @@ type SizeDDProps =
...
@@ -194,10 +192,10 @@ type SizeDDProps =
sizeDD :: Record SizeDDProps -> R.Element
sizeDD :: Record SizeDDProps -> R.Element
sizeDD p = R.createElement sizeDDCpt p []
sizeDD p = R.createElement sizeDDCpt p []
where
sizeDDCpt :: R.Component SizeDDProps
sizeDDCpt = R.hooksComponentWithModule thisModule "sizeDD" cpt
sizeDDCpt :: R.Component SizeDDProps
sizeDDCpt = R.hooksComponentWithModule thisModule "sizeDD" cpt
where
cpt {params: params /\ setParams} _ = do
cpt {params: params /\ setParams} _ = do
pure $ H.span {} [
pure $ H.span {} [
R2.select { className, defaultValue: show pageSize, on: {change} } sizes
R2.select { className, defaultValue: show pageSize, on: {change} } sizes
...
...
src/Gargantext/Components/TopBar.purs
View file @
b142da83
...
@@ -151,10 +151,10 @@ type MenuButtonProps = (
...
@@ -151,10 +151,10 @@ type MenuButtonProps = (
menuButton :: R2.Component MenuButtonProps
menuButton :: R2.Component MenuButtonProps
menuButton = R.createElement menuButtonCpt
menuButton = R.createElement menuButtonCpt
where
menuButtonCpt :: R.Component MenuButtonProps
menuButtonCpt = R.hooksComponentWithModule thisModule "menuButton" cpt
menuButtonCpt :: R.Component MenuButtonProps
menuButtonCpt = R.hooksComponentWithModule thisModule "menuButton" cpt
where
cpt { element: LiNav { title, href, icon, text }, show: (_ /\ setShow) } _ = do
cpt { element: LiNav { title, href, icon, text }, show: (_ /\ setShow) } _ = do
pure $ H.a { className: "dropdown-toggle navbar-text"
pure $ H.a { className: "dropdown-toggle navbar-text"
-- , data: {toggle: "dropdown"}
-- , data: {toggle: "dropdown"}
...
@@ -173,10 +173,10 @@ type MenuElementsProps = (
...
@@ -173,10 +173,10 @@ type MenuElementsProps = (
menuElements :: R2.Component MenuElementsProps
menuElements :: R2.Component MenuElementsProps
menuElements = R.createElement menuElementsCpt
menuElements = R.createElement menuElementsCpt
where
menuElementsCpt :: R.Component MenuElementsProps
menuElementsCpt = R.hooksComponentWithModule thisModule "menuElements" cpt
menuElementsCpt :: R.Component MenuElementsProps
menuElementsCpt = R.hooksComponentWithModule thisModule "menuElements" cpt
where
cpt { show: false /\ _ } _ = do
cpt { show: false /\ _ } _ = do
pure $ H.div {} []
pure $ H.div {} []
cpt { elements, show: (true /\ setShow) } _ = do
cpt { elements, show: (true /\ setShow) } _ = do
...
...
src/Gargantext/Ends.purs
View file @
b142da83
...
@@ -222,6 +222,7 @@ sessionPath (R.ChartHash { chartType, listId, tabType } i) =
...
@@ -222,6 +222,7 @@ sessionPath (R.ChartHash { chartType, listId, tabType } i) =
<> defaultListAddMaybe listId
<> defaultListAddMaybe listId
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
------- misc routing stuff
------- misc routing stuff
defaultList :: Int -> String
defaultList :: Int -> String
...
...
src/Gargantext/Routes.purs
View file @
b142da83
...
@@ -5,7 +5,7 @@ import Prelude
...
@@ -5,7 +5,7 @@ import Prelude
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit,
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit,
ListId, NgramsGetOpts, NgramsGetTableAllOpts, NodeType,
ListId,
DocId, ContactId,
NgramsGetOpts, NgramsGetTableAllOpts, NodeType,
Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList)
Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList)
import Gargantext.Types as GT
import Gargantext.Types as GT
...
@@ -35,9 +35,6 @@ data AppRoute
...
@@ -35,9 +35,6 @@ data AppRoute
derive instance eqAppRoute :: Eq AppRoute
derive instance eqAppRoute :: Eq AppRoute
type AnnuaireId = Int
type ContactId = Int
data SessionRoute
data SessionRoute
= Tab TabType (Maybe Id)
= Tab TabType (Maybe Id)
| Children NodeType Offset Limit (Maybe OrderBy) (Maybe Id)
| Children NodeType Offset Limit (Maybe OrderBy) (Maybe Id)
...
@@ -53,12 +50,13 @@ data SessionRoute
...
@@ -53,12 +50,13 @@ data SessionRoute
| TreeFirstLevel (Maybe Id) String
| TreeFirstLevel (Maybe Id) String
| GraphAPI Id String
| GraphAPI Id String
| ListsRoute ListId
| ListsRoute ListId
| ListDocument (Maybe ListId) (Maybe Id)
| ListDocument (Maybe ListId) (Maybe
Doc
Id)
| Search SearchOpts (Maybe Id)
| Search SearchOpts (Maybe Id)
| CorpusMetrics CorpusMetricOpts (Maybe Id)
| CorpusMetrics CorpusMetricOpts (Maybe Id)
| CorpusMetricsHash { listId :: ListId, tabType :: TabType } (Maybe Id)
| CorpusMetricsHash { listId :: ListId, tabType :: TabType } (Maybe Id)
| Chart ChartOpts (Maybe Id)
| Chart ChartOpts (Maybe Id)
| ChartHash { chartType :: ChartType, listId :: Maybe ListId, tabType :: TabType } (Maybe Id)
| ChartHash { chartType :: ChartType, listId :: Maybe ListId, tabType :: TabType } (Maybe Id)
-- | AnnuaireContact AnnuaireId DocId
instance showAppRoute :: Show AppRoute where
instance showAppRoute :: Show AppRoute where
show Home = "Home"
show Home = "Home"
...
...
src/Gargantext/Types.purs
View file @
b142da83
...
@@ -333,8 +333,11 @@ nodeTypePath (NodePublic nt) = nodeTypePath nt
...
@@ -333,8 +333,11 @@ nodeTypePath (NodePublic nt) = nodeTypePath nt
nodeTypePath NodeFile = "file"
nodeTypePath NodeFile = "file"
------------------------------------------------------------
------------------------------------------------------------
type CorpusId = Int
type DocId = Int
type ListId = Int
type ListId = Int
type AnnuaireId = Int
type ContactId = Int
data ScoreType = Occurrences
data ScoreType = Occurrences
...
...
src/Gargantext/Utils/Reactix.purs
View file @
b142da83
...
@@ -45,6 +45,35 @@ import Web.Storage.Storage (Storage, getItem, setItem)
...
@@ -45,6 +45,35 @@ import Web.Storage.Storage (Storage, getItem, setItem)
type Component p = Record p -> Array R.Element -> R.Element
type Component p = Record p -> Array R.Element -> R.Element
-- newtypes
type NTHooksComponent props = props -> Array R.Element -> R.Hooks R.Element
newtype NTComponent p = NTComponent (EffectFn1 p R.Element)
class NTIsComponent component (props :: Type) children
| component -> props, component -> children where
ntCreateElement :: component -> props -> children -> R.Element
instance componentIsNTComponent :: NTIsComponent (NTComponent props) props (Array R.Element) where
ntCreateElement = R.rawCreateElement
-- | Turns a `HooksComponent` function into a Component
ntHooksComponent :: forall props. String -> NTHooksComponent props -> NTComponent props
ntHooksComponent name c = NTComponent $ named name $ mkEffectFn1 c'
where
c' :: props -> Effect R.Element
c' props = R.runHooks $ c props (children props)
ntHooksComponentWithModule :: forall props. Module -> String -> NTHooksComponent props -> NTComponent props
ntHooksComponentWithModule module' name c = ntHooksComponent (module' <> "." <> name) c
---------------------------
-- TODO Copied from reactix, export these:
children :: forall a. a -> Array R.Element
children a = react .. "Children" ... "toArray" $ [ (a .. "children") ]
type Module = String
---------------------------
newtype Point = Point { x :: Number, y :: Number }
newtype Point = Point { x :: Number, y :: Number }
-- a reducer function living in effector, for useReductor
-- a reducer function living in effector, for useReductor
...
...
src/Gargantext/Utils/Reload.purs
View file @
b142da83
module Gargantext.Utils.Reload where
module Gargantext.Utils.Reload where
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Tuple.Nested((/\))
import Data.Tuple.Nested
((/\))
import Effect (Effect)
import Effect (Effect)
import Reactix as R
import Reactix as R
...
...
src/sass/_annotation.sass
View file @
b142da83
...
@@ -3,56 +3,52 @@
...
@@ -3,56 +3,52 @@
// $annotation-stop-color: #f00
// $annotation-stop-color: #f00
// Copied from bootstrap's bg-warning, bg-success, bg-danger:
// Copied from bootstrap's bg-warning, bg-success, bg-danger:
$annotation-candidate-color
:
#FF9800
$annotation-graph-color
:
#95D295
93
$annotation-graph-color
:
#43A047
$annotation-candidate-color
:
#B8B8B8
76
$annotation-stop-color
:
#E53935
$annotation-stop-color
:
#F59499
31
@mixin
lg1
(
$color
)
color
:
#000
background-color
:
$color
@mixin
lg2
(
$color1
,
$color2
)
@mixin
lg2
(
$color1
,
$color2
)
color
:
#000
background-image
:
linear-gradient
(
rgba
(
$color1
,
0
.5
)
,
rgba
(
$color1
,
0
.5
))
,
linear-gradient
(
rgba
(
$color2
,
0
.5
)
,
rgba
(
$color2
,
0
.5
))
background-image
:
linear-gradient
(
rgba
(
$color1
,
0
.5
)
,
rgba
(
$color1
,
0
.5
))
,
linear-gradient
(
rgba
(
$color2
,
0
.5
)
,
rgba
(
$color2
,
0
.5
))
@mixin
lg3
(
$color1
,
$color2
,
$color3
)
@mixin
lg3
(
$color1
,
$color2
,
$color3
)
color
:
#000
background-image
:
linear-gradient
(
rgba
(
$color1
,
0
.34
)
,
rgba
(
$color1
,
0
.34
))
,
linear-gradient
(
rgba
(
$color2
,
0
.33
)
,
rgba
(
$color2
,
0
.33
))
,
linear-gradient
(
rgba
(
$color3
,
0
.33
)
,
rgba
(
$color3
,
0
.33
))
background-image
:
linear-gradient
(
rgba
(
$color1
,
0
.34
)
,
rgba
(
$color1
,
0
.34
))
,
linear-gradient
(
rgba
(
$color2
,
0
.33
)
,
rgba
(
$color2
,
0
.33
))
,
linear-gradient
(
rgba
(
$color3
,
0
.33
)
,
rgba
(
$color3
,
0
.33
))
.annotation-run
.annotation-run
cursor
:
pointer
cursor
:
pointer
&
.candidate-term.graph-term.stop-term
&
.candidate-term.graph-term.stop-term
color
:
#000
@include
lg3
(
$annotation-candidate-color
,
$annotation-graph-color
,
$annotation-stop-color
)
@include
lg3
(
$annotation-candidate-color
,
$annotation-graph-color
,
$annotation-stop-color
)
&
.candidate-term.graph-term
&
.candidate-term.graph-term
color
:
#000
@include
lg2
(
$annotation-candidate-color
,
$annotation-graph-color
)
@include
lg2
(
$annotation-candidate-color
,
$annotation-graph-color
)
&
.candidate-term.stop-term
&
.candidate-term.stop-term
color
:
#000
@include
lg2
(
$annotation-candidate-color
,
$annotation-stop-color
)
@include
lg2
(
$annotation-candidate-color
,
$annotation-stop-color
)
&
.graph-term.stop-term
&
.graph-term.stop-term
color
:
#000
@include
lg2
(
$annotation-graph-color
,
$annotation-stop-color
)
@include
lg2
(
$annotation-graph-color
,
$annotation-stop-color
)
&
.candidate-term
&
.candidate-term
color
:
#000
@include
lg1
(
$annotation-candidate-color
)
background-color
:
$annotation-candidate-color
&
.graph-term
&
.graph-term
color
:
#000
@include
lg1
(
$annotation-graph-color
)
background-color
:
$annotation-graph-color
&
.stop-term
&
.stop-term
color
:
#000
@include
lg1
(
$annotation-stop-color
)
background-color
:
$annotation-stop-color
.context-menu
.context-menu
.candidate-term
.candidate-term
color
:
#000
@include
lg1
(
$annotation-candidate-color
)
background-color
:
$annotation-candidate-color
.graph-term
.graph-term
color
:
#000
@include
lg1
(
$annotation-graph-color
)
background-color
:
$annotation-graph-color
.stop-term
.stop-term
color
:
#000
@include
lg1
(
$annotation-stop-color
)
background-color
:
$annotation-stop-color
src/sass/_code_editor.sass
View file @
b142da83
...
@@ -20,24 +20,16 @@
...
@@ -20,24 +20,16 @@
word-break
:
keep-all
word-break
:
keep-all
.code-editor-heading
.code-editor-heading
display
:
flex
//justify-content: space-between
.renameable
.renameable
flex-grow
:
2
flex-grow
:
2
.text
.text
padding-right
:
10px
padding-right
:
10px
.buttons-right
/*
.buttons-right
display
:
flex
/*
display: flex
justify-content
:
flex-end
/*
justify-content: flex-end
.code-editor
.code-editor
.toolbar
display
:
flex
justify-content
:
flex-start
width
:
100%
.editor
.editor
display
:
flex
width
:
100%
.code-area
.code-area
flex-grow
:
1
flex-grow
:
1
max-height
:
200px
max-height
:
200px
...
...
src/sass/sass.sass
View file @
b142da83
...
@@ -6,3 +6,4 @@
...
@@ -6,3 +6,4 @@
@use
"_code_editor.sass"
@use
"_code_editor.sass"
@use
"_styles.sass"
@use
"_styles.sass"
@use
"_range_slider.sass"
@use
"_range_slider.sass"
@use
"_annotation.sass"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment