Skip to content

Conversation

@kushthedude
Copy link
Member

@kushthedude kushthedude commented Jul 10, 2019

Fixes #3254

Short description of what this resolves:

  • Showing Payment Information in case for Donation Tickets too.

Screenshot

image

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)

@auto-label auto-label bot added the fix label Jul 10, 2019
Anupam-dagar
Anupam-dagar previously approved these changes Jul 10, 2019
mrsaicharan1
mrsaicharan1 previously approved these changes Jul 10, 2019
Copy link
Member

@mrsaicharan1 mrsaicharan1 left a comment

Choose a reason for hiding this comment

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

Looks good

prateekj117
prateekj117 previously approved these changes Jul 10, 2019
Copy link
Member

@prateekj117 prateekj117 left a comment

Choose a reason for hiding this comment

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

LGTM

@kushthedude kushthedude changed the title fix: Showing Payment Options for Donations [WIP] fix: Showing Payment Options for Donations Jul 10, 2019
@auto-label auto-label bot removed the fix label Jul 10, 2019
Copy link
Member

@mrsaicharan1 mrsaicharan1 left a comment

Choose a reason for hiding this comment

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

Don't refactor the whole file with ES6 in this PR. Just solve the linked issue.

@kushthedude kushthedude reopened this Jul 11, 2019
@kushthedude kushthedude changed the title [WIP] fix: Showing Payment Options for Donations fix: Showing Payment Options for Donations Jul 11, 2019
@kushthedude
Copy link
Member Author

@mrsaicharan1 @niranjan94 Please take a look here, @computed decorator didn't do any good, So tried different way according to their docs.

@mrsaicharan1
Copy link
Member

@kushthedude I think we could follow ES6 styled computed properties for new resources.

@kushthedude kushthedude requested review from abhinavk96 and removed request for abhinavk96 July 12, 2019 20:32
@kushthedude
Copy link
Member Author

@CosmicCoder96 Please Check now

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.

return filter(this.get('data.event.tickets').toArray(), ticket => ticket.get('type') === 'paid' || ticket.get('type') === 'donation').length > 0;
  }

@kushthedude
Copy link
Member Author

@CosmicCoder96 Did the requested change

@kushthedude
Copy link
Member Author

@niranjan94 @CosmicCoder96 Please Review

hasPaidTickets: computed('data.event.tickets.[]', function() {
return filter(this.get('data.event.tickets').toArray(), ticket => ticket.get('type') === 'paid').length > 0;
hasPaidTickets: computed('data.event.tickets.@each.type', function() {
return filter(this.data.event.tickets.toArray(), ticket => ticket.type === 'paid' || ticket.type === 'donation').length > 0;
Copy link
Member

Choose a reason for hiding this comment

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

Use native filter function.

this.data.event.tickets.toArray().filter(

@kushthedude
Copy link
Member Author

Closed in favour of #3281

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.

Event Wizard: Show Payment Options when only Donation Tickets are there.

7 participants