Skip to content

Conversation

Haider8
Copy link
Contributor

@Haider8 Haider8 commented Jul 28, 2020

Fixes #4481
Fixes #4657

Short description of what this resolves:

Some featured events was no longer on start page because they are being queried on the frontend from already existing upcoming events which puts the constraint on the event's date.

Changes proposed in this pull request:

Separately query server for featured events by using is-featured filter.

featured-events

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
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Jul 28, 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/ccsaf6eyh
✅ Preview: https://open-event-frontend-git-fork-haider8-query-featured-events.eventyay.vercel.app

@codecov
Copy link

codecov bot commented Jul 28, 2020

Codecov Report

Merging #4653 into development will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #4653      +/-   ##
===============================================
+ Coverage        23.03%   23.11%   +0.07%     
===============================================
  Files              476      476              
  Lines             4962     4967       +5     
  Branches             8        8              
===============================================
+ Hits              1143     1148       +5     
  Misses            3818     3818              
  Partials             1        1              
Impacted Files Coverage Δ
app/controllers/index.js 90.90% <100.00%> (+0.90%) ⬆️
app/routes/index.js 76.00% <100.00%> (+3.27%) ⬆️

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 e603810...23162a2. Read the comment docs.

}
]
}
]
Copy link
Member

Choose a reason for hiding this comment

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

This shows all featured events including the ones from past

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

Nope. Reuse the returned filterOptions. This will break on search page

@iamareebjamal
Copy link
Member

Since call for speaker filtering using server will be difficult, change the computed property to filter those from combined featured and upcoming events

event_name = null;
filterDate = null;

@computed('filteredEvents.[]')
Copy link
Member

Choose a reason for hiding this comment

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

You haven't listed featured events in computed dependency

const endDateTime = callForPapers.get('endsAt');
const privacyState = callForPapers.get('privacy');
return (moment().isBetween(startDateTime, endDateTime) && (sessionEnabled) && (privacyState === 'public'));
let filteredEventsCfs = this.filteredEvents.filter(event => {
Copy link
Member

Choose a reason for hiding this comment

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

Why let and not const?

const endDateTime = callForPapers.get('endsAt');
const privacyState = callForPapers.get('privacy');
return (moment().isBetween(startDateTime, endDateTime) && (sessionEnabled) && (privacyState === 'public'));
let filteredEventsCfs = this.filteredEvents.filter(event => {
Copy link
Member

Choose a reason for hiding this comment

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

You can directly pass isEventCfsOpen in filter function, no need to create an arrow function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@Haider8 Haider8 requested a review from iamareebjamal July 30, 2020 11:21
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.

Perfect. Thanks

@iamareebjamal iamareebjamal merged commit c9cc816 into fossasia:development Jul 30, 2020
@Haider8 Haider8 deleted the query-featured-events branch July 30, 2020 14:01
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.

Front Page: Call for speakers not showing up Featured events no longer on start page

2 participants