-conflits resolve

This commit is contained in:
Emile NDAGIJIMANA 2021-06-14 15:11:21 +02:00
parent 688ef08cd5
commit 080fcb9c62
141 changed files with 4856 additions and 931 deletions

View file

@ -164,7 +164,7 @@ Users.attachSchema(
},
'profile.showDesktopDragHandles': {
/**
* does the user want to hide system messages?
* does the user want to show desktop drag handles?
*/
type: Boolean,
optional: true,
@ -176,6 +176,13 @@ Users.attachSchema(
type: Boolean,
optional: true,
},
'profile.cardMaximized': {
/**
* has user clicked maximize card?
*/
type: Boolean,
optional: true,
},
'profile.hiddenSystemMessages': {
/**
* does the user want to hide system messages?
@ -641,6 +648,11 @@ Users.helpers({
return profile.hiddenSystemMessages || false;
},
hasCardMaximized() {
const profile = this.profile || {};
return profile.cardMaximized || false;
},
hasHiddenMinicardLabelText() {
const profile = this.profile || {};
return profile.hiddenMinicardLabelText || false;
@ -793,6 +805,14 @@ Users.mutations({
};
},
toggleCardMaximized(value = false) {
return {
$set: {
'profile.cardMaximized': !value,
},
};
},
toggleLabelText(value = false) {
return {
$set: {
@ -887,6 +907,10 @@ Meteor.methods({
const user = Meteor.user();
user.toggleSystem(user.hasHiddenSystemMessages());
},
toggleCardMaximized() {
const user = Meteor.user();
user.toggleCardMaximized(user.hasCardMaximized());
},
toggleMinicardLabelText() {
const user = Meteor.user();
user.toggleLabelText(user.hasHiddenMinicardLabelText());
@ -952,7 +976,18 @@ if (Meteor.isServer) {
userOrgsArray,
userTeamsArray,
) {
check(fullname, String);
check(username, String);
check(initials, String);
check(password, String);
check(isAdmin, String);
check(isActive, String);
check(email, String);
check(importUsernames, Array);
check(userOrgsArray, Array);
check(userTeamsArray, Array);
if (Meteor.user() && Meteor.user().isAdmin) {
<<<<<<< HEAD
check(fullname, String);
check(username, String);
check(initials, String);
@ -964,6 +999,8 @@ if (Meteor.isServer) {
check(userOrgsArray, Array);
check(userTeamsArray, Array);
=======
>>>>>>> feature/250f95de
const nUsersWithUsername = Users.find({
username,
}).count();
@ -1003,9 +1040,9 @@ if (Meteor.isServer) {
}
},
setUsername(username, userId) {
check(username, String);
check(userId, String);
if (Meteor.user() && Meteor.user().isAdmin) {
check(username, String);
check(userId, String);
const nUsersWithUsername = Users.find({
username,
}).count();
@ -1021,11 +1058,12 @@ if (Meteor.isServer) {
}
},
setEmail(email, userId) {
check(email, String);
check(username, String);
if (Meteor.user() && Meteor.user().isAdmin) {
if (Array.isArray(email)) {
email = email.shift();
}
check(email, String);
const existingUser = Users.findOne(
{
'emails.address': email,
@ -1053,31 +1091,31 @@ if (Meteor.isServer) {
}
},
setUsernameAndEmail(username, email, userId) {
check(username, String);
check(email, String);
check(userId, String);
if (Meteor.user() && Meteor.user().isAdmin) {
check(username, String);
if (Array.isArray(email)) {
email = email.shift();
}
check(email, String);
check(userId, String);
Meteor.call('setUsername', username, userId);
Meteor.call('setEmail', email, userId);
}
},
setPassword(newPassword, userId) {
check(userId, String);
check(newPassword, String);
if (Meteor.user() && Meteor.user().isAdmin) {
check(userId, String);
check(newPassword, String);
if (Meteor.user().isAdmin) {
Accounts.setPassword(userId, newPassword);
}
}
},
setEmailVerified(email, verified, userId) {
check(email, String);
check(verified, Boolean);
check(userId, String);
if (Meteor.user() && Meteor.user().isAdmin) {
check(email, String);
check(verified, Boolean);
check(userId, String);
Users.update(userId, {
$set: {
emails: [
@ -1091,9 +1129,9 @@ if (Meteor.isServer) {
}
},
setInitials(initials, userId) {
check(initials, String);
check(userId, String);
if (Meteor.user() && Meteor.user().isAdmin) {
check(initials, String);
check(userId, String);
Users.update(userId, {
$set: {
'profile.initials': initials,