Fixed Rare bug: All Boards page icons random dance. Reverted changing migrations. Fixed reordering cards. Part 2.

Fixes #4214

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2023-06-09 18:03:28 +03:00
parent 44bfe89ea8
commit e1a00090ba
5 changed files with 15 additions and 49 deletions

View file

@ -7,21 +7,13 @@ Template.boardList.helpers({
return Settings.findOne();
},
hideCardCounterList() {
// Fix Rare bug: Board Icons random dance https://github.com/wekan/wekan/issues/4214
// by commenting out following line,
// where it probably counts too often at realtime,
// and makes cards that have card count and member list change size
// and order all the time:
//return Utils.isMiniScreen() && Session.get('currentBoard');
/* Bug Board icons random dance https://github.com/wekan/wekan/issues/4214
return Utils.isMiniScreen() && Session.get('currentBoard'); */
return true;
},
hideBoardMemberList() {
// Fix Rare bug: Board Icons random dance https://github.com/wekan/wekan/issues/4214
// by commenting out following line,
// where it probably counts too often at realtime,
// and makes cards that have card count and member list change size
// and order all the time:
//return Utils.isMiniScreen() && Session.get('currentBoard');
/* Bug Board icons random dance https://github.com/wekan/wekan/issues/4214
return Utils.isMiniScreen() && Session.get('currentBoard'); */
return true;
},
})
@ -64,6 +56,7 @@ BlazeComponent.extendComponent({
onRendered() {
const itemsSelector = '.js-board:not(.placeholder)';
const $boards = this.$('.js-boards');
$boards.sortable({
connectWith: '.js-boards',
@ -95,9 +88,7 @@ BlazeComponent.extendComponent({
// DOM in its initial state. The card move is then handled reactively by
// Blaze with the below query.
$boards.sortable('cancel');
// Fix Rare bug: Board Icons random dance https://github.com/wekan/wekan/issues/4214
// by commenting out following line:
//board.move(sortIndex.base);
board.move(sortIndex.base);
},
});
@ -221,29 +212,27 @@ BlazeComponent.extendComponent({
});
},
boardLists(boardId) {
/*
let boardLists = [];
const lists = Lists.find({ 'boardId': boardId, 'archived': false },{sort: ['sort','asc']});
/* Bug Board icons random dance https://github.com/wekan/wekan/issues/4214
lists.forEach(list => {
let cardCount = Cards.find({ 'boardId': boardId, 'listId': list._id }).count()
boardLists.push(`${list.title}: ${cardCount}`);
});
*/
return boardLists;
*/
return false;
},
boardMembers(boardId) {
/*
let boardMembers = [];
/* Bug Board icons random dance https://github.com/wekan/wekan/issues/4214
const lists = Boards.findOne({ '_id': boardId })
let members = lists.members
let members = lists.members;
members.forEach(member => {
boardMembers.push(member.userId);
});
*/
return boardMembers;
*/
return false;
},
isStarred() {

View file

@ -294,14 +294,6 @@ Boards.attachSchema(
}
},
},
background: {
/**
* The background color of the board.
*/
type: String,
optional: true,
defaultValue: '#16A085',
},
backgroundImageURL: {
/**
* The background image URL of the board.
@ -314,7 +306,6 @@ Boards.attachSchema(
* Show card counter per list
*/
type: Boolean,
optional: false,
defaultValue: false,
},
allowsBoardMemberList: {
@ -366,7 +357,6 @@ Boards.attachSchema(
* Does the board allows subtasks?
*/
type: Boolean,
optional: false,
defaultValue: true,
},
@ -1318,7 +1308,7 @@ Boards.mutations({
},
setVisibility(visibility) {
return { $set: { permission: visibility.toLowerCase() } };
return { $set: { permission: visibility } };
},
addLabel(name, color) {

View file

@ -51,12 +51,10 @@ Settings.attachSchema(
displayAuthenticationMethod: {
type: Boolean,
optional: true,
defaultValue: true,
},
defaultAuthenticationMethod: {
type: String,
optional: false,
defaultValue: 'password',
},
spinnerName: {
type: String,
@ -65,17 +63,14 @@ Settings.attachSchema(
hideLogo: {
type: Boolean,
optional: true,
defaultValue: false,
},
hideCardCounterList: {
type: Boolean,
optional: true,
defaultValue: false,
},
hideBoardMemberList: {
type: Boolean,
optional: true,
defaultValue: false,
},
customLoginLogoImageUrl: {
type: String,

View file

@ -171,7 +171,6 @@ Users.attachSchema(
*/
type: Boolean,
optional: true,
defaultValue: false,
},
'profile.hideCheckedItems': {
/**
@ -385,7 +384,6 @@ Users.attachSchema(
'board-view-lists',
'board-view-cal',
],
defaultValue: 'board-view-swimlanes',
},
'profile.listSortBy': {
/**

View file

@ -54,7 +54,6 @@ const noValidate = {
};
const noValidateMulti = { ...noValidate, multi: true };
/*
Migrations.add('board-background-color', () => {
const defaultColor = '#16A085';
Boards.update(
@ -91,6 +90,7 @@ Migrations.add('add-cardcounterlist-allowed', () => {
);
});
/*
Migrations.add('add-boardmemberlist-allowed', () => {
Boards.update(
{
@ -106,6 +106,7 @@ Migrations.add('add-boardmemberlist-allowed', () => {
noValidateMulti,
);
});
*/
Migrations.add('lowercase-board-permission', () => {
['Public', 'Private'].forEach(permission => {
@ -117,6 +118,7 @@ Migrations.add('lowercase-board-permission', () => {
});
});
/*
// Security migration: see https://github.com/wekan/wekan/issues/99
Migrations.add('change-attachments-type-for-non-images', () => {
const newTypeForNonImage = 'application/octet-stream';
@ -257,7 +259,6 @@ Migrations.add('add-swimlanes', () => {
});
});
/*
Migrations.add('add-views', () => {
Boards.find().forEach(board => {
if (!board.hasOwnProperty('view')) {
@ -269,7 +270,6 @@ Migrations.add('add-views', () => {
}
});
});
*/
Migrations.add('add-checklist-items', () => {
Checklists.find().forEach(checklist => {
@ -308,7 +308,6 @@ Migrations.add('add-card-types', () => {
});
});
/*
Migrations.add('add-custom-fields-to-cards', () => {
Cards.update(
{
@ -453,7 +452,6 @@ Migrations.add('add-authenticationMethod', () => {
noValidateMulti,
);
});
*/
Migrations.add('remove-tag', () => {
Users.update(
@ -479,7 +477,6 @@ Migrations.add('remove-customFields-references-broken', () => {
);
});
/*
Migrations.add('add-product-name', () => {
Settings.update(
{
@ -575,7 +572,6 @@ Migrations.add('add-defaultAuthenticationMethod', () => {
noValidateMulti,
);
});
*/
Migrations.add('add-templates', () => {
Boards.update(
@ -821,7 +817,6 @@ Migrations.add('fix-incorrect-dates', () => {
);
});
/*
Migrations.add('add-assignee', () => {
Cards.update(
{
@ -1125,7 +1120,6 @@ Migrations.add('add-description-text-allowed-on-minicard', () => {
noValidateMulti,
);
});
*/
Migrations.add('add-sort-field-to-boards', () => {
Boards.find().forEach((board, index) => {