mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-28 17:55:15 +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:
parent
d61c7242d8
commit
2099bbea73
@ -190,14 +190,14 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
|
|||||||
: options.authentication,
|
: options.authentication,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const { ui } = options;
|
const ui = options.ui || {};
|
||||||
|
|
||||||
const importSetting: IImportOption = mergeAll([
|
const importSetting: IImportOption = mergeAll([
|
||||||
defaultImport,
|
defaultImport,
|
||||||
options.import,
|
options.import,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const { experimental } = options;
|
const experimental = options.experimental || {};
|
||||||
|
|
||||||
const email: IEmailOption = mergeAll([defaultEmail, options.email]);
|
const email: IEmailOption = mergeAll([defaultEmail, options.email]);
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import { IUnleashConfig } from '../../types/option';
|
|||||||
import { IUnleashServices } from '../../types/services';
|
import { IUnleashServices } from '../../types/services';
|
||||||
import VersionService from '../../services/version-service';
|
import VersionService from '../../services/version-service';
|
||||||
import FeatureTypeService from '../../services/feature-type-service';
|
import FeatureTypeService from '../../services/feature-type-service';
|
||||||
|
import version from '../../util/version';
|
||||||
|
|
||||||
class BootstrapController extends Controller {
|
class BootstrapController extends Controller {
|
||||||
private logger: Logger;
|
private logger: Logger;
|
||||||
@ -50,7 +51,7 @@ class BootstrapController extends Controller {
|
|||||||
versionService,
|
versionService,
|
||||||
featureTypeService,
|
featureTypeService,
|
||||||
}: Pick<
|
}: Pick<
|
||||||
IUnleashServices,
|
IUnleashServices,
|
||||||
| 'contextService'
|
| 'contextService'
|
||||||
| 'tagTypeService'
|
| 'tagTypeService'
|
||||||
| 'strategyService'
|
| 'strategyService'
|
||||||
@ -103,10 +104,24 @@ class BootstrapController extends Controller {
|
|||||||
userPermissions,
|
userPermissions,
|
||||||
] = await Promise.all(jobs);
|
] = await Promise.all(jobs);
|
||||||
|
|
||||||
|
const authenticationType =
|
||||||
|
this.config.authentication && this.config.authentication.type;
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
...this.config.ui,
|
uiConfig: {
|
||||||
unleashUrl: this.config.server.unleashUrl,
|
...this.config.ui,
|
||||||
baseUriPath: this.config.server.baseUriPath,
|
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(),
|
version: this.versionService.getVersionInfo(),
|
||||||
user: { ...req.user, permissions: userPermissions },
|
user: { ...req.user, permissions: userPermissions },
|
||||||
email: this.emailService.isEnabled(),
|
email: this.emailService.isEnabled(),
|
||||||
|
Loading…
Reference in New Issue
Block a user