-
Notifications
You must be signed in to change notification settings - Fork 399
[upcoming] UIE-9402: Implement Owned groups tab landing page #13506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fabrice-akamai
wants to merge
21
commits into
linode:develop
Choose a base branch
from
fabrice-akamai:UIE-9402-owned-groups-landing-page
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8680aae
Added missing padding around the Managed dashboard card
fabrice-akamai d53e3f6
changed spacing to spacingFunction
fabrice-akamai ef5485f
Merge branch 'develop' of https://github.com/fabrice-akamai/manager iβ¦
fabrice-akamai 2a8188d
Merge branch 'develop' of https://github.com/fabrice-akamai/manager iβ¦
fabrice-akamai 2db02f3
Merge branch 'develop' of https://github.com/fabrice-akamai/manager iβ¦
fabrice-akamai 64b2563
Implement Owned groups landing content
fabrice-akamai 57488f1
Add pendo Ids
fabrice-akamai 2749983
Added changeset: Implement owned groups landing page content
fabrice-akamai df792bf
Update test cases
fabrice-akamai 4bf9aae
Remove sortableProps from unsupported keys in owned groups table
fabrice-akamai bab8579
More pendo Ids
fabrice-akamai b19fe0a
Merge branch 'develop' into UIE-9402-owned-groups-landing-page
fabrice-akamai 766b75a
Remove hard-coded value for share group type
fabrice-akamai fdef94a
Merge branch 'UIE-9402-owned-groups-landing-page' of https://github.cβ¦
fabrice-akamai 2d773d8
Use contextQueries with shareGroupQueries
fabrice-akamai ff24e6b
Add dash to updated cell when empty
fabrice-akamai 69e4266
Replace table component with cds table
fabrice-akamai d649b6d
Merge branch 'develop' into UIE-9402-owned-groups-landing-page
fabrice-akamai 37d7fe4
Rename interface name to be more generic
fabrice-akamai 8ef0c27
Update pendo IDs in the share group action menu
fabrice-akamai 30c3810
Improve table responsiveness and fix empty error display issue
fabrice-akamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| export * from './images'; | ||
|
|
||
| export * from './sharegroups'; | ||
|
|
||
| export * from './types'; |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-13506-upcoming-features-1773858733897.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Upcoming Features | ||
| --- | ||
|
|
||
| Implement owned groups landing page content ([#13506](https://github.com/linode/manager/pull/13506)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/manager/src/features/Images/ImagesLanding/v2/ShareGroups/ShareGroupActionMenu.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import React from 'react'; | ||
|
|
||
| import { ActionMenu } from 'src/components/ActionMenu/ActionMenu'; | ||
|
|
||
| import type { Action } from 'src/components/ActionMenu/ActionMenu'; | ||
|
|
||
| interface Props { | ||
| deleteButtonDisabled: boolean; | ||
| } | ||
| export const ShareGroupActionMenu = (props: Props) => { | ||
| const { deleteButtonDisabled } = props; | ||
| /* TODO: Implement action menu logic for each corresponding action */ | ||
|
Check warning on line 12 in packages/manager/src/features/Images/ImagesLanding/v2/ShareGroups/ShareGroupActionMenu.tsx
|
||
| const actions: Action[] = [ | ||
| { | ||
| title: 'Edit Group Details', | ||
| onClick: () => {}, | ||
| disabled: false, | ||
| hidden: false, | ||
| pendoId: 'Images Groups Owned-Edit Group Details', | ||
| }, | ||
| { | ||
| title: 'Add Images', | ||
| onClick: () => {}, | ||
| disabled: false, | ||
| hidden: false, | ||
| pendoId: 'Images Groups Owned-Add Images', | ||
| }, | ||
| { | ||
| title: 'Add Members', | ||
| onClick: () => {}, | ||
| disabled: false, | ||
| hidden: false, | ||
| pendoId: 'Images Groups Owned-Add Members', | ||
| }, | ||
| { | ||
| title: 'Delete', | ||
| onClick: () => {}, | ||
| disabled: deleteButtonDisabled, | ||
| hidden: false, | ||
| tooltip: deleteButtonDisabled | ||
| ? 'Before deleting this share group, revoke access for all members first.' | ||
| : undefined, | ||
| pendoId: 'Images Groups Owned-Delete', | ||
| }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <ActionMenu | ||
| actionsList={actions} | ||
| ariaLabel="Action menu for share group" | ||
| data-pendo-id="Images Groups Owned-Group Action menu" | ||
| /> | ||
| ); | ||
| }; | ||
61 changes: 61 additions & 0 deletions
61
packages/manager/src/features/Images/ImagesLanding/v2/ShareGroups/ShareGroupRow.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { useProfile } from '@linode/queries'; | ||
| import { Hidden, LinkButton } from '@linode/ui'; | ||
| import { TableCell, TableRow } from 'akamai-cds-react-components/Table'; | ||
fabrice-akamai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import React from 'react'; | ||
|
|
||
| import { formatDate } from 'src/utilities/formatDate'; | ||
|
|
||
| import { ShareGroupActionMenu } from './ShareGroupActionMenu'; | ||
| import { StyledActionMenuWrapper } from './ShareGroupTable.styles'; | ||
|
|
||
| import type { Sharegroup } from '@linode/api-v4'; | ||
|
|
||
| interface Props { | ||
| shareGroup: Sharegroup; | ||
| } | ||
|
|
||
| export const ShareGroupRow = (props: Props) => { | ||
| const { shareGroup } = props; | ||
| const { data: profile } = useProfile(); | ||
|
|
||
| const { | ||
| created, | ||
| description, | ||
| images_count, | ||
| label, | ||
| members_count, | ||
| updated, | ||
| id, | ||
| } = shareGroup; | ||
|
|
||
| return ( | ||
| <TableRow data-qa-sharegroup-row={id} key={id} rowborder> | ||
| <TableCell data-pendo-id={`Images Groups Owned-Group name`}> | ||
| <LinkButton onClick={() => {}}>{label}</LinkButton> | ||
| </TableCell> | ||
| <TableCell>{description}</TableCell> | ||
| <TableCell>{members_count}</TableCell> | ||
| <Hidden smDown> | ||
| <TableCell>{images_count}</TableCell> | ||
| </Hidden> | ||
| <Hidden lgDown> | ||
| <TableCell style={{ whiteSpace: 'nowrap' }}> | ||
| {created && | ||
| formatDate(created, { | ||
| timezone: profile?.timezone, | ||
| })} | ||
| </TableCell> | ||
| </Hidden> | ||
| <Hidden lgDown> | ||
| <TableCell style={{ whiteSpace: 'nowrap' }}> | ||
| {updated !== null | ||
| ? formatDate(updated, { timezone: profile?.timezone }) | ||
| : 'β'} | ||
| </TableCell> | ||
| </Hidden> | ||
| <StyledActionMenuWrapper> | ||
| <ShareGroupActionMenu deleteButtonDisabled={!!members_count} /> | ||
| </StyledActionMenuWrapper> | ||
| </TableRow> | ||
| ); | ||
| }; | ||
20 changes: 20 additions & 0 deletions
20
packages/manager/src/features/Images/ImagesLanding/v2/ShareGroups/ShareGroupTable.styles.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { styled } from '@mui/material/styles'; | ||
| import { TableCell } from 'akamai-cds-react-components/Table'; | ||
|
|
||
| export const StyledActionMenuWrapper = styled(TableCell, { | ||
| label: 'StyledActionMenuWrapper', | ||
| })(({ theme }) => ({ | ||
| justifyContent: 'flex-end', | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| maxWidth: 40, | ||
| '& button': { | ||
| padding: 0, | ||
| color: theme.tokens.alias.Content.Icon.Primary.Default, | ||
| backgroundColor: 'transparent', | ||
| }, | ||
| '& button:hover': { | ||
| backgroundColor: 'transparent', | ||
| color: theme.tokens.alias.Content.Icon.Primary.Hover, | ||
| }, | ||
| })); | ||
|
Check warning on line 20 in packages/manager/src/features/Images/ImagesLanding/v2/ShareGroups/ShareGroupTable.styles.ts
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
205 changes: 205 additions & 0 deletions
205
packages/manager/src/features/Images/ImagesLanding/v2/ShareGroups/ShareGroupsTable.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,205 @@ | ||
| import { Box, Button, Hidden, Typography, useTheme } from '@linode/ui'; | ||
| import { | ||
| Table, | ||
| TableBody, | ||
| TableCell, | ||
| TableHead, | ||
| TableHeaderCell, | ||
| TableRow, | ||
| } from 'akamai-cds-react-components/Table'; | ||
| import React from 'react'; | ||
|
|
||
| import { DocsLink } from 'src/components/DocsLink/DocsLink'; | ||
| import { PaginationFooter } from 'src/components/PaginationFooter/PaginationFooter'; | ||
| import { TableRowError } from 'src/components/TableRowError/TableRowError'; | ||
|
|
||
| import { | ||
| StyledImageContainer, | ||
| StyledImageTableContainer, | ||
| StyledImageTableHeader, | ||
| StyledImageTableSubheader, | ||
| } from '../ImageLibrary/ImagesTable.styles'; | ||
| import { ShareGroupRow } from './ShareGroupRow'; | ||
|
|
||
| import type { ShareGroupsViewTableColConfig } from './shareGroupsTabsConfig'; | ||
| import type { APIError, Sharegroup } from '@linode/api-v4'; | ||
| import type { Order } from 'src/hooks/useOrderV2'; | ||
| interface HeaderProps { | ||
| buttonProps?: { | ||
| buttonText?: string; | ||
| disabled?: boolean; | ||
| onButtonClick: () => void; | ||
| tooltipText?: string; | ||
| }; | ||
| description?: React.ReactNode; | ||
| docsLink?: { href: string; label?: string }; | ||
| title: string; | ||
| } | ||
|
|
||
| interface ShareGroupsTableProps { | ||
| columns: ShareGroupsViewTableColConfig[]; | ||
| emptyMessage: { | ||
| instruction?: string; | ||
| 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; | ||
| page: number; | ||
| pageSize: number; | ||
| }; | ||
| query?: string; | ||
| shareGroups: Sharegroup[]; | ||
| } | ||
|
|
||
| export const ShareGroupsTable = (props: ShareGroupsTableProps) => { | ||
| const { | ||
| columns, | ||
| headerProps, | ||
| eventCategory, | ||
| shareGroups, | ||
| query, | ||
| handleOrderChange, | ||
| error, | ||
| emptyMessage, | ||
| order, | ||
| orderBy, | ||
| pagination, | ||
| } = props; | ||
| const theme = useTheme(); | ||
| return ( | ||
| <StyledImageContainer> | ||
| {headerProps && headerProps.title && ( | ||
| <StyledImageTableHeader> | ||
| <Box | ||
| sx={{ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| justifyContent: 'space-between', | ||
| }} | ||
| > | ||
| <Typography variant="h3">{headerProps.title}</Typography> | ||
| <Box | ||
| sx={{ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| gap: 2, | ||
| minHeight: 40, | ||
| }} | ||
| > | ||
| {headerProps.docsLink && ( | ||
| <DocsLink | ||
| analyticsLabel={headerProps.title} | ||
| data-pendo-id={`Images Groups Owned-Docs Link`} | ||
| href={headerProps.docsLink.href} | ||
| label={headerProps.docsLink.label} | ||
| /> | ||
| )} | ||
| {headerProps.buttonProps && ( | ||
| <Button | ||
| buttonType="primary" | ||
| data-pendo-id={`Images Groups Owned-Create Button`} | ||
| disabled={headerProps.buttonProps.disabled} | ||
| onClick={headerProps.buttonProps.onButtonClick} | ||
| tooltipText={headerProps.buttonProps.tooltipText} | ||
| > | ||
| {headerProps.buttonProps.buttonText} | ||
| </Button> | ||
| )} | ||
| </Box> | ||
| </Box> | ||
| {headerProps.description && ( | ||
| <StyledImageTableSubheader> | ||
| {headerProps.description} | ||
| </StyledImageTableSubheader> | ||
| )} | ||
| </StyledImageTableHeader> | ||
| )} | ||
| <StyledImageTableContainer> | ||
| <Table> | ||
| <TableHead> | ||
| <TableRow | ||
| headerbackground={ | ||
| theme.tokens.component.Table.HeaderNested.Background | ||
| } | ||
| headerborder | ||
| > | ||
| {columns.map((col, idx) => { | ||
| const cell = col.sortableProps ? ( | ||
| <TableHeaderCell | ||
| key={idx} | ||
| sort={() => | ||
| handleOrderChange( | ||
| col.sortableProps?.label ?? col.name, | ||
| order === 'asc' ? 'desc' : 'asc' | ||
| ) | ||
| } | ||
| sortable | ||
| sorted={ | ||
| orderBy === col.sortableProps?.label ? order : undefined | ||
| } | ||
| style={{ ...col.style }} | ||
| > | ||
| {col.name} | ||
| </TableHeaderCell> | ||
| ) : ( | ||
| <TableHeaderCell key={idx} style={{ ...col.style }}> | ||
| {col.name} | ||
| </TableHeaderCell> | ||
| ); | ||
|
|
||
| return col.hidden ? ( | ||
| <Hidden key={idx} {...{ [col.hidden]: true }}> | ||
| {cell} | ||
| </Hidden> | ||
| ) : ( | ||
| cell | ||
| ); | ||
| })} | ||
| <TableHeaderCell style={{ maxWidth: '40px' }} /> | ||
| </TableRow> | ||
| </TableHead> | ||
| <TableBody> | ||
| {!error && shareGroups.length === 0 && ( | ||
| <TableRow> | ||
| <TableCell | ||
| style={{ | ||
| display: 'flex', | ||
| justifyContent: 'center', | ||
| }} | ||
| > | ||
| {emptyMessage.main} | ||
| </TableCell> | ||
| </TableRow> | ||
| )} | ||
| {error && query && ( | ||
| <TableRowError | ||
| colSpan={columns.length + 1} | ||
| message={error[0].reason} | ||
| /> | ||
| )} | ||
|
|
||
| {shareGroups.map((sharegroup) => ( | ||
| <ShareGroupRow key={sharegroup.id} shareGroup={sharegroup} /> | ||
| ))} | ||
| </TableBody> | ||
| </Table> | ||
| <PaginationFooter | ||
| count={pagination.count} | ||
| eventCategory={eventCategory} | ||
| handlePageChange={pagination.handlePageChange} | ||
| handleSizeChange={pagination.handlePageSizeChange} | ||
| page={pagination.page} | ||
| pageSize={pagination.pageSize} | ||
| /> | ||
| </StyledImageTableContainer> | ||
| </StyledImageContainer> | ||
| ); | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting & mobile support will need to be improved here:
Updatedcell dash seems right-alignedUpdatedcell contents get hidden at some point but the column remains (and theCreatedcontent gets shifted there)Screen.Recording.2026-03-23.at.11.29.39.AM.mov
This can be handled in a follow-up PR