File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import { guard } from "lit/directives/guard.js";
99import { ifDefined } from "lit/directives/if-defined.js" ;
1010import { until } from "lit/directives/until.js" ;
1111import { when } from "lit/directives/when.js" ;
12+ import omitBy from "lodash/fp/omitBy" ;
13+ import isNil from "lodash/isNil" ;
1214import queryString from "query-string" ;
1315
1416import type { Crawl , CrawlLog , Seed , Workflow } from "./types" ;
@@ -51,6 +53,9 @@ const CRAWLS_PAGINATION_NAME = "crawlsPage";
5153
5254const isLoading = ( task : Task ) => task . status === TaskStatus . PENDING ;
5355
56+ // Omit null or undefined values from object
57+ const omitNil = omitBy ( isNil ) ;
58+
5459/**
5560 * Usage:
5661 * ```ts
@@ -794,7 +799,16 @@ export class WorkflowDetail extends BtrixElement {
794799 <btrix-copy-button
795800 name="filetype-json"
796801 value=${ ifDefined (
797- this . workflow && JSON . stringify ( this . workflow . config ) ,
802+ this . workflow &&
803+ this . seeds &&
804+ JSON . stringify (
805+ {
806+ ...omitNil ( this . workflow . config ) ,
807+ seeds : this . seeds . items . map ( omitNil ) ,
808+ } ,
809+ null ,
810+ 2 ,
811+ ) ,
798812 ) }
799813 content=${ msg ( "Copy as JSON" ) }
800814 size="medium"
You can’t perform that action at this time.
0 commit comments