1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-26 01:17:00 +02:00

Added enterpriseVersion to root of IUnleashConfig/IUnleashOptions

This commit is contained in:
Christopher Kolstad 2021-04-23 11:05:25 +02:00
parent c58612fc8f
commit 8845c90f57
4 changed files with 11 additions and 5 deletions

View File

@ -196,6 +196,7 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
preHook: options.preHook,
preRouterHook: options.preRouterHook,
eventHook: options.eventHook,
enterpriseVersion: options.enterpriseVersion,
};
}

View File

@ -65,8 +65,8 @@ test.serial('supports setting enterprise version as well', async t => {
getLogger,
versionCheck: { url: testurl, enable: true },
version,
enterpriseVersion,
},
enterpriseVersion,
);
await service.checkLatestVersion();
fetchMock.done();
@ -104,8 +104,8 @@ test.serial(
getLogger,
versionCheck: { url: testurl, enable: false },
version,
enterpriseVersion,
},
enterpriseVersion,
);
await service.checkLatestVersion();
t.false(fetchMock.called(testurl));

View File

@ -41,14 +41,17 @@ export default class VersionService {
{
getLogger,
versionCheck,
}: Pick<IUnleashConfig, 'getLogger' | 'versionCheck'>,
enterpriseVersion?: string,
enterpriseVersion,
}: Pick<
IUnleashConfig,
'getLogger' | 'versionCheck' | 'enterpriseVersion'
>,
) {
this.logger = getLogger('lib/services/version-service.js');
this.settingStore = settingStore;
this.current = {
oss: version,
enterprise: enterpriseVersion,
enterprise: enterpriseVersion || '',
};
this.enabled = versionCheck.enable;
this.versionCheckUrl = versionCheck.url;

View File

@ -87,6 +87,7 @@ export interface IUnleashOptions {
preHook?: Function;
preRouterHook?: Function;
eventHook?: Function;
enterpriseVersion?: string;
}
export interface IEmailOption {
@ -125,4 +126,5 @@ export interface IUnleashConfig {
preHook?: Function;
preRouterHook?: Function;
eventHook?: Function;
enterpriseVersion?: string;
}