Skip to content

Commit

Permalink
Sandbox migration (#467)
Browse files Browse the repository at this point in the history
* adding sandbox change migration

* adding winston slack logger

* v2.10.1

* remove wrong ticket ids

* 2.10.2

* disable exit and only lookup current event id

* 2.10.3

* Update 20171006005624_sandbox2017.js

* Update 20171006005624_sandbox2017.js

* update search
  • Loading branch information
LeonFedotov authored Oct 5, 2017
1 parent eaf3d6e commit 2435852
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"this is part of the deployment proess, so it is important to update the version number",
"version name corresponds to the github release name / tag name - https://github.com/Midburn/Spark/releases"
],
"version": "2.10.2",
"version": "2.10.3",
"private": true,
"scripts": {
"postinstall": "bower install",
Expand Down
19 changes: 11 additions & 8 deletions routes/gate_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var constants = require('../models/constants');

router.get('/', userRole.isGateManager(), function (req, res) {
//TODO Temp SANDBOX2017, we need to add a global current-event selector.
Event.forge({event_id: 'SANDBOX2017'}).fetch().then(event => {
Event.forge({event_id: constants.CURRENT_EVENT_ID}).fetch().then(event => {
return res.render('pages/gate', {
gate_code: event.attributes.gate_code
});
Expand All @@ -37,13 +37,16 @@ router.get('/ajax/tickets', [security.protectJwt, userRole.isGateManager()], asy
.from('tickets')
.leftJoin('users', 'tickets.holder_id', 'users.user_id')
.leftJoin('users_groups', 'tickets.entrance_group_id', 'users_groups.group_id')
.where('ticket_number', isNaN(parseInt(req.query.search)) ? req.query.search : parseInt(req.query.search))
.orWhere('first_name', 'LIKE', '%' + req.query.search + '%')
.orWhere('last_name', 'LIKE', '%' + req.query.search + '%')
.orWhere('email', 'LIKE', '%' + req.query.search + '%')
.orWhere('israeli_id', 'LIKE', '%' + req.query.search + '%')
.orWhereRaw("(first_name REGEXP '" + searchRegex + "' and last_name REGEXP '" + searchRegex + "')")
//.limit(parseInt(req.query.limit)).offset(parseInt(req.query.offset))
.where('tickets.event_id', constants.CURRENT_EVENT_ID)
.andWhere(function() {
this.where('ticket_number', isNaN(parseInt(req.query.search)) ? req.query.search : parseInt(req.query.search))
.orWhere('first_name', 'LIKE', '%' + req.query.search + '%')
.orWhere('last_name', 'LIKE', '%' + req.query.search + '%')
.orWhere('email', 'LIKE', '%' + req.query.search + '%')
.orWhere('israeli_id', 'LIKE', '%' + req.query.search + '%')
.orWhereRaw("(first_name REGEXP '" + searchRegex + "' and last_name REGEXP '" + searchRegex + "')")
//.limit(parseInt(req.query.limit)).offset(parseInt(req.query.offset))
})
.then((tickets) => {
res.status(200).json({rows: tickets, total: tickets.length})
}).catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion views/pages/gate.jade
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ block scripts
return '<a class="entranceAction" id="' + row.barcode + '" ' +
'data-toggle="modal" href="#myModal" data-id="" title="Enter">#{t("gate:enter_ticket")}</a> ';
} else {
return '<a class="exitAction" id="' + row.barcode + '" ' +
return '<a disabled class="exitAction" id="' + row.barcode + '" ' +
'data-toggle="modal" href="#myModal" data-id="" title="Enter">#{t("gate:exit_ticket")}</a> ';
}
};
Expand Down

0 comments on commit 2435852

Please sign in to comment.