diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx index 7c44a4fa91..ea6e9e5f62 100644 --- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx +++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx @@ -129,7 +129,7 @@ export const PamAccountsTable = ({ projectId }: Props) => { setOrderDirection, setOrderBy } = usePagination(PamAccountOrderBy.Name, { - initPerPage: getUserTablePreference("pamAccountsTable", PreferenceKey.PerPage, 16), + initPerPage: getUserTablePreference("pamAccountsTable", PreferenceKey.PerPage, 18), initSearch }); @@ -260,12 +260,6 @@ export const PamAccountsTable = ({ projectId }: Props) => { setPage(1); setFilter({ resourceIds: [] }); setAccountView(e); - - // Reset perPage to appropriate default for the view - const newPerPage = e === PamAccountView.Flat ? 12 : 10; - setPerPage(newPerPage); - setUserTablePreference("pamAccountsTable", PreferenceKey.PerPage, newPerPage); - navigate({ search: (prev) => ({ ...prev, @@ -427,15 +421,24 @@ export const PamAccountsTable = ({ projectId }: Props) => { /> ))} - setPage(newPage)} - onChangePerPage={handlePerPageChange} - perPageList={[9, 12, 15, 18, 27]} - /> + {!isLoading && isContentEmpty && ( + + )} + {Boolean(totalCount) && !isLoading && !isContentEmpty && ( + setPage(newPage)} + onChangePerPage={handlePerPageChange} + perPageList={[9, 18, 48, 99]} + /> + )} ) : ( @@ -487,20 +490,20 @@ export const PamAccountsTable = ({ projectId }: Props) => { )} - - {Boolean(totalCount) && !isLoading && ( + {!isLoading && isContentEmpty && ( + + )} + {Boolean(totalCount) && !isLoading && !isContentEmpty && ( setPage(newPage)} onChangePerPage={handlePerPageChange} - /> - )} - {!isLoading && isContentEmpty && ( - )} diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAddAccountModal.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAddAccountModal.tsx index 6074e572af..00ef0e1b74 100644 --- a/frontend/src/pages/pam/PamAccountsPage/components/PamAddAccountModal.tsx +++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAddAccountModal.tsx @@ -48,6 +48,7 @@ export const PamAddAccountModal = ({ onComplete={(account) => { if (onComplete) onComplete(account); onOpenChange(false); + setSelectedResource(null); }} onBack={() => setSelectedResource(null)} resourceId={selectedResource.id}