mirror of
https://github.com/wekan/wekan.git
synced 2026-02-21 15:34:07 +01:00
Move every Team.findOne() to the ReactiveCache
This commit is contained in:
parent
2ab34d3b87
commit
fe2015735a
4 changed files with 32 additions and 9 deletions
|
|
@ -198,7 +198,7 @@ Template.orgRow.helpers({
|
|||
|
||||
Template.teamRow.helpers({
|
||||
teamData() {
|
||||
return Team.findOne(this.teamId);
|
||||
return ReactiveCache.getTeam(this.teamId);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ Template.editOrgPopup.helpers({
|
|||
|
||||
Template.editTeamPopup.helpers({
|
||||
team() {
|
||||
return Team.findOne(this.teamId);
|
||||
return ReactiveCache.getTeam(this.teamId);
|
||||
},
|
||||
errorMessage() {
|
||||
return Template.instance().errorMessage.get();
|
||||
|
|
@ -311,7 +311,7 @@ Template.newOrgPopup.helpers({
|
|||
|
||||
Template.newTeamPopup.helpers({
|
||||
team() {
|
||||
return Team.findOne(this.teamId);
|
||||
return ReactiveCache.getTeam(this.teamId);
|
||||
},
|
||||
errorMessage() {
|
||||
return Template.instance().errorMessage.get();
|
||||
|
|
@ -369,7 +369,7 @@ BlazeComponent.extendComponent({
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {},
|
||||
team() {
|
||||
return Team.findOne(this.teamId);
|
||||
return ReactiveCache.getTeam(this.teamId);
|
||||
},
|
||||
events() {
|
||||
return [
|
||||
|
|
@ -605,7 +605,7 @@ Template.editOrgPopup.events({
|
|||
Template.editTeamPopup.events({
|
||||
submit(event, templateInstance) {
|
||||
event.preventDefault();
|
||||
const team = Team.findOne(this.teamId);
|
||||
const team = ReactiveCache.getTeam(this.teamId);
|
||||
|
||||
const teamDisplayName = templateInstance
|
||||
.find('.js-teamDisplayName')
|
||||
|
|
|
|||
|
|
@ -1845,7 +1845,7 @@ BlazeComponent.extendComponent({
|
|||
|
||||
Template.removeBoardTeamPopup.helpers({
|
||||
team() {
|
||||
return Team.findOne(this.teamId);
|
||||
return ReactiveCache.getTeam(this.teamId);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -148,18 +148,18 @@ BlazeComponent.extendComponent({
|
|||
|
||||
Template.boardTeamRow.helpers({
|
||||
teamData() {
|
||||
return Team.findOne(this.teamId);
|
||||
return ReactiveCache.getTeam(this.teamId);
|
||||
},
|
||||
});
|
||||
|
||||
Template.boardTeamName.helpers({
|
||||
teamName() {
|
||||
const team = Team.findOne(this.teamId);
|
||||
const team = ReactiveCache.getTeam(this.teamId);
|
||||
return team && team.teamDisplayName;
|
||||
},
|
||||
|
||||
teamViewPortWidth() {
|
||||
const team = Team.findOne(this.teamId);
|
||||
const team = ReactiveCache.getTeam(this.teamId);
|
||||
return ((team && team.teamDisplayName.length) || 1) * 12;
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue