mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 15:38:03 -05:00
address feedback
This commit is contained in:
@@ -129,7 +129,7 @@ export const PamAccountsTable = ({ projectId }: Props) => {
|
|||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
setOrderBy
|
setOrderBy
|
||||||
} = usePagination<PamAccountOrderBy>(PamAccountOrderBy.Name, {
|
} = usePagination<PamAccountOrderBy>(PamAccountOrderBy.Name, {
|
||||||
initPerPage: getUserTablePreference("pamAccountsTable", PreferenceKey.PerPage, 16),
|
initPerPage: getUserTablePreference("pamAccountsTable", PreferenceKey.PerPage, 18),
|
||||||
initSearch
|
initSearch
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -260,12 +260,6 @@ export const PamAccountsTable = ({ projectId }: Props) => {
|
|||||||
setPage(1);
|
setPage(1);
|
||||||
setFilter({ resourceIds: [] });
|
setFilter({ resourceIds: [] });
|
||||||
setAccountView(e);
|
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({
|
navigate({
|
||||||
search: (prev) => ({
|
search: (prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
@@ -427,15 +421,24 @@ export const PamAccountsTable = ({ projectId }: Props) => {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<Pagination
|
{!isLoading && isContentEmpty && (
|
||||||
className="col-span-full justify-start! border-transparent bg-transparent pl-2"
|
<EmptyState
|
||||||
count={totalCount}
|
title={isSearchEmpty ? "No accounts match search" : "No accounts"}
|
||||||
page={page}
|
icon={isSearchEmpty ? faSearch : faCircleXmark}
|
||||||
perPage={perPage}
|
className="rounded border border-mineshaft-500"
|
||||||
onChangePage={(newPage) => setPage(newPage)}
|
/>
|
||||||
onChangePerPage={handlePerPageChange}
|
)}
|
||||||
perPageList={[9, 12, 15, 18, 27]}
|
{Boolean(totalCount) && !isLoading && !isContentEmpty && (
|
||||||
/>
|
<Pagination
|
||||||
|
className="col-span-full justify-start! border-transparent bg-transparent pl-2"
|
||||||
|
count={totalCount}
|
||||||
|
page={page}
|
||||||
|
perPage={perPage}
|
||||||
|
onChangePage={(newPage) => setPage(newPage)}
|
||||||
|
onChangePerPage={handlePerPageChange}
|
||||||
|
perPageList={[9, 18, 48, 99]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<TableContainer>
|
<TableContainer>
|
||||||
@@ -487,20 +490,20 @@ export const PamAccountsTable = ({ projectId }: Props) => {
|
|||||||
)}
|
)}
|
||||||
</TBody>
|
</TBody>
|
||||||
</Table>
|
</Table>
|
||||||
|
{!isLoading && isContentEmpty && (
|
||||||
{Boolean(totalCount) && !isLoading && (
|
<EmptyState
|
||||||
|
title={isSearchEmpty ? "No accounts match search" : "No accounts"}
|
||||||
|
icon={isSearchEmpty ? faSearch : faCircleXmark}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{Boolean(totalCount) && !isLoading && !isContentEmpty && (
|
||||||
<Pagination
|
<Pagination
|
||||||
count={totalCount}
|
count={totalCount}
|
||||||
page={page}
|
page={page}
|
||||||
perPage={perPage}
|
perPage={perPage}
|
||||||
onChangePage={(newPage) => setPage(newPage)}
|
onChangePage={(newPage) => setPage(newPage)}
|
||||||
onChangePerPage={handlePerPageChange}
|
onChangePerPage={handlePerPageChange}
|
||||||
/>
|
perPageList={[9, 18, 48, 99]}
|
||||||
)}
|
|
||||||
{!isLoading && isContentEmpty && (
|
|
||||||
<EmptyState
|
|
||||||
title={isSearchEmpty ? "No accounts match search" : "No accounts"}
|
|
||||||
icon={isSearchEmpty ? faSearch : faCircleXmark}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</TableContainer>
|
</TableContainer>
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export const PamAddAccountModal = ({
|
|||||||
onComplete={(account) => {
|
onComplete={(account) => {
|
||||||
if (onComplete) onComplete(account);
|
if (onComplete) onComplete(account);
|
||||||
onOpenChange(false);
|
onOpenChange(false);
|
||||||
|
setSelectedResource(null);
|
||||||
}}
|
}}
|
||||||
onBack={() => setSelectedResource(null)}
|
onBack={() => setSelectedResource(null)}
|
||||||
resourceId={selectedResource.id}
|
resourceId={selectedResource.id}
|
||||||
|
|||||||
Reference in New Issue
Block a user