Skip to content

Commit

Permalink
fix(group): undefined text when deleting group
Browse files Browse the repository at this point in the history
fix(group): trailing white space was allowed
fix(dashboard): error when no tickets were in cache
revert(overdue): JavaScript implementation using velocity
  • Loading branch information
polonel committed Sep 20, 2018
1 parent ffc2938 commit 6f432db
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
6 changes: 6 additions & 0 deletions src/models/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ var groupSchema = mongoose.Schema({
public: { type: Boolean, required: true, default: false }
});

groupSchema.pre('save', function(next) {
this.name = this.name.trim();

next();
});

groupSchema.methods.addMember = function(memberId, callback) {
if (_.isUndefined(memberId)) return callback('Invalid MemberId - $Group.AddMember()');

Expand Down
2 changes: 1 addition & 1 deletion src/public/js/angularjs/controllers/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ define(['angular', 'underscore', 'jquery', 'modules/helpers', 'uikit', 'history'

$scope.deleteGroup = function(event) {
event.preventDefault();
var self = $(event.target);
var self = $(event.currentTarget);
var groupID = self.attr('data-group-id');
var card = self.parents('.tru-card-wrapper');
if (groupID) {
Expand Down
8 changes: 4 additions & 4 deletions src/public/js/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,22 @@ define('pages/dashboard', [

//QuickStats
var mostRequester = $('#mostRequester');
if (_data.mostRequester !== null)
if (_data.mostRequester)
mostRequester.text(_data.mostRequester.name + ' (' + _data.mostRequester.value + ')');
var mostCommenter = $('#mostCommenter');
if (_data.mostCommenter !== null)
if (_data.mostCommenter)
mostCommenter.text(_data.mostCommenter.name + ' (' + _data.mostCommenter.value + ')');
else
mostCommenter.text('--');

var mostAssignee = $('#mostAssignee');
if (_data.mostAssignee !== null)
if (_data.mostAssignee)
mostAssignee.text(_data.mostAssignee.name + ' (' + _data.mostAssignee.value + ')');
else
mostAssignee.text('--');

var mostActiveTicket = $('#mostActiveTicket');
if (_data.mostActiveTicket !== null)
if (_data.mostActiveTicket)
mostActiveTicket.attr('href', '/tickets/' + _data.mostActiveTicket.uid).text('T#' + _data.mostActiveTicket.uid);
},
error: function(err) {
Expand Down
15 changes: 7 additions & 8 deletions src/public/js/pages/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
define('pages/tickets', [
'jquery',
'modules/helpers',
'velocity',
'datatables',
'dt_responsive',
'dt_grouping',
//'dt_foundation',
'dt_scroller',
'history'

], function($, helpers) {
], function($, helpers, velocity) {
var ticketsPage = {};

ticketsPage.init = function(callback) {
Expand Down Expand Up @@ -73,13 +74,11 @@ define('pages/tickets', [
return isNaN(x) ? '00' : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
}

setInterval(function() {
var $overDueTR = $('tr.overdue');
if ($overDueTR.hasClass('overdue-red'))
$overDueTR.removeClass('overdue-red');
else
$overDueTR.addClass('overdue-red');
}, 800);
$('tr.overdue td').velocity({backgroundColor: '#b71c1c', color: '#ffffff'}, {
loop: true,
easing: [1],
duration: 800
});

if (typeof callback === 'function')
return callback();
Expand Down
2 changes: 1 addition & 1 deletion src/sass/_settings.sass
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $page_content_border_accent: 2px solid $page_content_title_bg
$page_content_button_color: #FFFFFF
$page_content_button_text_color: $sidebar_item_active

$overdue_flash_color: #b71c1c
//$overdue_flash_color: #b71c1c
$ticket_status_new: $accent_success
$ticket_status_open: $accent_danger
Expand Down
5 changes: 0 additions & 5 deletions src/sass/partials/tickets.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
@media only screen and (min-width: 40.063em) and (max-width: 64em)
padding: 0 0 0 55px !important

.overdue-red
background: $overdue_flash_color !important
td
color: white !important

.ticketList,
.accountList
overflow: hidden
Expand Down

0 comments on commit 6f432db

Please sign in to comment.