From 1d4224d7333aee23b4bba70bd01915dcb008b6ce Mon Sep 17 00:00:00 2001 From: djmaze Date: Tue, 18 Aug 2020 20:45:43 +0200 Subject: [PATCH] Drop License code (not used by comunity) --- README.md | 14 +++++++------- dev/App/Admin.js | 41 ++-------------------------------------- dev/Common/Enums.js | 4 ---- dev/Common/Links.js | 3 --- dev/Common/Translator.js | 4 ---- dev/Remote/Admin/Ajax.js | 22 --------------------- 6 files changed, 9 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 227b6c471..73fe6e876 100644 --- a/README.md +++ b/README.md @@ -79,23 +79,23 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill |js/* |1.14.0 |native | |----------- |--------: |--------: | -|admin.js |2.130.942 |1.082.985 | -|app.js |4.184.455 |2.751.154 | +|admin.js |2.130.942 |1.070.325 | +|app.js |4.184.455 |2.748.672 | |boot.js | 671.522 | 43.995 | |libs.js | 647.614 | 316.876 | |polyfills.js | 325.834 | 0 | -|TOTAL |7.960.367 |4.195.010 | +|TOTAL |7.960.367 |4.179.868 | |js/min/* |1.14.0 |native |gzip 1.14 |gzip | |--------------- |--------: |--------: |--------: |--------: | -|admin.min.js | 252.147 | 147.526 | 73.657 | 42.213 | -|app.min.js | 511.202 | 369.396 |140.462 | 97.130 | +|admin.min.js | 252.147 | 146.008 | 73.657 | 41.877 | +|app.min.js | 511.202 | 369.021 |140.462 | 97.026 | |boot.min.js | 66.007 | 5.579 | 22.567 | 2.328 | |libs.min.js | 572.545 | 300.520 |176.720 | 92.825 | |polyfills.min.js | 32.452 | 0 | 11.312 | 0 | -|TOTAL |1.434.353 | 823.015 |424.718 |234.496 | +|TOTAL |1.434.353 | 821.128 |424.718 |234.056 | -611.338 bytes (190.222 gzip) is not much, but it feels faster. +613.225 bytes (190.662 gzip) is not much, but it feels faster. |css/* |1.14.0 |native | diff --git a/dev/App/Admin.js b/dev/App/Admin.js index e7d5fbbd0..5a5904b2d 100644 --- a/dev/App/Admin.js +++ b/dev/App/Admin.js @@ -1,9 +1,7 @@ import ko from 'ko'; import { root } from 'Common/Links'; -import { getNotification } from 'Common/Translator'; -import { StorageResultType, Notification } from 'Common/Enums'; -import { pInt } from 'Common/Utils'; +import { StorageResultType } from 'Common/Enums'; import * as Settings from 'Storage/Settings'; @@ -11,7 +9,6 @@ import AppStore from 'Stores/Admin/App'; import CapaStore from 'Stores/Admin/Capa'; import DomainStore from 'Stores/Admin/Domain'; import PluginStore from 'Stores/Admin/Plugin'; -import LicenseStore from 'Stores/Admin/License'; import PackageStore from 'Stores/Admin/Package'; import CoreStore from 'Stores/Admin/Core'; import Remote from 'Remote/Admin/Ajax'; @@ -131,7 +128,7 @@ class AdminApp extends AbstractApp { CoreStore.coreVersion(data.Result.Version || ''); CoreStore.coreRemoteVersion(data.Result.RemoteVersion || ''); CoreStore.coreRemoteRelease(data.Result.RemoteRelease || ''); - CoreStore.coreVersionCompare(pInt(data.Result.VersionCompare)); + CoreStore.coreVersionCompare(parseInt(data.Result.VersionCompare, 10) || 0); } else { CoreStore.coreReal(false); CoreStore.coreChannel('stable'); @@ -145,40 +142,6 @@ class AdminApp extends AbstractApp { }); } - /** - * @param {boolean=} force = false - */ - reloadLicensing(force = false) { - LicenseStore.licensingProcess(true); - LicenseStore.licenseError(''); - Remote.licensing((result, data) => { - LicenseStore.licensingProcess(false); - if (StorageResultType.Success === result && data && data.Result && null != data.Result.Expired) { - LicenseStore.licenseValid(true); - LicenseStore.licenseExpired(pInt(data.Result.Expired)); - LicenseStore.licenseError(''); - LicenseStore.licensing(true); - AppStore.prem(true); - } else { - if ( - data && - data.ErrorCode && - [Notification.LicensingServerIsUnavailable, Notification.LicensingExpired].includes(pInt(data.ErrorCode)) - ) { - LicenseStore.licenseError(getNotification(pInt(data.ErrorCode))); - LicenseStore.licensing(true); - } else { - if (StorageResultType.Abort === result) { - LicenseStore.licenseError(getNotification(Notification.LicensingServerIsUnavailable)); - LicenseStore.licensing(true); - } else { - LicenseStore.licensing(false); - } - } - } - }, force); - } - bootend(bootendCallback = null) { if (window.progressJs) { progressJs.end(); diff --git a/dev/Common/Enums.js b/dev/Common/Enums.js index f89a2cd65..c1104b229 100644 --- a/dev/Common/Enums.js +++ b/dev/Common/Enums.js @@ -523,10 +523,6 @@ export const Notification = { InvalidPluginPackage: 703, UnsupportedPluginPackage: 704, - LicensingServerIsUnavailable: 710, - LicensingExpired: 711, - LicensingBanned: 712, - DemoSendMessageError: 750, DemoAccountError: 751, diff --git a/dev/Common/Links.js b/dev/Common/Links.js index 7a1fde104..a5afc319f 100644 --- a/dev/Common/Links.js +++ b/dev/Common/Links.js @@ -348,9 +348,6 @@ export function admin(screenName) { case 'AdminSecurity': result += 'security'; break; - case 'AdminLicensing': - result += 'licensing'; - break; // no default } diff --git a/dev/Common/Translator.js b/dev/Common/Translator.js index 238d81633..6c40f77ac 100644 --- a/dev/Common/Translator.js +++ b/dev/Common/Translator.js @@ -62,10 +62,6 @@ const I18N_NOTIFICATION_MAP = [ [Notification.InvalidPluginPackage, 'NOTIFICATIONS/INVALID_PLUGIN_PACKAGE'], [Notification.UnsupportedPluginPackage, 'NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE'], - [Notification.LicensingServerIsUnavailable, 'NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE'], - [Notification.LicensingExpired, 'NOTIFICATIONS/LICENSING_EXPIRED'], - [Notification.LicensingBanned, 'NOTIFICATIONS/LICENSING_BANNED'], - [Notification.DemoSendMessageError, 'NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR'], [Notification.DemoAccountError, 'NOTIFICATIONS/DEMO_ACCOUNT_ERROR'], diff --git a/dev/Remote/Admin/Ajax.js b/dev/Remote/Admin/Ajax.js index eea080a94..3abd9a904 100644 --- a/dev/Remote/Admin/Ajax.js +++ b/dev/Remote/Admin/Ajax.js @@ -162,28 +162,6 @@ class RemoteAdminAjax extends AbstractAjaxRemote { return this.defaultRequest(fCallback, 'AdminPluginSettingsUpdate', oConfig); } - /** - * @param {?Function} fCallback - * @param {boolean} bForce - */ - licensing(fCallback, bForce) { - return this.defaultRequest(fCallback, 'AdminLicensing', { - Force: bForce ? 1 : 0 - }); - } - - /** - * @param {?Function} fCallback - * @param {string} sDomain - * @param {string} sKey - */ - licensingActivate(fCallback, sDomain, sKey) { - return this.defaultRequest(fCallback, 'AdminLicensingActivate', { - Domain: sDomain, - Key: sKey - }); - } - /** * @param {?Function} fCallback * @param {string} sName