Skip to content

Commit

Permalink
Merge pull request #749 from adobe/bulk-rum
Browse files Browse the repository at this point in the history
chore(bulk): track usage
  • Loading branch information
rofe authored May 30, 2024
2 parents 6246fca + 1bdd1e4 commit d3ae483
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/extension/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,7 @@ import sampleRUM from './rum.js';
lstnrs: {
click: (evt) => {
evt.stopPropagation();
sampleRUM('sidekick:bulk:result:urlsCopied');
navigator.clipboard.writeText(ok.map((item) => `https://${host}${item.path}`)
.join('\n'));
sk.hideModal();
Expand All @@ -1887,6 +1888,7 @@ import sampleRUM from './rum.js';
lstnrs: {
click: (evt) => {
evt.stopPropagation();
sampleRUM('sidekick:bulk:result:urlsOpened');
if (ok.length <= 20 || window.confirm(i18n(sk, 'open_urls_confirm').replace('$1', ok.length))) {
ok.forEach((item) => {
const url = `https://${host}${item.path}`;
Expand Down Expand Up @@ -1938,6 +1940,9 @@ import sampleRUM from './rum.js';
lines.push(createTag({
tag: 'button',
text: i18n(sk, 'close'),
action: () => {
sampleRUM('sidekick:bulk:result:closed');
},
}));
let level = 2;
if (failed.length > 0) {
Expand Down Expand Up @@ -2144,6 +2149,11 @@ import sampleRUM from './rum.js';
operation: 'preview',
host: sk.config.innerHost,
});
fireEvent(sk, 'previewed', {
paths: validateWebPaths(bulkSelection
.map((item) => toWebPath(status.webPath, item))),
});
sampleRUM('sidekick:bulk:previewed');
}
}, { once: true });
sk.fetchStatus(true);
Expand Down Expand Up @@ -2173,6 +2183,11 @@ import sampleRUM from './rum.js';
route: 'live',
host: sk.config.host || sk.config.outerHost,
});
fireEvent(sk, 'published', {
paths: validateWebPaths(bulkSelection
.map((item) => toWebPath(status.webPath, item))),
});
sampleRUM('sidekick:bulk:published');
}
}, { once: true });
sk.fetchStatus(true);
Expand Down Expand Up @@ -2224,6 +2239,7 @@ import sampleRUM from './rum.js';
sk.showWait();
sk.addEventListener('statusfetched', () => {
doBulkCopyUrls(hostProperty);
sampleRUM('sidekick:bulk:urlsCopied');
}, { once: true });
sk.fetchStatus(true);
}
Expand Down

0 comments on commit d3ae483

Please sign in to comment.