@@ -943,6 +943,23 @@ export class WorkflowEditor extends BtrixElement {
943
943
} ;
944
944
945
945
private readonly renderPageScope = ( ) => {
946
+ const linkToBrowserSettings = ( label : string ) =>
947
+ html `<button
948
+ type="button"
949
+ class="text-blue-600 hover:text-blue-500"
950
+ @click=${ async ( ) => {
951
+ this . updateProgressState ( { activeTab : "browserSettings" } ) ;
952
+
953
+ await this . updateComplete ;
954
+
955
+ void this . scrollToActivePanel ( ) ;
956
+ } }
957
+ >
958
+ ${ label }
959
+ </button>` ;
960
+ const link_to_browser_profile = linkToBrowserSettings (
961
+ msg ( "Browser Profile" ) ,
962
+ ) ;
946
963
return html `
947
964
${ this . formState . scopeType === ScopeType . Page
948
965
? html `
@@ -1016,8 +1033,18 @@ export class WorkflowEditor extends BtrixElement {
1016
1033
${ inputCol ( html `
1017
1034
<sl-checkbox
1018
1035
name="failOnContentCheck"
1019
- ?checked=${ this . formState . failOnContentCheck }
1036
+ ?checked=${ this . formState . failOnContentCheck &&
1037
+ this . formState . browserProfile !== null }
1038
+ ?disabled=${ this . formState . browserProfile === null }
1020
1039
>
1040
+ ${ this . formState . browserProfile === null
1041
+ ? html `<span slot="help-text">
1042
+ ${ msg (
1043
+ html `Custom logged in ${ link_to_browser_profile } is required
1044
+ to use this option.` ,
1045
+ ) }
1046
+ </span>`
1047
+ : nothing }
1021
1048
${ msg ( "Fail crawl if not logged in" ) }
1022
1049
</sl-checkbox>
1023
1050
` ) }
@@ -1372,6 +1399,24 @@ https://replayweb.page/docs`}
1372
1399
const additionalUrlList = urlListToArray ( this . formState . urlList ) ;
1373
1400
const maxUrls = this . localize . number ( URL_LIST_MAX_URLS ) ;
1374
1401
1402
+ const linkToBrowserSettings = ( label : string ) =>
1403
+ html `<button
1404
+ type="button"
1405
+ class="text-blue-600 hover:text-blue-500"
1406
+ @click=${ async ( ) => {
1407
+ this . updateProgressState ( { activeTab : "browserSettings" } ) ;
1408
+
1409
+ await this . updateComplete ;
1410
+
1411
+ void this . scrollToActivePanel ( ) ;
1412
+ } }
1413
+ >
1414
+ ${ label }
1415
+ </button>` ;
1416
+ const link_to_browser_profile = linkToBrowserSettings (
1417
+ msg ( "Browser Profile" ) ,
1418
+ ) ;
1419
+
1375
1420
return html `
1376
1421
${ inputCol ( html `
1377
1422
<sl-input
@@ -1516,8 +1561,17 @@ https://example.net`}
1516
1561
${ inputCol ( html `
1517
1562
<sl-checkbox
1518
1563
name="failOnContentCheck"
1519
- ?checked=${ this . formState . failOnContentCheck }
1564
+ ?checked=${ this . formState . failOnContentCheck &&
1565
+ this . formState . browserProfile !== null }
1566
+ ?disabled=${ this . formState . browserProfile === null }
1520
1567
>
1568
+ ${ this . formState . browserProfile === null
1569
+ ? html `<span slot="help-text">
1570
+ ${ msg (
1571
+ html `Select a ${ link_to_browser_profile } to use this option.` ,
1572
+ ) }
1573
+ </span>`
1574
+ : nothing }
1521
1575
${ msg ( "Fail crawl if not logged in" ) }
1522
1576
</sl-checkbox>
1523
1577
` ) }
@@ -1911,7 +1965,7 @@ https://archiveweb.page/images/${"logo.svg"}`}
1911
1965
.profileId=${ this . formState . browserProfile ?. id }
1912
1966
@on-change=${ ( e : SelectBrowserProfileChangeEvent ) =>
1913
1967
this . updateFormState ( {
1914
- browserProfile : e . detail . value ,
1968
+ browserProfile : e . detail . value ?? null ,
1915
1969
} ) }
1916
1970
></btrix-select-browser-profile>
1917
1971
` ) }
@@ -2844,6 +2898,14 @@ https://archiveweb.page/images/${"logo.svg"}`}
2844
2898
}
2845
2899
}
2846
2900
2901
+ // Disable failOnContentCheck if no browser profile is selected
2902
+ // This is done here rather than in `willChange` so that the state of the checkbox
2903
+ // can be remembered if the switches from a browser profile to no browser profile,
2904
+ // and then back to a browser profile
2905
+ if ( this . formState . browserProfile === null ) {
2906
+ this . formState . failOnContentCheck = false ;
2907
+ }
2908
+
2847
2909
const isValid = await this . checkFormValidity ( this . formElem ) ;
2848
2910
2849
2911
if ( ! isValid || this . formHasError ) {
0 commit comments