From b048619a0f8c48aa7f584204e208172f51fc0653 Mon Sep 17 00:00:00 2001 From: Stephan Schultz Date: Tue, 28 Feb 2017 22:20:12 +0100 Subject: [PATCH] Made business name clickable, fixes #35 --- .../datastore/datastore-indexes-auto.xml | 12 ++-------- IntelliQ/backend/datastore/local_db.bin | Bin 3714400 -> 3714400 bytes .../backend/src/main/webapp/static/js/api.js | 6 +++++ .../backend/src/main/webapp/static/js/ui.js | 21 +++++++++++++++++- .../website/includes/en/common_head.jsp | 2 ++ 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/IntelliQ/backend/datastore/datastore-indexes-auto.xml b/IntelliQ/backend/datastore/datastore-indexes-auto.xml index ad84c27..5b54fa1 100644 --- a/IntelliQ/backend/datastore/datastore-indexes-auto.xml +++ b/IntelliQ/backend/datastore/datastore-indexes-auto.xml @@ -1,12 +1,4 @@ - + - + - - - - - - - - diff --git a/IntelliQ/backend/datastore/local_db.bin b/IntelliQ/backend/datastore/local_db.bin index 95aa73ed61882c792285539f1f8aac405b9296fe..a457aae4a367f7a204fbeb4395af8eddb060e17c 100644 GIT binary patch delta 337 zcmXxcxlRIM7=>Z}`4Pkg5EW%{0cBAH7q;&zyaW@?R94zeWnwI>prDyZ2puLE5-Cik zwWqN&F%(E;LqmN*Oox2U9(o>W={pH|F4h7xVC80gG6|GW-Z2 zh!upeiZ!ewj16oef+%8$V+-5Z!7dU=Vh{UBA&m^OIKUxtI6@u;9ODG1I71O7lu<#| zF_ko$y8f-~_pT(IXiH*-ei{DPuyfv)3$Oki{MfG@dD7k4e)%loao>M@zS;eb6zoAy Tu61pC5(!w=t?SO^n})U~6cK85 delta 337 zcmXxc%Ps?P9L4ee=RbN;lwxS>))sZ^g}VG6LOg)QNN5xYv7NHjLH zoqfH4Sxr2ECSHIqjm0M?=PXVXey9k&b7fr~-?-}5Rlh7~*cd?^2_%uiDAE|iI3|$6 zB&LwXG-fah2XmN54tW%?fJH1}87nBFgfdpKhILf1flX{-8#}0?hB_M9#U7g2#{mv; z60KmQ;FOTUGG)$varRoFJ diff --git a/IntelliQ/backend/src/main/webapp/static/js/api.js b/IntelliQ/backend/src/main/webapp/static/js/api.js index 25605a6..9873a0b 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/api.js +++ b/IntelliQ/backend/src/main/webapp/static/js/api.js @@ -86,6 +86,7 @@ var intelliqApi = function(){ 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.PAGE_LINK_WEB_APP_BUSINESS = api.PAGE_LINK_WEB_APP + "business/"; api.PAGE_LINK_WEB_APP_TICKETS = api.PAGE_LINK_WEB_APP + "tickets/"; api.PATH_BUSINESS = "business/"; @@ -942,6 +943,11 @@ var intelliqApi = function(){ return urls.replaceParameter("businessKeyId", business.key.id, url); } + urls.openInWebApp = function() { + var url = api.PAGE_LINK_WEB_APP_BUSINESS; + return urls.replaceParameter("businessKeyId", business.key.id, url); + } + return urls; } diff --git a/IntelliQ/backend/src/main/webapp/static/js/ui.js b/IntelliQ/backend/src/main/webapp/static/js/ui.js index a8ba731..85b3f90 100644 --- a/IntelliQ/backend/src/main/webapp/static/js/ui.js +++ b/IntelliQ/backend/src/main/webapp/static/js/ui.js @@ -447,7 +447,26 @@ var ui = function(){ card.withImageRatio(3/1); - card.withContent().withTitle(business.name, false); + var url = intelliqApi.getUrls().forBusiness(business).openInWebApp(); + var title = $("", { + "href": url, + "class": "truncate" + }).text(business.name); + + if (business.queues.length == 1) { + // directly navigate to only queue available + var queue = business.queues[0]; + var url = intelliqApi.getUrls().forQueue(queue).openInWebApp(); + title.attr("href", url); + } else { + // don't actually navigate, show toast instead + title.click(function(event) { + event.preventDefault(); + Materialize.toast(getString("selectQueue"), 3000); + }); + } + + card.withContent().withTitle(title, false); 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 261567f..4be3989 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 @@ -32,6 +32,8 @@ "uploadSuccessful": "Upload Finished", "uploadFailed": "Upload Failed", + "selectQueue": "Select a queue", + "status": "Status", "statusWaiting": "Waiting", "statusCalled": "Called",