mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-19 00:15:43 +01:00
fix: get features by project
This commit is contained in:
parent
577f7a2824
commit
aa4102c022
@ -54,22 +54,33 @@ export default class ProjectHealthService {
|
||||
projectId: string,
|
||||
): Promise<IProjectHealthReport> {
|
||||
//const overview = await this.getProjectOverview(projectId, false);
|
||||
const features = await this.featureToggleStore.getFeatures({
|
||||
projectId,
|
||||
const features = await this.featureToggleStore.getFeaturesBy({
|
||||
project: projectId,
|
||||
});
|
||||
|
||||
const overview = {
|
||||
name: 'test',
|
||||
description: '',
|
||||
features: features,
|
||||
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 {
|
||||
...overview,
|
||||
potentiallyStaleCount: await this.potentiallyStaleCount(
|
||||
overview.features,
|
||||
),
|
||||
activeCount: this.activeCount(overview.features),
|
||||
staleCount: this.staleCount(overview.features),
|
||||
health,
|
||||
version: 1,
|
||||
potentiallyStaleCount,
|
||||
activeCount,
|
||||
staleCount,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { IFeatureStrategy } from '../db/feature-strategy-store';
|
||||
|
||||
export interface IConstraint {
|
||||
contextName: string;
|
||||
operator: string;
|
||||
@ -39,13 +37,6 @@ export interface IFeatureToggleClient {
|
||||
strategies: IStrategyConfig[];
|
||||
}
|
||||
|
||||
export interface IFeatureEnvironmentInfo {
|
||||
name: string;
|
||||
environment: string;
|
||||
enabled: boolean;
|
||||
strategies: IFeatureStrategy[];
|
||||
}
|
||||
|
||||
export interface FeatureToggleWithEnvironment extends FeatureToggle {
|
||||
environments: IEnvironmentDetail[];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user