adding user service account policy edit (#1565)
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
This commit is contained in:
@@ -40,6 +40,7 @@ import PanelTitle from "../Common/PanelTitle/PanelTitle";
|
||||
import RBIconButton from "../Buckets/BucketDetails/SummaryItems/RBIconButton";
|
||||
import DeleteMultipleServiceAccounts from "./DeleteMultipleServiceAccounts";
|
||||
import { selectSAs } from "../../Console/Configurations/utils";
|
||||
import ServiceAccountPolicy from "../Account/ServiceAccountPolicy";
|
||||
|
||||
interface IUserServiceAccountsProps {
|
||||
classes: any;
|
||||
@@ -76,6 +77,7 @@ const UserServiceAccountsPanel = ({
|
||||
useState<NewServiceAccount | null>(null);
|
||||
const [selectedSAs, setSelectedSAs] = useState<string[]>([]);
|
||||
const [deleteMultipleOpen, setDeleteMultipleOpen] = useState<boolean>(false);
|
||||
const [policyOpen, setPolicyOpen] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
fetchRecords();
|
||||
@@ -147,12 +149,23 @@ const UserServiceAccountsPanel = ({
|
||||
setNewServiceAccount(null);
|
||||
};
|
||||
|
||||
const policyModalOpen = (selectedServiceAccount: string) => {
|
||||
setSelectedServiceAccount(selectedServiceAccount);
|
||||
setPolicyOpen(true);
|
||||
};
|
||||
|
||||
const confirmDeleteServiceAccount = (selectedServiceAccount: string) => {
|
||||
setSelectedServiceAccount(selectedServiceAccount);
|
||||
setDeleteOpen(true);
|
||||
};
|
||||
|
||||
const closePolicyModal = () => {
|
||||
setPolicyOpen(false);
|
||||
setLoading(true);
|
||||
};
|
||||
|
||||
const tableActions = [
|
||||
{ type: "view", onClick: policyModalOpen },
|
||||
{ type: "delete", onClick: confirmDeleteServiceAccount },
|
||||
];
|
||||
|
||||
@@ -193,6 +206,13 @@ const UserServiceAccountsPanel = ({
|
||||
entity="Service Account"
|
||||
/>
|
||||
)}
|
||||
{policyOpen && (
|
||||
<ServiceAccountPolicy
|
||||
open={policyOpen}
|
||||
selectedAccessKey={selectedServiceAccount}
|
||||
closeModalAndRefresh={closePolicyModal}
|
||||
/>
|
||||
)}
|
||||
<div className={classes.actionsTray}>
|
||||
<PanelTitle>Service Accounts</PanelTitle>
|
||||
<Box>
|
||||
|
||||
Reference in New Issue
Block a user