-
Notifications
You must be signed in to change notification settings - Fork 1
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
109 agenda session registrations #125
Merged
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
cac7d00
feat: registered sessions now are favorited. Added additional data to…
f336b78
refactor: changed session types and associated logic
af0d0bb
feat: added agenda and session registrations #109
09e306c
feat: added session detail (web view) #109
cf026cf
feat: added filter session by speakers #109
5df3e87
feat: added option to configurations to open/close session registrati…
2110de6
feat: added minimum time interval between sessions #109
926a08a
fix: removed block when session is full #109
829effb
fix: update session participant number after registration #109
b312d07
feat: added custom error messages to registrations #109
e41d8bf
feat: added guards for admins and users with spot
8db6bf5
fix: missing home tab for unregistered users
81deb83
feat: added social media links to users and speakers #78
7c6dc8d
fix: users with non admin permissions couldn't manage content #109
61490ba
feat: added organization management #111
703d73d
chore: fixed imports #111
7e099ad
feat: added venue management #111
f604ff8
fix: added missing translations #111
d0ea59a
fix: added missing html editor import #111
a163818
feat: added room management #111
9795599
feat: added speaker management #111
64bec70
feat: added content insertion to manage page #111
317d26e
fix: session error messages appear blank #109
cd07a01
fix: could not load full list of rooms #78
dfc0abd
fix: speakers not added to new and updated sessions #109
c05e985
feat: added session management #111
00e086e
chore: removed console.log #111
a4d012e
fix: missing attribute types on save session due to no load method #111
21d12e7
fix: refactored app guard and added admin override for admin guard
ba04ffa
feat: added date to session detail #109
24635eb
fix: missing obligatory dots and error highlighting #111
2e46b50
feat: added back-button to all detial pages #78
e6be87f
fix: speakers list is filtered by organization
e8c2441
fix: can't see ion-select data when editing entities #111
481e11e
fix: wrong link for sessions
48ed935
style: removed description from session card
2691ac6
fix: session description on detail not updating when changing #109
9fde6cb
feat: can't unfavorite registered sessions
fce7279
feat: added data migration script
687c072
style: added more info to session detail per request
8e0e887
feat: added links to speakers on session detail
1315094
style: when filtering sessions, detail becomes too small
1e85c5f
feat: added session page, link and open on mobile
8e85c18
refactor: improved registration for multiple concurrent requests
e978899
fix: favoriting/registering a session on mobile would open detail and…
870e186
fix: country leaders can't access manage page
44283c0
review changes #109 #111
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { RoomLinked } from './room.model'; | |
import { SpeakerLinked } from './speaker.model'; | ||
|
||
/** | ||
* YYYY-MM-DDTHH:MM, without timezone. // @todo do we need this? | ||
* YYYY-MM-DDTHH:MM, without timezone. | ||
*/ | ||
type datetime = string; | ||
|
||
|
@@ -76,9 +76,11 @@ export class Session extends Resource { | |
this.endsAt = this.calcDatetimeWithoutTimezone(endsAt); | ||
this.room = typeof x.room === 'string' ? new RoomLinked({ roomId: x.room }) : new RoomLinked(x.room); | ||
this.speakers = this.cleanArray(x.speakers, x => new SpeakerLinked(x)); | ||
this.numberOfParticipants = this.clean(x.numberOfParticipants, Number, 0); | ||
this.limitOfParticipants = this.clean(x.limitOfParticipants, Number); | ||
this.requiresRegistration = Object.keys(IndividualSessionType).includes(this.type); | ||
this.requiresRegistration = this.type !== SessionType.COMMON; | ||
if (this.requiresRegistration) { | ||
this.numberOfParticipants = this.clean(x.numberOfParticipants, Number, 0); | ||
this.limitOfParticipants = this.clean(x.limitOfParticipants, Number); | ||
} | ||
} | ||
safeLoad(newData: any, safeData: any): void { | ||
super.safeLoad(newData, safeData); | ||
|
@@ -92,58 +94,43 @@ export class Session extends Resource { | |
if (isEmpty(this.durationMinutes)) e.push('durationMinutes'); | ||
if (!this.room.roomId) e.push('room'); | ||
if (!this.speakers?.length) e.push('speakers'); | ||
if (this.requiresRegistration && !this.limitOfParticipants) e.push('limitOfParticipants'); | ||
return e; | ||
} | ||
|
||
// @todo add a method to check if a user/speaker is in the session or not | ||
|
||
calcDatetimeWithoutTimezone(dateToFormat: Date | string | number): datetime { | ||
calcDatetimeWithoutTimezone(dateToFormat: Date | string | number, bufferInMinutes = 0): datetime { | ||
const date = new Date(dateToFormat); | ||
return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, 16); | ||
return new Date( | ||
date.getTime() - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After the merge I can come back to this timezone logic and simplify it, similarly to how we do in the GA app |
||
this.convertMinutesToMilliseconds(date.getTimezoneOffset()) + | ||
this.convertMinutesToMilliseconds(bufferInMinutes) | ||
) | ||
.toISOString() | ||
.slice(0, 16); | ||
} | ||
|
||
convertMinutesToMilliseconds(minutes: number) { | ||
return minutes * 60 * 1000; | ||
} | ||
|
||
isFull(): boolean { | ||
return this.numberOfParticipants >= this.limitOfParticipants; | ||
return this.requiresRegistration ? this.numberOfParticipants >= this.limitOfParticipants : false | ||
} | ||
} | ||
|
||
// @todo don't have three enums... | ||
// @todo check if any is missing or we need to add. | ||
export enum CommonSessionType { | ||
OPENING = 'OPENING', | ||
KEYNOTE = 'KEYNOTE', | ||
MORNING = 'MORNING', | ||
POSTER = 'POSTER', | ||
EXPO = 'EXPO', | ||
CANDIDATES = 'CANDIDATES', | ||
HARVESTING = 'HARVESTING', | ||
CLOSING = 'CLOSING', | ||
OTHER = 'OTHER' | ||
getSpeakers(): string { | ||
return this.speakers.map(s => s.name).join(', ') | ||
} | ||
} | ||
|
||
export enum IndividualSessionType { | ||
DISCUSSION = 'DISCUSSION', | ||
TALK = 'TALK', | ||
IGNITE = 'IGNITE', | ||
CAMPFIRE = 'CAMPFIRE', | ||
IDEAS = 'IDEAS', | ||
INCUBATOR = 'INCUBATOR' | ||
} | ||
|
||
export enum SessionType { | ||
OPENING = 'OPENING', | ||
KEYNOTE = 'KEYNOTE', | ||
MORNING = 'MORNING', | ||
POSTER = 'POSTER', | ||
EXPO = 'EXPO', | ||
CANDIDATES = 'CANDIDATES', | ||
HARVESTING = 'HARVESTING', | ||
CLOSING = 'CLOSING', | ||
DISCUSSION = 'DISCUSSION', | ||
TALK = 'TALK', | ||
IGNITE = 'IGNITE', | ||
CAMPFIRE = 'CAMPFIRE', | ||
IDEAS = 'IDEAS', | ||
INCUBATOR = 'INCUBATOR', | ||
OTHER = 'OTHER' | ||
HUB = 'HUB', | ||
COMMON = 'COMMON' | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I'd rename this RC "sessionsRegistrations", not to be confused with users registrations