-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@srv-twry @mayank8318 @pradeepgangwar @ritikamotwani @schedutron Please review |
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.
Highly unoptimised code.
@@ -165,11 +165,28 @@ export default Mixin.create(MutableArray, CustomFormMixin, { | |||
}); | |||
}, | |||
|
|||
validateEventDate(eventEndsAt, speakerCallStartsAt, speakerCallEndsAt) { | |||
if (eventEndsAt && speakerCallStartsAt && eventEndsAt < speakerCallStartsAt) { return false } |
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.
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'); |
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.
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'); |
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.
this.get('data.speakerCall.startsAt')
this.set('data.event.state', 'draft'); | ||
this.sendAction('save'); | ||
} else { | ||
this.get('notify').error('Invalid Start or End Date'); |
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.
No translation helper.
Checklist
development
branch.Short description of what this resolves:
Shows notify error when Speaker Call start or end date is after Event end date.
Fixes #1156