Skip to content
Merged
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
9 changes: 9 additions & 0 deletions nx/blocks/snapshot-admin/views/snapshot.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ svg.icon {
align-items: center;
gap: 8px;
}

button {
padding: 4px 6px;
border-radius: 4px;

&:not(:disabled):hover {
background: var(--s2-gray-50);
}
}
}

.nx-snapshot-sub-heading-actions {
Expand Down
7 changes: 4 additions & 3 deletions nx/blocks/snapshot-admin/views/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class NxSnapshot extends LitElement {
this.handleSave(false);
}

handleShare() {
const aemPaths = this._manifest.resources.map((res) => res.aemPreview);
handleShare(type = 'aemPreview') {
const aemPaths = this._manifest.resources.map((res) => res[type]);
const blob = new Blob([aemPaths.join('\n')], { type: 'text/plain' });
const data = [new ClipboardItem({ [blob.type]: blob })];
navigator.clipboard.write(data);
Expand Down Expand Up @@ -382,7 +382,8 @@ class NxSnapshot extends LitElement {
<p>
${showEdit ? html`URLs` : html`${count} URL${s}`}
${showEdit ? this.renderCancelUrlBtn() : this.renderEditUrlBtn()}
${showEdit ? nothing : html`<button @click=${this.handleShare}>Share</button>`}
${showEdit ? nothing : html`<button @click=${() => this.handleShare('aemPreview')}>Share URLs</button>`}
${showEdit ? nothing : html`<button @click=${() => this.handleShare('url')}>Share Review URLs</button>`}
</p>
</div>
${showEdit ? this.renderEditUrls() : this.renderUrls()}
Expand Down