Skip to content

Commit

Permalink
[refactoring] Remove unused in license 'light' and 'plugins' params
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Jul 5, 2024
1 parent 045e1e6 commit c0fdce6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
2 changes: 0 additions & 2 deletions Common/sources/license.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ exports.readLicense = async function () {
return [{
count: 1,
type: c_LR.Success,
light: false,
packageType: constants.PACKAGE_TYPE_OS,
mode: constants.LICENSE_MODE.None,
branding: false,
Expand All @@ -56,7 +55,6 @@ exports.readLicense = async function () {
usersViewCount: 0,
usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY,
hasLicense: false,
plugins: false,
buildDate: oBuildDate,
startDate: startDate,
endDate: null,
Expand Down
13 changes: 1 addition & 12 deletions Common/sources/tenantManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,8 @@ function fixTenantLicense(ctx, licenseInfo, licenseInfoTenant) {
licenseInfoTenant.mode |= c_LM.Developer;
errors.push('developer');
}
//can not turn off
if (licenseInfo.light && !licenseInfoTenant.light) {
licenseInfoTenant.light = licenseInfo.light;
errors.push('light');
}
//can not turn on
let flags = ['plugins', 'branding', 'customization'];
let flags = ['branding', 'customization'];
flags.forEach((flag) => {
if (!licenseInfo[flag] && licenseInfoTenant[flag]) {
licenseInfoTenant[flag] = licenseInfo[flag];
Expand Down Expand Up @@ -321,12 +316,6 @@ async function readLicenseTenant(ctx, licenseFile, baseVerifiedLicense) {
if (true === oLicense['developer']) {
res.mode |= c_LM.Developer;
}
if (oLicense.hasOwnProperty('light')) {
res.light = (true === oLicense['light'] || 'true' === oLicense['light'] || 'True' === oLicense['light']); // Someone who likes to put json string instead of bool
}
if (oLicense.hasOwnProperty('plugins')) {
res.plugins = true === oLicense['plugins'];
}
if (oLicense.hasOwnProperty('branding')) {
res.branding = (true === oLicense['branding'] || 'true' === oLicense['branding'] || 'True' === oLicense['branding']); // Someone who likes to put json string instead of bool
}
Expand Down
2 changes: 0 additions & 2 deletions Common/sources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,11 +1140,9 @@ exports.convertLicenseInfoToFileParams = function(licenseInfo) {
} else {
license.mode = '';
}
license.light = licenseInfo.light;
license.branding = licenseInfo.branding;
license.customization = licenseInfo.customization;
license.advanced_api = licenseInfo.advancedApi;
license.plugins = licenseInfo.plugins;
license.connections = licenseInfo.connections;
license.connections_view = licenseInfo.connectionsView;
license.users_count = licenseInfo.usersCount;
Expand Down
6 changes: 2 additions & 4 deletions DocService/sources/DocsCoServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ let connections = []; // Active connections
let lockDocumentsTimerId = {};//to drop connection that can't unlockDocument
let pubsub;
let queue;
let f = {type: constants.LICENSE_RESULT.Error, light: false, branding: false, customization: false, plugins: false};
let shutdownFlag = false;
let expDocumentsStep = gc.getCronStep(cfgExpDocumentsCron);

Expand Down Expand Up @@ -3416,7 +3415,7 @@ exports.install = function(server, callbackFunction) {
sendData(ctx, conn, {
type: 'license', license: {
type: licenseInfo.type,
light: licenseInfo.light,
light: false,//todo remove in sdk
mode: licenseInfo.mode,
rights: rights,
buildVersion: commonDefines.buildVersion,
Expand All @@ -3426,8 +3425,7 @@ exports.install = function(server, callbackFunction) {
liveViewerSupport: utils.isLiveViewerSupport(licenseInfo),
branding: licenseInfo.branding,
customization: licenseInfo.customization,
advancedApi: licenseInfo.advancedApi,
plugins: licenseInfo.plugins
advancedApi: licenseInfo.advancedApi
}
});
ctx.logger.info('_checkLicense end');
Expand Down

0 comments on commit c0fdce6

Please sign in to comment.