Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cu 861m77zun - Dettaglio Aula #136

Merged
merged 17 commits into from
Feb 23, 2023

Conversation

bob27aggiustatutto
Copy link
Contributor

No description provided.

@PoliNetwork-ClickUp
Copy link

Task linked: CU-861m77zun Pagina Dettaglio Aula

@PoliNetwork-ClickUp
Copy link

Task linked: CU-861m3wffu Pagina Aule Libere

@DiegoZaff
Copy link
Contributor

Per chi si chiedesse perché sono andato a modificare il componente CustomModal usato nel MainMenu spostando titolo e sottotitolo dal componente alla prop children è andata circa cosi:

  1. ho cercato di riutilizzare il CustomModal per la sezione affollamento con lo slider dinamico, quindi mi serviva il titolo e sottotitolo in posizioni diverse da come era stato progettato il componente, quindi li ho rimossi e passati come children (in modo da avere meno limitazioni).
  2. Ho realizzato che i react native gesture handlers non funzionano dentro i modali, o meglio, non funzionavano dentro il modale wrappato con Pressable, inoltre il contenuto del modale deve essere anche wrappato con una funzione particolare (vedi codice).
  3. Ho creato un nuovo modale specifico per le gestures.
  4. I cambiamenti nel CustomModal mi sembravano sensati e li ho lasciati come sono

@DiegoZaff
Copy link
Contributor

La pagina è quasi conclusa. Manca di capire come far funzionare il componente "Mancano ... ore ... minuti" e se le aule con i nomi particolari vengono mostrate correttamente.

@toto04 vuoi fare la review prima del merge nel branch di Matteo o facciamo tutto alla fine?

@toto04 toto04 marked this pull request as ready for review February 19, 2023 14:32
@lups2000
Copy link
Contributor

prima di fare la review forse sarebbe meglio fare un merge con main come è stato fatto con il mio branch per risolvere subito quella cosa degli spazi

@DiegoZaff
Copy link
Contributor

Per la pagina di dettaglio aula devo ancora cambiare il componente da... a ... Per riflettere l ultimo cambiamento dell' endpoint per cui restituisce anche quando l aula è libera dopo l' orario di fine specificato. Faccio stasera

I cambiamenti di design e di backend per quanto riguarda l endpoint che restituisce le aule libere da ora fino a fine giornata e l aggiunta del picker x la data di fine non dovrebbero riguardare questa pr

@DiegoZaff
Copy link
Contributor

Penso che l'endpoint abbia dei problemi perché prima mi restituiva errore 500 la chiamata per la ricerca della aule.
Comunque, la pagina di dettaglio articolo al momento dovrebbe essere funzionante e in pari con lo stato attuale degli endpoint, devo testare gli ultimi fix se non hanno rotto qualcosa.

Poi si può procedere alla review e merge.

Il collegamento con le informazioni di {occupancies, latitude e longitude} deve essere ancora fatto. Lo devo fare io?

@toto04
Copy link
Contributor

toto04 commented Feb 21, 2023

ma sì dai, se hai voglia sì

@DiegoZaff
Copy link
Contributor

Ho fixato alcune cose nella pagina di dettaglio aula e fatto il collegamento con le informazioni reali tramite la scelta con Campus -> Edificio -> Aula.

Momentaneamente ho messo che cliccando sulle notifiche si apre una pagina con dati hardcodati per mostrarne lo stato attuale, dato che l'endpoint è stato fixato e non restituisce più aule libere dopo le 20:00. Dovremmo valutare dei messaggi di errore o qualcosa da mostrare se non vengono restituite aule. Anche mettere degli activity indicator mentre le aule vengono ricercate (dato che ci può mettere diversi secondi).

Per informazione i dati di quell'aula sono:

            room: {
              name: "2.0.1",
              capacity: 380,
              building: "Edificio 2",
              address: "Piazza Leonardo da Vinci, 32 - 20133 - Milano (MI)",
              power: false,
            },
            startDate: "2023-02-22T16:15:00Z",
            roomId: 32,
            roomLatitude: 45.4788249919485,
            roomLongitude: 9.227210008150676,
            occupancies: {
              // eslint-disable-next-line @typescript-eslint/naming-convention
              "19:00": "FREE",
              // eslint-disable-next-line @typescript-eslint/naming-convention
              "19:35": "OCCUPIED",
            },
          }

@toto04 toto04 mentioned this pull request Feb 22, 2023
src/api/rooms.ts Outdated
@@ -10,13 +11,29 @@ export interface Room {
building: string
power: boolean
link: string
occupancyRate: number | undefined
occupancy_rate: number | null
occupancies: Record<string, "FREE" | "OCCUPIED">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

io direi che questo potrebbe avere un alias dato che lo continui a usare ovunque, puoi anche eventualmente essere più specifico con il key type usando template literals dato che hanno una forma precisa

export type Occupancies = Record<`${number}:${number}`, "FREE" | "OCCUPIED">

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok va bene. Devo aggiungere un po' di codice nella funzione getEndDate() per chiamare occupancies[key] ma niente di assurdo. Poi quando faccio il commit vedi.

position: "absolute",
borderBottomWidth: 0.5,
width: "100%",
borderColor: isLight ? "#454773" : "#fff",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probabilmente questo dovrebbe diventare un colore nel ColorTheme della palette, qualsiasi colore che usi più di una volta dovrebbe stare lì, puoi anche chiamarlo qualcosa come sliderBorderColor, o come preferisci, dipende da dove lo riutilizzi ma ho visto che in giro ritorna ogni tanto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, penso di aver fatto un po' di confusione con i colori dei vari componenti e di non aver usato l'hook ovunque, faccio un controllo anche in tutti gli altri file

style={{
fontSize: 13,
fontWeight: "600",
color: isLight ? "#414867" : "#fff",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem, nella palette

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

src/api/rooms.ts Outdated
@@ -1,4 +1,5 @@
import { HttpClient, RequestOptions } from "./HttpClient"
import { ValidCrowdStatus } from "components/FreeClass/ClassDetails/CrowdingSection"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La definizione di questo potresti portarla qui dentro e poi esportarla, se no fai import circolari che non è che siano un problema finché sono solo di tipi perché poi vengono tolti da tsc, ma fa brutto lo stesso ahah

ma on another note, serve? perché da quanto ho capito l'endpoint restituisce un float

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non so per quale motivo pensavo dovesse restituire un intero compreso tra 1 e 5. Quindi se può restituire anche numeri con la virgola devo fare parecchi cambiamenti.

style={{
fontSize: 40,
fontWeight: "300",
color: isLight ? "#414867" : primary,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tutti questi dovrebbero stare nella palette, sono tutti uguali

Comment on lines 6 to 9
/**
* Page Wrapper for Class Details page, maybe unify this with Settings Wrapper or any other wrapper
* somewhere in the app.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sì direi che ha senso, non è che sia molto utile fare pagewrapper per ogni sezione ahah, andrebbero unificate, cercando di mantenere il resto del codice invariato e aggiungendo solo i mezzi per ottenere le differenze per ogni pagina, vedi tu se riesci a farlo in modo poco invasivo, se devi modificare troppa roba allora diventerà una issue futura

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

Comment on lines 31 to 33
? isLight
? "#424967"
: "#8791BD"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know it, palette, quantomeno usare i colori della palette tipo

isLight ? palette.primary : palette.lighter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@toto04
Copy link
Contributor

toto04 commented Feb 23, 2023

Ok allora mi sembra tutto a posto, ovviamente adesso @lups2000 dovrai occuparti di rifinire il tutto assicurandoti che funzioni tutto senza problemi, ci potrebbe volere del tempo e te e @DiegoZaff eventualmente discutete direttamente tra di voi in caso per quanto riguarda l'interfaccia tra queste pagine
glhf :)

@toto04 toto04 merged commit a58b1e0 into feature/CU-861m3wffu Feb 23, 2023
@toto04 toto04 deleted the feature/CU-861m77zun branch February 23, 2023 11:32
@github-actions
Copy link

Updated task status CU-861m77zun to: completed

@DiegoZaff
Copy link
Contributor

Va bene, mi metto d'accordo con Matteo per fare eventualmente modifiche nel suo branch.

toto04 added a commit that referenced this pull request Mar 24, 2023
* freeClassroom page completed

* campus choice page almost completed

* create page to find class by position

* fix button state and graphic

* create component for list of free classrooms

* adjust the design

* adjust the design pt.2 and create interface Room

* add classChoice page

* fix problem with Flatlist->ScrollView

* create Map

* introduce geolocalization

* fix geolocation permissions

* adjust colors

* just fix

* just fix the design

* fix problem with margins

* just fix the structure

* DateTimePicker (#96)

* DateTimePicker

* Pr requested changes

* changed Text into BodyText

* fix modal shows up twice

* prettier error

Co-authored-by: Tommaso Morganti <tommaso.morganti01@gmail.com>

* fix the design(on IOS, android not yet)

* quick fix to freeClassList

* manage DateTimePicker's state and just try to call the room API

* fix the call to the API, refreshing must be fixed

* now the list of freeclassrooms is dynamic

* fix run issue

* fix activity indicator if GPS missing

* fix run problem

* fix map initial region and add few comments

* manage map if there is no GPS signal

* just fix imports

* checkPermission function and logic to put a marker on the map

* insert marker on campus and redirect to list

* missing the id of the class

* Main => m1 => CU-861m3wffu. Non toccare (#122)

* fix flash bianco (#97)

* login baseurl hotfix

* Bump ua-parser-js from 0.7.31 to 0.7.33 (#110)

Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](faisalman/ua-parser-js@0.7.31...0.7.33)

---
updated-dependencies:
- dependency-name: ua-parser-js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Feature/cu 34g7wcz (#108)

* risolte x tagliate

* app.json com er aprima

* diminuito margin container

* diminuito margin container

* vsc mi cancella sempre app json

* ri allenamento icone con x visibili

* Aumentata area di press dell'icona X

* fix status bar color (#115)

* Modificato nome Gruppi nel menu (#117)

Co-authored-by: github.nouser@nouser.github.com <github.nouser@nouser.github.com>

* getTags (#121)

* Groups Page (#106)

* Filters

* groups api

* Group searching logic with mocked data and language filter

* Adding proper filter values
reordering code

* groups api draft

* fixed search logic

* Reordering by Year

* lint error

* New Groups Page Design

* General fixes

* added svg platform icons

* added 2022/2023

* pr requested changes

* margin fix

* Flatlist and ordered groups fix

* fix no members

* small styling fixes

---------

Co-authored-by: Tommaso Morganti <tommaso.morganti01@gmail.com>

* fix conflitti

* fix conflitti (2)

* fix conflitti (3)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Diego <43524162+DiegoZaff@users.noreply.github.com>
Co-authored-by: Tommaso Morganti <tommaso.morganti@mail.polimi.it>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pontig <59708804+pontig@users.noreply.github.com>
Co-authored-by: github.nouser@nouser.github.com <github.nouser@nouser.github.com>
Co-authored-by: Tommaso Morganti <tommaso.morganti01@gmail.com>

* change to Diego's PageWrapper

* add class name to the list

* maybe find temporary solution to G.P.S not disabled

* display markers on map and handle the press

* just add some comments

* fix run error

* just fix gps signal acquisition

* put markers on buildings

* add button to return to user current location(on IOS)

* just to test commit

* fix map

* just add new component for the searchbar(must be completed)

* fix navigation to the page

* fix button to return to current position

* fix map and list behaviour

* change navigation logic

* add info on occupancy rate

* fix run error

* Feature/cu 861m77zun - Dettaglio Aula (#136)

* RoomDetails Page

* Added RoomDetails to flow
added Map and actual infos

* Sezione Info Utili

* Affollamento UI

* Sezione affollamento completata

* fix styling and lint

* open map

* small fix

* Merge remote-tracking branch 'origin/feature/CU-861m3wffu' into feature/CU-861m77zun

* TimeLeft component fix
latitude and longitude props
occupancies

* endDate bug fix

* fix TimeLeft not correct

* fixes and real data link

* requested changes

* forgot return

---------

Co-authored-by: DiegoZaff <diego.zaffe@gmail.com>
Co-authored-by: Tommaso Morganti <tommaso.morganti01@gmail.com>

* forgot this in the merge commit whoops

* headquarter choice

* new component for default list (+ search by position inefficent so far)

* fix run error

* Update README.md

* fix date start problem

* filter classrooms according to their campus

* fix problem showing list

* delete hard coded headquarter name

* fix title of some rooms

* just fix names

* position searchbar prototype

* fix problem with "fire" icon

* redesign the logic to find a room by position

* new endpoint filters
moved a lot of things
needs improvement

* fix run error

* fix redirect to roomDetailsPage

* fix run error

* add icon Google maps on IOS

* fix run error

* create component to display errors

* fix run errors

* update with new component Icon

* fix run errors

* improvements (not finished)

* Date Filters Flow
Search NOW

* update positonChoice page

* Rooms SearchBar Prototype

* fix problem in opening maps on IOS

* Fixed "libera" per color
added button scrollView in FreeClassrooms
Fixed Coordinates in SearchBar

* fix occupancy label

* fix problem in opening small map

* remove Como,residenze and S.Ulteriano from headquarters

* fix problem small map and searchbar

* decrese room name font size

* fix "Aggiungi" button

* change id into enum

* close modal when it's empty

* fix & context

* palette variant 3

* palette variant 3 sliderBorderColor

* updated ModalWithGestures

* margin top Pressable

* onPress on Map

* AdaptiveShadowView Map

* first review fixes

* skia paint removed

* general Istance timer

* buildingItem name field

* icon google maps on IOS position

* position fix

* fix run error

* removed FREE NOW

* fix FreeClassList padding

* fix margin padding DeafultList

* fix shadow in FreeClassList

* fix modal problem with svg

* stop animation if there is only ADD icon

* fixed freeclassroom choice buttons

* delete position search bar

* fix "libera fino alle"

* delete unuseful acronyms from context

* room tap fix
error fix

* ModalWithGestures removed

* removed useless eslint comments

* display all markers(wait for final endpoint) and add function to sort rooms by distance

* fix margin and padding

* adapt the structure to the new endpoint

* fix run error

* fix run error pt.2

* add animation when a marker is selected

* fixed pressable in shadows

* fix roomList by position

* fix room name

* Removed AcronymList and rooms.JSON

* code more functional?

* fix crowding feedback if not logged

* text aligned on multiple lines in class element

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Matteo <matteo1.luppi@mail.polimi.it>
Co-authored-by: github@github.com <github@github.com>
Co-authored-by: Diego <43524162+DiegoZaff@users.noreply.github.com>
Co-authored-by: Tommaso Morganti <tommaso.morganti01@gmail.com>
Co-authored-by: Tommaso Morganti <tommaso.morganti@mail.polimi.it>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pontig <59708804+pontig@users.noreply.github.com>
Co-authored-by: github.nouser@nouser.github.com <github.nouser@nouser.github.com>
Co-authored-by: Matteo Luppi <100372313+lups2000@users.noreply.github.com>
Co-authored-by: DiegoZaff <diego.zaffe@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants