mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Merge pull request #5022 from mfilser/removing_utils_getCurrentSetting
removing Utils.getCurrentSetting() and use ReactiveCache directly
This commit is contained in:
commit
aa53ad38fc
8 changed files with 17 additions and 17 deletions
|
@ -161,7 +161,7 @@ Template.userFormsLayout.events({
|
|||
},
|
||||
'DOMSubtreeModified #at-oidc'(event) {
|
||||
if (alreadyCheck <= 2) {
|
||||
let currSetting = Utils.getCurrentSetting();
|
||||
let currSetting = ReactiveCache.getCurrentSetting();
|
||||
let oidcBtnElt = $("#at-oidc");
|
||||
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||
|
@ -182,7 +182,7 @@ Template.userFormsLayout.events({
|
|||
'DOMSubtreeModified .at-form'(event) {
|
||||
if (alreadyCheck <= 2 && !isCheckDone) {
|
||||
if (document.getElementById("at-oidc") != null) {
|
||||
let currSetting = Utils.getCurrentSetting();
|
||||
let currSetting = ReactiveCache.getCurrentSetting();
|
||||
let oidcBtnElt = $("#at-oidc");
|
||||
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
|
||||
Template.invitationCode.onRendered(function() {
|
||||
Meteor.subscribe('setting', {
|
||||
onReady() {
|
||||
const setting = Utils.getCurrentSetting();
|
||||
const setting = ReactiveCache.getCurrentSetting();
|
||||
|
||||
if (!setting || !setting.disableRegistration) {
|
||||
$('#invitationcode').hide();
|
||||
|
|
|
@ -58,16 +58,16 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
toggleForgotPassword() {
|
||||
this.setLoading(true);
|
||||
const forgotPasswordClosed = Utils.getCurrentSetting().disableForgotPassword;
|
||||
Settings.update(Utils.getCurrentSetting()._id, {
|
||||
const forgotPasswordClosed = ReactiveCache.getCurrentSetting().disableForgotPassword;
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
$set: { disableForgotPassword: !forgotPasswordClosed },
|
||||
});
|
||||
this.setLoading(false);
|
||||
},
|
||||
toggleRegistration() {
|
||||
this.setLoading(true);
|
||||
const registrationClosed = Utils.getCurrentSetting().disableRegistration;
|
||||
Settings.update(Utils.getCurrentSetting()._id, {
|
||||
const registrationClosed = ReactiveCache.getCurrentSetting().disableRegistration;
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
$set: { disableRegistration: !registrationClosed },
|
||||
});
|
||||
this.setLoading(false);
|
||||
|
@ -163,7 +163,7 @@ BlazeComponent.extendComponent({
|
|||
.trim();
|
||||
const from = this.checkField('#mail-server-from');
|
||||
const tls = $('#mail-server-tls.is-checked').length > 0;
|
||||
Settings.update(Utils.getCurrentSetting()._id, {
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
$set: {
|
||||
'mailServer.host': host,
|
||||
'mailServer.port': port,
|
||||
|
@ -243,7 +243,7 @@ BlazeComponent.extendComponent({
|
|||
const spinnerName = $('#spinnerName').val();
|
||||
|
||||
try {
|
||||
Settings.update(Utils.getCurrentSetting()._id, {
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
$set: {
|
||||
productName,
|
||||
hideLogo: hideLogoChange,
|
||||
|
|
|
@ -32,7 +32,7 @@ Template.memberMenuPopup.helpers({
|
|||
}
|
||||
},
|
||||
isSameDomainNameSettingValue(){
|
||||
const currSett = Utils.getCurrentSetting();
|
||||
const currSett = ReactiveCache.getCurrentSetting();
|
||||
if(currSett && currSett != undefined && currSett.disableRegistration && currSett.mailDomainName !== undefined && currSett.mailDomainName != ""){
|
||||
currentUser = ReactiveCache.getCurrentUser();
|
||||
if (currentUser) {
|
||||
|
|
|
@ -19,7 +19,7 @@ Blaze.registerHelper('currentList', () => {
|
|||
});
|
||||
|
||||
Blaze.registerHelper('currentSetting', () => {
|
||||
const ret = Utils.getCurrentSetting();
|
||||
const ret = ReactiveCache.getCurrentSetting();
|
||||
return ret;
|
||||
});
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
|
||||
Meteor.subscribe('setting');
|
||||
|
||||
import { ALLOWED_WAIT_SPINNERS } from '/config/const';
|
||||
|
@ -9,7 +11,7 @@ export class Spinner extends BlazeComponent {
|
|||
if (defaultWaitSpinner && ALLOWED_WAIT_SPINNERS.includes(defaultWaitSpinner)) {
|
||||
ret = defaultWaitSpinner;
|
||||
}
|
||||
let settings = Utils.getCurrentSetting();
|
||||
let settings = ReactiveCache.getCurrentSetting();
|
||||
|
||||
if (settings && settings.spinnerName) {
|
||||
ret = settings.spinnerName;
|
||||
|
|
|
@ -58,10 +58,6 @@ Utils = {
|
|||
}
|
||||
return ret;
|
||||
},
|
||||
getCurrentSetting() {
|
||||
const ret = ReactiveCache.getCurrentSetting();
|
||||
return ret;
|
||||
},
|
||||
getPopupCard() {
|
||||
const cardId = Utils.getPopupCardId();
|
||||
const ret = ReactiveCache.getCard(cardId);
|
||||
|
|
|
@ -1956,7 +1956,7 @@ if (Meteor.isServer) {
|
|||
}
|
||||
|
||||
//invite user to corresponding boards
|
||||
const disableRegistration = Utils.getCurrentSetting().disableRegistration;
|
||||
const disableRegistration = ReactiveCache.getCurrentSetting().disableRegistration;
|
||||
// If ldap, bypass the inviation code if the self registration isn't allowed.
|
||||
// TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type
|
||||
if (doc.authenticationMethod !== 'ldap' && disableRegistration) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue