mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Move every CustomFields.findOne() to the ReactiveCache
This commit is contained in:
parent
0a7ffe4cb0
commit
54f7361767
4 changed files with 5 additions and 5 deletions
|
@ -159,7 +159,7 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
lastCustomField() {
|
||||
const lastCustomField = CustomFields.findOne(
|
||||
const lastCustomField = ReactiveCache.getCustomField(
|
||||
this.currentData().activity.customFieldId,
|
||||
);
|
||||
if (!lastCustomField) return null;
|
||||
|
@ -167,7 +167,7 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
lastCustomFieldValue() {
|
||||
const lastCustomField = CustomFields.findOne(
|
||||
const lastCustomField = ReactiveCache.getCustomField(
|
||||
this.currentData().activity.customFieldId,
|
||||
);
|
||||
if (!lastCustomField) return null;
|
||||
|
|
|
@ -275,7 +275,7 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
|
|||
'click .js-delete-custom-field': Popup.afterConfirm(
|
||||
'deleteCustomField',
|
||||
function() {
|
||||
const customField = CustomFields.findOne(this._id);
|
||||
const customField = ReactiveCache.getCustomField(this._id);
|
||||
if (customField.boardIds.length > 1) {
|
||||
CustomFields.update(customField._id, {
|
||||
$pull: {
|
||||
|
|
|
@ -56,7 +56,7 @@ Activities.helpers({
|
|||
return ReactiveCache.getCard(this.subtaskId);
|
||||
},
|
||||
customField() {
|
||||
return CustomFields.findOne(this.customFieldId);
|
||||
return ReactiveCache.getCustomField(this.customFieldId);
|
||||
},
|
||||
// Label activity did not work yet, unable to edit labels when tried this.
|
||||
//label() {
|
||||
|
|
|
@ -532,7 +532,7 @@ Cards.helpers({
|
|||
mapCustomFieldsToBoard(boardId) {
|
||||
// Map custom fields to new board
|
||||
return this.customFields.map(cf => {
|
||||
const oldCf = CustomFields.findOne(cf._id);
|
||||
const oldCf = ReactiveCache.getCustomField(cf._id);
|
||||
const newCf = CustomFields.findOne({
|
||||
boardIds: boardId,
|
||||
name: oldCf.name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue