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: Disallow speaker call start, end dates after event end date #1628

Merged
merged 1 commit into from
Aug 12, 2018

Conversation

mooocer
Copy link
Member

@mooocer mooocer commented Aug 12, 2018

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)

Short description of what this resolves:

Shows notify error when Speaker Call start or end date is after Event end date.

Fixes #1156

@open-event-bot

This comment has been minimized.

@codecov
Copy link

codecov bot commented Aug 12, 2018

Codecov Report

Merging #1628 into development will decrease coverage by 0.07%.
The diff coverage is 0%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #1628      +/-   ##
===============================================
- Coverage        24.33%   24.26%   -0.08%     
===============================================
  Files              381      381              
  Lines             3439     3450      +11     
===============================================
  Hits               837      837              
- Misses            2602     2613      +11
Impacted Files Coverage Δ
app/mixins/event-wizard.js 1.31% <0%> (-0.23%) ⬇️

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 2802efc...f6a4264. Read the comment docs.

@mooocer
Copy link
Member Author

mooocer commented Aug 12, 2018

@srv-twry @mayank8318 @pradeepgangwar @ritikamotwani @schedutron Please review

@dr0pdb dr0pdb merged commit c75ae5b into fossasia:development Aug 12, 2018
@mooocer mooocer deleted the cfsdate branch August 12, 2018 18:18
abhinavk96 added a commit that referenced this pull request Aug 12, 2018
Copy link
Contributor

@abhinavk96 abhinavk96 left a comment

Choose a reason for hiding this comment

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

Highly unoptimised code.

@@ -165,11 +165,28 @@ export default Mixin.create(MutableArray, CustomFormMixin, {
});
},

validateEventDate(eventEndsAt, speakerCallStartsAt, speakerCallEndsAt) {
if (eventEndsAt && speakerCallStartsAt && eventEndsAt < speakerCallStartsAt) { return false }
Copy link
Contributor

Choose a reason for hiding this comment

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

why are two there three return statements to return a binary value? use OR operator .

this.set('data.event.state', 'draft');
this.sendAction('save');
var isValidDate = true;
var eventEndsAt = this.get('data.event').get('endsAt');
Copy link
Contributor

Choose a reason for hiding this comment

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

two consecutive gets. Should be this.get('data.event.endsAt');

var isValidDate = true;
var eventEndsAt = this.get('data.event').get('endsAt');
if (this.get('data.speakersCall')) {
var speakerCallStartsAt = this.get('data.speakersCall').get('startsAt');
Copy link
Contributor

Choose a reason for hiding this comment

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

this.get('data.speakerCall.startsAt')

this.set('data.event.state', 'draft');
this.sendAction('save');
} else {
this.get('notify').error('Invalid Start or End Date');
Copy link
Contributor

Choose a reason for hiding this comment

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

No translation helper.

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.

Call for Speakers end date allowed to go after Event's end date
3 participants