fix: Right Align Copy Buttons & <btrix-desc-list> vertical width: 100% (#1177)

* Reorders actions, adds tooltip

- All copy buttons on the collection share dialog are now on the right side
- Adds a tooltip to tell the user the button opens the link in a new tab

* Make vertical `dec-list` items fill 100% width of their parent container

- Allows for better placement of items within the container
- Adds horizontal padding to info bars

* Right align copy button in item details page
This commit is contained in:
Henry Wilkinson 2023-09-28 15:08:27 -04:00 committed by GitHub
parent 86a424af93
commit e93f195d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 15 deletions

View File

@ -46,6 +46,10 @@ export class DescListItem extends LitElement {
justify-content: var(--justify-item, initial);
border-right: var(--border-right, 0px);
}
.content {
width: var(--width-full, initial);
}
`;
@property({ type: String })
@ -71,6 +75,7 @@ export class DescList extends LitElement {
.vertical {
grid-template-columns: 100%;
gap: 1rem;
--width-full: 100%;
}
.horizontal {

View File

@ -121,7 +121,9 @@ export class CollectionDetail extends LiteElement {
</sl-button>
${when(this.isCrawler, this.renderActions)}
</header>
<div class="border rounded-lg py-2 mb-3">${this.renderInfoBar()}</div>
<div class="border rounded-lg py-2 px-4 mb-3">
${this.renderInfoBar()}
</div>
<div class="mb-3">${this.renderTabs()}</div>
${choose(
@ -217,21 +219,23 @@ export class CollectionDetail extends LiteElement {
${msg("This collection can be viewed by anyone with the link.")}
</p>
<div class="flex items-center rounded border">
<div class="text-base">
<sl-tooltip content="Open in New Tab">
<sl-icon-button
href=${publicReplayUrl}
name="box-arrow-up-right"
target="_blank"
>
</sl-icon-button>
</sl-tooltip>
</div>
<div class="flex-1 min-w-0 truncate">${publicReplayUrl}</div>
<div class="text-base">
<btrix-copy-button
.getValue=${() => publicReplayUrl}
content=${msg("Copy Public URL")}
></btrix-copy-button>
</div>
<div class="flex-1 min-w-0 truncate">${publicReplayUrl}</div>
<div class="text-base">
<sl-icon-button
href=${publicReplayUrl}
name="box-arrow-up-right"
target="_blank"
>
</sl-icon-button>
</div>
</div>
</section>
<btrix-section-heading>${msg("Embed Collection")}</btrix-section-heading>

View File

@ -699,10 +699,14 @@ export class CrawlDetail extends LiteElement {
</btrix-desc-list-item>
<btrix-desc-list-item label=${msg("Crawl ID")}>
${this.crawl
? html`<btrix-copy-button
value=${this.crawl.id}
></btrix-copy-button>
<code title=${this.crawl.id}>${this.crawl.id}</code> `
? html`
<div class="flex items-center gap-2">
<code class="grow" title=${this.crawl.id}
>${this.crawl.id}</code
>
<btrix-copy-button value=${this.crawl.id}></btrix-copy-button>
</div>
`
: html`<sl-skeleton class="h-6"></sl-skeleton>`}
</btrix-desc-list-item>
</btrix-desc-list>

View File

@ -318,7 +318,7 @@ export class WorkflowDetail extends LiteElement {
</div>
</header>
<section class="col-span-1 border rounded-lg py-2">
<section class="col-span-1 border rounded-lg py-2 px-4">
${this.renderDetails()}
</section>