mirror of
https://github.com/wekan/wekan.git
synced 2026-02-10 02:04:20 +01:00
Merge branch 'sorted-archives' of https://github.com/bronger/wekan into bronger-sorted-archives
This commit is contained in:
commit
41e1f8fbc3
8 changed files with 57 additions and 5 deletions
|
|
@ -43,6 +43,13 @@ Boards.attachSchema(
|
|||
}
|
||||
},
|
||||
},
|
||||
archivedAt: {
|
||||
/**
|
||||
* Latest archiving time of the board
|
||||
*/
|
||||
type: Date,
|
||||
optional: true,
|
||||
},
|
||||
createdAt: {
|
||||
/**
|
||||
* Creation time of the board
|
||||
|
|
@ -1042,7 +1049,7 @@ Boards.helpers({
|
|||
|
||||
Boards.mutations({
|
||||
archive() {
|
||||
return { $set: { archived: true } };
|
||||
return { $set: { archived: true, archivedAt: new Date() } };
|
||||
},
|
||||
|
||||
restore() {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,13 @@ Cards.attachSchema(
|
|||
}
|
||||
},
|
||||
},
|
||||
archivedAt: {
|
||||
/**
|
||||
* latest archiving date
|
||||
*/
|
||||
type: Date,
|
||||
optional: true,
|
||||
},
|
||||
parentId: {
|
||||
/**
|
||||
* ID of the parent card
|
||||
|
|
@ -1449,6 +1456,7 @@ Cards.mutations({
|
|||
return {
|
||||
$set: {
|
||||
archived: true,
|
||||
archivedAt: new Date(),
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,6 +32,13 @@ Lists.attachSchema(
|
|||
}
|
||||
},
|
||||
},
|
||||
archivedAt: {
|
||||
/**
|
||||
* latest archiving date
|
||||
*/
|
||||
type: Date,
|
||||
optional: true,
|
||||
},
|
||||
boardId: {
|
||||
/**
|
||||
* the board associated to this list
|
||||
|
|
@ -292,7 +299,7 @@ Lists.mutations({
|
|||
return card.archive();
|
||||
});
|
||||
}
|
||||
return { $set: { archived: true } };
|
||||
return { $set: { archived: true, archivedAt: new Date() } };
|
||||
},
|
||||
|
||||
restore() {
|
||||
|
|
@ -384,6 +391,7 @@ if (Meteor.isServer) {
|
|||
Meteor.startup(() => {
|
||||
Lists._collection._ensureIndex({ modifiedAt: -1 });
|
||||
Lists._collection._ensureIndex({ boardId: 1 });
|
||||
Lists._collection._ensureIndex({ archivedAt: -1 });
|
||||
});
|
||||
|
||||
Lists.after.insert((userId, doc) => {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,13 @@ Swimlanes.attachSchema(
|
|||
}
|
||||
},
|
||||
},
|
||||
archivedAt: {
|
||||
/**
|
||||
* latest archiving date of the swimlane
|
||||
*/
|
||||
type: Date,
|
||||
optional: true,
|
||||
},
|
||||
boardId: {
|
||||
/**
|
||||
* the ID of the board the swimlane is attached to
|
||||
|
|
@ -259,7 +266,7 @@ Swimlanes.mutations({
|
|||
return list.archive();
|
||||
});
|
||||
}
|
||||
return { $set: { archived: true } };
|
||||
return { $set: { archived: true, archivedAt: new Date() } };
|
||||
},
|
||||
|
||||
restore() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue