mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
check toggles and strategies in clientapps
This commit is contained in:
parent
d334f3fece
commit
f5578d986e
@ -11,6 +11,8 @@ module.exports = function (app, config) {
|
|||||||
clientMetricsStore,
|
clientMetricsStore,
|
||||||
clientInstanceStore,
|
clientInstanceStore,
|
||||||
clientApplicationsStore,
|
clientApplicationsStore,
|
||||||
|
strategyStore,
|
||||||
|
featureToggleStore,
|
||||||
} = config.stores;
|
} = config.stores;
|
||||||
|
|
||||||
const metrics = new ClientMetrics(clientMetricsStore);
|
const metrics = new ClientMetrics(clientMetricsStore);
|
||||||
@ -129,8 +131,10 @@ module.exports = function (app, config) {
|
|||||||
Promise.all([
|
Promise.all([
|
||||||
clientApplicationsStore.getApplication(appName),
|
clientApplicationsStore.getApplication(appName),
|
||||||
clientInstanceStore.getByAppName(appName),
|
clientInstanceStore.getByAppName(appName),
|
||||||
|
strategyStore.getStrategies(),
|
||||||
|
featureToggleStore.getFeatures(),
|
||||||
])
|
])
|
||||||
.then(([application, instances]) => {
|
.then(([application, instances, strategies, features]) => {
|
||||||
const appDetails = {
|
const appDetails = {
|
||||||
appName: application.appName,
|
appName: application.appName,
|
||||||
createdAt: application.createdAt,
|
createdAt: application.createdAt,
|
||||||
@ -138,9 +142,21 @@ module.exports = function (app, config) {
|
|||||||
url: application.url,
|
url: application.url,
|
||||||
color: application.color,
|
color: application.color,
|
||||||
icon: application.icon,
|
icon: application.icon,
|
||||||
strategies: application.strategies,
|
strategies: application.strategies.map(name => {
|
||||||
|
const found = strategies.find((feature) => feature.name === name);
|
||||||
|
if (found) {
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
return { name, notFound: true };
|
||||||
|
}),
|
||||||
instances,
|
instances,
|
||||||
seenToggles,
|
seenToggles: seenToggles.map(name => {
|
||||||
|
const found = features.find((feature) => feature.name === name);
|
||||||
|
if (found) {
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
return { name, notFound: true };
|
||||||
|
}),
|
||||||
links: {
|
links: {
|
||||||
self: `/api/client/applications/${application.appName}`,
|
self: `/api/client/applications/${application.appName}`,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user