mirror of
https://github.com/wekan/wekan.git
synced 2026-02-21 07:24:07 +01:00
Merge branch 'main' into feature/reactive-cache-async-migration
This commit is contained in:
commit
5212f3beb3
328 changed files with 15124 additions and 3392 deletions
|
|
@ -1103,7 +1103,7 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.getSwimlaneHeight(boardId, swimlaneId);
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, get from localStorage
|
||||
try {
|
||||
const stored = localStorage.getItem('wekan-swimlane-heights');
|
||||
|
|
@ -1116,7 +1116,7 @@ Users.helpers({
|
|||
} catch (e) {
|
||||
console.warn('Error reading swimlane heights from localStorage:', e);
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
},
|
||||
|
||||
|
|
@ -1125,17 +1125,17 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.setSwimlaneHeight(boardId, swimlaneId, height);
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, save to localStorage
|
||||
try {
|
||||
const stored = localStorage.getItem('wekan-swimlane-heights');
|
||||
let heights = stored ? JSON.parse(stored) : {};
|
||||
|
||||
|
||||
if (!heights[boardId]) {
|
||||
heights[boardId] = {};
|
||||
}
|
||||
heights[boardId][swimlaneId] = height;
|
||||
|
||||
|
||||
localStorage.setItem('wekan-swimlane-heights', JSON.stringify(heights));
|
||||
return true;
|
||||
} catch (e) {
|
||||
|
|
@ -1322,7 +1322,7 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.getListWidth(boardId, listId);
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, get from validated localStorage
|
||||
if (typeof localStorage !== 'undefined' && typeof getValidatedLocalStorageData === 'function') {
|
||||
try {
|
||||
|
|
@ -1330,7 +1330,7 @@ Users.helpers({
|
|||
if (widths[boardId] && widths[boardId][listId]) {
|
||||
const width = widths[boardId][listId];
|
||||
// Validate it's a valid number
|
||||
if (validators.isValidNumber(width, 100, 1000)) {
|
||||
if (validators.isValidNumber(width, 270, 1000)) {
|
||||
return width;
|
||||
}
|
||||
}
|
||||
|
|
@ -1338,7 +1338,7 @@ Users.helpers({
|
|||
console.warn('Error reading list widths from localStorage:', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 270; // Return default width
|
||||
},
|
||||
|
||||
|
|
@ -1347,23 +1347,23 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.setListWidth(boardId, listId, width);
|
||||
}
|
||||
|
||||
|
||||
// Validate width before storing
|
||||
if (!validators.isValidNumber(width, 100, 1000)) {
|
||||
if (!validators.isValidNumber(width, 270, 1000)) {
|
||||
console.warn('Invalid list width:', width);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, save to validated localStorage
|
||||
if (typeof localStorage !== 'undefined' && typeof setValidatedLocalStorageData === 'function') {
|
||||
try {
|
||||
const widths = getValidatedLocalStorageData('wekan-list-widths', validators.listWidths);
|
||||
|
||||
|
||||
if (!widths[boardId]) {
|
||||
widths[boardId] = {};
|
||||
}
|
||||
widths[boardId][listId] = width;
|
||||
|
||||
|
||||
return setValidatedLocalStorageData('wekan-list-widths', widths, validators.listWidths);
|
||||
} catch (e) {
|
||||
console.warn('Error saving list width to localStorage:', e);
|
||||
|
|
@ -1378,7 +1378,7 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.getListConstraint(boardId, listId);
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, get from localStorage
|
||||
try {
|
||||
const stored = localStorage.getItem('wekan-list-constraints');
|
||||
|
|
@ -1391,7 +1391,7 @@ Users.helpers({
|
|||
} catch (e) {
|
||||
console.warn('Error reading list constraints from localStorage:', e);
|
||||
}
|
||||
|
||||
|
||||
return 550; // Return default constraint instead of -1
|
||||
},
|
||||
|
||||
|
|
@ -1400,17 +1400,17 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.setListConstraint(boardId, listId, constraint);
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, save to localStorage
|
||||
try {
|
||||
const stored = localStorage.getItem('wekan-list-constraints');
|
||||
let constraints = stored ? JSON.parse(stored) : {};
|
||||
|
||||
|
||||
if (!constraints[boardId]) {
|
||||
constraints[boardId] = {};
|
||||
}
|
||||
constraints[boardId][listId] = constraint;
|
||||
|
||||
|
||||
localStorage.setItem('wekan-list-constraints', JSON.stringify(constraints));
|
||||
return true;
|
||||
} catch (e) {
|
||||
|
|
@ -1424,7 +1424,7 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.getSwimlaneHeight(boardId, swimlaneId);
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, get from localStorage
|
||||
try {
|
||||
const stored = localStorage.getItem('wekan-swimlane-heights');
|
||||
|
|
@ -1437,7 +1437,7 @@ Users.helpers({
|
|||
} catch (e) {
|
||||
console.warn('Error reading swimlane heights from localStorage:', e);
|
||||
}
|
||||
|
||||
|
||||
return -1; // Return -1 if not found
|
||||
},
|
||||
|
||||
|
|
@ -1446,17 +1446,17 @@ Users.helpers({
|
|||
if (this._id) {
|
||||
return this.setSwimlaneHeight(boardId, swimlaneId, height);
|
||||
}
|
||||
|
||||
|
||||
// For non-logged-in users, save to localStorage
|
||||
try {
|
||||
const stored = localStorage.getItem('wekan-swimlane-heights');
|
||||
let heights = stored ? JSON.parse(stored) : {};
|
||||
|
||||
|
||||
if (!heights[boardId]) {
|
||||
heights[boardId] = {};
|
||||
}
|
||||
heights[boardId][swimlaneId] = height;
|
||||
|
||||
|
||||
localStorage.setItem('wekan-swimlane-heights', JSON.stringify(heights));
|
||||
return true;
|
||||
} catch (e) {
|
||||
|
|
@ -1914,16 +1914,16 @@ Meteor.methods({
|
|||
if (!user) {
|
||||
throw new Meteor.Error('user-not-found', 'User not found');
|
||||
}
|
||||
|
||||
|
||||
// Check if board is already starred
|
||||
const starredBoards = (user.profile && user.profile.starredBoards) || [];
|
||||
const isStarred = starredBoards.includes(boardId);
|
||||
|
||||
|
||||
// Build update object
|
||||
const updateObject = isStarred
|
||||
const updateObject = isStarred
|
||||
? { $pull: { 'profile.starredBoards': boardId } }
|
||||
: { $addToSet: { 'profile.starredBoards': boardId } };
|
||||
|
||||
|
||||
Users.update(this.userId, updateObject);
|
||||
},
|
||||
toggleGreyIcons(value) {
|
||||
|
|
@ -1991,11 +1991,11 @@ Meteor.methods({
|
|||
check(boardId, String);
|
||||
check(spaceId, String);
|
||||
if (!this.userId) throw new Meteor.Error('not-logged-in');
|
||||
|
||||
const user = Users.findOne(this.userId);
|
||||
|
||||
const user = Users.findOne(this.userId, { fields: { 'profile.boardWorkspaceAssignments': 1 } });
|
||||
const assignments = user.profile?.boardWorkspaceAssignments || {};
|
||||
assignments[boardId] = spaceId;
|
||||
|
||||
|
||||
Users.update(this.userId, {
|
||||
$set: { 'profile.boardWorkspaceAssignments': assignments }
|
||||
});
|
||||
|
|
@ -2005,11 +2005,11 @@ Meteor.methods({
|
|||
unassignBoardFromWorkspace(boardId) {
|
||||
check(boardId, String);
|
||||
if (!this.userId) throw new Meteor.Error('not-logged-in');
|
||||
|
||||
const user = Users.findOne(this.userId);
|
||||
|
||||
const user = Users.findOne(this.userId, { fields: { 'profile.boardWorkspaceAssignments': 1 } });
|
||||
const assignments = user.profile?.boardWorkspaceAssignments || {};
|
||||
delete assignments[boardId];
|
||||
|
||||
|
||||
Users.update(this.userId, {
|
||||
$set: { 'profile.boardWorkspaceAssignments': assignments }
|
||||
});
|
||||
|
|
@ -3081,7 +3081,9 @@ if (Meteor.isServer) {
|
|||
Authentication.checkUserId(req.userId);
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
data: Meteor.users.find({}).map(function (doc) {
|
||||
data: Meteor.users.find({}, {
|
||||
fields: { _id: 1, username: 1 }
|
||||
}).map(function (doc) {
|
||||
return {
|
||||
_id: doc._id,
|
||||
username: doc.username,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue