diff options
author | Thiago Fernando <thiagofernando@outlook.com> | 2019-05-10 14:54:25 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 14:54:25 -0300 |
commit | ce0473480bab3fc621d4baecfff0f413e21b5e2c (patch) | |
tree | 06d724b4f80885bdd13137f7977d7a914cca0138 /client/components/activities/activities.js | |
parent | c43508cacbd64357409a3de114db9dab2ae59a9d (diff) | |
parent | 7ff4067e88ed59686c86d81447fa2ce550032034 (diff) | |
download | wekan-ce0473480bab3fc621d4baecfff0f413e21b5e2c.tar.gz wekan-ce0473480bab3fc621d4baecfff0f413e21b5e2c.tar.bz2 wekan-ce0473480bab3fc621d4baecfff0f413e21b5e2c.zip |
Merge pull request #1 from wekan/devel
ldap changes
Diffstat (limited to 'client/components/activities/activities.js')
-rw-r--r-- | client/components/activities/activities.js | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js index ccb064f3..0476897f 100644 --- a/client/components/activities/activities.js +++ b/client/components/activities/activities.js @@ -8,16 +8,24 @@ BlazeComponent.extendComponent({ const sidebar = this.parentComponent(); // XXX for some reason not working sidebar.callFirstWith(null, 'resetNextPeak'); this.autorun(() => { - const mode = this.data().mode; + let mode = this.data().mode; const capitalizedMode = Utils.capitalize(mode); - const id = Session.get(`current${capitalizedMode}`); + let thisId, searchId; + if (mode === 'linkedcard' || mode === 'linkedboard') { + thisId = Session.get('currentCard'); + searchId = Cards.findOne({_id: thisId}).linkedId; + mode = mode.replace('linked', ''); + } else { + thisId = Session.get(`current${capitalizedMode}`); + searchId = thisId; + } const limit = this.page.get() * activitiesPerPage; const user = Meteor.user(); const hideSystem = user ? user.hasHiddenSystemMessages() : false; - if (id === null) + if (searchId === null) return; - this.subscribe('activities', mode, id, limit, hideSystem, () => { + this.subscribe('activities', mode, searchId, limit, hideSystem, () => { this.loadNextPageLocked = false; // If the sibear peak hasn't increased, that mean that there are no more @@ -42,6 +50,12 @@ BlazeComponent.extendComponent({ } }, + checkItem(){ + const checkItemId = this.currentData().checklistItemId; + const checkItem = ChecklistItems.findOne({_id:checkItemId}); + return checkItem.title; + }, + boardLabel() { return TAPi18n.__('this-board'); }, @@ -58,6 +72,40 @@ BlazeComponent.extendComponent({ }, card.title)); }, + lastLabel(){ + const lastLabelId = this.currentData().labelId; + if (!lastLabelId) + return null; + const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(lastLabelId); + if(lastLabel.name === undefined || lastLabel.name === ''){ + return lastLabel.color; + }else{ + return lastLabel.name; + } + }, + + lastCustomField(){ + const lastCustomField = CustomFields.findOne(this.currentData().customFieldId); + if (!lastCustomField) + return null; + return lastCustomField.name; + }, + + lastCustomFieldValue(){ + const lastCustomField = CustomFields.findOne(this.currentData().customFieldId); + if (!lastCustomField) + return null; + const value = this.currentData().value; + if (lastCustomField.settings.dropdownItems && lastCustomField.settings.dropdownItems.length > 0) { + const dropDownValue = _.find(lastCustomField.settings.dropdownItems, (item) => { + return item._id === value; + }); + if (dropDownValue) + return dropDownValue.name; + } + return value; + }, + listLabel() { return this.currentData().list().title; }, @@ -91,6 +139,13 @@ BlazeComponent.extendComponent({ }, attachment.name())); }, + customField() { + const customField = this.currentData().customField(); + if (!customField) + return null; + return customField.name; + }, + events() { return [{ // XXX We should use Popup.afterConfirmation here |