Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Significance: minor
Type: added

Stats: Open the live post, page, video or email in a new tab from its row in a widget, beside the title that opens its stats.
Stats: Open the live post, page or email in a new tab from its row in a widget, beside the title that opens its stats.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: patch
Type: fixed
Comment: Narrows the unreleased "View" action from #53996 so Top videos rows get none; no user-visible change on its own.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe( 'toViewLiveUrl', () => {
[ 'the homepage ID', 0, 'https://example.com/' ],
[ 'no URL', 42, null ],
[ 'an unsupported scheme', 42, 'javascript:alert(1)' ],
[ 'a wp-admin URL', 42, 'https://example.com/wp-admin/media.php?action=edit&attachment_id=42' ],
] )( 'offers no action for a post row with %s', ( _, id, link ) => {
expect( toViewLiveUrl( 'post', id, link ) ).toBeUndefined();
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export type ViewLiveContent = 'post' | 'video';
*
* Only a row whose title opens a detail page inside the dashboard needs a second
* link out to the live content; a title that links out already is the one link.
* The URL comes straight from report data, so its scheme is checked here.
* The URL comes straight from report data, so its scheme is checked here, and a
* wp-admin page is never the live content.
*
* @param content - Whether the row's detail page is a post or a video one.
* @param id - The row's post, page or video ID.
Expand All @@ -34,5 +35,12 @@ export function toViewLiveUrl(
return undefined;
}

return safeHttpUrl( link ) ?? undefined;
const url = safeHttpUrl( link );

// `stats/video-plays` sends the media editor as a video's URL (STATS-567).
if ( url === null || new URL( url ).pathname.includes( '/wp-admin/' ) ) {
return undefined;
}

return url;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Significance: minor
Type: enhancement

Premium Analytics: Open the live post, page, video or email in a new tab from its row in a Stats widget, beside the title that opens its stats.
Premium Analytics: Open the live post, page or email in a new tab from its row in a Stats widget, beside the title that opens its stats.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: patch
Type: bugfix
Comment: Narrows the unreleased "View" action from #53996 so Top videos rows get none; no user-visible change on its own.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Significance: minor
Type: added

Open the live post, page, video or email in a new tab from its row in a widget, beside the title that opens its stats.
Open the live post, page or email in a new tab from its row in a widget, beside the title that opens its stats.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Significance: patch
Type: fixed
Comment: Narrows the unreleased "View" action from #53996 so Top videos rows get none; no user-visible change on its own.
Loading