Skip to content

Commit 80cbbe9

Browse files
authored
Add Metric Explorer copy to clipboard (#1859)
* Add copy to clipboard for metric explorer charts * Update documentation for enhancements in this PR and PR #1745 * Remove browser recommendation
1 parent 6a042f7 commit 80cbbe9

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
- Changed user manual source pages from .docx to .rst. These pages are now stored in version control in the base XDMoD repository.
1313
- Improved user manual build process from internal scripts to Sphinx. This build process is now done as part of the base XDMoD build.
1414
- Updated theme from ExtJS to ReadTheDocs.
15+
- Metric Explorer
16+
- Added copy to clipboard option when generating a link to the current chart.
17+
- Job Viewer
18+
- Added copy to clipboard option when getting a shareable link to a job.
1519
- Uncategorized
1620
- Chart Feature Changes
1721
- For line charts, the context menu for a data series is brought up by clicking on its points, not its lines. As before, the context menu can also be brought up by clicking on it in the legend.

html/about/release_notes/xdmod.html

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ <h2 id="2024-XX-XX-v11-0-0">2024-XX-XX v11.0.0</h2>
1414
</li>
1515
</ul>
1616
</li>
17+
<li><p>Enhancements</p>
18+
<ul>
19+
<li>Metric Explorer<ul>
20+
<li>Added copy to clipboard option when generating a link to the current chart.</li>
21+
</ul>
22+
</li>
23+
<li>Job Viewer<ul>
24+
<li>Added copy to clipboard option when getting a shareable link to a job.</li>
25+
</ul>
26+
</li>
27+
</ul>
28+
</li>
1729
<li>Uncategorized<ul>
1830
<li>Chart Feature Changes<ul>
1931
<li>For line charts, the context menu for a data series is brought up by clicking on its points, not its lines. As before, the context menu can also be brought up by clicking on it in the legend.</li>

html/gui/js/modules/metric_explorer/MetricExplorer.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -6255,14 +6255,20 @@ Ext.extend(XDMoD.Module.MetricExplorer, XDMoD.PortalModule, {
62556255
// ---------------------------------------------------------
62566256

62576257
self.on('chart_link_clicked', function () {
6258-
var encodedData = window.btoa(JSON.stringify(this.getConfig()));
6259-
var link = window.location.protocol + '//' + window.location.host + '/#main_tab_panel:metric_explorer?config=' + encodedData;
6260-
var msg = 'Use the following link to share the current chart. Note that the link does not override the access controls. So if you send the link to someone who does not have access to the data, they will still not be able to see the data. <br> We recommend using Chrome or Firefox if the link does not work in Internet Explorer.<br><b>' + link + '</b>';
6258+
const encodedData = window.btoa(JSON.stringify(this.getConfig()));
6259+
const link = `${window.location.protocol}//${window.location.host}/#main_tab_panel:metric_explorer?config=${encodedData}`;
6260+
const msg = `Use the following link to share the current chart. Note that the link does not override the access controls. So if you send the link to someone who does not have access to the data, they will still not be able to see the data. <br><b>${link}</b>`;
62616261
Ext.Msg.show({
62626262
title: 'Link to Chart',
62636263
minWidth: 700,
62646264
msg: msg,
6265-
buttons: Ext.Msg.OK
6265+
buttons: { ok: 'Copy', cancel: 'Cancel' },
6266+
icon: Ext.MessageBox.INFO,
6267+
fn: (buttonId) => {
6268+
if (buttonId === 'ok') {
6269+
navigator.clipboard.writeText(link);
6270+
}
6271+
}
62666272
});
62676273
}); // self.on('chart_link_clicked', ...
62686274

0 commit comments

Comments
 (0)