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.
This commit is contained in:
parent
0ec94098a5
commit
cb6e279a3c
@ -1,5 +1,6 @@
|
|||||||
import { localized, msg, str } from "@lit/localize";
|
import { localized, msg, str } from "@lit/localize";
|
||||||
import type { SlSelect } from "@shoelace-style/shoelace";
|
import type { SlSelect } from "@shoelace-style/shoelace";
|
||||||
|
import clsx from "clsx";
|
||||||
import { html, nothing, type PropertyValues, type TemplateResult } from "lit";
|
import { html, nothing, type PropertyValues, type TemplateResult } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators.js";
|
import { customElement, property, state } from "lit/decorators.js";
|
||||||
import { choose } from "lit/directives/choose.js";
|
import { choose } from "lit/directives/choose.js";
|
||||||
@ -26,6 +27,7 @@ import {
|
|||||||
} from "@/utils/crawler";
|
} from "@/utils/crawler";
|
||||||
import { humanizeSchedule } from "@/utils/cron";
|
import { humanizeSchedule } from "@/utils/cron";
|
||||||
import { isArchivingDisabled } from "@/utils/orgs";
|
import { isArchivingDisabled } from "@/utils/orgs";
|
||||||
|
import { tw } from "@/utils/tailwind";
|
||||||
|
|
||||||
const SECTIONS = ["crawls", "watch", "settings", "logs"] as const;
|
const SECTIONS = ["crawls", "watch", "settings", "logs"] as const;
|
||||||
type Tab = (typeof SECTIONS)[number];
|
type Tab = (typeof SECTIONS)[number];
|
||||||
@ -895,6 +897,9 @@ export class WorkflowDetail extends BtrixElement {
|
|||||||
this.crawls!.items.map(
|
this.crawls!.items.map(
|
||||||
(crawl: Crawl) =>
|
(crawl: Crawl) =>
|
||||||
html` <btrix-crawl-list-item
|
html` <btrix-crawl-list-item
|
||||||
|
class=${clsx(
|
||||||
|
isActive(crawl) && tw`cursor-default text-neutral-500`,
|
||||||
|
)}
|
||||||
href=${ifDefined(
|
href=${ifDefined(
|
||||||
isActive(crawl)
|
isActive(crawl)
|
||||||
? undefined
|
? undefined
|
||||||
@ -911,7 +916,7 @@ export class WorkflowDetail extends BtrixElement {
|
|||||||
${msg("Copy Crawl ID")}
|
${msg("Copy Crawl ID")}
|
||||||
</sl-menu-item>
|
</sl-menu-item>
|
||||||
${when(
|
${when(
|
||||||
this.isCrawler,
|
this.isCrawler && !isActive(crawl),
|
||||||
() => html`
|
() => html`
|
||||||
<sl-divider></sl-divider>
|
<sl-divider></sl-divider>
|
||||||
<sl-menu-item
|
<sl-menu-item
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user