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