Removed more non-community (aka Prem/Premium/License) code

This commit is contained in:
djmaze 2020-08-24 20:56:14 +02:00
parent d5665463fe
commit e3e5929b21
35 changed files with 140 additions and 792 deletions

View file

@ -10,7 +10,6 @@ import CapaStore from 'Stores/Admin/Capa';
import DomainStore from 'Stores/Admin/Domain';
import PluginStore from 'Stores/Admin/Plugin';
import PackageStore from 'Stores/Admin/Package';
import CoreStore from 'Stores/Admin/Core';
import Remote from 'Remote/Admin/Ajax';
import { SettingsAdminScreen } from 'Screen/Admin/Settings';
@ -96,52 +95,6 @@ class AdminApp extends AbstractApp {
});
}
updateCoreData() {
CoreStore.coreUpdating(true);
Remote.updateCoreData((result, data) => {
CoreStore.coreUpdating(false);
CoreStore.coreVersion('');
CoreStore.coreRemoteVersion('');
CoreStore.coreRemoteRelease('');
CoreStore.coreVersionCompare(-2);
if (StorageResultType.Success === result && data && data.Result) {
CoreStore.coreReal(true);
location.reload();
} else {
CoreStore.coreReal(false);
}
});
}
reloadCoreData() {
CoreStore.coreChecking(true);
CoreStore.coreReal(true);
Remote.coreData((result, data) => {
CoreStore.coreChecking(false);
if (StorageResultType.Success === result && data && data.Result) {
CoreStore.coreReal(!!data.Result.Real);
CoreStore.coreChannel(data.Result.Channel || 'stable');
CoreStore.coreType(data.Result.Type || 'stable');
CoreStore.coreUpdatable(!!data.Result.Updatable);
CoreStore.coreAccess(!!data.Result.Access);
CoreStore.coreWarning(!!data.Result.Warning);
CoreStore.coreVersion(data.Result.Version || '');
CoreStore.coreRemoteVersion(data.Result.RemoteVersion || '');
CoreStore.coreRemoteRelease(data.Result.RemoteRelease || '');
CoreStore.coreVersionCompare(parseInt(data.Result.VersionCompare, 10) || 0);
} else {
CoreStore.coreReal(false);
CoreStore.coreChannel('stable');
CoreStore.coreType('stable');
CoreStore.coreWarning(false);
CoreStore.coreVersion('');
CoreStore.coreRemoteVersion('');
CoreStore.coreRemoteRelease('');
CoreStore.coreVersionCompare(-2);
}
});
}
bootend(bootendCallback = null) {
if (window.progressJs) {
progressJs.end();

View file

@ -912,10 +912,6 @@ class AppUser extends AbstractApp {
showScreenPopup(require('View/Popup/TwoFactorConfiguration'), [true]);
}
bootstartWelcomePopup(url) {
showScreenPopup(require('View/Popup/WelcomePage'), [url]);
}
bootstartLoginScreen() {
$htmlCL.remove('rl-user-auth');
$htmlCL.add('rl-user-no-auth');
@ -1046,10 +1042,6 @@ class AppUser extends AbstractApp {
addEventListener('rl.auto-logout', () => this.logout());
if (Settings.settingsGet('WelcomePageUrl')) {
setTimeout(() => this.bootstartWelcomePopup(Settings.settingsGet('WelcomePageUrl')), 1000);
}
if (
!!Settings.settingsGet('AccountSignMe') &&
navigator.registerProtocolHandler &&

View file

@ -4,11 +4,6 @@ import { KeyState } from 'Common/Enums';
export const $html = jQuery('html');
export const $htmlCL = document.documentElement.classList;
/**
* @type {boolean}
*/
export const community = RL_COMMUNITY;
/**
* @type {?}
*/

View file

@ -51,10 +51,6 @@ class UserAjaxUserPromises extends AbstractAjaxPromises {
'Hashes': aHashes
});
}
welcomeClose() {
return this.postRequest('WelcomeClose');
}
}
export default new UserAjaxUserPromises();

View file

@ -71,20 +71,6 @@ class RemoteAdminAjax extends AbstractAjaxRemote {
this.defaultRequest(fCallback, 'AdminPackagesList');
}
/**
* @param {?Function} fCallback
*/
coreData(fCallback) {
this.defaultRequest(fCallback, 'AdminCoreData');
}
/**
* @param {?Function} fCallback
*/
updateCoreData(fCallback) {
this.defaultRequest(fCallback, 'AdminUpdateCoreData', {}, 90000);
}
/**
* @param {?Function} fCallback
* @param {Object} oPackage

View file

@ -1,73 +1,11 @@
import ko from 'ko';
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
import { appSettingsGet, settingsGet } from 'Storage/Settings';
import AppStore from 'Stores/Admin/App';
import CoreStore from 'Stores/Admin/Core';
import { getApp } from 'Helper/Apps/Admin';
import { appSettingsGet } from 'Storage/Settings';
class AboutAdminSettings {
constructor() {
this.version = ko.observable(appSettingsGet('version'));
this.access = ko.observable(!!settingsGet('CoreAccess'));
this.errorDesc = ko.observable('');
this.coreReal = CoreStore.coreReal;
this.coreChannel = CoreStore.coreChannel;
this.coreType = CoreStore.coreType;
this.coreUpdatable = CoreStore.coreUpdatable;
this.coreAccess = CoreStore.coreAccess;
this.coreChecking = CoreStore.coreChecking;
this.coreUpdating = CoreStore.coreUpdating;
this.coreWarning = CoreStore.coreWarning;
this.coreVersion = CoreStore.coreVersion;
this.coreRemoteVersion = CoreStore.coreRemoteVersion;
this.coreRemoteRelease = CoreStore.coreRemoteRelease;
this.coreVersionCompare = CoreStore.coreVersionCompare;
this.community = RL_COMMUNITY || AppStore.community();
this.coreRemoteVersionHtmlDesc = ko.computed(() => {
translatorTrigger();
return i18n('TAB_ABOUT/HTML_NEW_VERSION', { 'VERSION': this.coreRemoteVersion() });
});
this.statusType = ko.computed(() => {
let type = '';
const versionToCompare = this.coreVersionCompare(),
isChecking = this.coreChecking(),
isUpdating = this.coreUpdating(),
isReal = this.coreReal();
if (isChecking) {
type = 'checking';
} else if (isUpdating) {
type = 'updating';
} else if (isReal && 0 === versionToCompare) {
type = 'up-to-date';
} else if (isReal && -1 === versionToCompare) {
type = 'available';
} else if (!isReal) {
type = 'error';
this.errorDesc('Cannot access the repository at the moment.');
}
return type;
});
}
onBuild() {
if (this.access() && !this.community) {
getApp().reloadCoreData();
}
}
updateCoreData() {
if (!this.coreUpdating() && !this.community) {
getApp().updateCoreData();
}
this.coreType = ko.observable('djmaze');
}
}

View file

@ -1,17 +1,13 @@
import ko from 'ko';
import { settingsSaveHelperSimpleFunction } from 'Common/Utils';
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
import Remote from 'Remote/Admin/Ajax';
import AppStore from 'Stores/Admin/App';
import { settingsGet } from 'Storage/Settings';
class BrandingAdminSettings {
constructor() {
this.capa = AppStore.prem;
this.title = ko.observable(settingsGet('Title')).idleTrigger();
this.loadingDesc = ko.observable(settingsGet('LoadingDescription')).idleTrigger();
this.faviconUrl = ko.observable(settingsGet('FaviconUrl')).idleTrigger();
@ -24,18 +20,6 @@ class BrandingAdminSettings {
this.loginDescription = ko.observable(settingsGet('LoginDescription')).idleTrigger();
this.loginCss = ko.observable(settingsGet('LoginCss')).idleTrigger();
this.userCss = ko.observable(settingsGet('UserCss')).idleTrigger();
this.welcomePageUrl = ko.observable(settingsGet('WelcomePageUrl')).idleTrigger();
this.welcomePageDisplay = ko.observable(settingsGet('WelcomePageDisplay')).idleTrigger();
this.welcomePageDisplay.options = ko.computed(() => {
translatorTrigger();
return [
{ optValue: 'none', optText: i18n('TAB_BRANDING/OPTION_WELCOME_PAGE_DISPLAY_NONE') },
{ optValue: 'once', optText: i18n('TAB_BRANDING/OPTION_WELCOME_PAGE_DISPLAY_ONCE') },
{ optValue: 'always', optText: i18n('TAB_BRANDING/OPTION_WELCOME_PAGE_DISPLAY_ALWAYS') }
];
});
this.community = RL_COMMUNITY || AppStore.community();
}
onBuild() {

View file

@ -6,7 +6,6 @@ import { getNotification } from 'Common/Translator';
import { settingsGet } from 'Storage/Settings';
import { showScreenPopup } from 'Knoin/Knoin';
import AppStore from 'Stores/Admin/App';
import PluginStore from 'Stores/Admin/Plugin';
import Remote from 'Remote/Admin/Ajax';
@ -20,8 +19,6 @@ class PluginsAdminSettings {
this.plugins = PluginStore.plugins;
this.pluginsError = PluginStore.plugins.error;
this.community = RL_COMMUNITY || AppStore.community();
this.visibility = ko.computed(() => (PluginStore.plugins.loading() ? 'visible' : 'hidden'));
this.onPluginLoadRequest = this.onPluginLoadRequest.bind(this);

View file

@ -6,18 +6,12 @@ class AbstractAppStore {
this.allowLanguagesOnSettings = ko.observable(true);
this.allowLanguagesOnLogin = ko.observable(true);
this.newMoveToFolder = ko.observable(true);
this.prem = ko.observable(false);
this.community = ko.observable(true);
}
populate() {
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
this.newMoveToFolder(!!Settings.settingsGet('NewMoveToFolder'));
this.prem(!!Settings.settingsGet('PremType'));
this.community(!!Settings.settingsGet('Community'));
}
}

View file

@ -1,20 +0,0 @@
import ko from 'ko';
class CoreAdminStore {
constructor() {
this.coreReal = ko.observable(true);
this.coreChannel = ko.observable('stable');
this.coreType = ko.observable('stable');
this.coreUpdatable = ko.observable(true);
this.coreAccess = ko.observable(true);
this.coreWarning = ko.observable(false);
this.coreChecking = ko.observable(false).extend({ throttle: 100 });
this.coreUpdating = ko.observable(false).extend({ throttle: 100 });
this.coreVersion = ko.observable('');
this.coreRemoteVersion = ko.observable('');
this.coreRemoteRelease = ko.observable('');
this.coreVersionCompare = ko.observable(-2);
}
}
export default new CoreAdminStore();

View file

@ -22,12 +22,8 @@ class PaneSettingsAdminView extends AbstractViewNext {
constructor() {
super();
this.adminDomain = ko.observable(Settings.settingsGet('AdminDomain'));
this.version = ko.observable(Settings.appSettingsGet('version'));
this.capa = !!Settings.settingsGet('PremType');
this.community = RL_COMMUNITY;
this.adminManLoading = ko.computed(
() =>
'000' !==

View file

@ -1,38 +0,0 @@
import ko from 'ko';
import Promises from 'Promises/User/Ajax';
import { popup } from 'Knoin/Knoin';
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
@popup({
name: 'View/Popup/WelcomePage',
templateID: 'PopupsWelcomePage'
})
class WelcomePagePopupView extends AbstractViewNext {
constructor() {
super();
this.welcomePageURL = ko.observable('');
}
clearPopup() {
this.welcomePageURL('');
}
/**
* @param {string} sUrl
* @returns {void}
*/
onShow(sUrl) {
this.clearPopup();
this.welcomePageURL(sUrl);
}
onHide() {
Promises.welcomeClose();
}
}
export { WelcomePagePopupView, WelcomePagePopupView as default };