Skip to content

Commit

Permalink
Merge pull request #4168 from RestyaPlatform/issue/1162
Browse files Browse the repository at this point in the history
Fixes #1162: plugin: show card inactivity like in trello added
  • Loading branch information
rrjanbiah authored Sep 14, 2020
2 parents c6c40f6 + 26edd8f commit eb0a789
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 38 deletions.
5 changes: 4 additions & 1 deletion client/js/views/card_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ App.CardView = Backbone.View.extend({
}
}
if (!_.isUndefined(this.model.attributes.name) && this.model.attributes.name !== '') {
this.$el.addClass('panel js-show-modal-card-view js-board-list-card non-select cur').removeAttr('id').attr('data-toggle', 'modal').attr('data-target', '#myModal').attr('data-card_id', this.model.id).attr('id', 'js-card-' + this.model.id).css("border-left-color", this.model.attributes.color).css("border-left-width", "8px");
this.$el.addClass('panel js-show-modal-card-view js-board-list-card non-select cur').removeAttr('id').attr('data-toggle', 'modal').attr('data-target', '#myModal').attr('data-card_id', this.model.id).attr('id', 'js-card-' + this.model.id).css("border-left-color", this.model.attributes.color);
if (!_.isUndefined(this.model.attributes.color) && !_.isEmpty(this.model.attributes.color) && this.model.attributes.color !== null) {
this.$el.css("border-left-width", "8px");
}
}
} else if (self.model !== null && !_.isEmpty(self.model) && !_.isUndefined(self.model.attributes.id) && !_.isUndefined(this.model.list) && !_.isUndefined(this.model.list.collection)) {
filter_count = 0;
Expand Down
13 changes: 10 additions & 3 deletions client/js/views/footer_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,7 @@ App.FooterView = Backbone.View.extend({
if (!_.isEmpty(card_list) && !_.isUndefined(card_list) && card_list !== null && !_.isEmpty(card_list.cards) && !_.isUndefined(card_list.cards) && card_list.cards !== null) {
var tmp_list_cards = card_list.cards;
new_card.set('created', activity.attributes.card.created);
new_card.set('modified', activity.attributes.card.created);
new_card.set('position', parseFloat(activity.attributes.card.position));
tmp_list_cards.add(new_card, {
silent: true
Expand Down Expand Up @@ -1291,6 +1292,9 @@ App.FooterView = Backbone.View.extend({
card.set('description', activity.attributes.revisions.new_value.description);
}
if (!_.isUndefined(card)) {
if (activity.attributes.type !== "add_card_evergreen_card" && activity.attributes.type !== "delete_card_evergreen_card") {
card.set('modified', activity.attributes.modified);
}
if ((!_.isUndefined(APPS) && APPS !== null && !_.isUndefined(APPS.enabled_apps) && APPS.enabled_apps !== null && $.inArray('r_custom_fields', APPS.enabled_apps)) && (activity.attributes.type === "add_card_custom_field" || activity.attributes.type === "update_card_custom_field" || activity.attributes.type === "delete_card_custom_field") && !_.isEmpty(activity.attributes.custom_fields) && !_.isUndefined(activity.attributes.custom_fields) && activity.attributes.custom_fields !== null) {
$('body').trigger('CutomFieldsRendered', [parseInt(activity.attributes.card_id), card]);
}
Expand Down Expand Up @@ -1339,6 +1343,9 @@ App.FooterView = Backbone.View.extend({
if ((!_.isUndefined(APPS) && APPS !== null && !_.isUndefined(APPS.enabled_apps) && APPS.enabled_apps !== null) && (activity.attributes.type === "add_card_estimatedtime" || activity.attributes.type === "edit_card_estimatedtime" || activity.attributes.type === "delete_card_estimatedtime" || activity.attributes.type === "add_card_spenttime" || activity.attributes.type === "edit_card_spenttime" || activity.attributes.type === "delete_card_spenttime" || activity.attributes.type === "add_card_startdate" || activity.attributes.type === "edit_card_startdate" || activity.attributes.type === "delete_card_startdate") && !_.isEmpty(activity.attributes.revisions.new_value.custom_fields)) {
$('body').trigger('cardCutomFieldsRendered', [parseInt(activity.attributes.revisions.new_value.id), card]);
}
if (!_.isUndefined(APPS) && APPS !== null && !_.isUndefined(APPS.enabled_apps) && APPS.enabled_apps !== null && (activity.attributes.type === "add_card_evergreen_card" || activity.attributes.type === "delete_card_evergreen_card") && !_.isEmpty(activity.attributes.revisions.new_value.custom_fields)) {
$('body').trigger('cardAgingRendered', [parseInt(card.id), card]);
}
if (activity.attributes.type === 'add_card_checklist') {
var new_checklist = new App.CheckList();
new_checklist.set(activity.attributes.checklist);
Expand Down Expand Up @@ -1661,6 +1668,7 @@ App.FooterView = Backbone.View.extend({
if (!_.isEmpty(card_new_list) && !_.isUndefined(card_new_list) && card_new_list !== null && !_.isEmpty(card_new_list.cards) && !_.isUndefined(card_new_list.cards) && card_new_list.cards !== null) {
var tmp_newlist_cards = card_new_list.cards;
card.set('created', card.get('created'));
card.set('modified', activity.attributes.created);
card.set('list_moved_date', activity.attributes.created);
card.set('list_name', activity.attributes.moved_list_name, {
silent: true
Expand Down Expand Up @@ -2822,6 +2830,7 @@ App.FooterView = Backbone.View.extend({
board_new_card.set('checklist_item_pending_count', new_card_checklist_count);
board_new_card.set('attachment_count', new_card_attachment);
board_new_card.set('created', activity.attributes.card.created);
board_new_card.set('modified', activity.attributes.card.created);
if (!_.isUndefined(activity.attributes.card.due_date) && activity.attributes.card.due_date !== null) {
board_new_card.set('created', activity.attributes.card.created);
}
Expand Down Expand Up @@ -2933,9 +2942,7 @@ App.FooterView = Backbone.View.extend({
$('#js-card-' + activity.attributes.card_id).parent().removeClass('animation');
$('#js-card-' + activity.attributes.card_id).removeClass('tada-animation');
$('#js-card-' + activity.attributes.card_id).removeClass('active');
$('#js-card-' + activity.attributes.card_id).animate({
backgroundColor: '#FFFFFF'
}, 2000);
$('#js-card-' + activity.attributes.card_id).css('background-color', '');
});
}
});
Expand Down
Loading

0 comments on commit eb0a789

Please sign in to comment.