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

fix: Show online or mixed location in event page header #5196

Merged
merged 4 commits into from Sep 30, 2020

Conversation

HADES-01
Copy link
Member

@HADES-01 HADES-01 commented Sep 30, 2020

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:

  • Fixed by creating a computed property as suggested by @iamareebjamal

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes

@vercel
Copy link

vercel bot commented Sep 30, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/hvcla1qc7
✅ Preview: https://open-event-frontend-git-fork-hades-01-issue5161.eventyay.vercel.app

if (this.locationName && this.online) {
return `In-Person Event and Online Event ${this.locationName}`;
}
else if (!this.locationName && this.online) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
else if (!this.locationName && this.online) {
else if (this.online) {

else if (!this.locationName && this.online) {
return 'Online Event';
}
else if (!this.online && this.locationName) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
else if (!this.online && this.locationName) {
else if (this.locationName) {

@codecov
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #5196 into development will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               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              
Impacted Files Coverage Δ
app/controllers/public.js 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e90d869...17e0c5e. Read the comment docs.

@@ -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() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
headererLocation: computed('locationName', 'online', function() {
headerLocation: computed('locationName', 'online', function() {

@iamareebjamal
Copy link
Member

Use correct formatting

app/models/event.js Outdated Show resolved Hide resolved
app/models/event.js Outdated Show resolved Hide resolved
@@ -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() {
Copy link
Member

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

@vercel vercel bot temporarily deployed to Preview September 30, 2020 11:32 Inactive
@iamareebjamal iamareebjamal changed the title Fixed Public Event Page Location Issue #5161 fix: Show online or mixed location in event page header Sep 30, 2020
@auto-label auto-label bot added the fix label Sep 30, 2020
@@ -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>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<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>

Copy link
Member

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

Copy link
Member

@iamareebjamal iamareebjamal left a comment

Choose a reason for hiding this comment

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

Wrong reference

@@ -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')
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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')

Copy link
Member Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public Event Page: Display Info for online, mixed etc. on header
2 participants