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