mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge pull request #1831 from andresmanelli/devel
Fix removed setters and getters
This commit is contained in:
commit
5c33a85341
2 changed files with 56 additions and 11 deletions
|
@ -129,14 +129,14 @@ template(name="cardDetails")
|
|||
+editCardRequesterForm
|
||||
else
|
||||
a.js-open-inlined-form
|
||||
if requestedBy
|
||||
if getRequestedBy
|
||||
+viewer
|
||||
= requestedBy
|
||||
= getRequestedBy
|
||||
else
|
||||
| {{_ 'add'}}
|
||||
else if requestedBy
|
||||
else if getRequestedBy
|
||||
+viewer
|
||||
= requestedBy
|
||||
= getRequestedBy
|
||||
|
||||
.card-details-item.card-details-item-name
|
||||
h3.card-details-item-title {{_ 'assigned-by'}}
|
||||
|
@ -145,14 +145,14 @@ template(name="cardDetails")
|
|||
+editCardAssignerForm
|
||||
else
|
||||
a.js-open-inlined-form
|
||||
if assignedBy
|
||||
if getAssignedBy
|
||||
+viewer
|
||||
= assignedBy
|
||||
= getAssignedBy
|
||||
else
|
||||
| {{_ 'add'}}
|
||||
else if requestedBy
|
||||
else if getRequestedBy
|
||||
+viewer
|
||||
= assignedBy
|
||||
= getAssignedBy
|
||||
|
||||
hr
|
||||
+checklists(cardId = _id)
|
||||
|
@ -192,13 +192,13 @@ template(name="editCardTitleForm")
|
|||
a.fa.fa-times-thin.js-close-inlined-form
|
||||
|
||||
template(name="editCardRequesterForm")
|
||||
input.js-edit-card-requester(type='text' autofocus value=requestedBy)
|
||||
input.js-edit-card-requester(type='text' autofocus value=getRequestedBy)
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-submit-edit-card-requester-form(type="submit") {{_ 'save'}}
|
||||
a.fa.fa-times-thin.js-close-inlined-form
|
||||
|
||||
template(name="editCardAssignerForm")
|
||||
input.js-edit-card-assigner(type='text' autofocus value=assignedBy)
|
||||
input.js-edit-card-assigner(type='text' autofocus value=getAssignedBy)
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-submit-edit-card-assigner-form(type="submit") {{_ 'save'}}
|
||||
a.fa.fa-times-thin.js-close-inlined-form
|
||||
|
|
|
@ -88,7 +88,6 @@ Cards.attachSchema(new SimpleSchema({
|
|||
type: String,
|
||||
optional: true,
|
||||
defaultValue: '',
|
||||
|
||||
},
|
||||
assignedBy: {
|
||||
type: String,
|
||||
|
@ -769,6 +768,52 @@ Cards.helpers({
|
|||
return this.archived;
|
||||
}
|
||||
},
|
||||
|
||||
setRequestedBy(requestedBy) {
|
||||
if (this.isLinkedCard()) {
|
||||
return Cards.update(
|
||||
{ _id: this.linkedId },
|
||||
{$set: {requestedBy}}
|
||||
);
|
||||
} else {
|
||||
return Cards.update(
|
||||
{_id: this._id},
|
||||
{$set: {requestedBy}}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
getRequestedBy() {
|
||||
if (this.isLinkedCard()) {
|
||||
const card = Cards.findOne({ _id: this.linkedId });
|
||||
return card.requestedBy;
|
||||
} else {
|
||||
return this.requestedBy;
|
||||
}
|
||||
},
|
||||
|
||||
setAssignedBy(assignedBy) {
|
||||
if (this.isLinkedCard()) {
|
||||
return Cards.update(
|
||||
{ _id: this.linkedId },
|
||||
{$set: {assignedBy}}
|
||||
);
|
||||
} else {
|
||||
return Cards.update(
|
||||
{_id: this._id},
|
||||
{$set: {assignedBy}}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
getAssignedBy() {
|
||||
if (this.isLinkedCard()) {
|
||||
const card = Cards.findOne({ _id: this.linkedId });
|
||||
return card.assignedBy;
|
||||
} else {
|
||||
return this.assignedBy;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Cards.mutations({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue