-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27cc554
commit 488b212
Showing
13 changed files
with
400 additions
and
310 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
59 changes: 32 additions & 27 deletions
59
src/ui/components/userDetail/userRoles/UserRolesListHeader.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 |
---|---|---|
@@ -1,41 +1,46 @@ | ||
import { getImageUrl } from "../../../../utils"; | ||
import { getImageUrl, getSelectedTenantId } from "../../../../utils"; | ||
import Button from "../../button"; | ||
import IconButton from "../../common/iconButton"; | ||
|
||
type UserRolesListHeaderProps = { | ||
setIsEditing: (value: boolean) => void; | ||
isEditing: boolean; | ||
isFeatureEnabled: boolean; | ||
isFeatureEnabled: boolean | undefined; | ||
}; | ||
|
||
export const UserRolesListHeader = ({ setIsEditing, isEditing, isFeatureEnabled }: UserRolesListHeaderProps) => { | ||
if (isFeatureEnabled === undefined && isFeatureEnabled === false) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<> | ||
<div className="title">Asssigned User Roles</div> | ||
{isFeatureEnabled ? ( | ||
<> | ||
{!isEditing ? ( | ||
<IconButton | ||
size="small" | ||
text="Edit" | ||
tint="var(--color-link)" | ||
icon={getImageUrl("edit.svg")} | ||
onClick={() => { | ||
setIsEditing(true); | ||
}} | ||
/> | ||
) : ( | ||
<div className="metadata-actions actions"> | ||
<Button | ||
size="sm" | ||
color="secondary" | ||
onClick={() => setIsEditing(false)}> | ||
Save | ||
</Button> | ||
</div> | ||
)} | ||
</> | ||
) : null} | ||
<div> | ||
<div className="title">Asssigned User Roles</div> | ||
<span className="subtext"> | ||
All roles assigned to the user for tenant: <span>{getSelectedTenantId()}</span> | ||
</span> | ||
</div> | ||
{!isEditing ? ( | ||
<IconButton | ||
size="small" | ||
text="Edit" | ||
tint="var(--color-link)" | ||
icon={getImageUrl("edit.svg")} | ||
onClick={() => { | ||
setIsEditing(true); | ||
}} | ||
/> | ||
) : ( | ||
<div className="metadata-actions actions"> | ||
<Button | ||
size="sm" | ||
color="secondary" | ||
onClick={() => setIsEditing(false)}> | ||
Save | ||
</Button> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; |
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
Oops, something went wrong.