-
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
Refactor to display events on public page via New API #399
Conversation
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.
@CosmicCoder96
app/models/event.js
Outdated
@@ -100,14 +100,14 @@ export default Model.extend({ | |||
* | |||
* @see app/models/discount-code.js | |||
*/ | |||
discountCode: belongsTo('discount-code'), | |||
discountCode: belongsTo('discount-code', {inverse:null}), |
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.
Lets keep event model clean and specify inverses on the discount-code model instead. Also, specify the correct inverses. Not null.
event : belongsTo('event', {
inverse: 'discountCodes'
}), // The event that this discount code belongs to [Form (2)]
events: hasMany('event', {
inverse: 'discountCode'
}) // The events that this discount code has been applied to [Form (1)]
app/routes/index.js
Outdated
filter:[ | ||
{ | ||
name: 'starts_at', | ||
op:'ge',val:moment().toISOString() |
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 val
to the next line please
app/serializers/event-topic.js
Outdated
@@ -2,6 +2,10 @@ import ApplicationSerializer from 'open-event-frontend/serializers/application'; | |||
|
|||
export default ApplicationSerializer.extend({ | |||
attrs: { | |||
subTopics: 'eventSubTopics' | |||
type : 'event-type', |
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 is the event topic serializer. Should only have subTopics: 'event-sub-topics'
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.
@CosmicCoder96 something seems to be wrong the with the updated lockfile. See travis logs.
df44f1c
to
09b53df
Compare
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.
@CosmicCoder96 what have you done here ? Please ... don't update any other packages. And don't use shrinkwrap. Let npm v5 generate it's own lockfile.
929c22c
to
4ede73c
Compare
Also @CosmicCoder96 the base branch was rebased. So, please update your branch accordingly. |
@niranjan94 It was a temporary mistake, didn't knew base branch was rebased, have done it now. |
@CosmicCoder96 that's alright... I rebased it just now. That's why I added a comment :) |
@CosmicCoder96 @niranjan94 Why are we locking ember-data to |
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.
@CosmicCoder96 run eslint please and ensure there are no linting errors.
app/serializers/event-topic.js
Outdated
@@ -2,6 +2,6 @@ import ApplicationSerializer from 'open-event-frontend/serializers/application'; | |||
|
|||
export default ApplicationSerializer.extend({ | |||
attrs: { | |||
subTopics: 'eventSubTopics' | |||
subTopics : 'event-sub-topics' |
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.
Would cause an eslint fail.
app/routes/index.js
Outdated
include: 'event_topic,event_sub_topic,event_type', | ||
filter:[ | ||
{ | ||
name: 'starts_at', |
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.
The colons are not aligned. Would cause an eslint fail.
@geekyd we have a bug in the latest ember-data package with regards to displaying model relationships on the template. So, until they fix it, we lock our package to the version that works. In js, it's always better to lock your packages and update after testing. |
@niranjan94 Got it. Thanks for the reference :) |
@niranjan94 @geekyd fixed all of linting |
</span> | ||
</div> | ||
{{#smart-overflow class='description'}} | ||
{{event.shortLocationName}} |
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 have you used description instead of shortLocationName
?
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.
@niranjan94 Had confused it with the class thought it should be here 😅 apologies, I have changed it back.
@niranjan94 We've released a new version of ember data that may fix the issue you had. |
Checklist
development
branch.Short description of what this resolves:
Refactors the models and app to display events on public page via new API.
Changes proposed in this pull request: