@@ -8,7 +8,13 @@ import capitalize from "lodash/fp/capitalize";
8
8
import RegexColorize from "regex-colorize" ;
9
9
10
10
import { BtrixElement } from "@/classes/BtrixElement" ;
11
- import type { CrawlConfig , Seed , SeedConfig } from "@/pages/org/types" ;
11
+ import { none , notSpecified } from "@/layouts/empty" ;
12
+ import {
13
+ Behavior ,
14
+ type CrawlConfig ,
15
+ type Seed ,
16
+ type SeedConfig ,
17
+ } from "@/pages/org/types" ;
12
18
import { labelFor } from "@/strings/crawl-workflows/labels" ;
13
19
import scopeTypeLabel from "@/strings/crawl-workflows/scopeType" ;
14
20
import sectionStrings from "@/strings/crawl-workflows/section" ;
@@ -162,22 +168,15 @@ export class ConfigDetails extends BtrixElement {
162
168
heading : sectionStrings . behaviors ,
163
169
renderDescItems : ( seedsConfig ) => html `
164
170
${ this . renderSetting (
165
- labelFor . autoscrollBehavior ,
166
- seedsConfig ?. behaviors &&
167
- ! seedsConfig . behaviors . includes ( "autoscroll" )
168
- ? msg ( "Disabled" )
169
- : html `< span class ="text-neutral-400 "
170
- > ${ msg ( "Enabled (default)" ) } </ span
171
- > ` ,
172
- ) }
173
- ${ this . renderSetting (
174
- labelFor . autoclickBehavior ,
175
- seedsConfig ?. behaviors &&
176
- seedsConfig . behaviors . includes ( "autoclick" )
177
- ? msg ( "Enabled" )
178
- : html `< span class ="text-neutral-400 "
179
- > ${ msg ( "Disabled (default)" ) } </ span
180
- > ` ,
171
+ labelFor . behaviors ,
172
+ [
173
+ seedsConfig ?. behaviors ?. includes ( Behavior . AutoScroll ) &&
174
+ labelFor . autoscrollBehavior ,
175
+ seedsConfig ?. behaviors ?. includes ( Behavior . AutoClick ) &&
176
+ labelFor . autoclickBehavior ,
177
+ ]
178
+ . filter ( ( v ) => v )
179
+ . join ( ", " ) || none ,
181
180
) }
182
181
${ this . renderSetting (
183
182
labelFor . pageLoadTimeoutSeconds ,
@@ -424,7 +423,7 @@ export class ConfigDetails extends BtrixElement {
424
423
) }
425
424
</ ul >
426
425
`
427
- : msg ( "None" ) ,
426
+ : none ,
428
427
true ,
429
428
) ,
430
429
) }
@@ -463,7 +462,7 @@ export class ConfigDetails extends BtrixElement {
463
462
} ) }
464
463
</ ul >
465
464
`
466
- : msg ( "None" ) ,
465
+ : none ,
467
466
true ,
468
467
) }
469
468
${ when (
@@ -477,7 +476,7 @@ export class ConfigDetails extends BtrixElement {
477
476
</ btrix-queue-exclusion-table >
478
477
</ div >
479
478
` ,
480
- ( ) => this . renderSetting ( msg ( "Exclusions" ) , msg ( "None" ) ) ,
479
+ ( ) => this . renderSetting ( msg ( "Exclusions" ) , none ) ,
481
480
) }
482
481
` ;
483
482
} ;
@@ -490,11 +489,9 @@ export class ConfigDetails extends BtrixElement {
490
489
} else if ( typeof value === "boolean" ) {
491
490
content = value ? msg ( "Yes" ) : msg ( "No" ) ;
492
491
} else if ( Array . isArray ( value ) && ! value . length ) {
493
- content = html ` < span class =" text-neutral-400 " > ${ msg ( "None" ) } </ span > ` ;
492
+ content = none ;
494
493
} else if ( typeof value !== "number" && ! value ) {
495
- content = html `< span class ="text-neutral-400 "
496
- > ${ msg ( "Not specified" ) } </ span
497
- > ` ;
494
+ content = notSpecified ;
498
495
}
499
496
return html `
500
497
< btrix-desc-list-item label =${ label } class =${ breakAll ? "break-all" : "" } >
0 commit comments