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: Download ticket and invoice made available to ticket purchaser only #5806

Merged
merged 1 commit into from
Nov 28, 2020

Conversation

codedsun
Copy link
Contributor

@codedsun codedsun commented Nov 28, 2020

Fixes #5623
Fixes fossasia/open-event-server#7397

Short description of what this resolves:

Changes proposed in this pull request:

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 Nov 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/8z4iykymc
✅ Preview: https://open-event-frontend-git-permissions.eventyay.vercel.app

@codedsun
Copy link
Contributor Author

image

image

@codecov
Copy link

codecov bot commented Nov 28, 2020

Codecov Report

Merging #5806 (b8859ef) into development (bf9cbee) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #5806      +/-   ##
===============================================
+ Coverage        23.45%   23.47%   +0.02%     
===============================================
  Files              512      512              
  Lines             5445     5456      +11     
  Branches            63       63              
===============================================
+ Hits              1277     1281       +4     
- Misses            4152     4159       +7     
  Partials            16       16              
Impacted Files Coverage Δ
app/helpers/general-date.js 66.66% <0.00%> (-33.34%) ⬇️
app/components/public/session-item.js 18.18% <0.00%> (-1.82%) ⬇️
app/controllers/public/index.js 6.25% <0.00%> (-0.10%) ⬇️
app/routes/create.js 100.00% <0.00%> (ø)
app/components/public/call-for-speakers.js 0.00% <0.00%> (ø)
app/components/public/stream/video-stream.ts 4.00% <0.00%> (ø)
app/controllers/events/view/videoroom/list.js 0.00% <0.00%> (ø)
app/helpers/header-date.js
app/models/video-stream.ts 0.00% <0.00%> (ø)

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 bf9cbee...b8859ef. Read the comment docs.

Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Thanks, but this is a bit confusing for the user. First the user sees a button. Then the user clicks on the button. Then the use gets the info - "The information is not available". In that case if the user has not bought the tickets, the button should not be there at all.

Therefore please change this as follows:

  • Show the download link of the user ticket (only for that user) in the user area
  • For users who have not bought the ticket (just received it from someone else), do not show "All Tickets" and "Invoice" button.

@@ -13,6 +13,10 @@ export default class ViewController extends Controller {

@action
downloadInvoice(eventName, orderId) {
if (this.model.order.user.get('id') !== this.authManager.currentUser.id) {
confirm('Only the account that made the order is able to access this invoice.');
Copy link
Member

Choose a reason for hiding this comment

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

This is browser confirm, not our dialog

@@ -44,6 +48,10 @@ export default class ViewController extends Controller {
}

downloadTickets(eventName, orderId) {
if (this.model.order.user.get('id') !== this.authManager.currentUser.id) {
Copy link
Member

Choose a reason for hiding this comment

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

This should download the attendee tickets instead

@codedsun
Copy link
Contributor Author

@iamareebjamal

image

@iamareebjamal
Copy link
Member

order.user should not be available to the ticket holder

Please open a server issue for this

@codedsun
Copy link
Contributor Author

image

@iamareebjamal iamareebjamal merged commit fc2ae86 into fossasia:development Nov 28, 2020
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.

Complete Order Page: Implement Per Ticket Download Ticket PDF should exist for each attendee
3 participants