Skip to content

Commit cb6e279

Browse files
authored
fix: Hide incorrect menu item for running workflow crawl (#2591)
- Hides the "Delete" menu item for a running crawl in the workflows crawls list. - Slightly grays out row for running crawl to indicate that it's not clickable.
1 parent 0ec9409 commit cb6e279

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { localized, msg, str } from "@lit/localize";
22
import type { SlSelect } from "@shoelace-style/shoelace";
3+
import clsx from "clsx";
34
import { html, nothing, type PropertyValues, type TemplateResult } from "lit";
45
import { customElement, property, state } from "lit/decorators.js";
56
import { choose } from "lit/directives/choose.js";
@@ -26,6 +27,7 @@ import {
2627
} from "@/utils/crawler";
2728
import { humanizeSchedule } from "@/utils/cron";
2829
import { isArchivingDisabled } from "@/utils/orgs";
30+
import { tw } from "@/utils/tailwind";
2931

3032
const SECTIONS = ["crawls", "watch", "settings", "logs"] as const;
3133
type Tab = (typeof SECTIONS)[number];
@@ -895,6 +897,9 @@ export class WorkflowDetail extends BtrixElement {
895897
this.crawls!.items.map(
896898
(crawl: Crawl) =>
897899
html` <btrix-crawl-list-item
900+
class=${clsx(
901+
isActive(crawl) && tw`cursor-default text-neutral-500`,
902+
)}
898903
href=${ifDefined(
899904
isActive(crawl)
900905
? undefined
@@ -911,7 +916,7 @@ export class WorkflowDetail extends BtrixElement {
911916
${msg("Copy Crawl ID")}
912917
</sl-menu-item>
913918
${when(
914-
this.isCrawler,
919+
this.isCrawler && !isActive(crawl),
915920
() => html`
916921
<sl-divider></sl-divider>
917922
<sl-menu-item

0 commit comments

Comments
 (0)