From d9329a9e158e2be8cc1739653a2cbfc92c144922 Mon Sep 17 00:00:00 2001 From: Emile NDAGIJIMANA Date: Mon, 18 Oct 2021 15:26:01 +0200 Subject: [PATCH 1/2] add full name if exists in email-invite-subject or when tagging someone with '@' while commenting a card --- client/components/main/editor.js | 6 ++++-- client/components/main/layouts.jade | 5 +++-- client/components/main/layouts.js | 8 ++++++++ client/components/users/userHeader.js | 2 +- models/settings.js | 6 +++++- models/users.js | 3 ++- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 09ce2a015..9c8cd0483 100644 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -17,8 +17,10 @@ Template.editor.onRendered(() => { currentBoard .activeMembers() .map(member => { - const username = Users.findOne(member.userId).username; - return username.includes(term) ? username : null; + const user = Users.findOne(member.userId); + const username = user.username; + const fullName = user.profile && user.profile !== undefined ? user.profile.fullname : ""; + return username.includes(term) || fullName.includes(term) ? fullName + "(" + username + ")" : null; }) .filter(Boolean), [...specialHandleNames]) ); diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade index 3c87104f4..054d51ca8 100644 --- a/client/components/main/layouts.jade +++ b/client/components/main/layouts.jade @@ -34,8 +34,9 @@ template(name="userFormsLayout") img(src="{{currentSetting.customLoginLogoImageUrl}}" width="300" height="auto") br unless currentSetting.customLoginLogoImageUrl - img(src="{{pathFor '/wekan-logo.svg'}}" alt="" width="300" height="auto") - br + if isSettingDatabaseFctCallDone + img(src="{{pathFor '/wekan-logo.svg'}}" alt="" width="300" height="auto") + br if currentSetting.textBelowCustomLoginLogo +viewer | {{currentSetting.textBelowCustomLoginLogo}} diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js index 0381c8f93..303bf7a10 100644 --- a/client/components/main/layouts.js +++ b/client/components/main/layouts.js @@ -23,6 +23,8 @@ const validator = { }, }; +let isSettingDatabaseFctCallDone = false; + Template.userFormsLayout.onCreated(function() { const templateInstance = this; templateInstance.currentSetting = new ReactiveVar(); @@ -37,6 +39,8 @@ Template.userFormsLayout.onCreated(function() { let htmlvalue = "" + currSetting.oidcBtnText; oidcBtnElt.html(htmlvalue); } + + isSettingDatabaseFctCallDone = true; return this.stop(); }, }); @@ -65,6 +69,10 @@ Template.userFormsLayout.helpers({ return Template.instance().currentSetting.get(); }, + isSettingDatabaseCallDone(){ + return isSettingDatabaseFctCallDone; + }, + isLoading() { return Template.instance().isLoading.get(); }, diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index f3b139d26..7088e4309 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -25,7 +25,7 @@ Template.memberMenuPopup.helpers({ isNotOAuth2AuthenticationMethod(){ currentUser = Meteor.user(); if (currentUser) { - return currentUser.authenticationMethod != 'OAuth2'; + return currentUser.authenticationMethod.toLowerCase() != 'oauth2'; } else { return true; } diff --git a/models/settings.js b/models/settings.js index 1aff9d3f3..60dbe8134 100644 --- a/models/settings.js +++ b/models/settings.js @@ -217,9 +217,13 @@ if (Meteor.isServer) { const icode = InvitationCodes.findOne(_id); const author = Users.findOne(Meteor.userId()); try { + const fullName = Users.findOne(icode.authorId) + && Users.findOne(icode.authorId).profile + && Users.findOne(icode.authorId).profile !== undefined ? Users.findOne(icode.authorId).profile.fullname : ""; + const params = { email: icode.email, - inviter: Users.findOne(icode.authorId).username, + inviter: fullName != "" ? fullName + " (" + Users.findOne(icode.authorId).username + " )" : Users.findOne(icode.authorId).username, user: icode.email.split('@')[0], icode: icode.code, url: FlowRouter.url('sign-up'), diff --git a/models/users.js b/models/users.js index fd0d83b7e..69c6d5e0e 100644 --- a/models/users.js +++ b/models/users.js @@ -1237,9 +1237,10 @@ if (Meteor.isServer) { } try { + const fullName = inviter.profile !== undefined ? inviter.profile.fullname : ""; const params = { user: user.username, - inviter: inviter.username, + inviter: fullName != "" ? fullName + " (" + inviter.username + " )" : inviter.username, board: board.title, url: board.absoluteUrl(), }; From 5a5a01cf1778c3ae7495208ea14a3e36deb08723 Mon Sep 17 00:00:00 2001 From: Emile NDAGIJIMANA Date: Mon, 18 Oct 2021 16:58:54 +0200 Subject: [PATCH 2/2] [point #3830] Display default weekan logo if there isn't a custom one --- client/components/main/layouts.jade | 2 +- client/components/main/layouts.js | 14 +++++++++----- client/components/main/layouts.styl | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade index 054d51ca8..bcaf0c026 100644 --- a/client/components/main/layouts.jade +++ b/client/components/main/layouts.jade @@ -34,7 +34,7 @@ template(name="userFormsLayout") img(src="{{currentSetting.customLoginLogoImageUrl}}" width="300" height="auto") br unless currentSetting.customLoginLogoImageUrl - if isSettingDatabaseFctCallDone + div#isSettingDatabaseCallDone img(src="{{pathFor '/wekan-logo.svg'}}" alt="" width="300" height="auto") br if currentSetting.textBelowCustomLoginLogo diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js index 303bf7a10..984507f55 100644 --- a/client/components/main/layouts.js +++ b/client/components/main/layouts.js @@ -23,7 +23,7 @@ const validator = { }, }; -let isSettingDatabaseFctCallDone = false; +// let isSettingDatabaseFctCallDone = false; Template.userFormsLayout.onCreated(function() { const templateInstance = this; @@ -40,7 +40,11 @@ Template.userFormsLayout.onCreated(function() { oidcBtnElt.html(htmlvalue); } - isSettingDatabaseFctCallDone = true; + // isSettingDatabaseFctCallDone = true; + if(currSetting && currSetting !== undefined && currSetting.customLoginLogoImageUrl !== undefined) + document.getElementById("isSettingDatabaseCallDone").style.display = 'none'; + else + document.getElementById("isSettingDatabaseCallDone").style.display = 'block'; return this.stop(); }, }); @@ -69,9 +73,9 @@ Template.userFormsLayout.helpers({ return Template.instance().currentSetting.get(); }, - isSettingDatabaseCallDone(){ - return isSettingDatabaseFctCallDone; - }, + // isSettingDatabaseCallDone(){ + // return isSettingDatabaseFctCallDone; + // }, isLoading() { return Template.instance().isLoading.get(); diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl index 5896bbb2e..25ef74feb 100644 --- a/client/components/main/layouts.styl +++ b/client/components/main/layouts.styl @@ -542,3 +542,6 @@ a 100% transform: rotate(360deg) + +#isSettingDatabaseCallDone + display: none;