The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
wekan/server/lib/titleChangeActivity.js

16 lines
791 B

// Pure helper used by the Cards.before.update hook to detect a card title change.
// Extracted so the title-change activity logic (issue #3619) can be unit-tested
// without the Meteor/Mongo collection machinery.
//
// Returns true only when the update modifier sets `title` to a value that
// differs from the current document's title. This mirrors how sibling tracked
// fields (e.g. dueAt) are detected in the before.update hook, so the existing
// Activities.after.insert outgoing-webhook hook fires on title changes too.
export function titleChanged(oldDoc, modifier) {
if (!modifier || !modifier.$set || !('title' in modifier.$set)) {
return false;
}
const oldTitle = (oldDoc && oldDoc.title) || '';
const newTitle = modifier.$set.title;
return newTitle !== oldTitle;
}