[ENHANCEMENT]: Add dashboard-level links support#67
[ENHANCEMENT]: Add dashboard-level links support#67prakhar29jain wants to merge 1 commit intoperses:mainfrom
Conversation
73a717c to
5c0ea97
Compare
|
Only checked screenshot, please use the same layout as others drawers / editors |
| ); | ||
| } | ||
|
|
||
| function DashboardLinkMenuItem({ link }: { link: Link }): ReactElement { |
There was a problem hiding this comment.
Same remark as above
| ); | ||
| } | ||
|
|
||
| function useLink(link: Link): Link { |
There was a problem hiding this comment.
same remark as above
5c0ea97 to
b8b4d6b
Compare
|
I became more ambitious and went forward create a single component for Displaying Links... |
b8b4d6b to
8b97c01
Compare
…iagtion Signed-off-by: Prakhar JAIN <prakhar29jain@gmail.com>
8b97c01 to
907b536
Compare
| sx={{ backgroundColor: (theme) => theme.palette.primary.main + (isEditMode ? '30' : '0') }} | ||
| > | ||
| {dashboardTitle} | ||
| {dashboardLinks.length > 0 && ( |
There was a problem hiding this comment.
We need to check if isLinksEnabled is enabled here too
| // Default: show dropdown menu for multiple links | ||
| return ( | ||
| <> | ||
| <InfoTooltip description={`${links.length} links`} enterDelay={100}> |
There was a problem hiding this comment.
IMO, if there is only one link, it should not display a menu on the dashboard, the link could be directly clickable. Can be improved later in another PR, if others are fine with that
| <TableContainer> | ||
| <Table size="small" sx={{ tableLayout: 'fixed', width: '100%' }} aria-label="table of dashboard links"> | ||
| <TableHead> | ||
| <TableRow> |
There was a problem hiding this comment.
Let's use all the place available
<TableRow>
<TableCell>Name</TableCell>
<TableCell>URL</TableCell>
<TableCell width={80}>New Tab</TableCell>
<TableCell align="right" width={180}>
Actions
</TableCell>
</TableRow>| <TableCell component="th" scope="row" sx={{ fontWeight: 'bold', overflow: 'hidden', textOverflow: 'ellipsis' }}> | ||
| {displayName} | ||
| </TableCell> | ||
| <TableCell |
There was a problem hiding this comment.
URL is wrap, title will help to see all url on hover, we could use tooltip, but I think title is enough
<TableCell
title={link.url || '(no URL)'}
...| display?: Display; | ||
| datasources?: Record<string, DatasourceSpec>; | ||
| links?: Link[]; | ||
| setLinks: (links: Link[]) => void; |
There was a problem hiding this comment.
In readonly mode with embedded usage, it not useful to useful to define this method. Make it optional
setLinks?: (links: Link[]) => void;
I wonder if we should not use Slice instead too 🤔










Description
Adds support for dashboard-level links, allowing users to navigate between dashboards or external resources while preserving variable context.
Merge Panel level and Dashboard level Links support for scalability.
perses/perses#3905
Screenshots
UX-1:

UX-2:
Working after Variables rendering -
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: