Skip to content

Commit 090fb5d

Browse files
committed
Add amp prefix to element IDs
1 parent 19ffbfd commit 090fb5d

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

assets/src/amp-validation/counts/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ function setMenuItemCountValue( itemId, count ) {
5757
* Initializes the 'Validated URLs' and 'Error Index' menu items.
5858
*/
5959
function initializeMenuItemCounts() {
60-
setMenuItemIsLoading( 'new-error-index-count' );
61-
setMenuItemIsLoading( 'new-validation-url-count' );
60+
setMenuItemIsLoading( 'amp-new-error-index-count' );
61+
setMenuItemIsLoading( 'amp-new-validation-url-count' );
6262
}
6363

6464
/**
@@ -71,8 +71,8 @@ function initializeMenuItemCounts() {
7171
function updateMenuItemCounts( counts ) {
7272
const { validated_urls: newValidatedUrlCount, errors: newErrorCount } = counts;
7373

74-
setMenuItemCountValue( 'new-error-index-count', newErrorCount );
75-
setMenuItemCountValue( 'new-validation-url-count', newValidatedUrlCount );
74+
setMenuItemCountValue( 'amp-new-error-index-count', newErrorCount );
75+
setMenuItemCountValue( 'amp-new-validation-url-count', newValidatedUrlCount );
7676
}
7777

7878
/**

assets/src/amp-validation/counts/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
display: inline-block;
2424
}
2525

26-
body.no-js #new-validation-url-count,
27-
body.no-js #new-error-index-count {
26+
body.no-js #amp-new-validation-url-count,
27+
body.no-js #amp-new-error-index-count {
2828
display: none;
2929
}

includes/validation/class-amp-validated-url-post-type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ public static function update_validated_url_menu_item() {
469469

470470
if ( ValidationCounts::is_needed() ) {
471471
// Append markup to display a loading spinner while the unreviewed count is being fetched.
472-
$submenu_item[0] .= ' <span id="new-validation-url-count"></span>';
472+
$submenu_item[0] .= ' <span id="amp-new-validation-url-count"></span>';
473473
}
474474

475475
break;

includes/validation/class-amp-validation-error-taxonomy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ public static function add_admin_menu_validation_error_item() {
17451745

17461746
if ( ValidationCounts::is_needed() ) {
17471747
// Append markup to display a loading spinner while the unreviewed count is being fetched.
1748-
$menu_item_label .= ' <span id="new-error-index-count"></span>';
1748+
$menu_item_label .= ' <span id="amp-new-error-index-count"></span>';
17491749
}
17501750

17511751
$post_menu_slug = 'edit.php?post_type=' . AMP_Validated_URL_Post_Type::POST_TYPE_SLUG;

tests/php/validation/test-class-amp-validated-url-post-type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function test_update_validated_url_menu_item() {
170170

171171
AMP_Validated_URL_Post_Type::update_validated_url_menu_item();
172172
if ( Services::get( 'dependency_support' )->has_support() ) {
173-
$this->assertSame( 'Validated URLs <span id="new-validation-url-count"></span>', $submenu[ AMP_Options_Manager::OPTION_NAME ][2][0] );
173+
$this->assertSame( 'Validated URLs <span id="amp-new-validation-url-count"></span>', $submenu[ AMP_Options_Manager::OPTION_NAME ][2][0] );
174174
} else {
175175
$this->assertSame( 'Validated URLs', $submenu[ AMP_Options_Manager::OPTION_NAME ][2][0] );
176176
}

tests/php/validation/test-class-amp-validation-error-taxonomy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,8 +1034,8 @@ public function test_add_admin_menu_validation_error_item() {
10341034
'Error Index',
10351035
];
10361036
if ( Services::get( 'dependency_support' )->has_support() ) {
1037-
$expected_submenu[0] .= ' <span id="new-error-index-count"></span>';
1038-
$expected_submenu[3] .= ' <span id="new-error-index-count"></span>';
1037+
$expected_submenu[0] .= ' <span id="amp-new-error-index-count"></span>';
1038+
$expected_submenu[3] .= ' <span id="amp-new-error-index-count"></span>';
10391039
}
10401040
$amp_options = $submenu[ AMP_Options_Manager::OPTION_NAME ];
10411041
$this->assertEquals( $expected_submenu, end( $amp_options ) );

0 commit comments

Comments
 (0)