diff --git a/frontend/src/pages/org/workflow-detail.ts b/frontend/src/pages/org/workflow-detail.ts index 5777f94f..76603d8a 100644 --- a/frontend/src/pages/org/workflow-detail.ts +++ b/frontend/src/pages/org/workflow-detail.ts @@ -9,6 +9,8 @@ import { guard } from "lit/directives/guard.js"; import { ifDefined } from "lit/directives/if-defined.js"; import { until } from "lit/directives/until.js"; import { when } from "lit/directives/when.js"; +import omitBy from "lodash/fp/omitBy"; +import isNil from "lodash/isNil"; import queryString from "query-string"; import type { Crawl, CrawlLog, Seed, Workflow } from "./types"; @@ -51,6 +53,9 @@ const CRAWLS_PAGINATION_NAME = "crawlsPage"; const isLoading = (task: Task) => task.status === TaskStatus.PENDING; +// Omit null or undefined values from object +const omitNil = omitBy(isNil); + /** * Usage: * ```ts @@ -789,16 +794,40 @@ export class WorkflowDetail extends BtrixElement { `; } - if (this.workflowTab === WorkflowTab.Settings && this.isCrawler) { - return html` - - - `; + if (this.workflowTab === WorkflowTab.Settings) { + return html` + ${this.appState.isAdmin + ? html` + ` + : nothing} + ${this.isCrawler + ? html` + + + ` + : nothing} + `; } return nothing;