1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-17 13:46:47 +02:00

fix: get features by project

This commit is contained in:
Fredrik Oseberg 2021-08-09 15:44:54 +02:00
parent 577f7a2824
commit aa4102c022
2 changed files with 18 additions and 16 deletions

View File

@ -54,22 +54,33 @@ export default class ProjectHealthService {
projectId: string, projectId: string,
): Promise<IProjectHealthReport> { ): Promise<IProjectHealthReport> {
//const overview = await this.getProjectOverview(projectId, false); //const overview = await this.getProjectOverview(projectId, false);
const features = await this.featureToggleStore.getFeatures({ const features = await this.featureToggleStore.getFeaturesBy({
projectId, project: projectId,
}); });
const overview = { const overview = {
name: 'test', name: 'test',
description: '', description: '',
features: features, features: features,
members: 1, members: 1,
}; };
const staleCount = this.staleCount(overview.features);
const activeCount = this.activeCount(overview.features);
const potentiallyStaleCount = await this.potentiallyStaleCount(
overview.features,
);
const health = this.getHealthRating(
overview.features.length,
staleCount,
potentiallyStaleCount,
);
return { return {
...overview, ...overview,
potentiallyStaleCount: await this.potentiallyStaleCount( health,
overview.features, version: 1,
), potentiallyStaleCount,
activeCount: this.activeCount(overview.features), activeCount,
staleCount: this.staleCount(overview.features), staleCount,
}; };
} }

View File

@ -1,5 +1,3 @@
import { IFeatureStrategy } from '../db/feature-strategy-store';
export interface IConstraint { export interface IConstraint {
contextName: string; contextName: string;
operator: string; operator: string;
@ -39,13 +37,6 @@ export interface IFeatureToggleClient {
strategies: IStrategyConfig[]; strategies: IStrategyConfig[];
} }
export interface IFeatureEnvironmentInfo {
name: string;
environment: string;
enabled: boolean;
strategies: IFeatureStrategy[];
}
export interface FeatureToggleWithEnvironment extends FeatureToggle { export interface FeatureToggleWithEnvironment extends FeatureToggle {
environments: IEnvironmentDetail[]; environments: IEnvironmentDetail[];
} }