mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-14 00:19:16 +01:00
fix: add environments to project details (#992)
This commit is contained in:
parent
e3cebb21c8
commit
0a83abe101
@ -63,6 +63,9 @@ export default class ProjectHealthService {
|
||||
archived: boolean = false,
|
||||
): Promise<IProjectOverview> {
|
||||
const project = await this.projectStore.get(projectId);
|
||||
const environments = await this.projectStore.getEnvironmentsForProject(
|
||||
projectId,
|
||||
);
|
||||
const features = await this.featureToggleService.getFeatureOverview(
|
||||
projectId,
|
||||
archived,
|
||||
@ -72,6 +75,7 @@ export default class ProjectHealthService {
|
||||
name: project.name,
|
||||
description: project.description,
|
||||
health: project.health,
|
||||
environments,
|
||||
features,
|
||||
members,
|
||||
version: 1,
|
||||
|
@ -310,6 +310,9 @@ export default class ProjectService {
|
||||
archived: boolean = false,
|
||||
): Promise<IProjectOverview> {
|
||||
const project = await this.store.get(projectId);
|
||||
const environments = await this.store.getEnvironmentsForProject(
|
||||
projectId,
|
||||
);
|
||||
const features = await this.featureToggleService.getFeatureOverview(
|
||||
projectId,
|
||||
archived,
|
||||
@ -317,6 +320,7 @@ export default class ProjectService {
|
||||
const members = await this.store.getMembers(projectId);
|
||||
return {
|
||||
name: project.name,
|
||||
environments,
|
||||
description: project.description,
|
||||
health: project.health,
|
||||
features,
|
||||
|
@ -135,6 +135,7 @@ export interface IFeatureOverview {
|
||||
export interface IProjectOverview {
|
||||
name: string;
|
||||
description: string;
|
||||
environments: string[];
|
||||
features: IFeatureOverview[];
|
||||
members: number;
|
||||
version: number;
|
||||
|
@ -49,6 +49,8 @@ test('Project with no stale toggles should have 100% health rating', async () =>
|
||||
.expect('Content-Type', /json/)
|
||||
.expect((res) => {
|
||||
expect(res.body.health).toBe(100);
|
||||
expect(res.body.environments).toHaveLength(1);
|
||||
expect(res.body.environments).toStrictEqual(['default']);
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user