Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8680aae
Added missing padding around the Managed dashboard card
fabrice-akamai Sep 26, 2025
d53e3f6
changed spacing to spacingFunction
fabrice-akamai Sep 26, 2025
ef5485f
Merge branch 'develop' of https://github.com/fabrice-akamai/manager i…
fabrice-akamai Mar 2, 2026
2a8188d
Merge branch 'develop' of https://github.com/fabrice-akamai/manager i…
fabrice-akamai Mar 3, 2026
2db02f3
Merge branch 'develop' of https://github.com/fabrice-akamai/manager i…
fabrice-akamai Mar 10, 2026
a8323a1
Merge branch 'develop' of https://github.com/fabrice-akamai/manager i…
fabrice-akamai Mar 19, 2026
77ec16e
Merge branch 'develop' of https://github.com/fabrice-akamai/manager i…
fabrice-akamai Mar 25, 2026
5eff798
Replace PaginationFooter by CDS pagination component
fabrice-akamai Mar 25, 2026
91890bc
Add sharegroup factory for testing and mocking
fabrice-akamai Mar 25, 2026
d4295a4
Update pagination to show only when sharegroups count exceeds 25
fabrice-akamai Mar 27, 2026
4c18c40
Merge branch 'develop' into UIE-9402-owned-groups-table-pagination
fabrice-akamai Mar 27, 2026
6c0f4fb
Added changeset: Add shareGroup factory for testing and mocking data
fabrice-akamai Mar 27, 2026
0767069
Move shareGroup factory to linode utilities
fabrice-akamai Mar 27, 2026
2ff7d8e
Merge branch 'UIE-9402-owned-groups-table-pagination' of https://gith…
fabrice-akamai Mar 27, 2026
58c525e
Merge branch 'develop' into UIE-9402-owned-groups-table-pagination
fabrice-akamai Mar 27, 2026
4c71d04
Added changeset: Private Image Sharing: update pagination footer in O…
fabrice-akamai Mar 30, 2026
4043437
Merge branch 'UIE-9402-owned-groups-table-pagination' of https://gith…
fabrice-akamai Mar 30, 2026
a658d4d
Merge branch 'develop' into UIE-9402-owned-groups-table-pagination
fabrice-akamai Mar 30, 2026
5ab8bda
Fix formatting in sharegroups.ts
fabrice-akamai Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Private Image Sharing: update pagination footer in Owned groups tab ([#13535](https://github.com/linode/manager/pull/13535))
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
useTheme,
ZeroStateSearchNarrowIcon,
} from '@linode/ui';
import { Pagination } from 'akamai-cds-react-components';
import {
Table,
TableBody,
Expand All @@ -18,8 +19,8 @@ import {
import React from 'react';

import { DocsLink } from 'src/components/DocsLink/DocsLink';
import { PaginationFooter } from 'src/components/PaginationFooter/PaginationFooter';

import { DEFAULT_PAGE_SIZES } from '../constants';
import {
StyledImageContainer,
StyledImageTableContainer,
Expand Down Expand Up @@ -52,15 +53,14 @@ interface ShareGroupsTableProps {
main: string;
};
error?: APIError[] | null;
eventCategory: string;
handleOrderChange: (newOrderBy: string, newOrder: Order) => void;
headerProps?: HeaderProps;
order: Order;
orderBy: string;
pagination: {
count: number;
handlePageChange: (newPage: number) => void;
handlePageSizeChange: (newSize: number) => void;
onPageChange: (event: CustomEvent<{ page: number }>) => void;
onPageSizeChange: (event: CustomEvent<{ pageSize: number }>) => void;
page: number;
pageSize: number;
};
Expand All @@ -72,7 +72,6 @@ export const ShareGroupsTable = (props: ShareGroupsTableProps) => {
const {
columns,
headerProps,
eventCategory,
shareGroups,
query,
handleOrderChange,
Expand Down Expand Up @@ -183,7 +182,7 @@ export const ShareGroupsTable = (props: ShareGroupsTableProps) => {
style={{
display: 'flex',
justifyContent: 'center',
padding: 0
padding: 0,
}}
>
<Box
Expand Down Expand Up @@ -220,14 +219,16 @@ export const ShareGroupsTable = (props: ShareGroupsTableProps) => {
))}
</TableBody>
</Table>
<PaginationFooter
count={pagination.count}
eventCategory={eventCategory}
handlePageChange={pagination.handlePageChange}
handleSizeChange={pagination.handlePageSizeChange}
page={pagination.page}
pageSize={pagination.pageSize}
/>
{pagination.count > DEFAULT_PAGE_SIZES[0] && (
<Pagination
count={pagination.count}
onPageChange={pagination.onPageChange}
onPageSizeChange={pagination.onPageSizeChange}
page={pagination.page}
pageSize={pagination.pageSize}
pageSizes={DEFAULT_PAGE_SIZES}
/>
)}
</StyledImageTableContainer>
</StyledImageContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type ShareGroupsConfigMock = {
description: string;
docsLink: { href: string; label: string };
emptyMessage: { instruction: string; main: string };
eventCategory: string;
orderByDefault: string;
orderDefault: 'asc' | 'desc';
preferenceKey: string;
Expand All @@ -40,7 +39,6 @@ const queryMocks = vi.hoisted(() => {
main: 'No Share groups to display',
instruction: 'Create your first share group',
},
eventCategory: 'shareGroups',
orderByDefault: 'label',
orderDefault: 'asc' as const,
preferenceKey: 'owned-sharegroups',
Expand Down Expand Up @@ -319,7 +317,6 @@ describe('For Owned groups', () => {
expect(queryMocks.tableProps).toMatchObject({
columns: queryMocks.shareGroupsConfig['owned-groups'].columns,
emptyMessage: queryMocks.shareGroupsConfig['owned-groups'].emptyMessage,
eventCategory: queryMocks.shareGroupsConfig['owned-groups'].eventCategory,
handleOrderChange,
order: 'desc',
orderBy: 'created',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ export const ShareGroupsView = (props: Props) => {
);
}

const handlePageChange = (event: CustomEvent<{ page: number }>) => {
pagination.handlePageChange(Number(event.detail));
};

const handlePageSizeChange = (event: CustomEvent<{ pageSize: number }>) => {
const newSize = event.detail.pageSize;
pagination.handlePageSizeChange(newSize);
};

const tableHeaderProps = {
title: config.title,
buttonProps: config.buttonProps
Expand Down Expand Up @@ -145,7 +154,6 @@ export const ShareGroupsView = (props: Props) => {
columns={config.columns}
emptyMessage={config.emptyMessage}
error={shareGroupsError}
eventCategory={config.eventCategory}
handleOrderChange={handleShareGroupsOrderChange}
headerProps={tableHeaderProps}
order={shareGroupsOrder}
Expand All @@ -154,8 +162,8 @@ export const ShareGroupsView = (props: Props) => {
page: pagination.page,
pageSize: pagination.pageSize,
count: shareGroups?.results ?? 0,
handlePageChange: pagination.handlePageChange,
handlePageSizeChange: pagination.handlePageSizeChange,
onPageChange: handlePageChange,
onPageSizeChange: handlePageSizeChange,
}}
query={search.query}
shareGroups={shareGroups?.data ?? []}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export interface ShareGroupsTabsConfig {
main: string;
};
error?: APIError[] | null;
eventCategory: string;
orderByDefault: string;
orderDefault: 'asc' | 'desc';
preferenceKey: string;
Expand Down Expand Up @@ -132,10 +131,9 @@ export const SHAREGROUPS_CONFIG: Record<
instruction:
'Click \u2018Create Share Group\u2019 to create your first share group and share your custom images with other accounts.',
},
eventCategory: 'owned-groups',
orderByDefault: 'label',
orderDefault: 'asc',
preferenceKey: 'owned-groups',
preferenceKey: 'owned-groups-table',
buttonProps: {
buttonText: 'Create Share Group',
navigateTo: '/images/share-groups/create',
Expand All @@ -158,10 +156,9 @@ export const SHAREGROUPS_CONFIG: Record<
instruction:
"Go to 'My membership requests' to make a request and join a group",
},
eventCategory: 'joined-groups',
orderByDefault: 'label',
orderDefault: 'asc',
preferenceKey: 'joined-groups',
preferenceKey: 'joined-groups-table',
},
'membership-requests': {
title: 'Membership requests',
Expand All @@ -177,9 +174,8 @@ export const SHAREGROUPS_CONFIG: Record<
instruction:
"Click 'Request Membership' to create your first membership request",
},
eventCategory: 'membership-requests',
orderByDefault: 'label',
orderDefault: 'asc',
preferenceKey: 'membership-requests',
preferenceKey: 'membership-requests-table',
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const DEFAULT_PAGE_SIZES = [25, 50, 75, 100];
Comment thread
fabrice-akamai marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/utilities": Upcoming Features
---

Add shareGroup factory for testing and mocking data ([#13535](https://github.com/linode/manager/pull/13535))
1 change: 1 addition & 0 deletions packages/utilities/src/factories/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export * from './linodes';
export * from './nodebalancer';
export * from './profile';
export * from './regions';
export * from './sharegroups';
102 changes: 102 additions & 0 deletions packages/utilities/src/factories/sharegroups.ts
Comment thread
pmakode-akamai marked this conversation as resolved.
Comment thread
fabrice-akamai marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import { Factory } from './factoryProxy';

import type {
AddSharegroupImagesPayload,
AddSharegroupMemberPayload,
CreateSharegroupPayload,
GenerateSharegroupTokenPayload,
Sharegroup,
SharegroupImagePayload,
SharegroupMember,
SharegroupToken,
UpdateSharegroupImagePayload,
UpdateSharegroupMemberPayload,
UpdateSharegroupPayload,
} from '@linode/api-v4';

export const sharegroupImagePayloadFactory =
Factory.Sync.makeFactory<SharegroupImagePayload>({
description: 'A shared image for the sharegroup.',
id: Factory.each((id) => `private/${id}`),
label: Factory.each((id) => `sharegroup-image-${id}`),
});

export const sharegroupFactory = Factory.Sync.makeFactory<Sharegroup>({
created: new Date().toISOString(),
description: 'A test sharegroup.',
expiry: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30).toISOString(),
id: Factory.each((id) => id),
images_count: 3,
is_suspended: false,
label: Factory.each((id) => `sharegroup-${id}`),
members_count: 2,
updated: new Date().toISOString(),
uuid: Factory.each(() => crypto.randomUUID()),
});

export const createSharegroupPayloadFactory =
Factory.Sync.makeFactory<CreateSharegroupPayload>({
description: 'A test sharegroup.',
images: sharegroupImagePayloadFactory.buildList(2),
label: Factory.each((id) => `sharegroup-${id}`),
});

export const updateSharegroupPayloadFactory =
Factory.Sync.makeFactory<UpdateSharegroupPayload>({
description: 'An updated test sharegroup.',
disk_id: 1,
label: Factory.each((id) => `updated-sharegroup-${id}`),
});

export const addSharegroupImagesPayloadFactory =
Factory.Sync.makeFactory<AddSharegroupImagesPayload>({
images: sharegroupImagePayloadFactory.buildList(2),
});

export const updateSharegroupImagePayloadFactory =
Factory.Sync.makeFactory<UpdateSharegroupImagePayload>({
description: 'An updated shared image.',
label: Factory.each((id) => `updated-sharegroup-image-${id}`),
});

export const sharegroupMemberFactory =
Factory.Sync.makeFactory<SharegroupMember>({
created: new Date().toISOString(),
expiry: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30).toISOString(),
label: Factory.each((id) => `sharegroup-member-${id}`),
status: 'active',
token_uuid: Factory.each(() => crypto.randomUUID()),
updated: new Date().toISOString(),
});

export const addSharegroupMemberPayloadFactory =
Factory.Sync.makeFactory<AddSharegroupMemberPayload>({
label: Factory.each((id) => `sharegroup-member-${id}`),
token: Factory.each((id) => `sharegroup-token-${id}`),
});

export const updateSharegroupMemberPayloadFactory =
Factory.Sync.makeFactory<UpdateSharegroupMemberPayload>({
label: Factory.each((id) => `updated-sharegroup-member-${id}`),
});

export const generateSharegroupTokenPayloadFactory =
Factory.Sync.makeFactory<GenerateSharegroupTokenPayload>({
label: Factory.each((id) => `sharegroup-token-${id}`),
valid_for_sharegroup_uuid: Factory.each(() => crypto.randomUUID()),
});

export const sharegroupTokenFactory = Factory.Sync.makeFactory<SharegroupToken>(
{
created: new Date().toISOString(),
expiry: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30).toISOString(),
label: Factory.each((id) => `sharegroup-token-${id}`),
sharegroup_label: Factory.each((id) => `sharegroup-${id}`),
sharegroup_uuid: Factory.each(() => crypto.randomUUID()),
status: 'active',
token: Factory.each((id) => `token-${id}`),
token_uuid: Factory.each(() => crypto.randomUUID()),
updated: new Date().toISOString(),
valid_for_sharegroup_uuid: Factory.each(() => crypto.randomUUID()),
},
);
Loading