mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Move every Swimlanes.find(idOrFirstObjectSelector, options) to the ReactiveCache (directory client/)
This commit is contained in:
parent
1c966ed7b4
commit
9125ab440d
4 changed files with 6 additions and 6 deletions
|
|
@ -46,7 +46,7 @@ BlazeComponent.extendComponent({
|
||||||
// fix swimlanes sort field if there are null values
|
// fix swimlanes sort field if there are null values
|
||||||
const currentBoardData = Utils.getCurrentBoard();
|
const currentBoardData = Utils.getCurrentBoard();
|
||||||
const nullSortSwimlanes = currentBoardData.nullSortSwimlanes();
|
const nullSortSwimlanes = currentBoardData.nullSortSwimlanes();
|
||||||
if (nullSortSwimlanes.count() > 0) {
|
if (nullSortSwimlanes.length > 0) {
|
||||||
const swimlanes = currentBoardData.swimlanes();
|
const swimlanes = currentBoardData.swimlanes();
|
||||||
let count = 0;
|
let count = 0;
|
||||||
swimlanes.forEach(s => {
|
swimlanes.forEach(s => {
|
||||||
|
|
|
||||||
|
|
@ -463,14 +463,14 @@ BlazeComponent.extendComponent({
|
||||||
if (!this.selectedBoardId.get()) {
|
if (!this.selectedBoardId.get()) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const swimlanes = Swimlanes.find(
|
const swimlanes = ReactiveCache.getSwimlanes(
|
||||||
{
|
{
|
||||||
boardId: this.selectedBoardId.get()
|
boardId: this.selectedBoardId.get()
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
sort: { sort: 1 },
|
sort: { sort: 1 },
|
||||||
});
|
});
|
||||||
if (swimlanes.count())
|
if (swimlanes.length)
|
||||||
this.selectedSwimlaneId.set(swimlanes.fetch()[0]._id);
|
this.selectedSwimlaneId.set(swimlanes.fetch()[0]._id);
|
||||||
return swimlanes;
|
return swimlanes;
|
||||||
},
|
},
|
||||||
|
|
@ -746,7 +746,7 @@ BlazeComponent.extendComponent({
|
||||||
} else if (this.isSwimlaneTemplateSearch) {
|
} else if (this.isSwimlaneTemplateSearch) {
|
||||||
element.sort = ReactiveCache.getBoard(this.boardId)
|
element.sort = ReactiveCache.getBoard(this.boardId)
|
||||||
.swimlanes()
|
.swimlanes()
|
||||||
.count();
|
.length;
|
||||||
element.type = 'swimlane';
|
element.type = 'swimlane';
|
||||||
_id = element.copy(this.boardId);
|
_id = element.copy(this.boardId);
|
||||||
} else if (this.isBoardTemplateSearch) {
|
} else if (this.isBoardTemplateSearch) {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
archivedSwimlanes() {
|
archivedSwimlanes() {
|
||||||
return Swimlanes.find(
|
return ReactiveCache.getSwimlanes(
|
||||||
{
|
{
|
||||||
archived: true,
|
archived: true,
|
||||||
boardId: Session.get('currentBoard'),
|
boardId: Session.get('currentBoard'),
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ export class DialogWithBoardSwimlaneList extends BlazeComponent {
|
||||||
setFirstSwimlaneId() {
|
setFirstSwimlaneId() {
|
||||||
try {
|
try {
|
||||||
const board = ReactiveCache.getBoard(this.selectedBoardId.get());
|
const board = ReactiveCache.getBoard(this.selectedBoardId.get());
|
||||||
const swimlaneId = board.swimlanes().fetch()[0]._id;
|
const swimlaneId = board.swimlanes()[0]._id;
|
||||||
this.selectedSwimlaneId.set(swimlaneId);
|
this.selectedSwimlaneId.set(swimlaneId);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue