@@ -29,6 +29,7 @@ import activeCrawlsCountContext, {
2929} from "@/context/active-crawls-count" ;
3030import { makeUpdateActiveCrawlsCountEvent } from "@/context/active-crawls-count/events" ;
3131import { SearchParamsValue } from "@/controllers/searchParamsValue" ;
32+ import { type BtrixUserGuideShowEvent } from "@/events/btrix-user-guide-show" ;
3233import {
3334 Action ,
3435 type BtrixSelectActionEvent ,
@@ -40,6 +41,7 @@ import {
4041 WorkflowSearch ,
4142 type SearchFields ,
4243} from "@/features/crawl-workflows/workflow-search" ;
44+ import { emptyMessage } from "@/layouts/emptyMessage" ;
4345import { WorkflowTab } from "@/routes" ;
4446import { deleteConfirmation } from "@/strings/ui" ;
4547import type { APIPaginatedList , APIPaginationQuery } from "@/types/api" ;
@@ -754,7 +756,7 @@ export class WorkflowsList extends BtrixElement {
754756 < div class ="rounded-lg border bg-neutral-50 p-4 ">
755757 < p class ="text-center ">
756758 < span class ="text-neutral-400 "
757- > ${ msg ( "No matching Workflows found." ) } </ span
759+ > ${ msg ( "No matching workflows found." ) } </ span
758760 >
759761 < button
760762 class ="font-medium text-neutral-500 underline hover:no-underline "
@@ -777,16 +779,63 @@ export class WorkflowsList extends BtrixElement {
777779 ` ;
778780 }
779781
780- return html `
781- < div class ="border-b border-t py-5 ">
782- < p class ="text-center text-neutral-500 "> ${ msg ( "No Workflows yet." ) } </ p >
783- </ div >
784- ` ;
782+ const message = msg ( "Your org doesn’t have any crawl workflows yet." ) ;
783+ const guideButton = html `< sl-button
784+ variant ="text "
785+ @click =${ ( ) => {
786+ this . dispatchEvent (
787+ new CustomEvent < BtrixUserGuideShowEvent [ "detail" ] > (
788+ "btrix-user-guide-show" ,
789+ {
790+ detail : { path : "crawl-workflows" } ,
791+ bubbles : true ,
792+ composed : true ,
793+ } ,
794+ ) ,
795+ ) ;
796+ } }
797+ >
798+ < sl-icon slot ="prefix " name ="book "> </ sl-icon >
799+ ${ msg ( "Read Guide" ) }
800+ </ sl-button > ` ;
801+
802+ if ( this . appState . isCrawler ) {
803+ return emptyMessage ( {
804+ classNames : tw `border-y` ,
805+ message,
806+ detail : msg ( "Schedule, run, and manage crawls with crawl workflows." ) ,
807+ actions : html `
808+ < sl-button
809+ href =${ `${ this . navigate . orgBasePath } /workflows/new` }
810+ @click =${ ( e : MouseEvent ) => {
811+ if ( e . metaKey ) {
812+ return ;
813+ }
814+ e . preventDefault ( ) ;
815+
816+ this . navigate . to ( ( e . target as HTMLAnchorElement ) . href , {
817+ scopeType : this . appState . userPreferences ?. newWorkflowScopeType ,
818+ } ) ;
819+ } }
820+ >
821+ < sl-icon slot ="prefix " name ="plus-lg "> </ sl-icon >
822+ ${ msg ( "Create New Workflow" ) }
823+ </ sl-button >
824+ ${ guideButton }
825+ ` ,
826+ } ) ;
827+ }
828+
829+ return emptyMessage ( {
830+ classNames : tw `border-y` ,
831+ message,
832+ actions : guideButton ,
833+ } ) ;
785834 }
786835
787836 private renderLoading ( ) {
788837 return html `< div
789- class ="my-24 flex w-full items-center justify-center text-3xl "
838+ class ="my-24 flex w-full items-center justify-center text-2xl "
790839 >
791840 < sl-spinner > </ sl-spinner >
792841 </ div > ` ;
0 commit comments