-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add page for viewing pickup service information (#95)
* Add page for viewing pickup service information * filterData is now called mapData
- Loading branch information
1 parent
4492656
commit 82c73f2
Showing
5 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-pickup.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<link rel="import" href="../../../bower_components/polymer/polymer.html"> | ||
<link rel="import" href="../../../bower_components/lancie-ajax/lancie-ajax.html"> | ||
|
||
<link rel="import" href="../lancie-admin-page-layout.html"> | ||
<link rel="import" href="../../lancie-admin-table/lancie-admin-table.html"> | ||
|
||
<dom-module id="lancie-admin-pickup"> | ||
<template> | ||
<style> | ||
:host { | ||
display: block; | ||
} | ||
</style> | ||
|
||
<lancie-ajax auto-fire id="pickupAjax" refurl="tickets/transport" on-lancie-ajax="onResponse"></lancie-ajax> | ||
|
||
<lancie-admin-page-layout endpoint="Pickup"> | ||
<p>Here is an overview of all the people who bought Pickup Service, including relevant information.</p> | ||
|
||
<lancie-admin-table id="table"></lancie-admin-table> | ||
</lancie-admin-page-layout> | ||
|
||
</template> | ||
<script> | ||
(function () { | ||
'use strict'; | ||
|
||
Polymer({ | ||
is: 'lancie-admin-pickup', | ||
properties: { | ||
data: Object, | ||
endpoint: String, | ||
}, | ||
|
||
onResponse: function(e, request) { | ||
if (request.succeeded) { | ||
const data = request.response.map(person => this.mapData(person)); | ||
this.$.table.setData(data); | ||
} | ||
}, | ||
|
||
mapData: function(data) { | ||
return { | ||
"Ticket ID": data.id, | ||
"Name": `${data.owner.profile.firstName} ${data.owner.profile.lastName}`, | ||
"Email": data.owner.email, | ||
"Address": `${data.owner.profile.address} ${data.owner.profile.zipcode} ${data.owner.profile.city}`, | ||
"Phone number": data.owner.profile.phoneNumber, | ||
}; | ||
}, | ||
|
||
}); | ||
})(); | ||
</script> | ||
</dom-module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters