Skip to content

Commit e7255e4

Browse files
Feat: Snapshots - Add a link to share the review urls
Fix: adobe/da-live#756
1 parent bedd20f commit e7255e4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

nx/blocks/snapshot-admin/views/snapshot.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@ svg.icon {
210210
align-items: center;
211211
gap: 8px;
212212
}
213+
214+
button {
215+
padding: 4px;
216+
border-radius: 4px;
217+
218+
&:hover {
219+
background: rgb(0 0 0 / 20%);
220+
}
221+
}
213222
}
214223

215224
.nx-snapshot-sub-heading-actions {

nx/blocks/snapshot-admin/views/snapshot.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ class NxSnapshot extends LitElement {
160160
this.handleSave(false);
161161
}
162162

163-
handleShare() {
164-
const aemPaths = this._manifest.resources.map((res) => res.aemPreview);
163+
handleShare(type = 'aemPreview') {
164+
const aemPaths = this._manifest.resources.map((res) => res[type]);
165165
const blob = new Blob([aemPaths.join('\n')], { type: 'text/plain' });
166166
const data = [new ClipboardItem({ [blob.type]: blob })];
167167
navigator.clipboard.write(data);
@@ -335,7 +335,8 @@ class NxSnapshot extends LitElement {
335335
<p>
336336
${showEdit ? html`URLs` : html`${count} URL${s}`}
337337
${showEdit ? this.renderCancelUrlBtn() : this.renderEditUrlBtn()}
338-
${showEdit ? nothing : html`<button @click=${this.handleShare}>Share</button>`}
338+
${showEdit ? nothing : html`<button @click=${() => this.handleShare('aemPreview')}>Share URLs</button>`}
339+
${showEdit ? nothing : html`<button @click=${() => this.handleCopy('url')}>Share Review URLs</button>`}
339340
</p>
340341
</div>
341342
${showEdit ? this.renderEditUrls() : this.renderUrls()}

0 commit comments

Comments
 (0)