summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-03-08 11:28:21 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-03-08 11:32:59 +0100
commit6d6bb8fc5745300dedef85d4500e0a5ee3f9017f (patch)
tree1c63971d9ebece44daeac7a2991d9cd044b44ce6 /client
parent7836ab83d02adc40bc59bc4393191abec0a4f636 (diff)
downloadwekan-6d6bb8fc5745300dedef85d4500e0a5ee3f9017f.tar.gz
wekan-6d6bb8fc5745300dedef85d4500e0a5ee3f9017f.tar.bz2
wekan-6d6bb8fc5745300dedef85d4500e0a5ee3f9017f.zip
Activities: register customFields changed in the activities
This stores the updates to the custom fields in the activities side bar. Only manual updates to the custom fields are currently registered.
Diffstat (limited to 'client')
-rw-r--r--client/components/activities/activities.jade6
-rw-r--r--client/components/activities/activities.js18
2 files changed, 24 insertions, 0 deletions
diff --git a/client/components/activities/activities.jade b/client/components/activities/activities.jade
index bddc4dad..949400f6 100644
--- a/client/components/activities/activities.jade
+++ b/client/components/activities/activities.jade
@@ -114,6 +114,12 @@ template(name="boardActivities")
if($eq activityType 'removedLabel')
| {{{_ 'activity-removed-label' lastLabel cardLink}}}.
+ if($eq activityType 'setCustomField')
+ | {{{_ 'activity-set-customfield' lastCustomField lastCustomFieldValue cardLink}}}.
+
+ if($eq activityType 'unsetCustomField')
+ | {{{_ 'activity-unset-customfield' lastCustomField cardLink}}}.
+
if($eq activityType 'unjoinMember')
if($eq user._id member._id)
| {{{_ 'activity-unjoined' cardLink}}}.
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js
index b3fe8f50..81995221 100644
--- a/client/components/activities/activities.js
+++ b/client/components/activities/activities.js
@@ -82,6 +82,24 @@ BlazeComponent.extendComponent({
}
},
+ lastCustomField(){
+ const lastCustomField = CustomFields.findOne(this.currentData().customFieldId);
+ return lastCustomField.name;
+ },
+
+ lastCustomFieldValue(){
+ const lastCustomField = CustomFields.findOne(this.currentData().customFieldId);
+ 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;
},