Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Rename to store notices
Browse files Browse the repository at this point in the history
  • Loading branch information
albarin committed Jan 11, 2023
1 parent f2d8f93 commit 0c09df4
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "woocommerce/notices",
"name": "woocommerce/store-notices",
"version": "1.0.0",
"title": "WooCommerce Notices",
"description": "Display notifications as customers interact with the store.",
"title": "Store Notices",
"description": "Displays shopper-facing notifications generated by WooCommerce or extensions.",
"category": "woocommerce",
"keywords": [ "WooCommerce" ],
"supports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*/
import { __ } from '@wordpress/i18n';

const Notices = () => {
const StoreNotices = () => {
return (
<div className="woocommerce-notice">
{ __( 'This is a demo notice.', 'woo-gutenberg-products-block' ) }
</div>
);
};

export default Notices;
export default StoreNotices;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface Attributes {
const Edit = ( { attributes }: BlockEditProps< Attributes > ) => {
const { className } = attributes;
const blockProps = useBlockProps( {
className: classNames( 'wc-block-notices', className ),
className: classNames( 'wc-block-store-notices', className ),
} );

return (
Expand Down
2 changes: 1 addition & 1 deletion bin/webpack-entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const blocks = {
},
'filter-wrapper': {},
'customer-account': {},
notices: {},
'store-notices': {},
};

// Returns the entries for each block given a relative path (ie: `index.js`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
use Automattic\WooCommerce\Blocks\Utils\StyleAttributesUtils;

/**
* CatalogSorting class.
* StoreNotices class.
*/
class Notices extends AbstractBlock {
class StoreNotices extends AbstractBlock {

/**
* Block name.
*
* @var string
*/
protected $block_name = 'notices';
protected $block_name = 'store-notices';

/**
* Render the block.
Expand All @@ -36,6 +36,6 @@ protected function render( $attributes, $content, $block ) {

$classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes );

return "<div class='wc-block-notices " . esc_attr( $classes_and_styles['classes'] ) . "' style='" . esc_attr( $classes_and_styles['styles'] ) . "'>" . $notices . '</div>';
return "<div class='wc-block-store-notices " . esc_attr( $classes_and_styles['classes'] ) . "' style='" . esc_attr( $classes_and_styles['styles'] ) . "'>" . $notices . '</div>';
}
}
2 changes: 1 addition & 1 deletion src/BlockTypesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected function get_block_types() {
'ProductQuery',
'FilterWrapper',
'CustomerAccount',
'Notices',
'StoreNotices',
];

$block_types = array_merge( $block_types, Cart::get_cart_block_types(), Checkout::get_checkout_block_types() );
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/specs/backend/notices.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { visitBlockPage } from '@woocommerce/blocks-test-utils';
import { insertBlockDontWaitForInsertClose } from '../../utils.js';

const block = {
name: 'Notices',
slug: 'woocommerce/notices',
class: '.wc-block-notices',
name: 'Store Notices',
slug: 'woocommerce/store-notices',
class: '.wc-block-store-notices',
};

describe( `${ block.name } Block`, () => {
Expand Down

0 comments on commit 0c09df4

Please sign in to comment.