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
fix: Show online or mixed location in event page header #5196
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/hvcla1qc7 |
app/models/event.js
Outdated
if (this.locationName && this.online) { | ||
return `In-Person Event and Online Event ${this.locationName}`; | ||
} | ||
else if (!this.locationName && this.online) { |
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.
else if (!this.locationName && this.online) { | |
else if (this.online) { |
app/models/event.js
Outdated
else if (!this.locationName && this.online) { | ||
return 'Online Event'; | ||
} | ||
else if (!this.online && this.locationName) { |
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.
else if (!this.online && this.locationName) { | |
else if (this.locationName) { |
Codecov Report
@@ Coverage Diff @@
## development #5196 +/- ##
===============================================
- Coverage 22.65% 22.62% -0.04%
===============================================
Files 489 489
Lines 5191 5198 +7
Branches 36 36
===============================================
Hits 1176 1176
- Misses 4010 4017 +7
Partials 5 5
Continue to review full report at Codecov.
|
app/models/event.js
Outdated
@@ -181,6 +181,21 @@ export default class Event extends ModelBase.extend(CustomPrimaryKeyMixin, { | |||
|
|||
sessionsByState: computed('sessions', function() { | |||
return groupBy(this.sessions.toArray(), 'data.state'); | |||
}), | |||
|
|||
headererLocation: computed('locationName', 'online', function() { |
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.
headererLocation: computed('locationName', 'online', function() { | |
headerLocation: computed('locationName', 'online', function() { |
Use correct formatting |
36f5308
to
177dfe9
Compare
app/models/event.js
Outdated
@@ -181,6 +181,18 @@ export default class Event extends ModelBase.extend(CustomPrimaryKeyMixin, { | |||
|
|||
sessionsByState: computed('sessions', function() { | |||
return groupBy(this.sessions.toArray(), 'data.state'); | |||
}), | |||
|
|||
headerLocation: computed('locationName', 'online', function() { |
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.
Move this to the controller rather than the model
f35a200
to
7dfbe89
Compare
app/templates/public.hbs
Outdated
@@ -14,7 +14,7 @@ | |||
<h5 class="event time ends">{{t 'To'}} {{header-date this.model.endsAt this.model.timezone}}</h5> | |||
{{/if}} | |||
<h1 class="event name">{{this.model.name}}</h1> | |||
<h4 class="event location"><i class="icon map marker alternate"></i>{{this.model.locationName}}</h4> | |||
<h4 class="event location"><i class="icon map marker alternate"></i>{{this.model.headerLocation}}</h4> |
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.
<h4 class="event location"><i class="icon map marker alternate"></i>{{this.model.headerLocation}}</h4> | |
<h4 class="event location"><i class="icon map marker alternate"></i>{{this.headerLocation}}</h4> |
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.
Do not resolve conversation. It is resolved automatically once suggested changes are made
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.
Wrong reference
e8867be
to
5ff36be
Compare
app/controllers/public.js
Outdated
@@ -20,6 +20,19 @@ export default class PublicController extends Controller { | |||
return this.session.currentRouteName && this.session.currentRouteName !== 'public.cfs.new-session' && this.session.currentRouteName !== 'public.cfs.new-speaker' && this.session.currentRouteName !== 'public.cfs.edit-speaker' && this.session.currentRouteName !== 'public.cfs.edit-session'; | |||
} | |||
|
|||
@computed('locationName', 'online') |
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.
Wrong computed properties
Every event is shown as Online Event. Please test the PR properly
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.
@iamareebjamal It shows online event at first, but when you refresh it shows the correct value. Then this value shows up for the next event you click. Can you help me, I am not able to figure it out myself.
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.
@computed('model.locationName', 'model.online')
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.
@iamareebjamal Thanks
Fixes #5161
Short description of what this resolves:
Fixed the issue of empty location line in the header of the public event page.
Changes proposed in this pull request:
Checklist
development
branch.