1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 06:24:19 +00:00

Merge branch 'main' of zero.ryg.one:nest/g2-progetto

This commit is contained in:
@uni-chiara 2021-05-18 19:54:46 +02:00
commit f44142c2db
14 changed files with 141 additions and 17 deletions

View file

@ -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à |
|-------|--------|----------|

View file

@ -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à |
|-------|--------|----------|

View file

@ -57,17 +57,17 @@ app.add_url_rule(
methods=["GET", "PATCH", "DELETE", "PUT"],
)
app.add_url_rule(
"/api/v1/repositories/<int:rid>/conditions",
"/api/v1/repositories/<int:rid>/conditions/",
view_func=routes.page_repository_conditions,
methods=["GET", "POST"],
)
app.add_url_rule(
"/api/v1/repositories/<int:rid>/alerts",
"/api/v1/repositories/<int:rid>/alerts/",
view_func=routes.page_repository_alerts,
methods=["GET", "POST"]
)
app.add_url_rule(
"/api/v1/repositories/<int:rid>/tweets",
"/api/v1/repositories/<int:rid>/tweets/",
view_func=routes.page_repository_tweets,
methods=["GET"]
)

View file

@ -1,4 +1,5 @@
.SummaryLeft {
min-width: 175px;
width: 275px;
display: grid;

View file

@ -6,7 +6,9 @@ import classNames from "classnames"
export default function SummaryText({ children, className, ...props }) {
return (
<div className={classNames(Style.SummaryText, className)} {...props}>
<div className={Style.Text}>
{children}
</div>
</div>
)
}

View file

@ -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;
}

View file

@ -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 (
<BoxFullScrollable header={"Tweets"} {...props}>
{tweets.map(tweet => <SummaryTweet tweet={tweet}/>)}
</BoxFullScrollable>
)
}

View file

@ -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,
}}

View file

@ -40,7 +40,7 @@ export default function SummaryRepository(
}
return (
<SummaryBase>
<SummaryBase {...props}>
<SummaryLeft
icon={repo.is_active ? faFolderOpen : faFolder}
title={repo.name}

View file

@ -0,0 +1,32 @@
import React from "react"
import SummaryBase from "../base/summary/SummaryBase"
import SummaryLeft from "../base/summary/SummaryLeft"
import { faComment, faMapPin } from "@fortawesome/free-solid-svg-icons"
import SummaryText from "../base/summary/SummaryText"
import SummaryRight from "../base/summary/SummaryRight"
export default function SummaryTweet({ tweet, ...props }) {
let icon
if(tweet.place) {
icon = faMapPin
}
else {
icon = faComment
}
return (
<SummaryBase {...props}>
<SummaryLeft
icon={icon}
title={`@${tweet.poster}`}
subtitle={tweet.place}
onClick={() => window.open(`https://twitter.com/${tweet.poster}/status/${tweet.snowflake}`)}
/>
<SummaryText>
{tweet.content}
</SummaryText>
<SummaryRight/>
</SummaryBase>
)
}

View file

@ -12,7 +12,7 @@ export default function SummaryUser({ user, destroyUser, running, ...props }) {
const { strings } = useContext(ContextLanguage)
return (
<SummaryBase>
<SummaryBase {...props}>
<SummaryLeft
icon={user.isAdmin ? faStar : faUser}
title={user.username}

View file

@ -28,6 +28,10 @@ h1, h2, h3, h4, h5, h6 {
cursor: not-allowed;
}
a {
color: var(--fg-primary)
}
.ThemeDark {
--bg-primary: #3B7097;
--fg-primary: #FFFFFF;

View file

@ -1,13 +1,51 @@
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 (
<div className={classNames(Style.PageRepository, className)} {...props}>
<BoxWordcloud className={Style.Wordcloud}/>
<BoxRepositoryTweets className={Style.Tweets} tweets={tweets}/>
<BoxWordcloud className={Style.Wordcloud} words={processedWords}/>
</div>
)
}

View file

@ -1,14 +1,25 @@
.PageRepository {
display: grid;
grid-template-areas: "a";
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;
}