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,
|
archived: boolean = false,
|
||||||
): Promise<IProjectOverview> {
|
): Promise<IProjectOverview> {
|
||||||
const project = await this.projectStore.get(projectId);
|
const project = await this.projectStore.get(projectId);
|
||||||
|
const environments = await this.projectStore.getEnvironmentsForProject(
|
||||||
|
projectId,
|
||||||
|
);
|
||||||
const features = await this.featureToggleService.getFeatureOverview(
|
const features = await this.featureToggleService.getFeatureOverview(
|
||||||
projectId,
|
projectId,
|
||||||
archived,
|
archived,
|
||||||
@ -72,6 +75,7 @@ export default class ProjectHealthService {
|
|||||||
name: project.name,
|
name: project.name,
|
||||||
description: project.description,
|
description: project.description,
|
||||||
health: project.health,
|
health: project.health,
|
||||||
|
environments,
|
||||||
features,
|
features,
|
||||||
members,
|
members,
|
||||||
version: 1,
|
version: 1,
|
||||||
|
@ -310,6 +310,9 @@ export default class ProjectService {
|
|||||||
archived: boolean = false,
|
archived: boolean = false,
|
||||||
): Promise<IProjectOverview> {
|
): Promise<IProjectOverview> {
|
||||||
const project = await this.store.get(projectId);
|
const project = await this.store.get(projectId);
|
||||||
|
const environments = await this.store.getEnvironmentsForProject(
|
||||||
|
projectId,
|
||||||
|
);
|
||||||
const features = await this.featureToggleService.getFeatureOverview(
|
const features = await this.featureToggleService.getFeatureOverview(
|
||||||
projectId,
|
projectId,
|
||||||
archived,
|
archived,
|
||||||
@ -317,6 +320,7 @@ export default class ProjectService {
|
|||||||
const members = await this.store.getMembers(projectId);
|
const members = await this.store.getMembers(projectId);
|
||||||
return {
|
return {
|
||||||
name: project.name,
|
name: project.name,
|
||||||
|
environments,
|
||||||
description: project.description,
|
description: project.description,
|
||||||
health: project.health,
|
health: project.health,
|
||||||
features,
|
features,
|
||||||
|
@ -135,6 +135,7 @@ export interface IFeatureOverview {
|
|||||||
export interface IProjectOverview {
|
export interface IProjectOverview {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
environments: string[];
|
||||||
features: IFeatureOverview[];
|
features: IFeatureOverview[];
|
||||||
members: number;
|
members: number;
|
||||||
version: number;
|
version: number;
|
||||||
|
@ -49,6 +49,8 @@ test('Project with no stale toggles should have 100% health rating', async () =>
|
|||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
.expect((res) => {
|
.expect((res) => {
|
||||||
expect(res.body.health).toBe(100);
|
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