Skip to content

Commit

Permalink
Add page for viewing pickup service information (#95)
Browse files Browse the repository at this point in the history
* Add page for viewing pickup service information

* filterData is now called mapData
  • Loading branch information
bramvankooten authored Feb 25, 2020
1 parent 4492656 commit 82c73f2
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions gulp/polymer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-users.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-types/lancie-admin-types.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-seats/lancie-admin-seats.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-pickup.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-mail/lancie-admin-mail.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-homepage-text.html",
"src/lancie-admin-endpoint/lancie-admin-pages/lancie-admin-roles.html",
Expand Down
1 change: 1 addition & 0 deletions src/lancie-admin-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<lancie-admin-teams data-route="teams" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-teams.html"></lancie-admin-teams>
<lancie-admin-types data-route="types" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-types/lancie-admin-types.html"></lancie-admin-types>
<lancie-admin-seats data-route="seats" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-seats/lancie-admin-seats.html"></lancie-admin-seats>
<lancie-admin-pickup data-route="pickup" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-pickup.html"></lancie-admin-pickup>
<lancie-admin-homepage-text data-route="text" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-homepage-text.html"></lancie-admin-homepage-text>
<lancie-admin-mail data-route="mail" data-path="lancie-admin-endpoint/lancie-admin-pages/lancie-admin-mail/lancie-admin-mail.html"></lancie-admin-mail>
<lancie-admin-web data-route="web" data-path="lancie-admin-web/lancie-admin-web.html"></lancie-admin-web>
Expand Down
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>
1 change: 1 addition & 0 deletions src/lancie-admin-icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
<g id="timeline"><path d="M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z"/></g>
<g id="web"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/></g>
<g id="visibility"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"></path></g>
<g id="pickup"><path d="M12 16.5l4-4h-3v-9h-2v9H8l4 4zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2z"/></g>
</defs></svg>
</iron-iconset-svg>
4 changes: 4 additions & 0 deletions src/lancie-admin-layout/lancie-admin-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
<iron-icon icon="lancie-admin:event-seat" slot="item-icon"></iron-icon>
<a href="/seats">Seats</a>
</paper-icon-item>
<paper-icon-item data-route="pickup">
<iron-icon icon="lancie-admin:pickup" slot="item-icon"></iron-icon>
<a href="/pickup">Pickup Service</a>
</paper-icon-item>
<paper-icon-item data-route="text">
<iron-icon icon="lancie-admin:text" slot="item-icon"></iron-icon>
<a href="/text">Text</a>
Expand Down

0 comments on commit 82c73f2

Please sign in to comment.