Skip to content

Commit 83ced38

Browse files
authored
Add "shareable" notices to workflow list & detail (#2788)
Closes #2785
1 parent f4d0d94 commit 83ced38

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { msg } from "@lit/localize";
2+
import { html } from "lit";
3+
4+
export const ShareableNotice = () =>
5+
html`<btrix-popover
6+
content=${msg(
7+
"The latest crawl from this workflow is publicly accessible to anyone with the link. This can be changed with the Browsertrix API.",
8+
)}
9+
>
10+
<btrix-badge class="part-[base]:min-h-5" variant="warning">
11+
<sl-icon name="info-circle" class="align-icon mr-1"></sl-icon>
12+
${msg("Public")}
13+
</btrix-badge>
14+
</btrix-popover>`;

frontend/src/features/crawl-workflows/workflow-list.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import {
1919
query,
2020
queryAssignedElements,
2121
} from "lit/decorators.js";
22+
import { when } from "lit/directives/when.js";
23+
24+
import { ShareableNotice } from "./templates/shareable-notice";
2225

2326
import { BtrixElement } from "@/classes/BtrixElement";
2427
import type { OverflowDropdown } from "@/components/ui/overflow-dropdown";
@@ -250,7 +253,8 @@ export class WorkflowListItem extends BtrixElement {
250253
}}
251254
>
252255
<div class="col">
253-
<div class="detail url truncate">
256+
<div class="detail url items-center truncate">
257+
${when(this.workflow?.shareable, ShareableNotice)}
254258
${this.safeRender(this.renderName)}
255259
</div>
256260
<div class="desc">

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
import { ClipboardController } from "@/controllers/clipboard";
2424
import { CrawlStatus } from "@/features/archived-items/crawl-status";
2525
import { ExclusionEditor } from "@/features/crawl-workflows/exclusion-editor";
26+
import { ShareableNotice } from "@/features/crawl-workflows/templates/shareable-notice";
2627
import { pageError } from "@/layouts/pageError";
2728
import { pageNav, type Breadcrumb } from "@/layouts/pageHeader";
2829
import { WorkflowTab } from "@/routes";
@@ -445,16 +446,17 @@ export class WorkflowDetail extends BtrixElement {
445446
446447
<div>
447448
<header class="col-span-1 mb-3 flex flex-wrap gap-2">
448-
<div class="flex max-w-full flex-wrap gap-x-2 gap-y-1.5">
449+
<div
450+
class="flex max-w-full flex-wrap items-center gap-x-2 gap-y-1.5"
451+
>
449452
<btrix-detail-page-title
450453
.item=${this.workflow}
451454
></btrix-detail-page-title>
455+
${when(this.workflow?.shareable, ShareableNotice)}
452456
${when(
453457
this.workflow?.inactive,
454458
() => html`
455-
<btrix-badge
456-
class="inline-block align-middle"
457-
variant="warning"
459+
<btrix-badge class="min-h-5" variant="warning"
458460
>${msg("Inactive")}</btrix-badge
459461
>
460462
`,
@@ -471,9 +473,7 @@ export class WorkflowDetail extends BtrixElement {
471473
)}
472474
</div>
473475
474-
<div
475-
class="flex-0 order-first ml-auto flex flex-wrap justify-end gap-2 lg:order-last"
476-
>
476+
<div class="flex-0 ml-auto flex flex-wrap justify-end gap-2">
477477
${when(
478478
this.isCrawler && this.workflow && !this.workflow.inactive,
479479
this.renderActions,

frontend/src/types/crawler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export type Workflow = CrawlConfig & {
107107
isCrawlRunning: boolean | null;
108108
autoAddCollections: string[];
109109
seedCount: number;
110+
shareable?: boolean;
110111
};
111112

112113
export type ListWorkflow = Omit<Workflow, "config">;

0 commit comments

Comments
 (0)