Skip to content

Commit

Permalink
Take user prefered list size into account in systems lists pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cbosdo committed Oct 4, 2023
1 parent 39f76bd commit 491d276
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ script(type='text/javascript').
module.renderer(
'systems-all-list', '#{docsLocale}',
{
pageSize: #{pageSize},
isAdmin: #{is_admin},
queryColumn: #{queryColumn},
query: !{query}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ script(type='text/javascript').
module.renderer(
'systems-virtual-list', '#{docsLocale}',
{
pageSize: #{pageSize},
isAdmin: #{is_admin}
}
)
Expand Down
1 change: 1 addition & 0 deletions java/spacewalk-java.changes.cbosdo.page-size
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Take user prefered page size into account in systems lists
11 changes: 9 additions & 2 deletions web/html/src/manager/systems/all-list.renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ import { MessagesContainer } from "components/toastr";
import { AllSystems } from "./all-list";

type RendererProps = {
pageSize: number;
isAdmin: boolean;
queryColumn?: string;
query?: string;
};

export const renderer = (id: string, docsLocale: string, { isAdmin, queryColumn, query }: RendererProps) =>
export const renderer = (id: string, docsLocale: string, { pageSize, isAdmin, queryColumn, query }: RendererProps) =>
SpaRenderer.renderNavigationReact(
<>
<MessagesContainer />
<AllSystems docsLocale={docsLocale} isAdmin={isAdmin} queryColumn={queryColumn} query={query} />
<AllSystems
docsLocale={docsLocale}
pageSize={pageSize}
isAdmin={isAdmin}
queryColumn={queryColumn}
query={query}
/>
</>,
document.getElementById(id)
);
2 changes: 2 additions & 0 deletions web/html/src/manager/systems/all-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { SystemsListFilter } from "./list-filter";
type Props = {
/** Locale of the help links */
docsLocale: string;
pageSize: number;
isAdmin: boolean;
queryColumn?: string;
query?: string;
Expand Down Expand Up @@ -54,6 +55,7 @@ export function AllSystems(props: Props) {
searchField={<SystemsListFilter />}
defaultSearchField={props.queryColumn || "server_name"}
initialSearch={props.query}
initialItemsPerPage={props.pageSize}
emptyText={t("No Systems.")}
>
<Column
Expand Down
5 changes: 3 additions & 2 deletions web/html/src/manager/systems/virtual-list.renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import { MessagesContainer } from "components/toastr";
import { VirtualSystems } from "./virtual-list";

type RendererProps = {
pageSize: number;
isAdmin: boolean;
};

export const renderer = (id: string, docsLocale: string, { isAdmin }: RendererProps) =>
export const renderer = (id: string, docsLocale: string, { pageSize, isAdmin }: RendererProps) =>
SpaRenderer.renderNavigationReact(
<>
<MessagesContainer />
<VirtualSystems docsLocale={docsLocale} isAdmin={isAdmin} />
<VirtualSystems docsLocale={docsLocale} pageSize={pageSize} isAdmin={isAdmin} />
</>,
document.getElementById(id)
);
2 changes: 2 additions & 0 deletions web/html/src/manager/systems/virtual-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Network from "utils/network";
type Props = {
/** Locale of the help links */
docsLocale: string;
pageSize: number;
isAdmin: boolean;
};

Expand Down Expand Up @@ -53,6 +54,7 @@ export function VirtualSystems(props: Props) {
data="/rhn/manager/api/systems/list/virtual"
identifier={(item) => item.virtualSystemId || item.uuid}
initialSortColumnKey="hostServerName"
initialItemsPerPage={props.pageSize}
selectable={(item) => item.hasOwnProperty("virtualSystemId")}
selectedItems={selectedSystems}
onSelect={handleSelectedSystems}
Expand Down
1 change: 1 addition & 0 deletions web/spacewalk-web.changes.cbosdo.page-size
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Take user prefered page size into account in systems lists

0 comments on commit 491d276

Please sign in to comment.