@@ -29,10 +29,14 @@ const UIStrings = {
2929 */
3030 addNetworkRequestBlockingPattern : 'Add network request blocking pattern' ,
3131 /**
32- *@description Button to add a pattern to block netwrok requests in the Network request blocking tool
32+ *@description Text that shows in the network request blocking panel if no pattern has yet been added.
33+ */
34+ noNetworkRequestsBlocked : 'No blocked network requests' ,
35+ /**
36+ *@description Text that shows in the network request blocking panel if no pattern has yet been added.
3337 *@example {Add pattern} PH1
3438 */
35- networkRequestsAreNotBlockedS : 'Network requests are not blocked. {PH1}' ,
39+ addPatternToBlock : 'Add a pattern to block network requests by clicking on the " {PH1}" button. ' ,
3640 /**
3741 *@description Text in Blocked URLs Pane of the Network panel
3842 *@example {4} PH1
@@ -54,10 +58,17 @@ const UIStrings = {
5458 *@description Message to be announced for a when list item is removed from list widget
5559 */
5660 itemDeleted : 'Item successfully deleted' ,
61+ /**
62+ *@description Message to be announced for a when list item is removed from list widget
63+ */
64+ learnMore : 'Learn more' ,
5765} ;
5866const str_ = i18n . i18n . registerUIStrings ( 'panels/network/BlockedURLsPane.ts' , UIStrings ) ;
5967const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
6068
69+ const NETWORK_REQUEST_BLOCKING_EXPLANATION_URL =
70+ 'https://developer.chrome.com/docs/devtools/network-request-blocking' as Platform . DevToolsPath . UrlString ;
71+
6172export class BlockedURLsPane extends UI . Widget . VBox implements
6273 UI . ListWidget . Delegate < SDK . NetworkManager . BlockedPattern > {
6374 private manager : SDK . NetworkManager . MultitargetNetworkManager ;
@@ -108,16 +119,24 @@ export class BlockedURLsPane extends UI.Widget.VBox implements
108119 }
109120
110121 private createEmptyPlaceholder ( ) : Element {
111- const element = this . contentElement . createChild ( 'div' , 'no-blocked-urls' ) ;
122+ const placeholder = this . contentElement . createChild ( 'div' , 'empty-state' ) ;
123+ placeholder . createChild ( 'span' , 'empty-state-header' ) . textContent = i18nString ( UIStrings . noNetworkRequestsBlocked ) ;
124+
125+ const description = placeholder . createChild ( 'div' , 'empty-state-description' ) ;
126+ description . createChild ( 'span' ) . textContent =
127+ i18nString ( UIStrings . addPatternToBlock , { PH1 : i18nString ( UIStrings . addPattern ) } ) ;
128+ const link = UI . XLink . XLink . create (
129+ NETWORK_REQUEST_BLOCKING_EXPLANATION_URL , i18nString ( UIStrings . learnMore ) , undefined , undefined , 'learn-more' ) ;
130+ description . appendChild ( link ) ;
131+
112132 const addButton = UI . UIUtils . createTextButton ( i18nString ( UIStrings . addPattern ) , this . addPattern . bind ( this ) , {
113133 className : 'add-button' ,
114134 jslogContext : 'network.add-network-request-blocking-pattern' ,
115- variant : Buttons . Button . Variant . PRIMARY ,
135+ variant : Buttons . Button . Variant . TONAL ,
116136 } ) ;
117137 UI . ARIAUtils . setLabel ( addButton , i18nString ( UIStrings . addNetworkRequestBlockingPattern ) ) ;
118- element . appendChild (
119- i18n . i18n . getFormatLocalizedString ( str_ , UIStrings . networkRequestsAreNotBlockedS , { PH1 : addButton } ) ) ;
120- return element ;
138+ placeholder . appendChild ( addButton ) ;
139+ return placeholder ;
121140 }
122141
123142 addPattern ( ) : void {
0 commit comments