Skip to content

Conversation

@nathanss
Copy link
Contributor

@nathanss nathanss commented Jun 27, 2023

Submission Review Guidelines:

Changes proposed in this Pull Request:

Closes #36913 .

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Go to Settings > General.
  2. Change your language to a language other than English (United States) (e.g. English (UK)).
  3. Using WCA Test Helper, go to Tools > WCA Test Helper > Admin notes and add 2-3 notes of type "update" .
  4. Run the following command on your database:
UPDATE wp_wc_admin_notes SET
`status` = 'unactioned',
WHERE `name` = 'woocommerce-WCstripe-May-2023-updated-needed';
  1. Go to WooCommerce > Home.
  2. Navigate to the last alert and press the Dismiss button for the stripe message, or the action button for the generated messages. (The stripe message should navigate to WordPress home, that's expected)
  3. Go back to WooCommerce > Home and refresh the page.
  4. All the alerts should be gone.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement

Message

Fix undismissable store alert when using language localization

Comment

@github-actions github-actions bot added focus: react admin [team:Ghidorah] plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Jun 27, 2023
@nathanss nathanss self-assigned this Jun 27, 2023
@nathanss nathanss changed the title Fix/undismissable notice3 Fix undismissable store alert when using language localization Jun 27, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2023

Test Results Summary

Commit SHA: e3b15b8

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 55s
E2E Tests1900018020817m 39s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@nathanss nathanss force-pushed the fix/undismissable-notice3 branch from 143fcdc to a92da63 Compare June 28, 2023 20:27
@octaedro octaedro self-requested a review June 28, 2023 20:45
@github-actions
Copy link
Contributor

Hi @octaedro,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested well, I did leave a suggestion around your solution approach. I think it may leave a bit to much room for error.
Also might be worth creating a couple tests for this.

$actions_length = count( $localized_actions );
// Manually copy the action id from the db to the localized action, since they were not being provided.
for ( $i = 0; $i < $actions_length; $i++ ) {
$localized_actions[ $i ]->id = $actions_from_db[ $i ]->id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this will do for now, it is a bit of a dirty hack, and there is no way to know if the order of the actions are the same.
I would instead create a get_action_by_name function and add the id based on that.
Something like this: $localized_actions[ $i ]->id = Notes::get_action_by_name( $note_from_db, $localized_actions[ $i ]->name )->id ( if the action exists of-course )

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 This is still testing great, and thanks for updating the implementation, it looks great now!
Also thanks for updating the test 👍

@nathanss nathanss merged commit 408ceaa into trunk Jul 4, 2023
@nathanss nathanss deleted the fix/undismissable-notice3 branch July 4, 2023 19:54
@github-actions github-actions bot added this to the 8.0.0 milestone Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undismissable notice

3 participants