Skip to content

Commit a70d05d

Browse files
committed
[wip] update collection sharing UI and copy button
- updates the share collection component to add "name" and "size" attributes to the copy button for improved accessibility and styling - changes button text from "Copy Link" to "Copy Public Link" for clarity - modifies the collection detail page to make the access icon next to the collection title a clickable button that opens the sharing tab in the edit dialog - adds a dedicated share button to the header actions with a share icon that also opens the sharing tab
1 parent 4314e2a commit a70d05d

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

frontend/src/features/collections/share-collection.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ export class ShareCollection extends BtrixElement {
6969
return html`
7070
<div class="flex items-center gap-2">
7171
<btrix-copy-button
72+
name="link"
73+
size="medium"
7274
.getValue=${() => this.shareLink}
73-
content=${msg("Copy Link")}
75+
content=${msg("Copy Public Link")}
7476
@click=${() => {
7577
void this.clipboardController.copy(this.shareLink);
7678

frontend/src/pages/org/collection-detail.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,15 @@ export class CollectionDetail extends BtrixElement {
187187
class="-mb-1 -ml-2 -mr-1 -mt-1 flex flex-none flex-col gap-2 self-start rounded-lg pb-1 pl-2 pr-1 pt-1 transition-colors has-[.addSummary:hover]:bg-primary-50 has-[sl-icon-button:hover]:bg-primary-50"
188188
>
189189
<div class="flex flex-wrap items-center gap-2.5">
190-
${this.renderAccessIcon()}${pageTitle(
191-
this.collection?.name,
192-
tw`mb-2 h-6 w-60`,
193-
)}
190+
<button
191+
type="button"
192+
@click=${() => {
193+
this.openDialogName = "edit";
194+
this.editTab = "sharing";
195+
}}
196+
>
197+
${this.renderAccessIcon()}</button
198+
>${pageTitle(this.collection?.name, tw`mb-2 h-6 w-60`)}
194199
${this.collection &&
195200
html`<sl-icon-button
196201
name="pencil"
@@ -481,6 +486,17 @@ export class CollectionDetail extends BtrixElement {
481486
const authToken = this.authState?.headers.Authorization.split(" ")[1];
482487

483488
return html`
489+
<sl-tooltip content=${msg("Share")}>
490+
<sl-icon-button
491+
name="box-arrow-up"
492+
@click=${() => {
493+
this.openDialogName = "edit";
494+
this.editTab = "sharing";
495+
}}
496+
>
497+
<sl-icon slot="prefix"></sl-icon>
498+
</sl-icon-button>
499+
</sl-tooltip>
484500
<sl-tooltip content=${msg("Edit Collection Settings")}>
485501
<sl-icon-button
486502
name="gear"

0 commit comments

Comments
 (0)