From 988ac981bfff6be90bb4df10be8228459cf571c5 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Tue, 13 Sep 2016 17:51:04 +0200 Subject: [PATCH 01/25] Added webapp --- .../datastore/datastore-indexes-auto.xml | 11 +-- IntelliQ/backend/datastore/local_db.bin | Bin 18056 -> 8903 bytes .../appengine/website/IntelliQServlet.java | 6 +- .../backend/src/main/webapp/WEB-INF/web.xml | 18 ++++ .../backend/src/main/webapp/static/js/api.js | 13 +++ .../src/main/webapp/static/js/edit_queue.js | 2 +- .../src/main/webapp/static/js/general.js | 41 ++++----- .../src/main/webapp/static/js/manage.js | 62 +------------- .../backend/src/main/webapp/static/js/ui.js | 54 ++++++++++++ .../src/main/webapp/static/js/webapp.js | 81 ++++++++++++++++++ .../src/main/webapp/website/en/webapp.jsp | 52 +++++++++++ .../website/includes/en/common_head.jsp | 1 + .../website/includes/en/webapp_footer.jsp | 70 +++++++++++++++ .../website/includes/en/webapp_navigation.jsp | 23 +++++ 14 files changed, 340 insertions(+), 94 deletions(-) create mode 100644 IntelliQ/backend/src/main/webapp/static/js/webapp.js create mode 100644 IntelliQ/backend/src/main/webapp/website/en/webapp.jsp create mode 100644 IntelliQ/backend/src/main/webapp/website/includes/en/webapp_footer.jsp create mode 100644 IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 906b906..a343fa5 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,11 +1,4 @@ - + - + - - - - - - - diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 6fc84f07d7ed208303ef667308684e6ccb1b6362..689e256d88e2fe62e42b44f7ecadb2b04184129c 100644 GIT binary patch delta 1122 zcmbW1OK1~O6o%*C%)}&3(zK-2rb$e#wQW|ZcB(5e)q;$vOZ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 zUC#4kkO#J9DhKS>nXt1Y+x>(3Jdb3boB6O@*q+=6^?=5d}tI-4_~x&lD$|*L=%)KwD;VfIi6r4ahQT{X_Sl zdDQxeC-;5fQ0Xg0t%cnEEt{hR5_)q&b)FSh6mWJiD_T}^a6ZN4oF&xm7a;q1g!<7# z`^)8=w^?kvB*OAzyCEs?nSDo`ukxPBFy=U7yVG#Xd&aJH=E z;QSVgGZ4#2wEI=Z0iJw*@3lvq=EBk>I;VZU1@>A(mvIY`6z44=J|5DRogAcJWRV7D z8Pe`W`ZUjEc;KP`I%PC%8W#JD8Tp%UaykR~+wq-hAE*Gei>0(>CW L8vgXlqN)D@8|cS( diff --git a/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java b/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java index 9b9f639..c516bed 100644 --- a/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java +++ b/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java @@ -52,7 +52,11 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) //forwardUrl += "manage/overviewservlet/"; } } else if (requestUrl.contains("/apps/")) { - forwardUrl += "appsservlet/"; + if (requestUrl.contains("/web/")) { + forwardUrl += "webappservlet/"; + } else { + forwardUrl += "appsservlet/"; + } } else if (requestUrl.contains("/unternehmen/") || requestUrl.contains("/business/")) { forwardUrl += "businessservlet/"; } else if (requestUrl.contains("/signin/")) { diff --git a/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml b/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml index de50e87..93ed714 100644 --- a/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml +++ b/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml @@ -243,4 +243,22 @@ /intelliq/en/display/queueservlet/* + + + de/apps/web + /website/en/webapp.jsp + + + de/apps/web + /intelliq/de/webappservlet/* + + + en/apps/web + /website/en/webapp.jsp + + + en/apps/web + /intelliq/en/webappservlet/* + + diff --git a/IntelliQ/backend/src/main/webapp/static/js/api.js b/IntelliQ/backend/src/main/webapp/static/js/api.js index 9e40d08..5696865 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/api.js +++ b/IntelliQ/backend/src/main/webapp/static/js/api.js @@ -52,6 +52,7 @@ var intelliqApi = function(){ api.ENDPOINT_QUEUE = api.ENDPOINT_API + "queue/"; api.ENDPOINT_QUEUE_GET = api.ENDPOINT_QUEUE + "get/"; + api.ENDPOINT_QUEUE_NEARBY = api.ENDPOINT_QUEUE + "nearby/"; api.ENDPOINT_QUEUE_ADD = api.ENDPOINT_QUEUE + "add/"; api.ENDPOINT_QUEUE_EDIT = api.ENDPOINT_QUEUE + "edit/"; api.ENDPOINT_QUEUE_POPULATE = api.ENDPOINT_QUEUE + "populate/"; @@ -349,6 +350,18 @@ var intelliqApi = function(){ return request; } + api.getNearbyQueues = function(latitude, longitude) { + var request = api.request(api.ENDPOINT_QUEUE_NEARBY); + request.addParameter("latitude", latitude); + request.addParameter("longitude", longitude); + + request.inRange = function(distance) { + request.addParameter("distance", distance); + } + + return request; + } + api.addQueue = function(queue) { var request = api.request(api.ENDPOINT_QUEUE_ADD); request.addParameter("businessKeyId", queue.businessKeyId); diff --git a/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js b/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js index 538902f..53ca8f0 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js @@ -333,7 +333,7 @@ function updateQueueLocationMarker(latitude, longitude) { // and reverse-geocodes the address function updateFormWithDeviceLocation() { Materialize.toast(getString("locatingDevice"), 3000); - getDeviceLocation().then(function(location){ + requestDeviceLocation().then(function(location){ deviceLocation = location; var latitude = location.coords.latitude; diff --git a/IntelliQ/backend/src/main/webapp/static/js/general.js b/IntelliQ/backend/src/main/webapp/static/js/general.js index cb172f9..742e5d2 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/general.js +++ b/IntelliQ/backend/src/main/webapp/static/js/general.js @@ -11,24 +11,6 @@ function whenAvailable(name, callback) { }, interval); } -function getDeviceLocation() { - var promise = new Promise(function(resolve, reject) { - try { - navigator.geolocation.getCurrentPosition(function(position) { - console.log(position); - //var lat = position.coords.latitude; - //var long = position.coords.longitude; - resolve(position) - }, function() { - reject("Location request blocked"); - }); - } catch(ex) { - reject(ex); - } - }); - return promise; -} - function getDecodedUrlParam(sParam) { var value = getUrlParam(sParam); if (value != null) { @@ -122,11 +104,20 @@ function getCookie(cname) { return ""; } -function getDistanceBetween(lat1, lon1, lat2, lon2) { - var p = 0.017453292519943295; // Math.PI / 180 - var c = Math.cos; - var a = 0.5 - c((lat2 - lat1) * p)/2 + - c(lat1 * p) * c(lat2 * p) * - (1 - c((lon2 - lon1) * p))/2; - return 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km +function requestDeviceLocation() { + var promise = new Promise(function(resolve, reject) { + try { + navigator.geolocation.getCurrentPosition(function(position) { + console.log(position); + //var lat = position.coords.latitude; + //var long = position.coords.longitude; + resolve(position) + }, function(error) { + reject("Location request blocked"); + }); + } catch(ex) { + reject(ex); + } + }); + return promise; } \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/manage.js b/IntelliQ/backend/src/main/webapp/static/js/manage.js index 490bdee..a6a3282 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/manage.js +++ b/IntelliQ/backend/src/main/webapp/static/js/manage.js @@ -49,7 +49,7 @@ function renderBusinesses(entries, container) { var options = {}; options.itemGenerator = ui.generateBusinessCard; options.itemWrapperGenerator = generateCardWrapper; - renderEntries(entries, container, options); + ui.renderEntries(entries, container, options); } function renderQueues(entries, container) { @@ -61,7 +61,7 @@ function renderQueues(entries, container) { var options = {}; options.itemGenerator = ui.generateQueueCard; options.itemWrapperGenerator = generateCardWrapper; - renderEntries(entries, container, options); + ui.renderEntries(entries, container, options); } function renderQueueItems(entries, container) { @@ -73,59 +73,5 @@ function renderQueueItems(entries, container) { var options = {}; options.itemGenerator = ui.generateQueueItemCollectionItem; options.wrapperGenerator = wrapperGenerator; - renderEntries(entries, container, options); -} - -function renderEntries(entries, container, options) { - if (container == null || container.length < 1) { - return; - } - container.empty(); - var wrapper = container; - - if (options.wrapperGenerator != null) { - wrapper = options.wrapperGenerator(); - } - - for (var i = 0; i < entries.length; i++) { - try { - // create a item - var item = options.itemGenerator(entries[i]); - - if (options.itemWrapperGenerator != null) { - // create a div that wraps the item - var itemWrapper = options.itemWrapperGenerator(); - - // render the item in the item wrapper - item.renderIn(itemWrapper); - - // add the item wrapper to the wrapper - wrapper.append(itemWrapper); - } else { - // add the item to the wrapper - wrapper.append(item); - } - } catch (ex) { - console.log("Unable to render entry:"); - console.log(ex); - } - } - - if (options.wrapperGenerator != null) { - container.append(wrapper); - } else { - container = wrapper; - } - - if (entries.length < 1) { - container.hide(); - container.parent().find(".emptyState").removeClass("hide"); - } else { - container.show(); - container.parent().find(".emptyState").addClass("hide"); - } - - // re-initialize tooltips - $(".material-tooltip").remove(); - $(".tooltipped").tooltip({ delay: 250 }); -} + ui.renderEntries(entries, container, options); +} \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/ui.js b/IntelliQ/backend/src/main/webapp/static/js/ui.js index 18c5808..6d7bf3f 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/ui.js +++ b/IntelliQ/backend/src/main/webapp/static/js/ui.js @@ -536,6 +536,60 @@ var ui = function(){ return getString("unknown"); } + ui.renderEntries = function(entries, container, options) { + if (container == null || container.length < 1) { + return; + } + container.empty(); + var wrapper = container; + + if (options.wrapperGenerator != null) { + wrapper = options.wrapperGenerator(); + } + + for (var i = 0; i < entries.length; i++) { + try { + // create a item + var item = options.itemGenerator(entries[i]); + + if (options.itemWrapperGenerator != null) { + // create a div that wraps the item + var itemWrapper = options.itemWrapperGenerator(); + + // render the item in the item wrapper + item.renderIn(itemWrapper); + + // add the item wrapper to the wrapper + wrapper.append(itemWrapper); + } else { + // add the item to the wrapper + wrapper.append(item); + } + } catch (ex) { + console.log("Unable to render entry:"); + console.log(ex); + } + } + + if (options.wrapperGenerator != null) { + container.append(wrapper); + } else { + container = wrapper; + } + + if (entries.length < 1) { + container.hide(); + container.parent().find(".emptyState").removeClass("hide"); + } else { + container.show(); + container.parent().find(".emptyState").addClass("hide"); + } + + // re-initialize tooltips + $(".material-tooltip").remove(); + $(".tooltipped").tooltip({ delay: 250 }); + } + /* Location */ diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js new file mode 100644 index 0000000..6e6b8f7 --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -0,0 +1,81 @@ +var deviceLocation; + +(function($){ + $(function(){ + initAuthentication(); + requestNearbyQueues(); + }); +})(jQuery); + +/* + Initializes the authentication +*/ +function initAuthentication() { + var statusChangeListener = { + onGoogleSignIn: function() { + ui.hideSignInForm(); + authenticator.requestIntelliqUserFromGoogleIdToken().then(function(user) { + + }).catch(function(error) { + console.log("Unable to get IntelliQ user from Google ID token: " + error); + ui.showErrorMessage(error); + }); + }, + + onGoogleSignOut: function() { + ui.hideSignOutForm(); + //ui.showSignInForm(); + }, + + onUserAvailable: function(user) { + + } + }; + authenticator.registerStatusChangeListener(statusChangeListener); + + authenticator.requestGoogleSignInStatus().then(function(isSignedIn) { + if (isSignedIn) { + statusChangeListener.onGoogleSignIn(); + } else { + statusChangeListener.onGoogleSignOut(); + } + }).catch(function(error) { + ui.showErrorMessage(error); + }); +} + +function requestNearbyQueues() { + // request device location + requestDeviceLocation().then(function(location){ + deviceLocation = location; + + var latitude = location.coords.latitude; + var longitude = location.coords.longitude; + + // request queues at location + var request = intelliqApi.getNearbyQueues(latitude, longitude); + request.send().then(function(data){ + var queues = intelliqApi.getQueuesFromBusinessResponse(data); + console.log(queues); + renderQueues(queues, $("#queuesContainer")); + }).catch(function(error){ + console.log(error); + showErrorMessage(error); + }); + }).catch(function(error){ + console.log(error); + showErrorMessage(getString("locationUnavailable") + ": " + error); + }); +} + +function renderQueues(entries, container) { + var generateCardWrapper = function() { + var className = ui.generateColumnClassName(12, 6, 6); + return ui.generateCardWrapper(className); + } + + var options = {}; + options.itemGenerator = ui.generateQueueCard; + options.itemWrapperGenerator = generateCardWrapper; + ui.renderEntries(entries, container, options); +} \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp new file mode 100644 index 0000000..a4082ed --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp @@ -0,0 +1,52 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java"%> + + + IntelliQ.me - Web App + <%@include file="../includes/en/common_head.jsp"%> + + + + <%@include file="../includes/en/webapp_navigation.jsp"%> +
+
+ + +
+
Nearby Queues
+
+
+ + +
+
+

We couldn't find any queues nearby.

+
+
+
+
+
+
+
+
+
+ + +
+
+ + group_add + Create a Queue + +
You can create a new queue at any time. It's free, no payment information required.
+
+
+ +
+
+ +
+
+ <%@include file="../includes/en/webapp_footer.jsp"%> + + + \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp index 05fc4ca..a4b31d7 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp @@ -49,6 +49,7 @@ "editQueue": "Edit Queue", "populatingQueue": "Popuating queue", + "locationUnavailable": "Location unavailable", "locatingDevice": "Updating device location", "geocodingAddress": "Getting location for address", "geocodingLocation": "Getting address for location", diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_footer.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_footer.jsp new file mode 100644 index 0000000..79079a5 --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_footer.jsp @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp new file mode 100644 index 0000000..bd343f3 --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp @@ -0,0 +1,23 @@ + +
+ +
From f5815ba254aebe9e13011303de51cd8263b44f8b Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Wed, 14 Sep 2016 13:03:23 +0200 Subject: [PATCH 02/25] Added asset link json file for deep linking support --- .../datastore/datastore-indexes-auto.xml | 2 +- IntelliQ/backend/datastore/local_db.bin | Bin 8903 -> 8903 bytes .../com/intelliq/appengine/RequestFilter.java | 4 ++++ .../appengine/website/IntelliQServlet.java | 1 + .../src/main/webapp/static/assetlinks.json | 11 +++++++++ .../src/main/webapp/static/js/webapp.js | 1 - .../src/main/webapp/website/en/webapp.jsp | 7 +++++- .../website/includes/en/webapp_navigation.jsp | 6 ++--- IntelliQ/mobile/mobile.iml | 22 +++++++----------- IntelliQ/wear/wear.iml | 10 -------- 10 files changed, 34 insertions(+), 30 deletions(-) create mode 100644 IntelliQ/backend/src/main/webapp/static/assetlinks.json diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index a343fa5..65fe5eb 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,4 +1,4 @@ - + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 689e256d88e2fe62e42b44f7ecadb2b04184129c..0662cd2f015c79261bf7998d5ea187b37ecd1c9c 100644 GIT binary patch delta 41 zcmV+^0M`GBY!+J#PJIu4 diff --git a/IntelliQ/backend/src/main/java/com/intelliq/appengine/RequestFilter.java b/IntelliQ/backend/src/main/java/com/intelliq/appengine/RequestFilter.java index 895d592..2f2566c 100644 --- a/IntelliQ/backend/src/main/java/com/intelliq/appengine/RequestFilter.java +++ b/IntelliQ/backend/src/main/java/com/intelliq/appengine/RequestFilter.java @@ -40,6 +40,10 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha if (path.startsWith("/static") || path.startsWith("/_ah") || path.startsWith("/intelliq")) { // preserve special routes filterChain.doFilter(request, response); + } else if(uri.contains(".well-known/assetlinks.json")) { + // redirect to Digital Asset Links JSON file + RequestDispatcher rd = request.getRequestDispatcher("/static/assetlinks.json"); + rd.forward(request, response); } else { // forward request to matching servlet RequestDispatcher rd = request.getRequestDispatcher("/intelliq" + path); diff --git a/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java b/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java index c516bed..b91134b 100644 --- a/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java +++ b/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java @@ -73,6 +73,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) req.setAttribute("rootUrl", rootUrl); req.setAttribute("requestUrl", requestUrl.replace("/intelliq", "")); req.setAttribute("staticUrl", rootUrl + "/static/"); + req.setAttribute("appUrl", rootUrl + "/apps/web/"); try { rd.forward(req, resp); diff --git a/IntelliQ/backend/src/main/webapp/static/assetlinks.json b/IntelliQ/backend/src/main/webapp/static/assetlinks.json new file mode 100644 index 0000000..e44e0ae --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/static/assetlinks.json @@ -0,0 +1,11 @@ +[{ + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "com.steppschuh.intelliq", + "sha256_cert_fingerprints": [ + "69:36:21:B8:B9:5D:F2:C6:0F:5A:B9:AE:36:35:89:CD:0C:36:51:FE", + "65:D6:85:5D:3B:55:33:25:2B:32:97:A7:02:F6:BA:A7:76:F3:6C:4B" + ] + } +}] \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index 6e6b8f7..b74ddc3 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -3,7 +3,6 @@ var deviceLocation; (function($){ $(function(){ initAuthentication(); - requestNearbyQueues(); }); })(jQuery); diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp index a4082ed..1f30efb 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp @@ -19,7 +19,7 @@
-

We couldn't find any queues nearby.

+

Looks like there aren't any queues nearby.

@@ -48,5 +48,10 @@ <%@include file="../includes/en/webapp_footer.jsp"%> + \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp index bd343f3..667b410 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp @@ -9,10 +9,10 @@ diff --git a/IntelliQ/mobile/mobile.iml b/IntelliQ/mobile/mobile.iml index 734359f..1c492df 100755 --- a/IntelliQ/mobile/mobile.iml +++ b/IntelliQ/mobile/mobile.iml @@ -64,14 +64,6 @@ - - - - - - - - @@ -80,6 +72,14 @@ + + + + + + + + @@ -123,8 +123,6 @@ - - @@ -185,16 +183,12 @@ - - - - diff --git a/IntelliQ/wear/wear.iml b/IntelliQ/wear/wear.iml index 6c94458..7de1927 100755 --- a/IntelliQ/wear/wear.iml +++ b/IntelliQ/wear/wear.iml @@ -83,8 +83,6 @@ - - @@ -93,20 +91,12 @@ - - - - - - - - From 2a998db49394a5c1864a6ad6ba2d35e118e35448 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Wed, 14 Sep 2016 15:35:09 +0200 Subject: [PATCH 03/25] Minor style & layout adjustments --- .../datastore/datastore-indexes-auto.xml | 11 ++++- IntelliQ/backend/datastore/local_db.bin | Bin 8903 -> 9511 bytes .../src/main/webapp/static/css/style.css | 12 +++-- .../backend/src/main/webapp/static/js/api.js | 10 +++++ .../main/webapp/static/js/edit_business.js | 42 ++++++++++-------- .../src/main/webapp/static/js/edit_queue.js | 40 ++++++++++------- .../src/main/webapp/static/js/manage.js | 4 +- .../backend/src/main/webapp/static/js/ui.js | 39 +++++++++++++--- .../src/main/webapp/static/js/webapp.js | 2 +- .../src/main/webapp/website/en/apps.jsp | 20 ++++----- .../src/main/webapp/website/en/home.jsp | 8 ++-- .../src/main/webapp/website/en/webapp.jsp | 2 +- .../website/includes/en/common_head.jsp | 2 + .../website/includes/en/webapp_navigation.jsp | 6 +-- IntelliQ/mobile/mobile.iml | 12 ++--- IntelliQ/wear/wear.iml | 16 +++---- 16 files changed, 145 insertions(+), 81 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 65fe5eb..7dbca23 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,4 +1,11 @@ - + - + + + + + + + + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 0662cd2f015c79261bf7998d5ea187b37ecd1c9c..a8fbf36bc65e1d015bcbdba66fb14f093c145c76 100644 GIT binary patch delta 270 zcmX@^y4-7mEMw%+KHg76mtat Du7gP;`x!e#7)y&7n4+E5d=~$~#u4&>iGiV_ zVDm#E878K4ER+9>$Z+!qq!#6778hsc=S@B!B*iUITF6kxz{kMA@NTjIo7Uz?rd0mT z5~4DUlS?G-usmu%uzzxhWFXU7u", { + "src": imageSrc, + "class": "animated activator", + "alt": business.name + " Cover" + }); + + card.withImage(image); + card.withImageRatio(3/2); + + card.withContent().withTitle(business.name, false); + + var revealableContent = $("

").text(business.mail); + card.withRevealableContent(revealableContent).withTitle(business.name); + + var manageUrl = intelliqApi.getUrls().forBusiness(business).manage(); + var manageAction = ui.generateAction(getString("manage"), manageUrl); + + var editUrl = intelliqApi.getUrls().forBusiness(business).edit(); + var editAction = ui.generateAction(getString("edit"), editUrl); + card.withActions([manageAction, editAction]); + + return card; + } + + ui.generateManageQueueCard = function(queue) { var card = ui.generateCard() var imageWidth = Math.min(500, $(window).width() / 2); @@ -443,10 +472,10 @@ var ui = function(){ card.withRevealableContent(revealableContent).withTitle(queue.name); var manageUrl = intelliqApi.getUrls().forQueue(queue).manage(); - var manageAction = ui.generateAction("Manage", manageUrl); + var manageAction = ui.generateAction(getString("manage"), manageUrl); var editUrl = intelliqApi.getUrls().forQueue(queue).edit(); - var editAction = ui.generateAction("Edit", editUrl); + var editAction = ui.generateAction(getString("edit"), editUrl); card.withActions([manageAction, editAction]); return card; diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index b74ddc3..ea4525c 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -52,7 +52,7 @@ function requestNearbyQueues() { var longitude = location.coords.longitude; // request queues at location - var request = intelliqApi.getNearbyQueues(latitude, longitude); + var request = intelliqApi.getNearbyQueues(latitude, longitude).includeBusinesses(true); request.send().then(function(data){ var queues = intelliqApi.getQueuesFromBusinessResponse(data); console.log(queues); diff --git a/IntelliQ/backend/src/main/webapp/website/en/apps.jsp b/IntelliQ/backend/src/main/webapp/website/en/apps.jsp index 1beb250..92bc2e6 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/apps.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/apps.jsp @@ -15,16 +15,14 @@



-

IntelliQ.me

+

Join a Queue

-
Get our free app for Android or iOS
- +
And stop wasting your lifetime while waiting in line

-
@@ -45,10 +43,10 @@
Android
-

Get IntelliQ for your Android smartphone or Wear device from the Play Store

+

Get IntelliQ.me for your Android smartphone and Wear device from the Play Store.

@@ -60,10 +58,10 @@
iOS
-

Visit the Apple App Store to get IntelliQ for your iPhone or Apple Watch.

+

Visit the Apple App Store to get IntelliQ.me for your iPhone and Apple Watch.

@@ -75,10 +73,10 @@
Web
-

If you own a Google Chromebook you can get the IntelliQ Chrome extension.

+

If you don't want to download the native IntelliQ.me app right now, simply use your browser.

diff --git a/IntelliQ/backend/src/main/webapp/website/en/home.jsp b/IntelliQ/backend/src/main/webapp/website/en/home.jsp index b0ce3ca..2155351 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/home.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/home.jsp @@ -13,7 +13,7 @@
-

IntelliQ.me

+

Smarter Waiting

@@ -22,7 +22,7 @@
For Users
-

Use your waiting time more effectively and download the free IntelliQ.me app

+

Spend your waiting time more effectively and start using the free IntelliQ.me app

Get the App @@ -35,9 +35,9 @@

business

-
For Business
+
For Businesses
-

Learn how to get more satisfied customers and save costs by using IntelliQ.me

+

Learn how to get satisfied customers and save costs by using IntelliQ.me

Learn More diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp index 1f30efb..bf4c489 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp @@ -37,7 +37,7 @@ group_add Create a Queue -
You can create a new queue at any time. It's free, no payment information required.
+
You can create a new queue at any time. It's free!
diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp index a4b31d7..d5cee83 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp @@ -44,6 +44,8 @@ "deletingQueueItems": "Deleting queue items", "noQueueItems": "No queue items available", + "edit": "Edit", + "manage": "Manage", "editBusiness": "Edit Business", "addBusiness": "Add Business", "editQueue": "Edit Queue", diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp index 667b410..34818fb 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp @@ -10,9 +10,9 @@ diff --git a/IntelliQ/mobile/mobile.iml b/IntelliQ/mobile/mobile.iml index 1c492df..5c26365 100755 --- a/IntelliQ/mobile/mobile.iml +++ b/IntelliQ/mobile/mobile.iml @@ -42,12 +42,6 @@ - - - - - - @@ -56,6 +50,12 @@ + + + + + + diff --git a/IntelliQ/wear/wear.iml b/IntelliQ/wear/wear.iml index 7de1927..8915bb1 100755 --- a/IntelliQ/wear/wear.iml +++ b/IntelliQ/wear/wear.iml @@ -64,14 +64,6 @@ - - - - - - - - @@ -80,6 +72,14 @@ + + + + + + + + From 156af2fcfe4bc2466a10f5e603620bb133e18b42 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Wed, 14 Sep 2016 17:00:41 +0200 Subject: [PATCH 04/25] Implemented nearby queues rendering --- .../datastore/datastore-indexes-auto.xml | 11 +-- IntelliQ/backend/datastore/local_db.bin | Bin 9511 -> 10600 bytes .../src/main/webapp/static/css/style.css | 23 +++++ .../backend/src/main/webapp/static/js/ui.js | 87 +++++++++++++----- .../src/main/webapp/static/js/webapp.js | 10 +- .../src/main/webapp/website/en/webapp.jsp | 2 +- 6 files changed, 93 insertions(+), 40 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 7dbca23..5c0c889 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,11 +1,4 @@ - + - + - - - - - - - diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index a8fbf36bc65e1d015bcbdba66fb14f093c145c76..57333552427dcef4fcbd6bdbff12ec73538275d0 100644 GIT binary patch delta 531 zcmZ4P^&)73EMw0`ITuDIW`@ZrjGGySHcK!q5a22;WT<1{V_;x-Gg*L5i*eCpM^H}pghh(U z(0DS3cuKvQk#UiM6n9E$adJ^+K}lwQ9#C3dN;Wtj=$`zN450F&#JrUJTm>X0MYtSn z1eD>-$x7)AM zlmCfG0VO^$B%p4Pkx&GPeOx{0i;v$QvZ>YpR|f3 rr38~oi!<|5i;Gi>or_WvOHxyS>X|qgCU0alVf+s?R(A7Y$rNq?Yw)5a delta 142 zcmaD6wA^cgEMw", { "class": "card hoverable" }); card.withImage = function(image) { - if (card.find(".card-image").length > 0) { - return card; - } - var imageContainer = $("
", { "class": "card-image invisible" }) imageContainer.append(image); imageContainer.prependTo(card); @@ -122,6 +118,7 @@ var ui = function(){ } card.fillImage(); + return card; } card.fillImage = function() { @@ -163,6 +160,7 @@ var ui = function(){ }); imageElement.attr("originalWidth", currentImageWidth); imageElement.attr("originalHeight", currentImageHeight); + return card; } var imageContainer = card.find(".card-image"); @@ -183,6 +181,23 @@ var ui = function(){ } $(window).resize(card.resizeImageContainer); + return card; + } + + card.withImageOverlay = function(overlay) { + // get the first image that hasn't any overlay + var image = card.find(".card-image").last(); + card.find(".card-image").each(function(index) { + if ($(this).find(".overlay-content").length == 0) { + image = $(this); + return false; + } + }); + + var overlayContainer = $("
", { "class": "overlay-content" }) + overlayContainer.append(overlay); + overlayContainer.appendTo(image); + return card; } return card; @@ -197,9 +212,9 @@ var ui = function(){ contentContainer.append(content); if (card.find(".card-image").length > 0) { - contentContainer.insertAfter(card.find(".card-image")); + contentContainer.insertAfter(card.find(".card-image").last()); } else if (card.find(".card-action").length > 0) { - contentContainer.insertBefore(card.find(".card-action")); + contentContainer.insertBefore(card.find(".card-action").first()); } else { contentContainer.appendTo(card); } @@ -255,8 +270,8 @@ var ui = function(){ } var defaultOptions = { - minimumTilesPerRow: 2, - maximumTilesPerRow: 4 + minimumTilesPerRow: 1, + maximumTilesPerRow: 2 }; if (options == null) { @@ -309,7 +324,7 @@ var ui = function(){ tilesContainer.append(tileWrappers); if (card.find(".card-action").length > 0) { - tilesContainer.insertBefore(card.find(".card-action")); + tilesContainer.insertBefore(card.find(".card-action").first()); } else { tilesContainer.appendTo(card); } @@ -394,32 +409,54 @@ var ui = function(){ return collectionItem; } - ui.generateBusinessCard = function(business) { + ui.generateBusinessWithQueuesCard = function(business) { var card = ui.generateCard() var imageWidth = Math.min(500, $(window).width() / 2); - var imageSrc = intelliqApi.getUrls().forImage(business.logoImageKeyId).resizedTo(imageWidth); - var image = $("", { - "src": imageSrc, - "class": "animated activator", - "alt": business.name + " Cover" - }); + for (var queueIndex = 0; queueIndex < business.queues.length; queueIndex++) { + var queue = business.queues[queueIndex]; + + var imageSrc = intelliqApi.getUrls().forImage(queue.photoImageKeyId).resizedTo(imageWidth); + var image = $("", { + "src": imageSrc, + "class": "animated medium-blur", + "alt": business.name + " Cover" + }); - card.withImage(image); - card.withImageRatio(3/2); + card.withImage(image); + + var overlay = $("

", { + "class": "truncate" + }).text(queue.name); + card.withImageOverlay(overlay); + } + card.withImageRatio(3/1); + card.withContent().withTitle(business.name, false); + return card; + } - var revealableContent = $("

").text(business.mail); - card.withRevealableContent(revealableContent).withTitle(business.name); + ui.generateBusinessWithQueuesCardOld = function(business) { + var card = ui.generateCard() - var manageUrl = intelliqApi.getUrls().forBusiness(business).manage(); - var manageAction = ui.generateAction(getString("manage"), manageUrl); + var imageWidth = Math.min(500, $(window).width() / 2); + for (var queueIndex = 0; queueIndex < business.queues.length; queueIndex++) { + var queue = business.queues[queueIndex]; + + var imageSrc = intelliqApi.getUrls().forImage(queue.photoImageKeyId).resizedTo(imageWidth); + var image = $("", { + "src": imageSrc, + "class": "animated activator", + "alt": business.name + " Cover" + }); - var editUrl = intelliqApi.getUrls().forBusiness(business).edit(); - var editAction = ui.generateAction(getString("edit"), editUrl); - card.withActions([manageAction, editAction]); + card.withImage(image); + } + card.withImageRatio(3/1); + + card.withContent().withTitle(business.name, false); return card; } diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index ea4525c..5cf9d69 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -54,9 +54,9 @@ function requestNearbyQueues() { // request queues at location var request = intelliqApi.getNearbyQueues(latitude, longitude).includeBusinesses(true); request.send().then(function(data){ - var queues = intelliqApi.getQueuesFromBusinessResponse(data); - console.log(queues); - renderQueues(queues, $("#queuesContainer")); + var businesses = intelliqApi.getBusinessesFromResponse(data); + console.log(businesses); + renderBusinesses(businesses, $("#businessesContainer")); }).catch(function(error){ console.log(error); showErrorMessage(error); @@ -67,14 +67,14 @@ function requestNearbyQueues() { }); } -function renderQueues(entries, container) { +function renderBusinesses(entries, container) { var generateCardWrapper = function() { var className = ui.generateColumnClassName(12, 6, 6); return ui.generateCardWrapper(className); } var options = {}; - options.itemGenerator = ui.generateQueueCard; + options.itemGenerator = ui.generateBusinessWithQueuesCard; options.itemWrapperGenerator = generateCardWrapper; ui.renderEntries(entries, container, options); } \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp index bf4c489..22210bd 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp @@ -21,7 +21,7 @@

Looks like there aren't any queues nearby.

-
+
From 6a8beb488fcf46d4ebba2f1b748c036796eb3418 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Thu, 15 Sep 2016 15:27:24 +0200 Subject: [PATCH 05/25] Implemented queue rendering --- .../datastore/datastore-indexes-auto.xml | 11 +- IntelliQ/backend/datastore/local_db.bin | Bin 10600 -> 22465 bytes .../appengine/website/IntelliQServlet.java | 6 +- .../backend/src/main/webapp/WEB-INF/web.xml | 18 ++ .../src/main/webapp/static/css/style.css | 20 +- .../backend/src/main/webapp/static/js/api.js | 36 ++- .../main/webapp/static/js/edit_business.js | 4 +- .../src/main/webapp/static/js/edit_queue.js | 12 +- .../src/main/webapp/static/js/general.js | 7 + .../src/main/webapp/static/js/manage_queue.js | 44 ++-- .../src/main/webapp/static/js/tracking.js | 1 + .../backend/src/main/webapp/static/js/ui.js | 80 ++++-- .../src/main/webapp/static/js/webapp.js | 21 +- .../src/main/webapp/static/js/webapp_queue.js | 242 ++++++++++++++++++ .../webapp/website/en/manage_business.jsp | 2 +- .../src/main/webapp/website/en/webapp.jsp | 4 +- .../main/webapp/website/en/webapp_queue.jsp | 80 ++++++ .../website/includes/en/common_head.jsp | 4 + 18 files changed, 518 insertions(+), 74 deletions(-) create mode 100644 IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js create mode 100644 IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 5c0c889..272dc4f 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,4 +1,11 @@ - + - + + + + + + + + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 57333552427dcef4fcbd6bdbff12ec73538275d0..aa218f734974e8e52c6264111a50a9850bdc8c89 100644 GIT binary patch literal 22465 zcmd^{e{dA#8OQgIkX&*hgyTnG5jkhn8R?K;q(JH)1rm@*KqWytZD- z+cZUyL_^k8{ravURg4f#m4~I!W+Ap%|4-$nO|3tg!FfA5Pt@RMchd73=y?rr{N_$> zW;AX{g9aB!98m-{+;CfOKV0z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_i`v}On(ro5%TNUB=UJ!$S}L{Omwl%&l09+w zq8;jdhR1BlhDWGm_>jclW`Q{ML#lIh#6@0PrXpY;V8Tw5Z1)QVyD)kE$2SfXF4-Ad z7dF5nZIIR*h^%h6P3r|Yq+JY-mYoRFud+x3GelY+XHa0C%_ZucNc8O%64mR6nHfjmXG8F;) zekSZR4RJ5nV;I=)O_`6pIG}~kbjZ#5%$;UgTXM2t+iz<}jgDs?J980kLImtXEZBf; PaFBi~X=UQujKTi`Z>Tdj delta 119 zcmX@Op7BM{1X;$OjdHGxj0}@g7&kKtZI)n~COCPKs1hUN*N|~&dDN*j+^xqrZO^L>OV4hzJlyzE@e}u|EwTIlN(jk89639Y8h|7 Uqw<%FzoMd$p^kwQLNQkW0O$QBbpQYW diff --git a/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java b/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java index b91134b..679c7c6 100644 --- a/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java +++ b/IntelliQ/backend/src/main/java/com/intelliq/appengine/website/IntelliQServlet.java @@ -53,7 +53,11 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) } } else if (requestUrl.contains("/apps/")) { if (requestUrl.contains("/web/")) { - forwardUrl += "webappservlet/"; + if (requestUrl.contains("/queue/")) { + forwardUrl += "webapp/queueservlet/"; + } else { + forwardUrl += "webappservlet/"; + } } else { forwardUrl += "appsservlet/"; } diff --git a/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml b/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml index 93ed714..fc00ff6 100644 --- a/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml +++ b/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml @@ -261,4 +261,22 @@ /intelliq/en/webappservlet/* + + + de/apps/web/queue + /website/en/webapp_queue.jsp + + + de/apps/web/queue + /intelliq/de/webapp/queueservlet/* + + + en/apps/web/queue + /website/en/webapp_queue.jsp + + + en/apps/web/queue + /intelliq/en/webapp/queueservlet/* + + diff --git a/IntelliQ/backend/src/main/webapp/static/css/style.css b/IntelliQ/backend/src/main/webapp/static/css/style.css index 2e366e0..ca06edc 100644 --- a/IntelliQ/backend/src/main/webapp/static/css/style.css +++ b/IntelliQ/backend/src/main/webapp/static/css/style.css @@ -138,11 +138,12 @@ a { vertical-align: middle; } -.card-image .overlay-content p { +.card-image .overlay-content a { color: #fff; - bottom: 0; - left: 0; - padding: 20px; + padding-top: 30px; + padding-right: 20px; + padding-bottom: 30px; + padding-left: 10px; width: 100%; font-size: 20px; font-weight: 300; @@ -306,6 +307,13 @@ a { h5 { font-size: 1.5rem; } + + .card .card-content .card-title { + font-size: 20px; + font-weight: 300; + line-height: 1; + } + } .background-image-container { @@ -471,4 +479,8 @@ footer.page-footer { .accent-color-text { color: #fd4482 !important; +} + +.warning-color { + background-color: #d50000 !important; } \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/api.js b/IntelliQ/backend/src/main/webapp/static/js/api.js index 74c4904..a08528e 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/api.js +++ b/IntelliQ/backend/src/main/webapp/static/js/api.js @@ -78,6 +78,10 @@ var intelliqApi = function(){ api.PAGE_LINK_CREATE = api.PAGE_LINK + "create/"; api.PAGE_LINK_DISPLAY = api.PAGE_LINK + "display/"; + api.PAGE_LINK_WEB_APP = api.PAGE_LINK + "apps/web/"; + api.PAGE_LINK_WEB_APP_NEARBY = api.PAGE_LINK_WEB_APP + "nearby/"; + api.PAGE_LINK_WEB_APP_QUEUE = api.PAGE_LINK_WEB_APP + "queue/"; + api.PATH_BUSINESS = "business/"; api.PATH_QUEUE = "queue/"; @@ -347,6 +351,16 @@ var intelliqApi = function(){ api.getQueue = function(queueKeyId) { var request = api.request(api.ENDPOINT_QUEUE_GET); request.addParameter("queueKeyId", queueKeyId); + + request.includeBusiness = function(value) { + if (value) { + request.addParameter("includeBusiness", "true"); + } else { + request.addParameter("includeBusiness", "false"); + } + return request; + } + return request; } @@ -500,6 +514,12 @@ var intelliqApi = function(){ return request; } + api.getQueueItem = function(queueItemKeyId) { + var request = api.request(api.ENDPOINT_QUEUE_ITEM_GET); + request.addParameter("queueItemKeyId", queueItemKeyId); + return request; + } + api.addQueueItem = function(queueKeyId) { var request = api.request(api.ENDPOINT_QUEUE_ITEM_ADD); request.addParameter("queueKeyId", queueKeyId); @@ -520,6 +540,15 @@ var intelliqApi = function(){ return request; } + request.usingApp = function(value) { + if (value) { + request.addParameter("usingApp", "true"); + } else { + request.addParameter("usingApp", "false"); + } + return request; + } + return request; } @@ -757,7 +786,7 @@ var intelliqApi = function(){ urls.resizedTo = function(size) { if (top.location.origin == "file://") { - return "http://localhost:8888/image/" + imageKeyId + "/" + size + ".jpg"; + return api.HOST_LOCAL + "image/" + imageKeyId + "/" + size + ".jpg"; } else { return api.PAGE_LINK + "image/" + imageKeyId + "/" + size + ".jpg"; } @@ -796,6 +825,11 @@ var intelliqApi = function(){ return urls.replaceParameter("queueKeyId", queue.key.id, url); } + urls.openInWebApp = function() { + var url = api.PAGE_LINK_WEB_APP_QUEUE; + return urls.replaceParameter("queueKeyId", queue.key.id, url); + } + return urls; } diff --git a/IntelliQ/backend/src/main/webapp/static/js/edit_business.js b/IntelliQ/backend/src/main/webapp/static/js/edit_business.js index 2c4a2ae..dc0a19e 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/edit_business.js +++ b/IntelliQ/backend/src/main/webapp/static/js/edit_business.js @@ -42,7 +42,7 @@ function requestExistingBusinessData(businessKeyId) { }).catch(function(error){ console.log(error); $(".loadingState").hide(); - showErrorMessage(error); + ui.showErrorMessage(error); }); } @@ -102,7 +102,7 @@ function saveNewBusiness() { console.log(data); window.location.href = intelliqApi.PAGE_LINK_MANAGE; }, function(error) { - showErrorMessage(error); + ui.showErrorMessage(error); }); } diff --git a/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js b/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js index 57281d2..9c7dce6 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/edit_queue.js @@ -47,7 +47,7 @@ function requestExistingQueueData(queueKeyId) { }).catch(function(error){ console.log(error); $(".loadingState").hide(); - showErrorMessage(error); + ui.showErrorMessage(error); }); } @@ -174,7 +174,7 @@ function saveNewQueue() { var business = { "key": { "id": newQueue.businessKeyId } }; window.location.href = intelliqApi.getUrls().forBusiness(business).manage(); }, function(error) { - showErrorMessage(error); + ui.showErrorMessage(error); }); } @@ -242,7 +242,7 @@ function initializeMap() { updateQueueLocationMarker(location.latitude, location.longitude); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); }); @@ -254,7 +254,7 @@ function initializeMap() { updateFormWithGoogleAddressData(results); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); }); @@ -360,11 +360,11 @@ function updateFormWithDeviceLocation() { updateFormWithGoogleAddressData(results); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); } diff --git a/IntelliQ/backend/src/main/webapp/static/js/general.js b/IntelliQ/backend/src/main/webapp/static/js/general.js index 742e5d2..a8bbf88 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/general.js +++ b/IntelliQ/backend/src/main/webapp/static/js/general.js @@ -85,6 +85,9 @@ function removeClassName(div, newClass) { } function setCookie(cname, cvalue, exdays) { + if (typeof exdays === 'undefined') { + exdays = 7; + } var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires=" + d.toUTCString(); @@ -120,4 +123,8 @@ function requestDeviceLocation() { } }); return promise; +} + +function navigateTo(url) { + window.location.href = url; } \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js b/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js index e5207f6..715a1e6 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js @@ -28,7 +28,7 @@ function updateQueue() { startUpdatingQueueItems(UPDATE_INTERVAL_DEFAULT); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); } @@ -39,7 +39,7 @@ function updateQueueItems() { lastQueueItemsUpdate = (new Date()).getTime(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); } @@ -236,7 +236,7 @@ function callNextQueueItem() { callQueueItem(queueItem); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -251,12 +251,12 @@ function callQueueItem(queueItem) { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Call queue item", queueItem.name, queueItem.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -271,12 +271,12 @@ function cancelQueueItem(queueItem) { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Cancel queue item", queueItem.name, queueItem.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -291,12 +291,12 @@ function markAllCalledQueueItemsAsDone() { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Mark all called queue items as done", queue.name, queue.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -311,12 +311,12 @@ function markQueueItemAsDone(queueItem) { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Mark queue item as done", queueItem.name, queueItem.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -331,12 +331,12 @@ function deleteAllQueueItems() { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Delete all queue items", queue.name, queue.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -351,12 +351,12 @@ function deleteAllProcessedQueueItems() { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Delete processed queue items", queue.name, queue.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -371,12 +371,12 @@ function deleteQueueItem(queueItem) { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Delete queue item", queueItem.name, queueItem.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -391,12 +391,12 @@ function reportQueueItem(queueItem) { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Report queue item", queueItem.name, queueItem.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -411,12 +411,12 @@ function populateQueue() { onQueueItemsModified(); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Populate queue", queue.name, queue.key.id); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } @@ -449,7 +449,7 @@ function onAddNewCustomerModalSubmitted() { tracking.trackEvent(tracking.CATEGORY_QUEUE_MANAGE, "Submit new queue item modal", name, hideName ? 1 : 0); } catch(error) { console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); } } diff --git a/IntelliQ/backend/src/main/webapp/static/js/tracking.js b/IntelliQ/backend/src/main/webapp/static/js/tracking.js index 780b055..49d38a1 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/tracking.js +++ b/IntelliQ/backend/src/main/webapp/static/js/tracking.js @@ -12,6 +12,7 @@ var tracking = function(){ tracking.CATEGORY_QUEUE_EDIT = "Edit Queue"; tracking.CATEGORY_BUSINESS_MANAGE = "Manage Business"; tracking.CATEGORY_BUSINESS_EDIT = "Edit Business"; + tracking.CATEGORY_WEBAPP = "Web App"; // for opt-out tracking.enabled = true; diff --git a/IntelliQ/backend/src/main/webapp/static/js/ui.js b/IntelliQ/backend/src/main/webapp/static/js/ui.js index 6fa1b60..b0ba5a6 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/ui.js +++ b/IntelliQ/backend/src/main/webapp/static/js/ui.js @@ -184,7 +184,7 @@ var ui = function(){ return card; } - card.withImageOverlay = function(overlay) { + card.withImageOverlay = function(overlay, clickHandler) { // get the first image that hasn't any overlay var image = card.find(".card-image").last(); card.find(".card-image").each(function(index) { @@ -195,6 +195,8 @@ var ui = function(){ }); var overlayContainer = $("
", { "class": "overlay-content" }) + overlay.click(clickHandler); + overlayContainer.append(overlay); overlayContainer.appendTo(image); return card; @@ -425,33 +427,17 @@ var ui = function(){ card.withImage(image); - var overlay = $("

", { - "class": "truncate" - }).text(queue.name); - card.withImageOverlay(overlay); - } - card.withImageRatio(3/1); - - card.withContent().withTitle(business.name, false); - return card; - } - - ui.generateBusinessWithQueuesCardOld = function(business) { - var card = ui.generateCard() - - var imageWidth = Math.min(500, $(window).width() / 2); - for (var queueIndex = 0; queueIndex < business.queues.length; queueIndex++) { - var queue = business.queues[queueIndex]; - - var imageSrc = intelliqApi.getUrls().forImage(queue.photoImageKeyId).resizedTo(imageWidth); - var image = $("", { - "src": imageSrc, - "class": "animated activator", - "alt": business.name + " Cover" - }); + var url = intelliqApi.getUrls().forQueue(queue).openInWebApp(); + var clickHandler = function() { + navigateTo(url); + } - card.withImage(image); + var overlay = $("", { + "href": url, + "class": "truncate" + }).text(queue.name); + card.withImageOverlay(overlay, clickHandler); } card.withImageRatio(3/1); @@ -518,6 +504,48 @@ var ui = function(){ return card; } + ui.generateQueueCard = function(queue) { + var card = ui.generateCard() + + var imageWidth = Math.min(500, $(window).width() / 2); + var imageSrc = intelliqApi.getUrls().forImage(queue.photoImageKeyId).resizedTo(imageWidth); + var image = $("", { + "src": imageSrc, + "class": "animated activator", + "alt": queue.name + " Cover" + }); + + card.withImage(image); + card.withImageRatio(3/2); + + card.withContent().withTitle(queue.name, false); + + var revealableContent = $("

").text(queue.description); + card.withRevealableContent(revealableContent).withTitle(queue.name); + + return card; + } + + ui.generateQueueDescriptionCard = function(queue) { + var card = ui.generateCard() + + var title = getString("description"); + var content = $("

").text(queue.description); + + card.withContent(content).withTitle(title, false); + return card; + } + + ui.generateQueueItemCard = function(queueItem) { + var card = ui.generateCard() + + var title = getString("ticket"); + var content = $("

").text(queueItem.ticketNumber); + + card.withContent(content).withTitle(title, false); + return card; + } + ui.generateQueueItemCollectionItem = function(queueItem) { var collectionItem = ui.generateCollectionItem(); collectionItem.css("cursor", "pointer"); diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index 5cf9d69..cea0611 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -59,22 +59,29 @@ function requestNearbyQueues() { renderBusinesses(businesses, $("#businessesContainer")); }).catch(function(error){ console.log(error); - showErrorMessage(error); + ui.showErrorMessage(error); }); }).catch(function(error){ console.log(error); - showErrorMessage(getString("locationUnavailable") + ": " + error); + ui.showErrorMessage(getString("locationUnavailable") + ": " + error); }); } function renderBusinesses(entries, container) { - var generateCardWrapper = function() { - var className = ui.generateColumnClassName(12, 6, 6); - return ui.generateCardWrapper(className); - } - var options = {}; options.itemGenerator = ui.generateBusinessWithQueuesCard; options.itemWrapperGenerator = generateCardWrapper; ui.renderEntries(entries, container, options); +} + +function renderQueues(entries, container) { + var options = {}; + options.itemGenerator = ui.generateQueueCard; + options.itemWrapperGenerator = generateCardWrapper; + ui.renderEntries(entries, container, options); +} + +function generateCardWrapper() { + var className = ui.generateColumnClassName(12, 6, 6); + return ui.generateCardWrapper(className); } \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js new file mode 100644 index 0000000..6e1d5f0 --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -0,0 +1,242 @@ +var queue; +var business; +var queueItem; + +$(function(){ + requestQueueDetails(); + + // add customer modal + $("#sbmitNewCustomerButton").click(onJoinQueueModalSubmitted); + $('#newCustomerName').keypress(function(e) { + if (e.which == 13) { + onJoinQueueModalSubmitted(); + return false; + } + }); +}); + +function requestQueueDetails() { + var queueKeyId = getUrlParamOrCookie("queueKeyId"); + var request = intelliqApi.getQueue(queueKeyId).includeBusiness(true); + request.send().then(function(data){ + try { + var businesses = intelliqApi.getBusinessesFromResponse(data); + if (businesses.length < 1) { + throw "Business not found"; + } + console.log(businesses); + business = businesses[0]; + if (business.queues.length < 1) { + throw "Queue not found"; + } + + queue = business.queues[0]; + var container = $("#queueContainer"); + renderQueues(business.queues, container); + + $("#joinQueueButton").click(function() { + joinQueue(queue); + }); + + $("#leaveQueueButton").click(function() { + leaveQueue(queue); + }); + + //renderQueueDescription(queue, container); + $("#joinQueueButton").removeClass("disabled"); + + requestQueueItem(); + } catch(error) { + console.log(error); + ui.showErrorMessage(error); + } + }).catch(function(error){ + console.log(error); + ui.showErrorMessage(error); + }); +} + +function requestQueueItem() { + var queueItemKeyId = getUrlParamOrCookie("queueItemKeyId"); + if (queueItemKeyId.length < 1) { + return; + } + + var request = intelliqApi.getQueueItem(queueItemKeyId); + request.send().then(function(data){ + try { + var queueItems = intelliqApi.getQueueItemsFromResponse(data); + if (queueItems.length < 1) { + throw "Queue item not found"; + } + queueItem = queueItems[0]; + onQueueJoined(queueItem); + } catch(error) { + console.log(error); + ui.showErrorMessage(error); + } + }).catch(function(error){ + console.log(error); + ui.showErrorMessage(error); + }); +} + +function renderQueueDescription(queue, container) { + var wrapper = generateCardWrapper(); + var descriptionCard = ui.generateQueueDescriptionCard(queue); + descriptionCard.renderIn(wrapper); + wrapper.appendTo(container); +} + +function renderQueueItem(queueItem, container) { + var wrapper = generateCardWrapper(); + var queueItemCard = ui.generateQueueItemCard(queueItem); + queueItemCard.renderIn(wrapper); + wrapper.appendTo(container); +} + +function joinQueue(queue) { + // check if queue requires signin + if (queue.requiresSignIn) { + authenticator.requestGoogleSignInStatus().then(function(isSignedIn) { + if (isSignedIn) { + showJoinQueueModal(); + } else { + // request a sign in + authenticator.registerStatusChangeListener({ + onGoogleSignIn: function() { + showJoinQueueModal(); + } + }); + ui.showSignInForm(); + } + }).catch(function(error) { + ui.showErrorMessage(error); + }); + } else { + showJoinQueueModal(); + } +} + +function leaveQueue(queue) { + var cancelQueuetem = function() { + Materialize.toast(getString("leavingQueue"), 3000); + var queueItemKeyId = getUrlParamOrCookie("queueItemKeyId"); + var request = intelliqApi.markQueueItemAsCanceled(queue.key.id, queueItemKeyId); + if (authenticator.getGoogleSignInStatus()) { + request.setGoogleIdToken(authenticator.getGoogleUserIdToken()); + } + + request.send().then(function(data){ + try { + console.log(data); + onQueueLeft(); + } catch(error) { + console.log(error); + ui.showErrorMessage(error); + } + }).catch(function(error){ + console.log(error); + ui.showErrorMessage(error); + }); + } + + // check if queue requires signin + if (queue.requiresSignIn) { + authenticator.requestGoogleSignInStatus().then(function(isSignedIn) { + if (isSignedIn) { + cancelQueuetem(); + } else { + // request a sign in + authenticator.registerStatusChangeListener({ + onGoogleSignIn: function() { + cancelQueuetem(); + } + }); + ui.showSignInForm(); + } + }).catch(function(error) { + ui.showErrorMessage(error); + }); + } else { + cancelQueuetem(); + } + + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Canceling queue ticket", queue.name, queue.key.id); +} + +function showJoinQueueModal() { + $("#newCustomerName").val(""); + authenticator.requestGoogleSignInStatus().then(function(isSignedIn) { + if ($("#newCustomerName").val() == "") { + var userName = authenticator.getGoogleUser().getBasicProfile().getName() + $("#newCustomerName").val(userName); + } + }); + $("#joinQueueModal").openModal(); + $("#newCustomerName").focus(); + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Show join queue modal"); +} + +function onJoinQueueModalSubmitted() { + try { + var name = $("#newCustomerName").val(); + var hideName = $("#newCustomerVisibility").prop("checked") == false; + + Materialize.toast(getString("joiningQueue"), 3000); + var request = intelliqApi.addQueueItem(queue.key.id) + .withName(name) + .hideName(hideName) + .usingApp(true); + + if (authenticator.getGoogleSignInStatus()) { + request.setGoogleIdToken(authenticator.getGoogleUserIdToken()); + } + + request.send().then(function(data){ + try { + console.log(data); + var queueItems = intelliqApi.getQueueItemsFromResponse(data); + if (queueItems.length < 1) { + throw "Queue item not found"; + } + queueItem = queueItems[0]; + + // persist data in cookies + setCookie("queueKeyId", queueItem.queueKeyId); + setCookie("queueItemKeyId", queueItem.key.id); + setCookie("queueItem", JSON.stringify(queueItem)); + + onQueueJoined(queueItem); + } catch(error) { + console.log(error); + ui.showErrorMessage(error); + } + }).catch(function(error){ + console.log(error); + ui.showErrorMessage(error); + }); + $("#joinQueueModal").closeModal(); + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Submit join queue modal", queue.name, queue.key.id); + } catch(error) { + console.log(error); + ui.showErrorMessage(error); + } +} + +function onQueueJoined(queueItem) { + renderQueueItem(queueItem, $("#queueContainer")); + // TODO: scroll to rendered card + + $("#joinQueueContainer").addClass("hide"); + $("#joinQueueButton").addClass("disabled"); + $("#leaveQueueContainer").removeClass("hide"); + $("#leaveQueueButton").removeClass("disabled"); +} + +function onQueueLeft() { + $("#joinQueueContainer").removeClass("hide"); + $("#joinQueueButton").removeClass("disabled"); + $("#leaveQueueContainer").addClass("hide"); + $("#leaveQueueButton").addClass("disabled"); +} \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/en/manage_business.jsp b/IntelliQ/backend/src/main/webapp/website/en/manage_business.jsp index d390020..acfc2ba 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/manage_business.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/manage_business.jsp @@ -34,7 +34,7 @@

- business + group_add Add Queue
Queues can keep track of your customers. You can add multiple queues to one business. Make sure that you don't confuse your customers and choose unique names.
diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp index 22210bd..dea7fb4 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp @@ -1,7 +1,7 @@ <%@ page contentType="text/html;charset=UTF-8" language="java"%> - IntelliQ.me - Web App + IntelliQ.me - Nearby <%@include file="../includes/en/common_head.jsp"%> @@ -37,7 +37,7 @@ group_add Create a Queue -
You can create a new queue at any time. It's free!
+
You can create a new queue at any time. It's free, no payment info required!
diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp new file mode 100644 index 0000000..76e2a57 --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp @@ -0,0 +1,80 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java"%> + + + IntelliQ.me - Queue + <%@include file="../includes/en/common_head.jsp"%> + + + + <%@include file="../includes/en/webapp_navigation.jsp"%> +
+
+ + +
+
Queue
+
+
+ + +
+
+

We're unable to find the requested queue.

+
+
+
+
+
+
+
+
+
+ + +
+
+ + group_add + Join this Queue + +
In order to claim your ticket, join the queue. We'll then provide you with your ticket details.
+
+
+ + clear + Leave this Queue + +
Leaving this queue will cancel your current ticket. Keep in mind that doing this often will hurt your reputation.
+
+
+ +
+
+ + + + +
+
+ <%@include file="../includes/en/webapp_footer.jsp"%> + + + + \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp index d5cee83..b12d881 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp @@ -50,6 +50,8 @@ "addBusiness": "Add Business", "editQueue": "Edit Queue", "populatingQueue": "Popuating queue", + "joiningQueue": "Joining queue", + "leavingQueue": "Leaving queue", "locationUnavailable": "Location unavailable", "locatingDevice": "Updating device location", @@ -58,6 +60,8 @@ "updatedQueueLocation": "Updated queue location", "updateAddressForLocation": "Update address for location", + "ticket": "Ticket", + "description": "Description", "waitingCustomers": "[VALUE] waiting customers", "unknown": "Unknown", From 0d3e8abc12653fa856eb5cba01728382f389ade6 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Thu, 15 Sep 2016 15:52:08 +0200 Subject: [PATCH 06/25] Improved queue rendering --- .../datastore/datastore-indexes-auto.xml | 11 ++++---- IntelliQ/backend/datastore/local_db.bin | Bin 22465 -> 22465 bytes .../src/main/webapp/static/js/general.js | 4 +++ .../src/main/webapp/static/js/webapp_queue.js | 25 ++++++++++++++++-- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 272dc4f..7197a5c 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,11 +1,12 @@ - + - - - - + + + + + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index aa218f734974e8e52c6264111a50a9850bdc8c89..bc24d693f730dfe2f4768d728aba4c2c17f4e167 100644 GIT binary patch delta 75 zcmV-R0JQ(XuK~fY0kC5M0rInC0l^pn@{>R#7n6P@2D3vN&Ittg%kJ=#pdcKR3L`ZE h@smI!7qfmO+A;+A>%{Pr@Gv$4=?9bXB^#5kR}!_bAWHxM delta 75 zcmV-R0JQ(XuK~fY0kC5M0m-vu0l^pn$&)}M7n6P@2D3vN&Its)u$J(XpdcKR3L`ZE h$df=L7qfmO+A;*-o8a%0@Gv$4w+EB)B^#5kR}y(J9-{yN diff --git a/IntelliQ/backend/src/main/webapp/static/js/general.js b/IntelliQ/backend/src/main/webapp/static/js/general.js index a8bbf88..7953593 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/general.js +++ b/IntelliQ/backend/src/main/webapp/static/js/general.js @@ -107,6 +107,10 @@ function getCookie(cname) { return ""; } +function deleteCookie(cname) { + setCookie(cname, "", -1); +} + function requestDeviceLocation() { var promise = new Promise(function(resolve, reject) { try { diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js index 6e1d5f0..7f4c70f 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -58,7 +58,13 @@ function requestQueueDetails() { function requestQueueItem() { var queueItemKeyId = getUrlParamOrCookie("queueItemKeyId"); - if (queueItemKeyId.length < 1) { + if (queueItemKeyId == null || queueItemKeyId.length < 1) { + return; + } + var queueKeyId = getUrlParam("queueKeyId"); + var queueItem = JSON.parse(getUrlParamOrCookie("queueItem")); + if (queueItem.queueKeyId != queueKeyId) { + // queueItem belongs to a different queue return; } @@ -130,7 +136,16 @@ function leaveQueue(queue) { request.send().then(function(data){ try { console.log(data); + + // delete cookies + deleteCookie("queueKeyId"); + deleteCookie("queueItemKeyId"); + deleteCookie("queueItem"); + onQueueLeft(); + + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue ticket canceled", queue.name, queue.key.id); + location.reload(); } catch(error) { console.log(error); ui.showErrorMessage(error); @@ -162,7 +177,6 @@ function leaveQueue(queue) { cancelQueuetem(); } - tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Canceling queue ticket", queue.name, queue.key.id); } function showJoinQueueModal() { @@ -208,6 +222,13 @@ function onJoinQueueModalSubmitted() { setCookie("queueItem", JSON.stringify(queueItem)); onQueueJoined(queueItem); + + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue ticket created", queue.name, queue.key.id); + + // update url + var url = intelliqApi.getUrls().forQueue(queue).openInWebApp(); + url = intelliqApi.getUrls().replaceParameter("queueItemKeyId", queueItem.key.id, url); + window.history.pushState(null, "Ticket", url); } catch(error) { console.log(error); ui.showErrorMessage(error); From 446126d8b03e78da739b3f3d4bf62bbde76be6d4 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Thu, 15 Sep 2016 16:28:17 +0200 Subject: [PATCH 07/25] Minor tracking changes --- .../backend/src/main/webapp/static/js/webapp_queue.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js index 7f4c70f..9a60066 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -79,11 +79,11 @@ function requestQueueItem() { onQueueJoined(queueItem); } catch(error) { console.log(error); - ui.showErrorMessage(error); + //ui.showErrorMessage(error); } }).catch(function(error){ console.log(error); - ui.showErrorMessage(error); + //ui.showErrorMessage(error); }); } @@ -144,7 +144,7 @@ function leaveQueue(queue) { onQueueLeft(); - tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue ticket canceled", queue.name, queue.key.id); + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue item canceled", queue.name, queue.key.id); location.reload(); } catch(error) { console.log(error); @@ -223,7 +223,7 @@ function onJoinQueueModalSubmitted() { onQueueJoined(queueItem); - tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue ticket created", queue.name, queue.key.id); + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue item created", queue.name, queue.key.id); // update url var url = intelliqApi.getUrls().forQueue(queue).openInWebApp(); From d5d5ecd7e432f263f70fcab0fe63eb900ec87a7a Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Fri, 16 Sep 2016 08:50:36 +0200 Subject: [PATCH 08/25] Queue rendering improvements --- .../datastore/datastore-indexes-auto.xml | 16 +- IntelliQ/backend/datastore/local_db.bin | Bin 22465 -> 19576 bytes .../backend/src/main/webapp/static/js/ui.js | 5 +- .../src/main/webapp/static/js/webapp.js | 4 +- .../src/main/webapp/static/js/webapp_queue.js | 2 +- IntelliQ/mobile/mobile.iml | 168 +++++++++--------- IntelliQ/wear/wear.iml | 16 +- 7 files changed, 122 insertions(+), 89 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 7197a5c..0b2f3e4 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,12 +1,24 @@ - + - + + + + + + + + + + + + + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index bc24d693f730dfe2f4768d728aba4c2c17f4e167..96f2418619da087784ad05f6b719e22299a60b75 100644 GIT binary patch delta 3124 zcmai0aZDT68TUJ%jeQ2}Ffit9oFi_UmX-mHFNl&d456b0xv$uF^U_YxB-g$l*aH&12;f%0~B}7j8WWs6!#v*eMV#WCB^|)_zQFt z-YUF`j^Sqz-gW;K9fw(aIZS%ap|j+#!z=30$58Fqh~9(*_b@YWBMyD+Fc@$oV%vzH zJMtc8cH4~z{>Q_vLwhlVM-#9quLi#{fNzj6vzG#=32>SK-_0YyX#yN2wWbN=?Eo&e995hsk4Ofw^{@woR% z#Qehnkx&J2zT2_nTHm+v^BZ12GvS1|w`~0PzO9IP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%1L8^3SB~ameNG z*itUTQ2zA^t1UW(bEP>_cxnVh7uk7wn97X@{ghtIr5_5MkJs zbZ$}S`Q{0VWha94@0q02#6xmV8s^V=r}cr;`wJyaJFCfwAhg}LX-a=^8=e2DeFFSX zY;osScP?;S#v*V(!NfhY;lLAekDH;@j*0!sThA7Xn}gnK5_f>FgB1or32DI_wYVbD zCqnFI-?>$u3)+^g2-;6FX{Tv+ziZliFq(blU#}ES`&%j6^ZCG5d4~pzQCsD3gsx4& zlDIAJ+|hsAk!&V1Y)Ddqn_+~sC0&UjZP|$+y`M!In59HSa4p&= zFe38#^|3-{Tyai^FiUby)Xkx z7Ju-t=mxs!BqRhkh@t`yfZLURH5k^Gr3lu~F`>=Z zT4y~euuXy@kG7w-0c+U*Y6p8h2DW7?0``kc*lBw0KCgFU^m^)<{e{EM$m<@hZ#dXP zGy^{0#$G}eD#qug42zouwgLgaM5}A+kjb6OGuzUX%mdMPgf~B4AH4 zVWTwUC`LoZE}twMc7}#*h)Q%`9^4>=VfoQct`}oaTZSS~|Cxmvprte~+TJzn6Y8i?^{WJ?TKue{z`?Bu@MzSXl zowq}s&+wQn+3*OJ3?Gsh+#(RCen@qWj=0Ec%TxsHXPB_lB-{N$!EQ`mzy9hog-dqE z)`gAmNE@W}Mk1>_Y}0yS4rv#Iqh%+8^vf*LzzmVrM;TS0;|}(z&kxfF19JC0p?BnD zKlf}W*QoU`%TxsHF?gcDaYqhd!@y=}h$HO#9y@Ih+x>>gj9nsGsDmxGnT=WkvrI+6 zzK01rO+(xZ_BaOiyVK?)FAiwoGaYhsK69s8)|Q-X*!J7nQKRFfGq2OfXb`YJVZjD$ PLqqgaNh=fIW)1xpsjoEO diff --git a/IntelliQ/backend/src/main/webapp/static/js/ui.js b/IntelliQ/backend/src/main/webapp/static/js/ui.js index b0ba5a6..f1203ef 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/ui.js +++ b/IntelliQ/backend/src/main/webapp/static/js/ui.js @@ -540,7 +540,10 @@ var ui = function(){ var card = ui.generateCard() var title = getString("ticket"); - var content = $("

").text(queueItem.ticketNumber); + + var status = ui.getStatusNameByQueueItemStatus(queueItem.status); + + var content = $("

").text("Number: " + queueItem.ticketNumber + ", Status: " + status); card.withContent(content).withTitle(title, false); return card; diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index cea0611..5541769 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -52,7 +52,9 @@ function requestNearbyQueues() { var longitude = location.coords.longitude; // request queues at location - var request = intelliqApi.getNearbyQueues(latitude, longitude).includeBusinesses(true); + var request = intelliqApi.getNearbyQueues(latitude, longitude) + .includeBusinesses(true) + .inRange(50000); // TODO: set this to something meaningful request.send().then(function(data){ var businesses = intelliqApi.getBusinessesFromResponse(data); console.log(businesses); diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js index 9a60066..67e7546 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -63,7 +63,7 @@ function requestQueueItem() { } var queueKeyId = getUrlParam("queueKeyId"); var queueItem = JSON.parse(getUrlParamOrCookie("queueItem")); - if (queueItem.queueKeyId != queueKeyId) { + if (queueItem != null && queueItem.queueKeyId != queueKeyId) { // queueItem belongs to a different queue return; } diff --git a/IntelliQ/mobile/mobile.iml b/IntelliQ/mobile/mobile.iml index 5c26365..fb2b903 100755 --- a/IntelliQ/mobile/mobile.iml +++ b/IntelliQ/mobile/mobile.iml @@ -64,14 +64,6 @@ - - - - - - - - @@ -80,6 +72,14 @@ + + + + + + + + @@ -104,14 +104,6 @@ - - - - - - - - @@ -120,9 +112,19 @@ + + + + + + + + + + @@ -183,93 +185,97 @@ + + + + - - - - - - - - - - - - - - - - - + + + - + + + - - - + + + + - - - - - - - + + + + + + + + + + + + + + + - - - + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - + + + + + + + - - - - + + + + + + + + - - + - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/IntelliQ/wear/wear.iml b/IntelliQ/wear/wear.iml index 8915bb1..a712f1a 100755 --- a/IntelliQ/wear/wear.iml +++ b/IntelliQ/wear/wear.iml @@ -83,6 +83,8 @@ + + @@ -91,22 +93,30 @@ + + + + + + + + - - - + + + \ No newline at end of file From 749486859d8f33b2460ff03d8e68c87ac811bd08 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Mon, 19 Sep 2016 13:13:57 +0200 Subject: [PATCH 09/25] Implemented queue item requesting --- .../datastore/datastore-indexes-auto.xml | 24 +--- IntelliQ/backend/datastore/local_db.bin | Bin 19576 -> 11739 bytes .../backend/src/main/webapp/static/js/api.js | 7 ++ .../src/main/webapp/static/js/webapp.js | 106 +++++++++++++++++- IntelliQ/mobile/mobile.iml | 30 ++--- IntelliQ/wear/wear.iml | 16 +-- 6 files changed, 135 insertions(+), 48 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 0b2f3e4..9477eb5 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,24 +1,4 @@ - + - + - - - - - - - - - - - - - - - - - - - - diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 96f2418619da087784ad05f6b719e22299a60b75..33ebeab2a292fcd9e76d0ff421234c7ff7f1477f 100644 GIT binary patch delta 277 zcmew{gYkCs1X)I_jdCuGOx*sHQy4ch%50Wkst}tj#A3oYbFv_>H{;96f&39n3pgh~ zWRqc<$uU`w#gu6#=VSv8FQ%DXlMA@QnHGWNfXW3}%ouNiHO&NTS`E>36RZg+alVkEnQ)AYyjSKs}OlI^FnQX)%HTj>U?&M?M n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(A+X@gq#Loq`FtowN}2H&eQrFCrq*fs>@7w1`NeIJe109zL9A=`P# zQ5LnHI&plyYVC%8Pi92}of~MhNqiXU?9ky1!S_I6dxBX7s;&TU8{~fQ5-Z*hQSr_Z zY~DWJEP_4z=*v#=<_cyNI5fb3bzkyypk}zM;)U!bS*kM5tDKeY`R z_6DqA37EY>wrI{QW-GgpUUeTy&kYVHSS{3>%DJWHsiIk47(xA>l) z1vuN772kf7mCy%hgx-}S)b -1) { + return; + } + queueItemKeyIds.push(queueItemKeyId); + }; + + // add id from URL paramter or cookie + addQueueItemKeyId(getUrlParamOrCookie("queueItemKeyId")); + + resolve(queueItemKeyIds); + }); + return promise; +} + function requestNearbyQueues() { // request device location requestDeviceLocation().then(function(location){ diff --git a/IntelliQ/mobile/mobile.iml b/IntelliQ/mobile/mobile.iml index fb2b903..bde2328 100755 --- a/IntelliQ/mobile/mobile.iml +++ b/IntelliQ/mobile/mobile.iml @@ -42,6 +42,12 @@ + + + + + + @@ -50,12 +56,6 @@ - - - - - - @@ -104,14 +104,6 @@ - - - - - - - - @@ -120,6 +112,14 @@ + + + + + + + + @@ -264,8 +264,8 @@ - + diff --git a/IntelliQ/wear/wear.iml b/IntelliQ/wear/wear.iml index a712f1a..e44eb53 100755 --- a/IntelliQ/wear/wear.iml +++ b/IntelliQ/wear/wear.iml @@ -64,14 +64,6 @@ - - - - - - - - @@ -80,6 +72,14 @@ + + + + + + + + From 9cf055182cb3a18273d2e78b38f3ed8e0ff0f018 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Mon, 19 Sep 2016 14:48:37 +0200 Subject: [PATCH 10/25] Added active tickets rendering to webapp pages --- .../datastore/datastore-indexes-auto.xml | 2 +- IntelliQ/backend/datastore/local_db.bin | Bin 11739 -> 11739 bytes .../src/main/webapp/static/css/style.css | 17 ++++++++++++++ .../src/main/webapp/static/js/webapp.js | 21 ++++++++++++++--- .../src/main/webapp/static/js/webapp_queue.js | 12 +++------- .../src/main/webapp/website/en/webapp.jsp | 2 ++ .../main/webapp/website/en/webapp_queue.jsp | 4 +++- .../website/includes/en/webapp_tickets.jsp | 22 ++++++++++++++++++ 8 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 IntelliQ/backend/src/main/webapp/website/includes/en/webapp_tickets.jsp diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 9477eb5..db2a1ae 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,4 +1,4 @@ - + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 33ebeab2a292fcd9e76d0ff421234c7ff7f1477f..9c03c157685ab56e0ca93ecf2afb14bd71019641 100644 GIT binary patch delta 135 zcmV;20C@k~TiaW(V*vq?lVkxP1qoGiWpa~`0f-a=b#ed#TSBb!7x)GURNw*t0C;e- zn;jei0+AP!AS@ZP(jP$r3lC6ba&2jIb7^mGlN=%%3mkQE0Db@t0002)lMn_fvsnTh p8?zH483D6+Cs70i`LXJg^pk)oPy&z_lOQY{vn(S`1hYLXo&lGWD&GJA delta 133 zcmcZ|eLH$XG9#n^`TK$(@WH5;CPl3{25ZYd(wrVB-jRz{J2% zQNX~!@NV)1eyz>l*<_?yIYWz6izdq`Nlg~e;M%OgB+0~dUTktBo7m<^78j4q#!q^#09+$&KoPOy|IAm>Re?Tj(ri1OR+!D+T}n diff --git a/IntelliQ/backend/src/main/webapp/static/css/style.css b/IntelliQ/backend/src/main/webapp/static/css/style.css index ca06edc..143d447 100644 --- a/IntelliQ/backend/src/main/webapp/static/css/style.css +++ b/IntelliQ/backend/src/main/webapp/static/css/style.css @@ -314,6 +314,23 @@ a { line-height: 1; } + .section { + padding-top: 0.2rem; + padding-bottom: 0.2rem; + } + + .vertical-spacing { + margin-top: 5px; + margin-bottom: 5px; + } + + .row { + margin-bottom: 5px; + } + + .row .col { + padding: 0 0.4rem; + } } .background-image-container { diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index 4acae98..d82c2b3 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -37,18 +37,26 @@ function initAuthentication() { } else { statusChangeListener.onGoogleSignOut(); } - renderActiveTickets(); + renderActiveQueueItems(); }).catch(function(error) { ui.showErrorMessage(error); }); } -function renderActiveTickets() { - console.log("Requesting active tickets"); +function renderActiveQueueItems() { + console.log("Requesting active queue items"); requestRecentQueueItems().then(function(queueItems) { var calledQueueItems = intelliqApi.filterQueueItems(queueItems).byStatus(intelliqApi.STATUS_CALLED); var waitingQueueItems = intelliqApi.filterQueueItems(queueItems).byStatus(intelliqApi.STATUS_WAITING); console.log("Called queue items: " + calledQueueItems.length + ", waiting queue items: " + waitingQueueItems.length); + + var visibleQueueItems = calledQueueItems.concat(waitingQueueItems); + renderQueueItems(visibleQueueItems, $("#queueItemsContainer")); + if (visibleQueueItems.length > 0) { + $("#activeQueueItemsSection").removeClass("hide"); + } else { + $("#activeQueueItemsSection").addClass("hide"); + } }).catch(function(error) { console.log(error); }) @@ -183,6 +191,13 @@ function renderQueues(entries, container) { ui.renderEntries(entries, container, options); } +function renderQueueItems(entries, container) { + var options = {}; + options.itemGenerator = ui.generateQueueItemCard; + options.itemWrapperGenerator = generateCardWrapper; + ui.renderEntries(entries, container, options); +} + function generateCardWrapper() { var className = ui.generateColumnClassName(12, 6, 6); return ui.generateCardWrapper(className); diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js index 67e7546..256b9e4 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -94,13 +94,6 @@ function renderQueueDescription(queue, container) { wrapper.appendTo(container); } -function renderQueueItem(queueItem, container) { - var wrapper = generateCardWrapper(); - var queueItemCard = ui.generateQueueItemCard(queueItem); - queueItemCard.renderIn(wrapper); - wrapper.appendTo(container); -} - function joinQueue(queue) { // check if queue requires signin if (queue.requiresSignIn) { @@ -246,8 +239,9 @@ function onJoinQueueModalSubmitted() { } function onQueueJoined(queueItem) { - renderQueueItem(queueItem, $("#queueContainer")); - // TODO: scroll to rendered card + $("html, body").animate({ + scrollTop: 0 + }, "slow"); $("#joinQueueContainer").addClass("hide"); $("#joinQueueButton").addClass("disabled"); diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp index dea7fb4..062cdf1 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp.jsp @@ -10,6 +10,8 @@

+ <%@include file="../includes/en/webapp_tickets.jsp"%> +
Nearby Queues
diff --git a/IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp b/IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp index 76e2a57..48392be 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/webapp_queue.jsp @@ -9,7 +9,9 @@ <%@include file="../includes/en/webapp_navigation.jsp"%>
- + + <%@include file="../includes/en/webapp_tickets.jsp"%> +
Queue
diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_tickets.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_tickets.jsp new file mode 100644 index 0000000..cf5c019 --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_tickets.jsp @@ -0,0 +1,22 @@ + +
+
Active Tickets
+
+
+ + +
+
+

You don't have any active tickets right now. Join a queue in order to get a ticket.

+
+
+
+
+
+
+
+
+
+ +
+
\ No newline at end of file From 548f5ede5993d974967aaceb119f25a84e2a064c Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Mon, 19 Sep 2016 15:17:27 +0200 Subject: [PATCH 11/25] Improved string replacement --- .../datastore/datastore-indexes-auto.xml | 2 +- IntelliQ/backend/datastore/local_db.bin | Bin 11739 -> 12286 bytes .../backend/src/main/webapp/static/js/api.js | 12 +++++++++++ .../src/main/webapp/static/js/general.js | 9 ++++++-- .../backend/src/main/webapp/static/js/init.js | 12 +++++++++++ .../backend/src/main/webapp/static/js/ui.js | 13 +++++++++++- .../website/includes/en/common_head.jsp | 20 ++++++++++-------- 7 files changed, 55 insertions(+), 13 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index db2a1ae..eda4710 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,4 +1,4 @@ - + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 9c03c157685ab56e0ca93ecf2afb14bd71019641..36feebf6c20b00c7f6c22b743b7ceb1be5d50b16 100644 GIT binary patch delta 303 zcmcZ|{V#rkEThdvIafx;pOaG<6}b5WQj2mki;FY!^CovPc1XyU7BMhIJFWRF{)3Gp zY;rG&q?UKTg(U@)Qx4;w>&oEGdr9POXgh_jFNU&|=tpf~k^`>AU#kMmDj{ zkt{Aun}wAm88?4W_hs3vs~o_>^5gsYDU%!31DSq+)i5=1O}5a{02#YEQzw~ma-xoj z1t(9Dq!d?SX=-VzcWR|)3eaFqjs`GT$z3EZ#h02_QdAj|nVSl-}DETh#%Iafx;iIYm?<=Hl@wR;fz$_=B$gDr=9LsxHZV4T!9wnml+EAdDuKpsE>MVO z;^q%XEy~R-F3!x)oBU5lid&|%kfDx&kAZ>V-DCkat<8~4lG2+`D9JExHqZ!UVg0%B y)#NXe1vRB7S81CvPMBPvAhr3SasbQZuR6+;-zjl!R@6;q 0) { + var values = Array.prototype.slice.call(arguments, 1); + string = String.format(string, values); + } + return string; } diff --git a/IntelliQ/backend/src/main/webapp/static/js/init.js b/IntelliQ/backend/src/main/webapp/static/js/init.js index 71624aa..9c69512 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/init.js +++ b/IntelliQ/backend/src/main/webapp/static/js/init.js @@ -99,4 +99,16 @@ function submitContactForm() { win.focus(); } return false; +} + +if (!String.format) { + String.format = function(format) { + var args = Array.prototype.slice.call(arguments, 1); + return format.replace(/{(\d+)}/g, function(match, number) { + return typeof args[number] != 'undefined' + ? args[number] + : match + ; + }); + }; } \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/ui.js b/IntelliQ/backend/src/main/webapp/static/js/ui.js index f1203ef..aa156b1 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/ui.js +++ b/IntelliQ/backend/src/main/webapp/static/js/ui.js @@ -539,13 +539,24 @@ var ui = function(){ ui.generateQueueItemCard = function(queueItem) { var card = ui.generateCard() - var title = getString("ticket"); + var title = getString("ticket") + " #" + queueItem.ticketNumber; var status = ui.getStatusNameByQueueItemStatus(queueItem.status); var content = $("

").text("Number: " + queueItem.ticketNumber + ", Status: " + status); card.withContent(content).withTitle(title, false); + + + var openUrl = intelliqApi.getUrls().forQueueItem(queueItem).openInWebApp(); + card.click(function() { + navigateTo(openUrl); + }) + + /* + var openAction = ui.generateAction(getString("show"), openUrl); + card.withActions([openAction]); + */ return card; } diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp index b12d881..a709d26 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp @@ -18,7 +18,7 @@ From 63d692e6f1cb38f0d58561e09049052602c40b2d Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Mon, 19 Sep 2016 17:46:33 +0200 Subject: [PATCH 15/25] Added datastore indexes, adjusted servlet mapping --- .../datastore/datastore-indexes-auto.xml | 26 +++++++++++++-- IntelliQ/backend/datastore/local_db.bin | Bin 23238 -> 13329 bytes .../queueitem/DeleteQueueItemEndpoint.java | 1 - .../webapp/WEB-INF/datastore-indexes-auto.xml | 31 ++++++++++++++++++ .../main/webapp/WEB-INF/datastore-indexes.xml | 31 ++++++++++++++++++ .../backend/src/main/webapp/WEB-INF/web.xml | 8 ++--- .../src/main/webapp/static/css/style.css | 4 +++ .../src/main/webapp/static/js/webapp_queue.js | 19 ++++++----- 8 files changed, 104 insertions(+), 16 deletions(-) create mode 100644 IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes-auto.xml create mode 100644 IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes.xml diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index ddf6b6a..8cbb0de 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,11 +1,31 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 14f0cdb23d236c5ee800e5c259c5332de5ddc528..bb3a06be8d68d4abcadd702a2b15b8c21993a081 100644 GIT binary patch delta 241 zcmX@Mm2qOm1X;$|jdHGxjAtgNFe-5K2c#C|W)>G`=I2fBWbBYoC@o@OigsG_S^NhZ zN5}&v28N0P1_p+AlPB#X{y_mLgPgdXwXPP5Dc_N1l_g4;{ ziV_CS(Bjmh$y};ZlYMl#Hfu0RGBKTzp4`YLHu=9c_vRE9OQy|?s*;SGb##4MHcP9` zV`KUF{O*j&`C5TYr@`u&8n`Bx7-}#wPJS3}%(!*(0c#VMBO6Z6n5^g}I{6W&)Z{E? k-N_e>Jt2aL7G_Mdr6(8qNDFP{=BcPCWT<1{giy>C0GOaqHUIzs literal 23238 zcmd^{eQ*@z9mn^Mklf|+#__U864DPs#T#_Q50W@1zTHe)ymk$H&pPA{+_+P%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FP8Gt(u_8A-PZ7)gOPnN)G6q>FM$bLW?9-A)G5 z&(TN&vvf`eZRhl@P;KX((_43Ha-FRq`Q&ugonF@=Q4*pdIdGjEj6fxACLl9eVC$wb zz&=8SJ#|gM^#l8`Sp@s`+ioLk<8)xVj3*B_LJ1MLF`yp&13-m5*2iYROg`{EK+^{*$1WzI_omx8c~ph zz?y_8!4nuvQTtd>>xMF*ewm6oL#XYm$1WD3e&rvJn4!*3s0}+-9SK+zg+PZGmd#0* zv5?m7WFY+tjWjSz>$LqkZx@SBAG!On>5|T>^V(!J(1xH0F<%eMSvc!fGH^ad<(#3? zeYRD47mG^2x91OLobyp>H`IhFm4@4#J7f$`LP3EJ8J>)?&Qv`ra#-7_J#cJw^n||`_bXjMelD7)*>;u?pY84VuQ___=q-`vTx}6N9U!{`H&}sWi;#({_ z{o$l3>HKusSWrix$b))XA}2AXsH<{N+em8NPzKb0rlAICX`!|+AaAh<^*z7&*YuOx zARwIrhWZ1tx>HD42*|7));7{wx0HePaVqN!u@2c5>$h0M`tY_d%~{`PUuS_%BpF`V5X6v>x&^|$>ogvqGhzN^Zf3)i-^EJEsrYa01f_y%{1%^{^zH7uIuGNb7bo zkp3%`bcR;jUl+HsX!Y3Z4^5x6VO{LOqC|RZdf*HOnU{O>SXk?pGO&J~$~r@-^NdU2Tx6x zHR;z*v4*5x0Z%(cffdjvD44E^3vxi)sPl9)89<+;g3eHC`)lF^i&Ag<=^-=F`KU+M zX?YupLIWjiH(`rQ0z3<8-A)G5Z%|2R=(PQcdV-?UmW@p(H=QMR})C!xZ(fME&TtFQ$i@Jk2tt9VQQ-HM@Gt)YJ6YEnhOC9)(71 T%bq5HHZ(+@E$dBwn=$lXy8kH$ diff --git a/IntelliQ/backend/src/main/java/com/intelliq/appengine/api/endpoint/queueitem/DeleteQueueItemEndpoint.java b/IntelliQ/backend/src/main/java/com/intelliq/appengine/api/endpoint/queueitem/DeleteQueueItemEndpoint.java index 4565fff..174b5d8 100644 --- a/IntelliQ/backend/src/main/java/com/intelliq/appengine/api/endpoint/queueitem/DeleteQueueItemEndpoint.java +++ b/IntelliQ/backend/src/main/java/com/intelliq/appengine/api/endpoint/queueitem/DeleteQueueItemEndpoint.java @@ -66,7 +66,6 @@ public ApiResponse generateRequestResponse(ApiRequest request) throws Exception long queueItemKeyId = request.getParameterAsLong("queueItemKeyId", -1); - try { QueueItemHelper.deleteEntryByKeyId(queueItemKeyId); } catch (JDOObjectNotFoundException exception) { diff --git a/IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes-auto.xml b/IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes-auto.xml new file mode 100644 index 0000000..8cbb0de --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes-auto.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes.xml b/IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes.xml new file mode 100644 index 0000000..8cbb0de --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/WEB-INF/datastore-indexes.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml b/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml index fc00ff6..44e0439 100644 --- a/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml +++ b/IntelliQ/backend/src/main/webapp/WEB-INF/web.xml @@ -11,7 +11,7 @@ CONFIDENTIAL - + requestFilter @@ -66,7 +66,7 @@ de/home - /website/de/home.jsp + /website/en/home.jsp de/home @@ -84,7 +84,7 @@ de/apps - /website/de/apps.jsp + /website/en/apps.jsp de/apps @@ -102,7 +102,7 @@ de/business - /website/de/business.jsp + /website/en/business.jsp de/business diff --git a/IntelliQ/backend/src/main/webapp/static/css/style.css b/IntelliQ/backend/src/main/webapp/static/css/style.css index 100ba5b..cae47e7 100644 --- a/IntelliQ/backend/src/main/webapp/static/css/style.css +++ b/IntelliQ/backend/src/main/webapp/static/css/style.css @@ -3,6 +3,10 @@ nav .brand-logo { color: #FFFFFF; } +.side-nav { + width: 250px; +} + .nav-wrapper ul li a i { cursor: pointer; } diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js index 024ee5c..55e244f 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -71,24 +71,27 @@ function requestQueueItem() { var request = intelliqApi.getQueueItem(queueItemKeyId); request.send().then(function(data){ try { - var queueItems = intelliqApi.getQueueItemsFromResponse(data); - if (queueItems.length < 1) { - throw "Queue item not found"; + queueItem = intelliqApi.getQueueItemsFromResponse(data)[0]; + + var ticketActive = true; + if (queueItem.status == intelliqApi.STATUS_CANCELED) { + ticketActive = false; + Materialize.toast(getString("statusCanceled"), 3000); + } else if (queueItem.status == intelliqApi.STATUS_DONE) { + ticketActive = false; + Materialize.toast(getString("statusDone"), 3000); } - queueItem = queueItems[0]; - if (queueItem.status != intelliqApi.STATUS_CANCELED) { + + if (ticketActive) { onQueueJoined(queueItem); } else { - Materialize.toast(getString("statusCanceled"), 3000); $("#joinQueueButton").addClass("disabled"); } } catch(error) { console.log(error); - //ui.showErrorMessage(error); } }).catch(function(error){ console.log(error); - //ui.showErrorMessage(error); }); } From f5097e17047df018a81a72219a0b22cc73485178 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Mon, 19 Sep 2016 18:19:09 +0200 Subject: [PATCH 16/25] Changed app engine host versioning --- .../datastore/datastore-indexes-auto.xml | 6 +++--- IntelliQ/backend/datastore/local_db.bin | Bin 13329 -> 13829 bytes .../backend/src/main/webapp/static/js/api.js | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 8cbb0de..0e0f137 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index bb3a06be8d68d4abcadd702a2b15b8c21993a081..29647599e106a21bd71291e4147a3c5a63a9eecd 100644 GIT binary patch delta 270 zcmbQ3(V8;R(Bjmh$^DESB21-43{25ZYd(wrVB-jRz{J2% zQLwpLQHF`>q|D}p%27<*`~j&&xtYbqnfZB>YmB70l}Za4>KOPK7#QA77GTrb9LdBe zKUs*ygz@fVM^O$%5zkdFmQ$zrxs0CFi_d7!6eDVbVhn|Bb(Ud`8wR2 zQ&=pSHosSwWZW!e;LEa^Q*$00>&NGJXMC9~pdG+;8my41fopP-Net6g?#TyCq+||o z6-i6+rRJ3sRfc5drWThZ<`yV0Xt8q~*>H05H Date: Mon, 19 Sep 2016 18:34:33 +0200 Subject: [PATCH 17/25] Fixed navigation URL --- .../src/main/webapp/website/includes/en/webapp_navigation.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp index 2bebd67..c50813f 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/webapp_navigation.jsp @@ -13,7 +13,7 @@

  • Nearby Queues
  • Search for Queues
  • -
  • Create a Queue
  • +
  • Create a Queue
  • Account
  • From aa825f206f873da18d239e580228527d779cf2ad Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Wed, 21 Sep 2016 13:35:48 +0200 Subject: [PATCH 18/25] UI adjustments --- .../datastore/datastore-indexes-auto.xml | 24 ++----------- IntelliQ/backend/datastore/local_db.bin | Bin 13829 -> 15451 bytes .../src/main/webapp/static/css/style.css | 4 +++ .../main/webapp/static/js/authenticator.js | 26 ++++++++++++++ .../src/main/webapp/static/js/manage_queue.js | 34 ++++++++++-------- .../backend/src/main/webapp/static/js/ui.js | 22 +++++++----- .../src/main/webapp/static/js/webapp.js | 2 +- .../src/main/webapp/static/js/webapp_queue.js | 2 +- .../src/main/webapp/website/en/business.jsp | 8 ++--- .../src/main/webapp/website/en/home.jsp | 6 ++-- .../website/includes/en/common_footer.jsp | 2 +- .../website/includes/en/common_head.jsp | 10 +++--- 12 files changed, 80 insertions(+), 60 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index 0e0f137..d1db810 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,31 +1,11 @@ - + - + - - - - - - - - - - - - - - - - - - - - diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 29647599e106a21bd71291e4147a3c5a63a9eecd..b4f1d1bdc3c5c79a5a9666e1762e4e72542623cd 100644 GIT binary patch delta 632 zcmZq8xm__qma%1{oC_n9fcNASMg?yEfYhSg%;MtA{JhDXj2#l{r9})((N1eVi~nHb z2zkK7z)(@Zz`*cs@&taZ&EMI+Dop;QW;!`g!JBdKU|{u$E@9 zmS(V)>+&Ei+|ArP6(tOup~b01lNAh9Hfu0RGBKT2nB2%FHhI1d_vRE9OQy~5)g>7x zOBrY}N>5HSQk|S-V4-^4h%&`5N1 zh>svVe8~(O)X9JEJ@7;I#+q}WD{+m-}alB zu3$aV4PgZEH^pW)RX1L znbVIaFEBMzXaG7unp+5Ax@%rZQKdu!7&LS6Ozt)@W@_e~e85CX{s32zv=m<|NI^(u vZYt2=+ybDv>>OX3E)nYlX1Ejnt^W;ng8oqjd`{rxsi-JqsAJ%SP|Oto?dj9< delta 372 zcmcaz(V8;R(Bjmh$^DESB21-43{25ZYd(wrVB-jRz{J2% zQLs5uLxzdzq|D?4rizz`*csvH+Xb z=18Wm3Y*XA$S`iUH=57Jy8Gj|8DAzV7)wvyU}nm60%VZnL6*vljFTT)88hykyvou<;^9r8tF?**q&SK* z^2_}ab3vM!1Q;h9a!5~}r>Q&H&dQSwqG<9)Ruh)}GEIz=Cs;}f?d9O9r~m~BCxl|I F0091qb$", { "class": "overlay-content" }) overlay.click(clickHandler); - - overlayContainer.append(overlay); + var overlayWrapper = $("
    ", { "class": "valign-wrapper" }) + overlay.addClass("valign"); + overlayWrapper.append(overlay); + overlayContainer.append(overlayWrapper); overlayContainer.appendTo(image); return card; } @@ -541,6 +543,8 @@ var ui = function(){ var title = getString("ticket") + " #" + queueItem.ticketNumber; var status = ui.getStatusNameByQueueItemStatus(queueItem.status); + var joined = ui.time().since(new Date(queueItem.entryTimestamp)); + joined = getString("timeAgo", joined); var table = $(""); var tableBody = $(""); @@ -563,7 +567,7 @@ var ui = function(){ tr = $(""); tr.append($("
    ").text(getString("joined"))); - tr.append($("").text(ui.time().at(new Date(queueItem.entryTimestamp)))); + tr.append($("").text(joined)); tr.appendTo(tableBody); tableBody.appendTo(table); @@ -736,25 +740,25 @@ var ui = function(){ var seconds = Math.floor((new Date() - date) / 1000); var interval = Math.floor(seconds / 31536000); if (interval > 1) { - return interval + " " + getString(unitYears); + return interval + " " + getString("unitYears"); } interval = Math.floor(seconds / 2592000); if (interval > 1) { - return interval + " " + getString(unitMonths); + return interval + " " + getString("unitMonths"); } interval = Math.floor(seconds / 86400); if (interval > 1) { - return interval + " " + getString(unitDays); + return interval + " " + getString("unitDays"); } interval = Math.floor(seconds / 3600); if (interval > 1) { - return interval + " " + getString(unitHours); + return interval + " " + getString("unitHours"); } interval = Math.floor(seconds / 60); if (interval > 1) { - return interval + " " + getString(unitMinutes); + return interval + " " + getString("unitMinutes"); } - return Math.floor(seconds) + " " + getString(unitSeconds); + return Math.floor(seconds) + " " + getString("unitSeconds"); } return time; diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index bc38ecc..2d98c5c 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -169,7 +169,7 @@ function requestNearbyQueues() { // request queues at location var request = intelliqApi.getNearbyQueues(latitude, longitude) .includeBusinesses(true) - .inRange(50000); // TODO: set this to something meaningful + .inRange(5000); // TODO: set this to something meaningful request.send().then(function(data){ var businesses = intelliqApi.getBusinessesFromResponse(data); console.log(businesses); diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js index 55e244f..c6c6fcc 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -224,7 +224,7 @@ function onJoinQueueModalSubmitted() { onQueueJoined(queueItem); - tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue item created", queue.name, queue.key.id); + tracking.trackEvent(tracking.CATEGORY_WEBAPP, "Queue joined", queue.name, queue.key.id); // update url var url = intelliqApi.getUrls().forQueue(queue).openInWebApp(); diff --git a/IntelliQ/backend/src/main/webapp/website/en/business.jsp b/IntelliQ/backend/src/main/webapp/website/en/business.jsp index 1e16624..7bfabaf 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/business.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/business.jsp @@ -23,7 +23,7 @@

    @@ -48,7 +48,7 @@
    Less waiting time
    -

    IntelliQ.me will let your customers know how many people are in front of them and provides an estimation about the remaining waiting time. +

    IntelliQ.me will let your customers know how many people are in line before them and provides an estimation about the remaining waiting time. This way customers can use their time outside of your waiting room. Our app will let them know when it's time to get back to your business if they left your waiting room.

    @@ -62,7 +62,7 @@
    Lower costs

    Existing ticketing solutions need maintenance and supplies of new printable paper. - IntelliQ.me causes no costs and doesn't need an proprietary hardware - it's an inexpensive and environmentally friendly solution even for large businesses. + IntelliQ.me causes no additional costs and doesn't need an proprietary hardware - it's an inexpensive and environmentally friendly solution even for large businesses. Initial costs for ticket dispensers and equipment can also be saved.

    @@ -72,7 +72,7 @@

    group_add

    -
    More satisfied customers
    +
    Satisfied customers

    Time spent in a waiting room will be perceived as unpleasant, no matter how well you furnish it. With IntelliQ.me your customers can spend their waiting time however they like and don't connect unpleasant feelings while waiting with your business. diff --git a/IntelliQ/backend/src/main/webapp/website/en/home.jsp b/IntelliQ/backend/src/main/webapp/website/en/home.jsp index 2155351..d5775dd 100644 --- a/IntelliQ/backend/src/main/webapp/website/en/home.jsp +++ b/IntelliQ/backend/src/main/webapp/website/en/home.jsp @@ -25,7 +25,7 @@

    Spend your waiting time more effectively and start using the free IntelliQ.me app

    @@ -37,10 +37,10 @@
    For Businesses
    -

    Learn how to get satisfied customers and save costs by using IntelliQ.me

    +

    Learn how to get satisfied customers and save costs by integrating IntelliQ.me

    diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/common_footer.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/common_footer.jsp index 671dcba..ba5f29c 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/common_footer.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/common_footer.jsp @@ -47,7 +47,7 @@
    About IntelliQ.me

    We think no one should waste lifetime while waiting. It doesn't matter where you are - you should be able to use the time until it's your turn effectively. - IntelliQ is a smart system to manage waiting queues and offers estimations about remaining waiting time.

    + IntelliQ.me is a smart system to manage waiting queues and offers estimations about remaining waiting time.

    Connect
    diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp index 76e5fea..1f7417e 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp @@ -73,12 +73,14 @@ "somethingWentWrong": "Something went wrong", "somethingWentWrongMessage": "Something went wrong: {0}", - "unitSeconds": "minutes", + "timeAgo": "{0} ago", + "sinceTime": "Since {0}", + "unitSeconds": "seconds", "unitMinutes": "minutes", "unitHours": "hours", - "unitDays": "minutes", - "unitWeeks": "minutes", - "unitMonths": "minutes", + "unitDays": "days", + "unitWeeks": "weeks", + "unitMonths": "months", "unitYears": "years" } From 27ce4d8b660983cf867db20651fc401f0219844e Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Wed, 21 Sep 2016 14:04:06 +0200 Subject: [PATCH 19/25] Fixed bug with negative time since --- IntelliQ/backend/src/main/webapp/static/js/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IntelliQ/backend/src/main/webapp/static/js/ui.js b/IntelliQ/backend/src/main/webapp/static/js/ui.js index c4e9361..c025eaf 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/ui.js +++ b/IntelliQ/backend/src/main/webapp/static/js/ui.js @@ -758,7 +758,7 @@ var ui = function(){ if (interval > 1) { return interval + " " + getString("unitMinutes"); } - return Math.floor(seconds) + " " + getString("unitSeconds"); + return Math.max(Math.floor(seconds), 0) + " " + getString("unitSeconds"); } return time; From cc91bc586ff84c5bb2cc904f6b0dd50627fc5a1e Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Thu, 22 Sep 2016 16:02:42 +0200 Subject: [PATCH 20/25] Implemented automatic ticket updating and queue status rendering --- .../datastore/datastore-indexes-auto.xml | 2 +- IntelliQ/backend/datastore/local_db.bin | Bin 15451 -> 15701 bytes .../backend/src/main/webapp/static/js/api.js | 8 +++ .../src/main/webapp/static/js/general.js | 2 +- .../backend/src/main/webapp/static/js/init.js | 19 +++-- .../src/main/webapp/static/js/manage_queue.js | 13 ++-- .../backend/src/main/webapp/static/js/ui.js | 65 +++++++++++++++++- .../src/main/webapp/static/js/webapp.js | 24 ++++++- .../src/main/webapp/static/js/webapp_queue.js | 8 +-- .../src/main/webapp/static/manifest.json | 27 ++++++++ .../website/includes/en/common_head.jsp | 18 +++++ IntelliQ/mobile/mobile.iml | 44 ++++++------ 12 files changed, 179 insertions(+), 51 deletions(-) create mode 100644 IntelliQ/backend/src/main/webapp/static/manifest.json diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index d1db810..13d332c 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,4 +1,4 @@ - + diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index b4f1d1bdc3c5c79a5a9666e1762e4e72542623cd..2827dd6fe5957354277fb1b620f5d6c936521da0 100644 GIT binary patch delta 240 zcmcazakXlKEMwb7ITuDIVWr6_j0&urp~b01llvJvM3_p87?`4+)_fNK!Nw8tfQf;j zqF{5Rh71$aBDKi}OcgiJ(6VIW<_}0M%FQe;&dkr7{6SZWTcfm)p^kx%fq~)OWC1p< z&5=ykRVNFvm@pomT&U&^B=fl;I}X*^one@_$POMyAOMR_Sd2 iPG18FZe%rK*{9gVIC+Alq|jjwo{9>PV>lrca|Hk|pHn0N delta 225 zcmcawb-QAMEMvPNSLLWEVc-lcPA!`JPETrbz7^+YbtWk$rqc?O8`;Dr z>l$!xPGPZR+I(79l97!our#$a6|PX;OqXTzQ@wd?EHjV)emptBB#`M8MB4{bw$0vF zhZ&igIVTI)7_)t8y7c&q*5rqr(vyE$DKIimma 0) { var values = Array.prototype.slice.call(arguments, 1); - string = String.format(string, values); + string = String.prototype.format.apply(string, values); } return string; diff --git a/IntelliQ/backend/src/main/webapp/static/js/init.js b/IntelliQ/backend/src/main/webapp/static/js/init.js index da5797c..a234fc8 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/init.js +++ b/IntelliQ/backend/src/main/webapp/static/js/init.js @@ -104,14 +104,11 @@ function submitContactForm() { return false; } -if (!String.format) { - String.format = function(format) { - var args = Array.prototype.slice.call(arguments, 1); - return format.replace(/{(\d+)}/g, function(match, number) { - return typeof args[number] != 'undefined' - ? args[number] - : match - ; - }); - }; -} \ No newline at end of file +String.prototype.format = function () { + var args = arguments; + return this.replace(/\{\{|\}\}|\{(\d+)\}/g, function (m, n) { + if (m == "{{") { return "{"; } + if (m == "}}") { return "}"; } + return args[n]; + }); +}; \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js b/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js index eaf049d..37988f4 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/manage_queue.js @@ -1,17 +1,14 @@ -var UPDATE_INTERVAL_CASUAL = 1000 * 30; -var UPDATE_INTERVAL_DEFAULT = 1000 * 15; -var UPDATE_INTERVAL_FAST = 1000 * 10; -var UPDATE_INTERVAL_DEMO = 1000 * 5; - var queue; var queueItems; var lastQueueItemsUpdate = -1; -var queueItemsUpdateInterval = UPDATE_INTERVAL_FAST; +var queueItemsUpdateInterval; var queueItemsUpdateIntervalObject; (function($){ $(function(){ + queueItemsUpdateInterval = intelliqApi.UPDATE_INTERVAL_FAST; + var statusChangeListener = { onUserAvailable: function(user) { updateQueue(); @@ -26,7 +23,7 @@ function updateQueue() { renderQueue(queue); setupQueueManagementButtons(); updateQueueItems(); - startUpdatingQueueItems(UPDATE_INTERVAL_DEFAULT); + startUpdatingQueueItems(intelliqApi.UPDATE_INTERVAL_DEFAULT); }).catch(function(error){ console.log(error); ui.showErrorMessage(error); @@ -95,7 +92,7 @@ function startUpdatingQueueItems(interval) { // set the interval queueItemsUpdateInterval = interval; if (queueItemsUpdateInterval == null) { - queueItemsUpdateInterval = UPDATE_INTERVAL_DEFAULT; + queueItemsUpdateInterval = intelliqApi.UPDATE_INTERVAL_DEFAULT; } // clear existing interval diff --git a/IntelliQ/backend/src/main/webapp/static/js/ui.js b/IntelliQ/backend/src/main/webapp/static/js/ui.js index c025eaf..be90a32 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/ui.js +++ b/IntelliQ/backend/src/main/webapp/static/js/ui.js @@ -520,9 +520,40 @@ var ui = function(){ card.withImage(image); card.withImageRatio(3/2); - card.withContent().withTitle(queue.name, false); + card.withContent(queue.description); + card.withTitle(queue.name, true); - var revealableContent = $("

    ").text(queue.description); + var table = $(""); + var tableBody = $(""); + + var tr; + tr = $(""); + tr.append($(""); + tr.append($(""); + tr.append($(""); tr.append($(""); diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp.js b/IntelliQ/backend/src/main/webapp/static/js/webapp.js index 2d98c5c..9dcd5f6 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp.js @@ -1,7 +1,11 @@ var deviceLocation; +var queueItemsUpdateInterval; +var queueItemsUpdateIntervalHandle; + (function($){ $(function(){ + queueItemsUpdateInterval = intelliqApi.UPDATE_INTERVAL_DEFAULT; initAuthentication(); }); })(jQuery); @@ -37,7 +41,8 @@ function initAuthentication() { } else { statusChangeListener.onGoogleSignOut(); } - renderActiveQueueItems(); + //renderActiveQueueItems(); + startUpdatingQueueItems(); }).catch(function(error) { ui.showErrorMessage(error); }); @@ -50,6 +55,23 @@ function onQueueItemsChanged() { }, "slow"); } +function startUpdatingQueueItems() { + if (queueItemsUpdateIntervalHandle != null) { + return; + } + console.log("Starting to update queue items"); + queueItemsUpdateIntervalHandle = setInterval(renderActiveQueueItems, queueItemsUpdateInterval); +} + +function stopUpdatingQueueItems() { + if (queueItemsUpdateIntervalHandle == null) { + return; + } + console.log("Stopping to update queue items"); + clearInterval(queueItemsUpdateIntervalHandle); + queueItemsUpdateIntervalHandle = null; +} + function renderActiveQueueItems() { console.log("Requesting active queue items"); requestRecentQueueItems().then(function(queueItems) { diff --git a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js index c6c6fcc..578b441 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js +++ b/IntelliQ/backend/src/main/webapp/static/js/webapp_queue.js @@ -42,7 +42,7 @@ function requestQueueDetails() { leaveQueue(queue); }); - //renderQueueDescription(queue, container); + renderQueueStatus(queue, container); $("#joinQueueButton").removeClass("disabled"); requestQueueItem(); @@ -95,10 +95,10 @@ function requestQueueItem() { }); } -function renderQueueDescription(queue, container) { +function renderQueueStatus(queue, container) { var wrapper = generateCardWrapper(); - var descriptionCard = ui.generateQueueDescriptionCard(queue); - descriptionCard.renderIn(wrapper); + var statusCard = ui.generateQueueStatusCard(queue); + statusCard.renderIn(wrapper); wrapper.appendTo(container); } diff --git a/IntelliQ/backend/src/main/webapp/static/manifest.json b/IntelliQ/backend/src/main/webapp/static/manifest.json new file mode 100644 index 0000000..0adc34b --- /dev/null +++ b/IntelliQ/backend/src/main/webapp/static/manifest.json @@ -0,0 +1,27 @@ +{ + "short_name": "IntelliQ.me", + "name": "IntelliQ.me", + "icons": [ + { + "src": "https://intelliq.me/static/images/icon.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "display": "standalone", + "orientation": "any", + "background_color": "#FFFFFF", + "theme_color": "#663fb4", + "description": "Smarter Waiting", + "prefer_related_applications": true, + "related_applications": [ + { + "platform": "web" + }/*, + { + "platform": "play", + "id": "com.steppschuh.intelliq", + "url": "https://play.google.com/store/apps/details?id=com.steppschuh.intelliq" + }*/ + ] +} \ No newline at end of file diff --git a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp index 1f7417e..9f3a2a7 100644 --- a/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp +++ b/IntelliQ/backend/src/main/webapp/website/includes/en/common_head.jsp @@ -4,6 +4,7 @@ + @@ -18,6 +19,9 @@
    ").text(getString("location"))); + var mapsUrl = "http://maps.google.com/maps?q=" + queue.latitude + "," + queue.longitude; + tr.append($("").append($("").attr("target","_blank").attr("href", mapsUrl).text(getString("locationMap")))); + tr.appendTo(tableBody); + + tr = $("
    ").text(getString("visibility"))); + var visibility = getString("public"); + if (queue.visibility == intelliqApi.VISIBILITY_PRIVATE) { + visibility = getString("private"); + } + tr.append($("").text(visibility)); + tr.appendTo(tableBody); + + tr = $("
    ").text(getString("requiresSignIn"))); + var requiresSignIn = getString("no"); + if (queue.requiresSignIn) { + requiresSignIn = getString("yes"); + } + tr.append($("").text(requiresSignIn)); + tr.appendTo(tableBody); + + tableBody.appendTo(table); + + var revealableContent = table; card.withRevealableContent(revealableContent).withTitle(queue.name); return card; @@ -538,6 +569,29 @@ var ui = function(){ return card; } + ui.generateQueueStatusCard = function(queue) { + var card = ui.generateCard() + + var getReadableWaitingTime = function() { + var waitinTime = queue.averageWaitingTime * queue.waitingPeople; + var timestamp = new Date() - waitinTime; + var since = ui.time().since(new Date(timestamp)); + return since; + } + + var status; + if (queue.waitingPeople > 0) { + status = getString("queueStatus", queue.waitingPeople, getReadableWaitingTime()); + } else { + status = getString("queueStatusEmpty"); + } + var content = $("

    ").text(status); + + card.withContent(content) + card.withTitle(getString("status"), false); + return card; + } + ui.generateQueueItemCard = function(queueItem) { var card = ui.generateCard() @@ -557,7 +611,12 @@ var ui = function(){ tr = $("

    ").text(getString("status"))); - tr.append($("").text(status)); + var statusData = $("").text(status); + if (queueItem.status == intelliqApi.STATUS_CALLED) { + statusData.addClass("red-text"); + card.addClass("deep-purple lighten-5"); + } + tr.append(statusData); tr.appendTo(tableBody); tr = $("