From cf678d73b252a581ec8766b3c9033d47a4169907 Mon Sep 17 00:00:00 2001 From: Lorenzo Balugani Date: Tue, 18 May 2021 19:04:59 +0200 Subject: [PATCH 1/5] Add slash to folder api calls --- nest_backend/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nest_backend/app.py b/nest_backend/app.py index 15ca7eb..5fbf025 100644 --- a/nest_backend/app.py +++ b/nest_backend/app.py @@ -57,17 +57,17 @@ app.add_url_rule( methods=["GET", "PATCH", "DELETE", "PUT"], ) app.add_url_rule( - "/api/v1/repositories//conditions", + "/api/v1/repositories//conditions/", view_func=routes.page_repository_conditions, methods=["GET", "POST"], ) app.add_url_rule( - "/api/v1/repositories//alerts", + "/api/v1/repositories//alerts/", view_func=routes.page_repository_alerts, methods=["GET", "POST"] ) app.add_url_rule( - "/api/v1/repositories//tweets", + "/api/v1/repositories//tweets/", view_func=routes.page_repository_tweets, methods=["GET"] ) From 943aba35990796c7a0b4ee21cf56befc37c33aaa Mon Sep 17 00:00:00 2001 From: Giovanni Anniballi <253150@studenti.unimore.it> Date: Tue, 18 May 2021 17:13:18 +0000 Subject: [PATCH 2/5] Update legacy/doc/log/sprint-1.md --- legacy/doc/log/sprint-1.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/doc/log/sprint-1.md b/legacy/doc/log/sprint-1.md index 79e2132..9dc5d99 100644 --- a/legacy/doc/log/sprint-1.md +++ b/legacy/doc/log/sprint-1.md @@ -7,7 +7,7 @@ # Log attività individuali dello Sprint 1 -Stefano Goldoni - Product Owner +Stefano Goldoni - Product Owner e Tester | Data | Durata | Attività | |-------|--------|----------| @@ -40,7 +40,7 @@ Giovanni Anniballi - Tester Per il lavoro di testing è stata utilizzata anche la tecnica del Pair Programming, grazie ad un plugin dell'IDE utilizzato. -Giorgio Minoccari - Sviluppatore Backend +Giorgio Minoccari - Analyst & Backend Developer Durante lo sprint ho principalmente svolto sviluppo e test riguardo alla API di twitter, in modo da poter effettuare chiamate efficenti e non venire limitati dal sito riguardo alle richieste effettuate. | Data | Durata | Attività | @@ -56,7 +56,7 @@ Durante lo sprint ho principalmente svolto sviluppo e test riguardo alla API di |02/05 |1.0h| Test di chiamata alle funzioni di ricerca a partire da repository con condizioni complesse aggregate -Lorenzo Balugani - Developer +Lorenzo Balugani - DB & Backend Developer | Data | Durata | Attività | |-------|--------|----------| @@ -73,7 +73,7 @@ Lorenzo Balugani - Developer |02/05 | 1.0h | Bugfixing -FLavia Cocca - Scrum Master +Flavia Cocca - Scrum Master & UI Designer | Data | Durata | Attività | |-------|--------|----------| From fe7cc3573ccc4d9f93df929c7245432a2f42a8de Mon Sep 17 00:00:00 2001 From: Giovanni Anniballi <253150@studenti.unimore.it> Date: Tue, 18 May 2021 17:14:12 +0000 Subject: [PATCH 3/5] Update legacy/doc/log/sprint-0.md --- legacy/doc/log/sprint-0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/legacy/doc/log/sprint-0.md b/legacy/doc/log/sprint-0.md index ab8e306..9539e5f 100644 --- a/legacy/doc/log/sprint-0.md +++ b/legacy/doc/log/sprint-0.md @@ -2,7 +2,7 @@ # Log attività individuali dello Sprint 0 -Stefano Goldoni - Product Owner +Stefano Goldoni - Product Owner e Tester | Data | Durata | Attività | |-------|--------|----------| @@ -15,7 +15,7 @@ Stefano Goldoni - Product Owner |17/04 |1.5h |diagrammi di attività -Flavia Cocca - Scrum Master +Flavia Cocca - Scrum Master & UI Designer | Data | Durata | Attività | |-------|--------|----------| @@ -28,7 +28,7 @@ Flavia Cocca - Scrum Master |16/04 |2.0h |ultimi ritocchi UI |17/04 |0.5h |Stesura documentazione partita scrumble -Chiara Calzolari - UI Designer +Chiara Calzolari - UI Designer | Data | Durata | Attività | |-------|--------|----------| From 97375bb77272cbf414711b1c9762e3d155a01c01 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 18 May 2021 19:15:53 +0200 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=A8=20Add=20tweet=20listing=20box?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/summary/SummaryLeft.module.css | 1 + .../components/base/summary/SummaryText.js | 4 ++- .../base/summary/SummaryText.module.css | 22 +++++++++++++ .../interactive/BoxRepositoryTweets.js | 14 ++++++++ .../interactive/SummaryRepository.js | 2 +- .../components/interactive/SummaryTweet.js | 32 +++++++++++++++++++ .../components/interactive/SummaryUser.js | 2 +- nest_frontend/index.css | 4 +++ nest_frontend/routes/PageRepository.js | 16 ++++++++-- .../routes/PageRepository.module.css | 5 ++- 10 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 nest_frontend/components/base/summary/SummaryText.module.css create mode 100644 nest_frontend/components/interactive/BoxRepositoryTweets.js create mode 100644 nest_frontend/components/interactive/SummaryTweet.js diff --git a/nest_frontend/components/base/summary/SummaryLeft.module.css b/nest_frontend/components/base/summary/SummaryLeft.module.css index 2cf21a4..e4491f9 100644 --- a/nest_frontend/components/base/summary/SummaryLeft.module.css +++ b/nest_frontend/components/base/summary/SummaryLeft.module.css @@ -1,4 +1,5 @@ .SummaryLeft { + min-width: 175px; width: 275px; display: grid; diff --git a/nest_frontend/components/base/summary/SummaryText.js b/nest_frontend/components/base/summary/SummaryText.js index 9086edf..d01ba11 100644 --- a/nest_frontend/components/base/summary/SummaryText.js +++ b/nest_frontend/components/base/summary/SummaryText.js @@ -6,7 +6,9 @@ import classNames from "classnames" export default function SummaryText({ children, className, ...props }) { return (
- {children} +
+ {children} +
) } diff --git a/nest_frontend/components/base/summary/SummaryText.module.css b/nest_frontend/components/base/summary/SummaryText.module.css new file mode 100644 index 0000000..7013698 --- /dev/null +++ b/nest_frontend/components/base/summary/SummaryText.module.css @@ -0,0 +1,22 @@ +.SummaryText { + flex-grow: 3; + + padding: 0 0 0 20px; + + background-color: var(--bg-light); + + display: flex; + justify-content: stretch; + align-items: center; + + font-size: small; +} + +.Text { + height: 60px; + overflow-y: auto; + + /* Custom scrollbar (firefox only!) */ + scrollbar-color: var(--bg-accent) var(--bg-light); + scrollbar-width: auto; +} \ No newline at end of file diff --git a/nest_frontend/components/interactive/BoxRepositoryTweets.js b/nest_frontend/components/interactive/BoxRepositoryTweets.js new file mode 100644 index 0000000..3ca1e7a --- /dev/null +++ b/nest_frontend/components/interactive/BoxRepositoryTweets.js @@ -0,0 +1,14 @@ +import React from "react" +import BoxFullScrollable from "../base/BoxFullScrollable" +import SummaryTweet from "./SummaryTweet" + + +export default function BoxRepositoryTweets({ tweets, ...props }) { + // TODO: Translate this + + return ( + + {tweets.map(tweet => )} + + ) +} diff --git a/nest_frontend/components/interactive/SummaryRepository.js b/nest_frontend/components/interactive/SummaryRepository.js index 46a9543..0d7bb5e 100644 --- a/nest_frontend/components/interactive/SummaryRepository.js +++ b/nest_frontend/components/interactive/SummaryRepository.js @@ -40,7 +40,7 @@ export default function SummaryRepository( } return ( - + + window.open(`https://twitter.com/${tweet.poster}/status/${tweet.snowflake}`)} + /> + + {tweet.content} + + + + ) +} diff --git a/nest_frontend/components/interactive/SummaryUser.js b/nest_frontend/components/interactive/SummaryUser.js index d158ddf..98e34cb 100644 --- a/nest_frontend/components/interactive/SummaryUser.js +++ b/nest_frontend/components/interactive/SummaryUser.js @@ -12,7 +12,7 @@ export default function SummaryUser({ user, destroyUser, running, ...props }) { const { strings } = useContext(ContextLanguage) return ( - + - + ) } diff --git a/nest_frontend/routes/PageRepository.module.css b/nest_frontend/routes/PageRepository.module.css index 7203ab8..1ca5e2d 100644 --- a/nest_frontend/routes/PageRepository.module.css +++ b/nest_frontend/routes/PageRepository.module.css @@ -1,7 +1,10 @@ .PageRepository { display: grid; - grid-template-areas: "a"; + grid-template-areas: + "a b" + "c d" + ; grid-gap: 10px; From e30b9ba2c686c1889ac42b57a443e7ed7d7b7020 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 18 May 2021 19:37:32 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=E2=9C=A8=20Add=20word=20counting=20feature?= =?UTF-8?q?=20to=20PageRepository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/interactive/BoxWordcloud.js | 2 +- nest_frontend/routes/PageRepository.js | 52 ++++++++++++++----- .../routes/PageRepository.module.css | 10 +++- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/nest_frontend/components/interactive/BoxWordcloud.js b/nest_frontend/components/interactive/BoxWordcloud.js index 191844c..d8e5177 100644 --- a/nest_frontend/components/interactive/BoxWordcloud.js +++ b/nest_frontend/components/interactive/BoxWordcloud.js @@ -24,7 +24,7 @@ export default function BoxWordcloud({ words, props }) { "var(--fg-primary)", ], fontFamily: "Bree Serif", - fontSizes: [12, 128], + fontSizes: [16, 48], size: undefined, deterministic: true, }} diff --git a/nest_frontend/routes/PageRepository.js b/nest_frontend/routes/PageRepository.js index f48501d..792f8dd 100644 --- a/nest_frontend/routes/PageRepository.js +++ b/nest_frontend/routes/PageRepository.js @@ -2,24 +2,50 @@ import React from "react" import Style from "./PageRepository.module.css" import classNames from "classnames" import BoxRepositoryTweets from "../components/interactive/BoxRepositoryTweets" +import BoxWordcloud from "../components/interactive/BoxWordcloud" export default function PageRepository({ className, ...props }) { + const tweets = [ + { + "conditions": [], + "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec posuere lacinia eleifend. Maecenas a neque augue. Nulla dapibus lobortis gravida. Quisque quis ultricies elit. Donec in tortor augue. Cras eget aliquam felis. Nunc tempor, ipsum in lobortis tristique, nunc ante velit.", + "insert_time": "2021-05-18T18:56Z", + "location": null, + "place": "Casa mia", + "poster": "USteffo", + "snowflake": "1394698342282809344", + }, + ] + + let preprocessedWords = {} + for(const tweet of tweets) { + if(!tweet.content) { + continue + } + for(const word of tweet.content.toLowerCase().split(/\s+/)) { + if(!preprocessedWords.hasOwnProperty(word)) { + preprocessedWords[word] = 0 + } + preprocessedWords[word] += 1 + } + } + + let processedWords = [] + for(const word in preprocessedWords) { + if(!preprocessedWords.hasOwnProperty(word)) { + continue + } + processedWords.push({ + text: word, + value: preprocessedWords[word] + }) + } + return (
- + +
) } diff --git a/nest_frontend/routes/PageRepository.module.css b/nest_frontend/routes/PageRepository.module.css index 1ca5e2d..caf1eb7 100644 --- a/nest_frontend/routes/PageRepository.module.css +++ b/nest_frontend/routes/PageRepository.module.css @@ -4,14 +4,22 @@ grid-template-areas: "a b" "c d" + "e f" + "g h" ; grid-gap: 10px; + grid-template-columns: 1fr 1fr; + grid-template-rows: 1fr auto 1fr auto; width: 100%; height: 100%; } -.Wordcloud { +.Tweets { grid-area: a; +} + +.Wordcloud { + grid-area: b; } \ No newline at end of file