Skip to content

Commit

Permalink
Add indicator for primary user
Browse files Browse the repository at this point in the history
  • Loading branch information
nkshah2 committed Sep 13, 2023
1 parent 100e72c commit 75830ed
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/static/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/ui/components/userDetail/userDetailHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
* under the License.
*/

import { FC, useCallback, useContext, useEffect } from "react";
import { FC, useCallback, useContext } from "react";
import { PopupContentContext } from "../../contexts/PopupContentContext";
import { User, UserProps } from "../../pages/usersList/types";
import CopyText from "../copyText/CopyText";
import { useUserDetailContext } from "./context/UserDetailContext";
import { UserDetailProps } from "./userDetail";
import { getUserDeleteConfirmationProps } from "./userDetailForm";
import { useUserDetailContext } from "./context/UserDetailContext";

const getBadgeInitial = ({ firstName, lastName, emails, id }: User) => {
let firstnameToUse = "";
Expand Down
7 changes: 6 additions & 1 deletion src/ui/components/userDetail/userDetailInfoGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const UserDetailInfoGrid: FC<UserDetailInfoGridProps> = (props) => {
...JSON.parse(userDetail.metaData ?? "{}"),
});
const { showModal } = useContext(PopupContentContext);
const { firstName, lastName, timeJoined, emails } = userState;
const { firstName, lastName, timeJoined, emails, isPrimaryUser } = userState;
const [isEditing, setIsEditing] = useState(false);
const { tenantsListFromStore } = useTenantsListContext();

Expand Down Expand Up @@ -289,6 +289,11 @@ export const UserDetailInfoGrid: FC<UserDetailInfoGridProps> = (props) => {
label={"Signed up on:"}
body={timeJoined && formatLongDate(timeJoined)}
/>

<UserDetailInfoGridItem
label={"Is Primary User?"}
body={isPrimaryUser ? "Yes" : "No"}
/>
</div>
</LayoutPanel>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/ui/pages/usersList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export type User = {
firstName?: string;
lastName?: string;
tenantIds: string[];
isPrimaryUser: boolean;
};

export type UserEmailPassword = User;
Expand Down

0 comments on commit 75830ed

Please sign in to comment.