Skip to content

Commit

Permalink
Move migration error notice to the new dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidasmi committed Sep 20, 2024
1 parent feaa0fb commit b06fcec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/js/src/helpers/moveNotices.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function moveNotices() {
migratedNotices.forEach( notice => notice.remove() );

const ids = allNotices.map( notice => notice.id );
const headers = allNotices.map( notice => notice.querySelector( ".notice-yoast__header-heading" ) );
const headers = allNotices.map( notice => notice.querySelector( ".yoast-notice-migrated-header" ) );
const content = allNotices.map( notice => notice.querySelector( ".notice-yoast-content" ) );
const buttons = allNotices.map( notice => notice.querySelector( "button.notice-dismiss" ) );

Expand Down
8 changes: 7 additions & 1 deletion src/presenters/admin/migration-error-presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public function __construct( $migration_error ) {
* @return string The error HTML.
*/
public function present() {
$header = \sprintf(
/* translators: %s: Yoast SEO. */
\esc_html__( '%s cannot create database tables', 'wordpress-seo' ),
'Yoast SEO'
);
$message = \sprintf(
/* translators: %s: Yoast SEO. */
\esc_html__( '%s had problems creating the database tables needed to speed up your site.', 'wordpress-seo' ),
Expand All @@ -61,7 +66,8 @@ public function present() {
);

return \sprintf(
'<div class="notice notice-error"><p>%1$s</p><p>%2$s</p><p>%3$s</p>%4$s</div>',
'<div class="notice notice-error yoast-migrated-notice"><h4 class="yoast-notice-migrated-header">%1$s</h4><div class="notice-yoast-content"><p>%2$s</p><p>%3$s</p><p>%4$s</p>%5$s</div></div>',
$header,
$message,
$support,
$reassurance,
Expand Down
2 changes: 1 addition & 1 deletion src/presenters/admin/notice-presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function present() {
$out .= '<div class="notice-yoast__header">';
$out .= '<span class="yoast-icon"></span>';
$out .= \sprintf(
'<h2 class="notice-yoast__header-heading">%s</h2>',
'<h2 class="notice-yoast__header-heading yoast-notice-migrated-header">%s</h2>',
\esc_html( $this->title )
);
$out .= '</div>';
Expand Down

0 comments on commit b06fcec

Please sign in to comment.