-
-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: project details for personal dashboard (#8274)
- Loading branch information
Showing
7 changed files
with
78 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,58 +103,22 @@ test('should return personal dashboard with membered projects', async () => { | |
{ | ||
name: 'Default', | ||
id: 'default', | ||
roles: [ | ||
{ | ||
name: 'Editor', | ||
id: 2, | ||
type: 'root', | ||
}, | ||
], | ||
owners: [ | ||
{ | ||
ownerType: 'system', | ||
}, | ||
], | ||
health: 100, | ||
memberCount: 0, | ||
featureCount: 0, | ||
}, | ||
{ | ||
name: projectA.name, | ||
id: projectA.id, | ||
roles: [ | ||
{ | ||
name: 'Member', | ||
id: 5, | ||
type: 'project', | ||
}, | ||
], | ||
owners: [ | ||
{ | ||
email: '[email protected]', | ||
imageUrl: | ||
'https://gravatar.com/avatar/a8cc79d8407a64b0d8982df34e3525afd298a479fe68f300651380730dbf23e9?s=42&d=retro&r=g', | ||
name: '[email protected]', | ||
ownerType: 'user', | ||
}, | ||
], | ||
health: 100, | ||
memberCount: 2, | ||
featureCount: 0, | ||
}, | ||
{ | ||
name: projectC.name, | ||
id: projectC.id, | ||
roles: [ | ||
{ | ||
name: 'Owner', | ||
id: 4, | ||
type: 'project', | ||
}, | ||
], | ||
owners: [ | ||
{ | ||
email: '[email protected]', | ||
imageUrl: | ||
'https://gravatar.com/avatar/706150f3ef810ea66acb30c6d55f1a7e545338747072609e47df71c7c7ccc6a4?s=42&d=retro&r=g', | ||
name: '[email protected]', | ||
ownerType: 'user', | ||
}, | ||
], | ||
memberCount: 1, | ||
featureCount: 0, | ||
}, | ||
], | ||
}); | ||
|
@@ -197,47 +161,16 @@ test('should return projects where users are part of a group', async () => { | |
{ | ||
name: 'Default', | ||
id: 'default', | ||
roles: [ | ||
{ | ||
name: 'Editor', | ||
id: 2, | ||
type: 'root', | ||
}, | ||
], | ||
owners: [ | ||
{ | ||
ownerType: 'system', | ||
}, | ||
], | ||
health: 100, | ||
memberCount: 0, | ||
featureCount: 0, | ||
}, | ||
{ | ||
name: projectA.name, | ||
id: projectA.id, | ||
roles: [ | ||
{ | ||
name: 'Owner', | ||
id: 4, | ||
type: 'project', | ||
}, | ||
{ | ||
name: 'Member', | ||
id: 5, | ||
type: 'project', | ||
}, | ||
], | ||
owners: [ | ||
{ | ||
email: '[email protected]', | ||
imageUrl: | ||
'https://gravatar.com/avatar/a8cc79d8407a64b0d8982df34e3525afd298a479fe68f300651380730dbf23e9?s=42&d=retro&r=g', | ||
name: '[email protected]', | ||
ownerType: 'user', | ||
}, | ||
{ | ||
name: 'groupA', | ||
ownerType: 'group', | ||
}, | ||
], | ||
health: 100, | ||
memberCount: 2, | ||
featureCount: 0, | ||
}, | ||
], | ||
}); | ||
|
14 changes: 9 additions & 5 deletions
14
src/lib/features/personal-dashboard/personal-dashboard-read-model-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
import type { ProjectOwners } from '../project/project-owners-read-model.type'; | ||
|
||
export type PersonalFeature = { name: string; type: string; project: string }; | ||
export type PersonalProject = { | ||
export type BasePersonalProject = { | ||
name: string; | ||
id: string; | ||
roles: { | ||
roles?: { | ||
name: string; | ||
id: number; | ||
type: 'custom' | 'project' | 'root' | 'custom-root'; | ||
}[]; | ||
}; | ||
export type PersonalProjectWithOwners = PersonalProject & { | ||
owners: ProjectOwners; | ||
export type PersonalProject = BasePersonalProject & { | ||
owners?: ProjectOwners; | ||
} & { | ||
health: number; | ||
memberCount: number; | ||
featureCount: number; | ||
}; | ||
|
||
export interface IPersonalDashboardReadModel { | ||
getPersonalFeatures(userId: number): Promise<PersonalFeature[]>; | ||
getPersonalProjects(userId: number): Promise<PersonalProject[]>; | ||
getPersonalProjects(userId: number): Promise<BasePersonalProject[]>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters