-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add user roles to menu (#1862)
* view user roles in menu resolves #1524 * fix stories * PR feedback
- Loading branch information
1 parent
8d7499f
commit 6052607
Showing
4 changed files
with
101 additions
and
29 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
42 changes: 42 additions & 0 deletions
42
site/src/components/UserProfileCard/UserProfileCard.stories.tsx
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,42 @@ | ||
import { Story } from "@storybook/react" | ||
import React from "react" | ||
import { MockUser } from "../../testHelpers/entities" | ||
import { UserProfileCard, UserProfileCardProps } from "./UserProfileCard" | ||
|
||
export default { | ||
title: "components/UserDropdown", | ||
component: UserProfileCard, | ||
argTypes: { | ||
onSignOut: { action: "Sign Out" }, | ||
}, | ||
} | ||
|
||
const Template: Story<UserProfileCardProps> = (args: UserProfileCardProps) => <UserProfileCard {...args} /> | ||
|
||
export const ExampleNoRoles = Template.bind({}) | ||
ExampleNoRoles.args = { | ||
user: { | ||
...MockUser, | ||
roles: [], | ||
}, | ||
} | ||
|
||
export const ExampleOneRole = Template.bind({}) | ||
ExampleOneRole.args = { | ||
user: { | ||
...MockUser, | ||
roles: [{ name: "member", display_name: "Member" }], | ||
}, | ||
} | ||
|
||
export const ExampleThreeRoles = Template.bind({}) | ||
ExampleThreeRoles.args = { | ||
user: { | ||
...MockUser, | ||
roles: [ | ||
{ name: "admin", display_name: "Admin" }, | ||
{ name: "member", display_name: "Member" }, | ||
{ name: "auditor", display_name: "Auditor" }, | ||
], | ||
}, | ||
} |
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