Skip to content
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

feat(rum-explorer): add the ability to show a help link for each facet #563

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions tools/rum/elements/list-facet.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export default class ListFacet extends HTMLElement {
const fieldSet = this.querySelector('fieldset') || document.createElement('fieldset');
fieldSet.classList.add(`facet-${facetName}`);
const legendText = this.querySelector('legend')?.textContent || facetName;
const extraElements = Array.from(this.querySelectorAll(':scope > a, legend > a.icon') || []);

fieldSet.textContent = '';

Expand Down Expand Up @@ -147,6 +148,8 @@ export default class ListFacet extends HTMLElement {
});

legend.append(clipboard, clipboardPaste);
extraElements.forEach((el) => el.classList.add('icon'));
legend.append(...extraElements);
if (drilldownAtt && url.searchParams.get('drilldown') !== facetName) {
const drilldown = document.createElement('a');
drilldown.className = 'drilldown';
Expand Down
2 changes: 2 additions & 0 deletions tools/rum/explorer.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ <h2>TTFB</h2>
<facet-sidebar>
<list-facet facet="userAgent" drilldown="share.html">
<legend>Device Type and Operating System</legend>
<a href="https://main--helix-website--adobe.aem.page/docs/rum-explorer#device-type-and-operating-system" class="help"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will not want to merge this as-is due to the branch. I suggest we get the doc published first, then we can add the href links with the proper URL (probably as a path starting with /docs without a domain).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

target="_blank" title="What devices and operating systems have accessed your site"></a>
<dl>
<dt>desktop</dt>
<dd>All Desktop</dd>
Expand Down
15 changes: 15 additions & 0 deletions tools/rum/rum-slicer.css
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,21 @@ vitals-facet fieldset label {
left: 2px;
}

a.icon.help::after {
content: '?';
}

a.icon.help {
overflow: visible;
font-size: 15px;
display: inline-block;
font-weight: 900;
text-decoration: none;
text-align: center;
bottom: auto;
line-height: 14px;
}

.pagespeed {
display: inline-block;
margin-left: 0;
Expand Down
Loading