Skip to content

Commit

Permalink
Add 'New certificate' option
Browse files Browse the repository at this point in the history
The 'New certificate' option should
create and associate a new certificate
to a given user.

Signed-off-by: Carla Martinez <[email protected]>
  • Loading branch information
carma12 committed Jan 11, 2024
1 parent bcaed53 commit a12e604
Show file tree
Hide file tree
Showing 4 changed files with 399 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/components/UserSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import DeleteUsers from "./modals/DeleteUsers";
import RebuildAutoMembership from "./modals/RebuildAutoMembership";
import UnlockUser from "./modals/UnlockUser";
import ResetPassword from "./modals/ResetPassword";
import IssueNewCertificate from "./modals/IssueNewCertificate";

export interface PropsToUserSettings {
originalUser: Partial<User>;
Expand Down Expand Up @@ -165,6 +166,13 @@ const UserSettings = (props: PropsToUserSettings) => {
const [isResetPasswordModalOpen, setIsResetPasswordModalOpen] =
useState(false);

// 'New certificate' option
const [isNewCertificateModalOpen, setIsNewCertificateModalOpen] =
useState(false);
const onCloseNewCertificateModal = () => {
setIsNewCertificateModalOpen(false);
};

// Kebab
const [isKebabOpen, setIsKebabOpen] = useState(false);

Expand Down Expand Up @@ -206,7 +214,12 @@ const UserSettings = (props: PropsToUserSettings) => {
>
Rebuild auto membership
</DropdownItem>,
<DropdownItem key="new certificate">New certificate</DropdownItem>,
<DropdownItem
key="new certificate"
onClick={() => setIsNewCertificateModalOpen(true)}
>
New certificate
</DropdownItem>,
];

const stageDropdownItems = [
Expand Down Expand Up @@ -503,6 +516,13 @@ const UserSettings = (props: PropsToUserSettings) => {
isOpen={isResetPasswordModalOpen}
onClose={() => setIsResetPasswordModalOpen(false)}
/>
<IssueNewCertificate
isOpen={isNewCertificateModalOpen}
onClose={onCloseNewCertificateModal}
uid={props.user.uid}
showPrincipalFields={false}
onRefresh={props.onRefresh}
/>
</>
);
};
Expand Down
Loading

0 comments on commit a12e604

Please sign in to comment.