Skip to content

Commit

Permalink
Merge pull request #6396 from ampproject/fix/user-endpoint-conflict
Browse files Browse the repository at this point in the history
Check for `conflicts.user` property before rendering list item
  • Loading branch information
westonruter authored Jun 17, 2021
2 parents e46ee60 + 382b803 commit 2debdb9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ jobs:
github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.fork == false &&
github.event.pull_request.user.login != 'dependabot[bot]'
needs: pre-run
runs-on: ubuntu-latest
outputs:
branch-name: ${{ steps.retrieve-branch-name.outputs.branch_name }}
Expand Down
42 changes: 23 additions & 19 deletions assets/src/settings-page/paired-url-structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,29 @@ function SlugConflictsNotice( { slug, conflicts } ) {
) )
) }

<li>
{
conflicts.user.edit_link ? (
<a href={ conflicts.user.edit_link } target="_blank" rel="noreferrer">
{ __( 'User', 'amp' ) }
</a>
) : (
__( 'User', 'amp' )
)
}
{ ': ' + conflicts.user.name }
{ ' ' }
<small>
{
/* translators: %d is entity ID */
sprintf( __( '(ID: %d)', 'amp' ), conflicts.user.id )
}
</small>
</li>
{
conflicts.user && (
<li>
{
conflicts.user.edit_link ? (
<a href={ conflicts.user.edit_link } target="_blank" rel="noreferrer">
{ __( 'User', 'amp' ) }
</a>
) : (
__( 'User', 'amp' )
)
}
{ ': ' + conflicts.user.name }
{ ' ' }
<small>
{
/* translators: %d is entity ID */
sprintf( __( '(ID: %d)', 'amp' ), conflicts.user.id )
}
</small>
</li>
)
}

{
conflicts.post_type && (
Expand Down

0 comments on commit 2debdb9

Please sign in to comment.