Add Features: allowing lists to be sorted by modifiedAt when not in draggable mode.

Bug Fix #2093: the broken should be prior to file attachment feature introduced, and tested export board is working.

Thanks to whowillcare !

( xet7 merged this pull request manually from https://github.com/wekan/wekan/pull/2756 )

Closes #2093
This commit is contained in:
Lauri Ojansivu 2019-10-29 19:05:44 +02:00
parent 13a2bd6380
commit 7d6d3af54a
29 changed files with 475 additions and 41 deletions

View file

@ -1695,6 +1695,25 @@ if (Meteor.isServer) {
const oldvalue = doc[action] || '';
const activityType = `a-${action}`;
const card = Cards.findOne(doc._id);
const list = card.list();
if (list && action === 'endAt') {
// change list modifiedAt
const modifiedAt = new Date(
new Date(value).getTime() - 365 * 24 * 3600 * 1e3,
); // set it as 1 year before
const boardId = list.boardId;
Lists.direct.update(
{
_id: list._id,
},
{
$set: {
modifiedAt,
boardId,
},
},
);
}
const username = Users.findOne(userId).username;
const activity = {
userId,
@ -1852,15 +1871,8 @@ if (Meteor.isServer) {
const check = Users.findOne({
_id: req.body.authorId,
});
const members = req.body.members || [req.body.authorId];
if (typeof check !== 'undefined') {
let members = req.body.members || [];
if (_.isString(members)) {
if (members === '') {
members = [];
} else {
members = [members];
}
}
const id = Cards.direct.insert({
title: req.body.title,
boardId: paramBoardId,