1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

fix: match bootstrap uiConfig with expected data format (#830)

* fix: match bootstrap uiConfig with expected data format

* fix: default to empty object for ui and experimental properties on config

* fix: update text
This commit is contained in:
Fredrik Strand Oseberg 2021-05-04 10:00:25 +02:00 committed by GitHub
parent d61c7242d8
commit 2099bbea73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 6 deletions

View File

@ -190,14 +190,14 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
: options.authentication,
]);
const { ui } = options;
const ui = options.ui || {};
const importSetting: IImportOption = mergeAll([
defaultImport,
options.import,
]);
const { experimental } = options;
const experimental = options.experimental || {};
const email: IEmailOption = mergeAll([defaultEmail, options.email]);

View File

@ -18,6 +18,7 @@ import { IUnleashConfig } from '../../types/option';
import { IUnleashServices } from '../../types/services';
import VersionService from '../../services/version-service';
import FeatureTypeService from '../../services/feature-type-service';
import version from '../../util/version';
class BootstrapController extends Controller {
private logger: Logger;
@ -50,7 +51,7 @@ class BootstrapController extends Controller {
versionService,
featureTypeService,
}: Pick<
IUnleashServices,
IUnleashServices,
| 'contextService'
| 'tagTypeService'
| 'strategyService'
@ -103,10 +104,24 @@ class BootstrapController extends Controller {
userPermissions,
] = await Promise.all(jobs);
const authenticationType =
this.config.authentication && this.config.authentication.type;
res.json({
...this.config.ui,
unleashUrl: this.config.server.unleashUrl,
baseUriPath: this.config.server.baseUriPath,
uiConfig: {
...this.config.ui,
authenticationType,
toast: {
message:
'You have been upgraded to Unleash version 4. This release brings a number of important changes and may affect how you work with Unleash. In order to view the full scope of changes in this release, please follow the link below.',
id: 'v4-update',
severity: 'info',
link: 'https://docs.getunleash.io/link-to-v4-upgrade',
},
unleashUrl: this.config.server.unleashUrl,
version,
baseUriPath: this.config.server.baseUriPath,
},
version: this.versionService.getVersionInfo(),
user: { ...req.user, permissions: userPermissions },
email: this.emailService.isEnabled(),