-
-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Unleash admins to API payload (#8299)
Adds Unleash admins to the personal dashboard payload. Uses the access store (and a new method) to fetch admins and maps it to a new `MinimalUser` type. We already have a `User` class, but it contains a lot of information we don't care about here, such as `isAPI`, SCIM data etc. In the UI, admins will be shown to users who are not part of any projects. This is the default state for new viewer users, and can also happen for editors if you archive the default project, for instance. Tests in a follow-up PR
- Loading branch information
1 parent
751c2fa
commit a4ea46d
Showing
9 changed files
with
104 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,41 @@ export const personalDashboardSchema = { | |
additionalProperties: false, | ||
required: ['projects', 'flags'], | ||
properties: { | ||
admins: { | ||
type: 'array', | ||
description: 'Users with the admin role in Unleash.', | ||
items: { | ||
type: 'object', | ||
required: ['id'], | ||
properties: { | ||
id: { | ||
type: 'integer', | ||
description: 'The user ID.', | ||
example: 1, | ||
}, | ||
name: { | ||
type: 'string', | ||
description: "The user's name.", | ||
example: 'Ash Ketchum', | ||
}, | ||
username: { | ||
type: 'string', | ||
description: "The user's username.", | ||
example: 'pokémaster13', | ||
}, | ||
imageUrl: { | ||
type: 'string', | ||
nullable: true, | ||
example: 'https://example.com/peek-at-you.jpg', | ||
}, | ||
email: { | ||
type: 'string', | ||
nullable: true, | ||
example: '[email protected]', | ||
}, | ||
}, | ||
}, | ||
}, | ||
projectOwners: { | ||
type: 'array', | ||
description: | ||
|
@@ -18,19 +53,25 @@ export const personalDashboardSchema = { | |
ownerType: { | ||
type: 'string', | ||
enum: ['user'], | ||
description: | ||
'The type of the owner; will always be `user`.', | ||
}, | ||
name: { | ||
type: 'string', | ||
example: 'User Name', | ||
description: | ||
"The name displayed for the user. Can be the user's name, username, or email, depending on what they have provided.", | ||
}, | ||
imageUrl: { | ||
type: 'string', | ||
nullable: true, | ||
description: "The URL of the user's profile image.", | ||
example: 'https://example.com/image.jpg', | ||
}, | ||
email: { | ||
type: 'string', | ||
nullable: true, | ||
description: "The user's email address.", | ||
example: '[email protected]', | ||
}, | ||
}, | ||
|
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