-
-
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: personal dashboard project details API stub (#8282)
- Loading branch information
Showing
5 changed files
with
106 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,3 +175,15 @@ test('should return projects where users are part of a group', async () => { | |
], | ||
}); | ||
}); | ||
|
||
test('should return personal dashboard project details', async () => { | ||
await loginUser('[email protected]'); | ||
const { body } = await app.request.get( | ||
`/api/admin/personal-dashboard/default`, | ||
); | ||
|
||
expect(body).toMatchObject({ | ||
owners: [{}], | ||
roles: [{}], | ||
}); | ||
}); |
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
49 changes: 49 additions & 0 deletions
49
src/lib/openapi/spec/personal-dashboard-project-details-schema.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type { FromSchema } from 'json-schema-to-ts'; | ||
import { projectSchema } from './project-schema'; | ||
|
||
export const personalDashboardProjectDetailsSchema = { | ||
$id: '#/components/schemas/personalDashboardProjectDetailsSchema', | ||
type: 'object', | ||
description: 'Project details in personal dashboard', | ||
additionalProperties: false, | ||
required: ['owners', 'roles'], | ||
properties: { | ||
owners: projectSchema.properties.owners, | ||
roles: { | ||
type: 'array', | ||
description: 'The list of roles that the user has in this project.', | ||
minItems: 1, | ||
items: { | ||
type: 'object', | ||
description: 'An Unleash role.', | ||
additionalProperties: false, | ||
required: ['name', 'id', 'type'], | ||
properties: { | ||
name: { | ||
type: 'string', | ||
example: 'Owner', | ||
description: 'The name of the role', | ||
}, | ||
id: { | ||
type: 'integer', | ||
example: 4, | ||
description: 'The id of the role', | ||
}, | ||
type: { | ||
type: 'string', | ||
enum: ['custom', 'project', 'root', 'custom-root'], | ||
example: 'project', | ||
description: 'The type of the role', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
components: { | ||
schemas: {}, | ||
}, | ||
} as const; | ||
|
||
export type PersonalDashboardProjectDetailsSchema = FromSchema< | ||
typeof personalDashboardProjectDetailsSchema | ||
>; |
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