* update card header styles to match typography in @wordpress/components
* revert analytics card headers
Co-authored-by: David Levin <davidlevin@Davids-MacBook-Pro-2.local>
* Add product attributes autocomplete for Search control.
* Support single selection in Search component.
* Fix SelectControl input after selection in single mode.
* Remove label from Search component's inner SelectControl.
Placeholder is the behavior we want to avoid label and selection collision.
* Match Search component selected prop to SelectControl.
It's passed through anyhow.
* Rework attribute filter to use new endpoints for custom terms.
* Hook up custom attribute filter to report queries.
* Fix errant space in filter name.
* Fix SelectControl active status when control is disabled.
* Fix SelectControl "has tags" logic for non-multiple use cases.
* Fix attribute filter screen reader text.
* Update changelogs.
* Move custom attribute test to it's own function.
* Remove SelectControl input disabling.
This was supposed to improve keyboard behavior for non-multiple controls, but it was questionable.
* Fix backspace in attribute term field.
* Add navigation opt out script
* Check to see if opted out before loading opt out scripts
* Include opt out styles
* Close modal after clicking 'Share Feedback'
* Update to not use export default
* Add product tags and categories taxonomies to menu
* Add product attributes page
* Register product taxonomies
* Register product attribute taxonomy screens
* Move order to taxonomy item getter
* Add match expressions for product tags and attributes
* Check against wc taxonomies instead of registering wc taxonomies
* Add comments to regex match groups
* Update nav readme to include taxonomies
* Update to less ambiguous taxonomy check
* Add new product attributes endpoint that allows searching.
Including custom attributes in the results.
* Add endpoint to fetch custom attribute values by slug.
* Add initial tests for Product Attributes endpoint.
* Test Product Attribute search.
* Fix schema/params for attribute terms endpoint.
* Add tests for custom term values endpoint.
* Add a LIMIT to the attributes query.
* Add endpoint to retrieve single attribute by slug.
Fixes the 'self' link.
* Use woocommerce_admin_report_table client side filter on the CSV download
* Remove duplicated applyFilters call
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Added unregister extended task
This commit adds a method to unregister extended task when the plugin is deactivated
* Refactored task lists handling
This commit refactors the task lists handling
* Added default task type
This commit adds a default task type
* Fixed method comment
* Moved method to group objects to lib
This commit moves method to group objects to `lib`
* Refactored getUngroupedTasks method
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Create get last order function that does not rely on Wordpress user, and add test for use case
* Add change log
* Make sure tests use the right index for comparison
* Order by date_created_gmt first and order id second, and wrote test for get_last_order
* Fix test assertion, and remove unnecessary parameter
* Remove showCount prop from SearchListControlItem
* Add option to show counts in ShowListControl story
* Fix count alignment in SearchListItem with latest Gutenberg
* Add new changelog entry
* Update dated prop description
* Hide shipping cost task if user has disabled shipping
* Add countries array to dataEndpoints
* Export the presentational component so that it can be tested
* Add a test for the shipping component
* Use default expression to match items
* Pass match expression for WCA homepage
* Match post types if the current post type matches item
* Remove unused getParams
* Update tests for isMatch util
* Update nav docs
* Update default expression to match params in any order
* add query arg tests: additional and order
* Use match score based on regex matches
* Return max safe int for exact matches
* Update tests for match score
* more tests
Co-authored-by: Paul Sealock <psealock@gmail.com>
* Adding simple add_plugin_setting_item() hook that enables adding a nav item only to the Settings menu
* Adding warning when a plugin attempts to register a settings item with illegal args
* rename to add_setting_item
Co-authored-by: Paul Sealock <psealock@gmail.com>
* Add onboarding settings only if the current page is one of the WC admin pages.
* Uses screen object to detect WC Admin pages
* Removed unused variable
* Use PageController to check for the WC Admin pages -- it is more reliable
* Add onboarding settings only if the current page is home or setup wizard
* Add reset option to bin/install-wp-tests.sh
* Fix logic issues and made reset more verbose
* Add testing suite removal on reset
* Change behaviour of test install script to reset by default
* Silence install-wp-tests.sh reset commands
The wc-analytics/reports/orders and /wc-analytics/reports/orders/stats endpoints have inconsistent parameter names for filtering the customer type: customer_type vs customer.
This was affecting the Customer Type filter in the orders analytics, reported in issue woocommerce/woocommerce-admin#5803, where the component expects the parameter names to be the same. This is because it uses a parameter name based on the key in the filter configuration (customer_type).
To resolve this, this PR updates /wc-analytics/reports/orders/stats to accept both customer_type and customer as parameter names for this filter. The customer parameter has however been deprecated in its description to discourage usage.
Co-authored-by: Sam Seay <samueljseay@gmail.com>
* Added tasks extensibility
This commit addes tasks extensibility
* Fixed tests
This commit fixes the tests
* Fixed add task example
This commit fixes the add task example
* Fixed method possiblyCompleteTaskList
This commit fixes the method "possiblyCompleteTaskList"
* Fixed method getIncompleteTasks
This commit fixes the method getIncompleteTasks
* Fixed add task example
* Added callback onDismiss
This commit adds the callback for the "onDismiss"
* Added onDismiss and isDismissable to add task example
This commit adds the props "onDismiss" and "isDismissable" to add task example
* Not showing extensions task list if empty
* Fixed onDismiss callback
* Add changelog
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Sam Seay <samueljseay@gmail.com>
* Use error_log() to log the deprecated class calls instead of _deprecated_function()
* Include method name and replacement in deprecation log message.
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
* Only render nav items belonging to parent menu ID
* Set item menu ID for items automatically
* Use categories map to filter items early
* Convert categorized menus to objects
* Prevent bypassing menu via existing parent
* Fix plugins name
* style changes to tax task
* Fix undefined variable use.
* Set plugin install dismissal actions as tertiary.
* change back to variable
* add margin to primary
* text-button-styles-homescreen
* Add specificity to the task caption selector.
We need to beat out the styles from Gutenberg.
Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
* Create initial reviews panel and displaying it on the home screen
* Update reviews package to support updating and deleting reviews
* Allow custom icons to be defined for rating component
* Add approve, spam, and delete actions to home screen review panel
* Show entire list as updating when items are still in the store
* Update rating to only import the required icons, and allow icons to be passed in instead of strings
* Prune out reviews header panel, as we are not using it anymore
* Showing just a header if collapsible is false for activity panel
* Add tests for reviews panel and accordion changes
* Fix undoing a deleted item by using status - untrash
* Several styling changes to match wireframe as mentioned in PR review
* Moved review rating into the subtitle in relation to new design
* Update clear cache logic for last item
* Remove activity panel unused css
* Use invalideResolution instead of invalidateResolutionForStoreSelector
* Disable the continue button while requests are being made
* Use isUpdatingProfileItems method name for all
* Add disabled attr for the choose buttons
* Add package dependencies and bump version
* don't use lodash's noop
* Use useEffect instead of changing state right in the render :-O
* Add dependencies for ces to Loader.php
* undo add dependencies for ces to Loader.php
* 🎶 found a typo
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Display Razorpay for stores in India.
* Add Razorpay setup component.
* Remove composition with HoCs.
Refactor to use useSelect() and useDispatch() instead.
* Tweak useSelect() call.
* Allow WCA registered pages to register plugin items and categories
* Don't allow top-level item registration through WCA
* Remove is_top_level from menu API
* Prevent directly setting woocommerce as parent ID
* Don't return an action-like object in action creators.
* Add missing itemType param to setError() calls.
* Add setItem() action (singular).
* Use singular setItem() when updating product stock.
* Split setting items and totals counts into separate actions.
* Refactor totals count resolvers not to use getItems().
Fixeswoocommerce/woocommerce-admin#5294 and Automattic/woocommerce-paymentswoocommerce/woocommerce-admin#810 .
Changes:
* Update UsageModal UI to have two action buttons instead of 'Count me in' checkbox.
* Make UsageModal configurable with custom title, message and buttons text.
* Add customized modal to request site usage tracking after WC Payments KYC flow is completed.
* fix settings change enqueue params
* Include comments in score record callback
* send empty string for comments
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Refactor low stock variable to be the count instead of a boolean.
* Add initial render of the Stock panel on the homescreen.
* Move existing Stock panel to homescreen accordion.
* Ensure int value for low stock product count.
* Update ProductImage styling.
* Update stock activity car styles.
* Only show 5 low stock products.
* Add "undo" action to the stock updated snackbar.
* Fix check for explicit notice dismissal when taking actions.
* Hide now-in-stock products after updating.
By cllearing "edited" flag on successful update.
* Fetch more products after updating stock.
* Fix the number of product placeholders shown.
* Only show products placeholders on the initial fetch.
* Fix placeholder style.
* Fetch low stock count dynamically.
* Let initialOpen prop toggle Accordion panels if they haven't been toggled by the user.
* Refactor item total count state.
Allows for auto-updating item totals whenever identical queries (from a totals perspective) are issued.
* Add last order date to low stock products API response.
* Allow non-date strings in ActivityCard date prop.
* Add last order date to stock panel cards.
* Remove empty stock panel view.
* Add test file for StockPanel.
* Only request necessary fields from products endpoint.
* Add test for products fetch after stock update.
* Fix field name.
* Add test for last order date in low stock products API response.
* Stock panel should be initially closed.
* Skip updating a product if the quantity is unchanged.
* Add Customer Effort Score modal
* Add style for selected emoji
* Update modal layout to match design
* Update colors to use color studio variables
* Refactor SCSS to reduce nesting
* Refactor render logic to reduce nesting
* Add translation to strings
* Add keyboard support to emoji buttons
* Fix button misalignment
* Fix missing white space around button text
* Refactor emoji button layout with flexbox
Flexbox makes more sense to use than a grid since the buttons need only a single row or column layout.
* Refactor merge conflict resolution
Tidies up the diff by
- Using naming convention of “visible” instead of “open”.
- Restoring previous import order.
* Add comments field
* Update initial score value to undefined
* Refactor SASS selectors
* Update sendScore with comments data
* Fix comments field to display on low scores only
* Refactor by extracting modal to own component
* Add input validation
* Add tests
* Fix variable name
* Update Feedback component documentation
* Fix uneven button height
* Restore previous prop names
This ensures naming consistency with the CustomerEffortScore component.
* Update variable name for consistency
* Don't close modal if click outside it
* Rename Feedback component to CustomerFeedbackModal
* Update error message text
* Fix import name
* Fix formatting
* Update test to use mockRecordScoreCallback prop name
* Convert score to int before recording
* Clear error message when score has been selected
* Add transitions when comments field is shown/hidden
* Wrapped comments field UI text for localization
* Increase contrast ratio for focused effort score labels
Co-authored-by: Matt Sherman <matt@jam123.com>
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Use a store to render CES tracks
* Use the CES store to trigger CES survey when users change date range or single product filters.
* Support onClick event for the Compare button
* Trigger CES survey when a user clicks the Compare button on products, variations, categories, coupon, and taxes pages
* Set default text for onSubmitLabel in js and remove its requirement
* Add addCesSurveyTrackForAnalytics action so that it can be shared in other components in analytics pages -- remove duplicates
* Call addCesSurveyTrack from addCesSurveyTrackForAnalytics to avoid duplicate
* Remove 'tracks' from the method name
* Refactor menu item callback check
* Migrate parent items that have first child item migrated
* Allow wp menu items to be hidden with public method
* Rename hide menu item method
* Add order count to shared component settings.
* Hide the Orders panel when the store has no orders.
* Check for all order statuses except drafts from the checkout block.
* Update Customer Effort Score to only ask feedback from desktop users
* Add test for mobile disabling
* Update documentation
* Fix broken test
Instantiation of `CustomerEffortScoreTracks` was moved to the individual tests because it has the side effects of adding hooks in the constructor.
* Remove check for WC Services and Jetpack
As part of work to move stripe connect logic to the Stripe plugin, this removes the WC Services and Jetpack dependencies from the stripe onboarding flow in WC-Admin.
This also adds a ToS prompt to the stripe OAuth onboarding task. Because we
are removing the Jetpack and WC Services dependencies for Oauth, it is
no longer clear that data will be shared with WC. As such we need to add
this notice.
Further, this adds a link to revert to manual config so that merchants
can opt-out of sharing data with WC.
* Fixed orders panel flickering
This commit fixes the orders panel flickering when Gutenberg is activated
* Fixed badge flickering
* Removed unnecessary line
* Fixed items selector
This commit fixes the items selector. The method 'getItemsTotalCount' was returning the 'defaultValue' instead of the 'totalCount' when its value was 0
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Fixed Link component prop
This commit fixes a Link component prop name
* Fixed Link prop
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Restore composer install on WooCommerce plugin
Previously removed in c26db640d6
* Remove direct require of wc-install.php
In some contexts, this causes phpunit to halt because of the early exit call in wc-install.php:
defined( 'ABSPATH' ) || exit;
* Add temporary composer 1 downgrade before installing WooCommerce
* Add support for an explicit dismiss button to snackbar, as well as an onDismiss callback
* Fix effect dependencies
* Fix disabling auto-dismiss when explicit dismissing is on, fix cursor styles
* fix noops and dismiss on action
* refactor action click handler
* rename dismiss button class
* increase CES modal placeholder z index
* white. space.
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Allows tabs component to render custom tab components, removing the need for showDisplayOptions
* Add display options logic to getTabs function
* Update const name from PR review suggestion
* Add an icon to the snackbar displayed for CES
* Change icon from SVG to a unicode emoji pencil
* formatting changes to satisfy CI
* bump ci
* Fix prop types and jsdocs for the customer effort score component
* whitespace >:-(
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Update Woo tested and min versions.
* Update Woo tested and min versions.
* Load the installer class in bootstrap.
Co-authored-by: Sam Seay <samueljseay@gmail.com>
* Match settings to mode of provided keys
* Add validation error for mismatched mode edge case
* Tweak key validation error message for conciseness
* Add test mode case to method's isConfigured check
* Refactor stripe method isConfigured logic for clarity
* Fix small error message typo
* Change rendering of homescreen layout so store links are last.
* Render in left column in 2 column mode.
* Revert accidental log changes.
* Make homescreen layout component width-aware.
Potentially toggle the two column styling when viewport width changes.
Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
* Trigger CES on the settings page when settgins get updated
* Added base test case for the CES class
* Update comments for the test
* Fix failing test -- moved down setup code after parent::setUp() so that the parent setUp runs first
* Fix coding standard
* Rename add_actions to enable_survey_enqueing_if_tracking_is_enabled and include admin_init action call in the method
* Show help tab always on homescreen, update help icon, and fix tests
* Add items to help menu for homescreen, when taskName is blank
* Add test for homescreen items when taskName is blank
* Add or case for showing help for performingSetupTask, incase setup happens on annother route
* Removed tabindex logic to allow for keyboard navigation when multiples tabs are available
* Update activity panel height and top when new navigation experience is enabled
* Moved style back into scss wrapper and used parent selector - &
* Adding ability for new navigation to scroll when list of links exceeds the viewport height
* Resetting scroll to the top of element when transitioning menus on navigation
* Migrate homescreen specific backend code to its own class.
* Default to single column homescreen.
Create an option to handle the default homescreen layout value.
* Potentially reset sticky column when layout is changed.
* Move homescreen components to their new locations.
* Clean up defunct CSS.
* Default to the two-column layout on existing stores.
* Remove header from inbox notes.
* Add "your store today" header on two column homescreens.
* Set default homescreen layout to two columns when task list is complete or hidden.
* Remove unused variables.
* Add sticky scrolling behavior to both homepage columns.
* Added support for custom actionable statuses
This commit adds support for custom actionable statuses
* Fixed styles
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Create separate methods for registering plugin items
* Fix add plugin category
* Allow scrolling of nav menu
* Use group title
* Add example plugin items
* Make menu item and category methods private
* Add analytics pages to navigation
* Register home item if dashboard feature is enabled
* Allow navigation registration from all wca items
* Update example plugin item registration
* Update order of menu groups
* Update plugins group name to extensions
* Remove temporary scroll fixes
* Spike out customer effort score
* Refactor CustomerEffortScore as Package (https://github.com/woocommerce/woocommerce-admin/pull/5342)
* Use an interstitial snackbar to trigger the CES modal
* Moved notice (snackbar) into @woocommerce/customer-effort-score
* Tidy up _webpack.config.js
* Fix linter issues
* refactor setting up CES tracking, add try..catch around loading from localStorage
* Add CES feature toggle (https://github.com/woocommerce/woocommerce-admin/pull/5387)
* Add feature toggle to only enable the customer effort score in development
* Move check into Loader
* fix logic 🙄
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add client-side check of the feature flag
* fix tabs in config
* Fix comment
* Use product lifecycle and options
* Add product count to tracks props
* Use Loader::load_features instead of DIY
* drop initiallyVisible from container
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
* Spike out customer effort score
* Refactor CustomerEffortScore as Package (https://github.com/woocommerce/woocommerce-admin/pull/5342)
* Tidy up _webpack.config.js
* Fix linter issues
* refactor setting up CES tracking, add try..catch around loading from localStorage
* Add CES feature toggle (https://github.com/woocommerce/woocommerce-admin/pull/5387)
* Add feature toggle to only enable the customer effort score in development
* Move check into Loader
* fix logic 🙄
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add client-side check of the feature flag
* fix tabs in config
* Fix comment
* Use product lifecycle and options
* Add product count to tracks props
* Display CES modal once per event per store
* Remove TODO
* appease the formatting gods
* Use Loader::load_features instead of DIY
* Drop CustomerEffortScoreTracks singleton
* Fix tracks event name
* Only add the CES JS if tracking is allowed
* Only display the CES modal if tracking is allowed
* bump ci
* Pull package-lock.json from main
* Refactor to remove some duplication
* Revert to keep toggleVisible etc
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
* Spike out customer effort score
* Refactor CustomerEffortScore as Package (https://github.com/woocommerce/woocommerce-admin/pull/5342)
* Tidy up _webpack.config.js
* Fix linter issues
* refactor setting up CES tracking, add try..catch around loading from localStorage
* Add CES feature toggle (https://github.com/woocommerce/woocommerce-admin/pull/5387)
* Add feature toggle to only enable the customer effort score in development
* Move check into Loader
* fix logic 🙄
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add client-side check of the feature flag
* fix tabs in config
* Fix comment
* Use product lifecycle and options
* Add product count to tracks props
* Display CES modal once per event per store
* Remove TODO
* appease the formatting gods
* Use Loader::load_features instead of DIY
* Drop CustomerEffortScoreTracks singleton
* Fix tracks event name
* bump ci
* Pull package-lock.json from main
* Refactor to remove some duplication
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
* Adding base styles for collapsed nav menu.
* Handling varying behaviour on mobile-sized screens, with the menu overlaying content instead of shrinking the content area.
* Folding the menu by default on screen sizes less than 960px, and if that condition is met after an orientation change
* Refactoring logic from Header/index.js to flag if user has scrolled to apply shadow to folded navigation as well.
* Refactoring styles in navigation feature to allow them to be loaded properly with webpack (with imports/etc).
* Spike out customer effort score
* Refactor CustomerEffortScore as Package (https://github.com/woocommerce/woocommerce-admin/pull/5342)
* Tidy up _webpack.config.js
* Fix linter issues
* refactor setting up CES tracking, add try..catch around loading from localStorage
* Add CES feature toggle (https://github.com/woocommerce/woocommerce-admin/pull/5387)
* Add feature toggle to only enable the customer effort score in development
* Move check into Loader
* fix logic 🙄
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add client-side check of the feature flag
* fix tabs in config
* Fix comment
* Use product lifecycle and options
* Add product count to tracks props
* Use Loader::load_features instead of DIY
* Only show the CES survey in the correct screen
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
* Spike out customer effort score
* Refactor CustomerEffortScore as Package (https://github.com/woocommerce/woocommerce-admin/pull/5342)
* Tidy up _webpack.config.js
* Fix linter issues
* refactor setting up CES tracking, add try..catch around loading from localStorage
* Add CES feature toggle (https://github.com/woocommerce/woocommerce-admin/pull/5387)
* Add feature toggle to only enable the customer effort score in development
* Move check into Loader
* fix logic 🙄
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add client-side check of the feature flag
* fix tabs in config
* Fix comment
* Use product lifecycle and options
* Add product count to tracks props
* Use Loader::load_features instead of DIY
* Only display the CES modal if tracking is allowed
* Move MONTH constant into @woocommerce/data
* Remove unused const
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
Composer 2 utilizes stricter conventions, so this fix involved repairing the namespace for the Navigation class, and adding a mechanism to load features that are contained within subdirectories.
* Spike out customer effort score
* Refactor CustomerEffortScore as Package (https://github.com/woocommerce/woocommerce-admin/pull/5342)
* Tidy up _webpack.config.js
* Fix linter issues
* refactor setting up CES tracking, add try..catch around loading from localStorage
* Add CES feature toggle (https://github.com/woocommerce/woocommerce-admin/pull/5387)
* Add feature toggle to only enable the customer effort score in development
* Move check into Loader
* fix logic 🙄
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add client-side check of the feature flag
* fix tabs in config
* Fix comment
* Use product lifecycle and options
* Add product count to tracks props
* Use Loader::load_features instead of DIY
Co-authored-by: Rebecca Scott <me@becdetat.com>
Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
* Added Accordion component
This commit adds an Accordion component to our available components
* Refactored Accordion component
* Added new Accordion component to index
* Fixed a few Accordion details
* Accordion fixed
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Update dependencies in prep for Composer 2.x.
* Rollback jetpack autoloader update.
* Restore range versions for composer dependencies, regenerate lock with Composer 1.x.
* Fix PSR-4 Classes (https://github.com/woocommerce/woocommerce-admin/pull/5473)
* PSR-4 class names need to match their filename.
Remove underscores in classnames.
* Fix reported class name in deprecation notice.
* Fix comments.
* We don't need composer dependencies in core WC test setup.
* Update composer lockfile using version 2.x.
* Temporarily turn off error display.
Function deprecation notices are breaking tests.
* Change WooCommerce Card to WordPress Card in the WelcomeCard component.
Use isElevated and margin-bottom to make the Card look close to previous UI.
* Use WordPress Card in KnowledgeBase.
For the description in Card header, it will be rendered as a p element instead of h2, which should be more semantically correct. Test is updated to reflect this.
* Add Card component wrapper that supports title and description props.
* Use WordPress Card component wrapper in recommended extensions.
* Code refactor to use WordPress Card wrapper.
* Use WordPress Card wrapper in installed extension.
* Use margin-bottom for children layout at the parent CSS level.
* Add test for Card.
* Fix no margin between cards in Coupons page, and remove previous css for WooCommerce Card.
* Remove old WooCommerce Card css.
* Don't use isElevated in Card, to match the style in WooCommerce Home screen.
* Make item border color consistent with WordPress Card in Installed Extension card.
Use WordPress Card without CardBody here because we don't want the padding from CardBody.
* Make the card description look similar to previous WooCommerce Card description.
* Fix spelling in CSS class names.
* Fix WooCommerce spelling in comment.
* Change the Marketing Card style to match with WooCommerce Home style.
Also change the text gray color to use CSS variable instead of hardcoded gray value.
Also remove the usage of h2 in the Card header to follow WooCommerce Home style.
* Use $gray-200 as light borders between items in card.
* Remove unneeded CSS code based on TODO in comment.
* Display a "read blog" message when there is an error in getting blog posts or there is no blog posts.
* Simplify ReadBlogMessage with interpolateComponents and Link.
* Adding 'has_navigation' flag to tracks pageView events to indicate if new navigation is enabled (https://github.com/woocommerce/woocommerce-admin/pull/5332)
* Testing if navigation is active using window.wcNavigation instead of window.wcAdminFeatures to handle the edge case of a single page opting out
* Remove inbox-specific class, widen single column.
* Create user preference for homescreen column layout.
* Add display options "tab" to homescreen.
* Style display options.
* Tweak homepage layout option values.
* Add tracks events for homepage layout.
* Add test coverage for homescreen display options.
* No need to use Fragment component.
* Use named exports.
* Fix display options styling on mobile/narrow viewports.
Don't show the options at all if we're forcing single column.
* Fix linting error.
Switches the WCPay inbox note from no URL to an action param admin URL. This allows redirecting to the next setup step after allowing installation & activation to complete (instead of stalling on busy state). Adding a ToS message enables navigating directly into the WCPay onboarding flow.
Co-authored-by: James Rodger <james.rodger@automattic.com>
Co-authored-by: Vasily Belolapotkov <belolapotkov.v@gmail.com>
* Move data store to package and hydrate navigation
* Use wc settings to get site URL and title
* Use wc settings admin link
* Update nav util tests to work with installs in subdirectory
* Code refactor with reducer and new action type SET_ERROR.
* Add default state for errors and code for SET_ERROR for blogPosts.
* Don't use handleFetchError, instead save the error and blogPosts category into redux store.
* Display message for error and empty content.
* Fix grammar; fix relevant test.
* Code refactor: put action type strings in one place.
* Add tests for error UI.
* Remove illustration for empty content with no blog posts.
This commit adds an array casting after getting "woocommerce_onboarding_profile" option.
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
TODO comments are an established practice in this repo, with ~100 occurrences. This removes the warning in our PHP linter about it. This warning was blocking some Git commits being made due to the linting in the pre-commit hook.
* Add URLs to categories to assist migrating items
* Migrate items when URL matches callback
* Check if nav is enabled before adding extra marketing menu
* Unset URLs on categories after migration
* Migrate leaderboard tests to RTL.
* Remove test of default prop value.
* Migrate ReportSummary tests to RTL.
* Migrate ActivityCard tests to RTL.
* Migrate ActivityCardPlaceholder tests to RTL.
* Migrate remaining ProductType tests to RTL.
* Migrate Card tests to RTL.
* Update RTL and user event packages.
* Migrate Date tests to RTL.
* Migrate D3Legend tests to RTL.
* Migrate D3Base tests to RTL.
* Migrate Gravatar tests to RTL.
* Migrate ImageUpload tests to RTL.
* Migrate ProductImage tests to RTL.
* Migrate Rating tests to RTL.
* Migrate Search tests to RTL.
* Migrate Plugins tests to RTL.
* Migrate SelectControl tests to RTL.
* Migrate Timeline tests to RTL.
Remove tests that inspect DOM since there are snapshots.
* Migrate DismissModal tests to RTL.
* Migrate SetupNotice tests to RTL.
* Migrate WelcomeCard tests to RTL.
* Fix setup error reason retrieval in ShippingBanner.
* Migrate ShippingBanner tests to RTL.
* Migrate RecommendedExtensions tests to RTL.
* Migrate KnowledgeBase tests to RTL.
* Rename enzyme setup file, modify to setup RTL.
* No need to import jest-dom in test files.
* Remove enzyme dependency.
* Use snapshot for testing Leaderboard markup.
* Switch from "not to be empty" to "be in the document".
* No need to waitFor() recordEvent mock.
* Be specific about clicking the "hide" button.
* Use toBeVisible() instead of checking style property.
The theme selection page e2e test is intermittently failing and it
is not clear why. It could be that there is a failure going from
the last setup step to this one because the selectors for this
step are ambiguous and could refer to anything.
This specifically waits for an element that is unique to the
theme selection screen in the hope of removing ambiguity.
* Preventing the legacy coupons page from being readded when the navigation plugin is active (woocommerce/navigation woocommerce/woocommerce-admin#122)
I've also added a check to prevent the "coupons page has moved" note from being displayed, since it's no longer applicable in the new nav.
* Addressing linting issues with PHP files
* Updating conditions to work correctly with navigation as feature instead of external plugin
* Updating comment text
* Rename admin notes classes and file names to fit conventions
* Use a facade class that adds deprecation warnings to each function call
* Add "Manage orders on the go" admin note
* Remove a rebase zombie 🙀
Co-authored-by: Rebecca Scott <me@becdetat.com>
* is_feature_enabled
* feature class
* copy/paste
* hooked up
* its alive
* add wc-admin items
* clean up entry point
* Analytics remove url
* rebase error
* add back in check is_feature_enabled
* specificity CSS
* Require Jetpack connected and WCS active to mark the shipping task as complete
* Require country _not_ be in AU, NZ, or UK to mark shipping methods as complete
* Bump CI
Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit invalidates the cache for "getTasksStatus" to force a rerequest of the value.
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Add note to confirm automated tax settings
* add back automated_tax_is_supported function
* Trigger CI
Co-authored-by: Rebecca Scott <me@becdetat.com>
This updates the Stable tag line in readme.txt to use a CRLF style line ending. This makes it consistent with the rest of the file and fixes “mixed line ending” type error messages when opening.
Removing breadcrumbs from wc-admin header, replacing with simple title (https://github.com/woocommerce/woocommerce-admin/pull/3963)
This is an interim step towards the integration of wc-navigation, where a back button will be provided to restore the critical functionality of the breadcrumbs. Note that the `breadcrumbs` data was preserved since it's still being utilized do construct the document title (in semi-breadcrumb-fashion) on both the backend and front-end.
* Don't auto generate chunk names.
This should make SVN diffs much easier to navigate for WP.org deploys.
* Include script version parameter in async chunk requests.
* Add version parameter to CSS chunks.
* Declare the note constants on the deprecated class.
This avoids triggering PHP errors when third party code references the old class constants.
* Remove deprecation notices and return the call result
* Restore deprecated notices.
* Avoid magic strings.
* Pass WC_Admin_Note constructor argument to migrated class.
* Allow subclasses to access the facade class instance.
Co-authored-by: Rebecca Scott <me@becdetat.com>
Updating Stripe key field validation to support test keys (https://github.com/woocommerce/woocommerce-admin/pull/4391)
Currently the form to configure Stripe keys accessed via the task list presents an error when test keys are used. I've updated the validation in order to support the format for test keys as well.
* Added filter to selected industries list
This commit adds a filter to the selected industries list
* Fixed lint error
* Fixed lint issues
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Fixed small text in OBW
This commit makes some OBW texts larger
* Fixed list items size
This commit makes the list items in the 2nd step of the OBW larger
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Rename admin notes classes and file names to fit conventions
* Use a facade class that adds deprecation warnings to each function call
* Tidy up after rebase
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add initial Variations Report to analytics feature.
* Restrict query to variations when not specifying any product IDs.
* Add route to get variations without specifying a parent.
* Move variations table component to variations report directory.
* Add missing LIMIT clause to variations report query.
* Remove broken features from Variations table.
* Add Variations report controller to CSV emailer.
* Add initial Variation Stats endpoint, based on Product Stats.
* Hook Variations Report components up to new stats endpoint.
* Hook attribute filter up to variations report queries.
* Remove variation title filter usage.
See: https://github.com/woocommerce/woocommerce-admin/pull/5100
* Use filtered separator in variation name formatting.
* Add "single variation" to variations report, fix autocompleter API request.
* Fix segmentation by variation.
* Add comparison to variations report.
* Always include manually specified variations in report results.
* Fix variations report table comparison mode.
The ReportTable component expects the `filter` query param.
* Fixing styling of compare button without table search component.
* Add variation filter to Orders report.
* Link orders count to orders report filtered by variation.
* Orders report: include variation attributes in product names.
* Further style tweaks for variations report download button.
* Add variations filter to order stats query.
* Clean up "category includes" login in REST controllers.
Prep for "category excludes" in the Variations report.
* Support category exclusion in report filters.
* Fix filter param used by the variation report table component.
* Add category filter to variations report.
* Fix initial selected ReportTable rows when using non-default compareParam.
* Add a new autocompleter for variable products.
* Add products filter to variations report.
* Fix tests.
* Handle variation IDs that are no longer found.
* Add documentation.
* Use getSetting() instead of directly accessing window properties in client code.
* Fix ordering Variations by SKU.
This commit changes the "Skip setup wizard" button text to "Skip setup store details"
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Fixeswoocommerce/woocommerce-admin#4443
Some investigation found that woocommerce/woocommerce-admin#4443 is no longer a reproducible issue. Why this issue no longer exists is not clear, but it makes sense now to disable the store registration checks as they are only called once. This PR just removes the checks but does not change any other behaviour.
* Reduced list padding
This commit reduces the industries list "padding" and its "min-height"
* Removed item from industries list
This commit removes the item "Art, Music & Photography" from the industries list
* Fixed e2e tests
This commit fixes the e2e tests
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
The marketplace suggestions opt-out is now used to determine if remote inbox notifications should be fetched. This corresponds to the
`woocommerce_show_marketplace_suggestions` WP option.
Additionally, a new protected method is added to the class. This provide a series of checks for whether remote notifications are enabled on the site.
* One-shot to enable the homescreen for everybody
* Make the home page the default (only) experience
* remove option check in activity panel tabs, get tests working, fix lint issues
* Remove is-homescreen CSS class
* Remove extra home page route registration
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Add option to not set up sales tax
* Correct JS lint errors
* Add abort option to plugin step
* Inline redirect to home page
* Use testing-library/react for the new test
* Also set woocommerce_calc_taxes to 'no'
Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit modifies the connection check for the note 'wc-admin-wc-helper-connection'
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Remove the chevron icons from the “Finish setup” task list
* Add a data-testid attribute to the TaskDashboard dismiss button for testing
* Add test for dismiss button in TaskDashboard component
* Remove use of `woocommerce_product_variation_title_include_attributes` filter.
* Use attribute values in product variation titles.
* Include attribute values in product variation name during segmentation.
* Include attribute values in product variations autocompleter query.
* Add product attribute filter to Orders report config.
* Add attribute args to Orders report controller.
* Include attribute filters in orders report query.
* Add attribute args to Orders Stats report controller.
* Include attribute filters in orders report stats query.
* Add test for product attribute filter in orders report.
* Add tests for invalid parameter values.
* Add tests for product attribute filter in order stats endpoint.
* Fix tests for PHP 5.6 and WC 3.8.x.
* Refactor filter input row into component.
* Support multiple filter value in "add filter" list.
* Refactor out one-off updateFilter() callback.
* Use array index to remove filters.
Also create unique keys for multiple value filters.
* Use numeric index instead of filter "key" for change callbacks.
* Maintain unique keys for multiple filter components.
This avoids rerenders when filters are removed.
* Calculate instance numbers in constructor.
* Support advanced filter instances in navigation helper methods.
* Add allowMultiple to advanced filters README.
* Fix tests.
* Add test cases for multiple filter instances.
* Handle missing attribute names and terms in screen reader text.
* Fix perpetual loading indicator when there are no attribute terms.
* Handle new boolean case when generating screen reader text.
* Handle multiple filter instances when creating report queries.
* Remove unused variables.
* Update Shipping Banner to use installPlugins since installPlugin has been removed.
* Fix shipping banner compatibility with WCS 1.24.
* Update metabox content to match WC 4.5 metaboxes.
* Add monthly pricing toggle
* Move product type label to its own folder
* Add popover to product type label
* Add card help text
* Add product type component tests
* Add tests for product types step
* Refactor validation in product types
* Export ProductTypes component for testing
* Simplify variation name logic.
* Remove errant commas from variation autocomplete options.
* Add single variation filter to products report.
* Include more variations in search results.
Also trim the response fields down.
* Add initial AttributeFilter component.
Only selected of attribute names for now.
* Add attribute term selection control.
* Position attribute filter inputs side by side.
* Add loading indicator to attribute term control.
* Clear term when attribute value changes, and handle backspaces.
* Generate screen reader text.
* Translate filter labels, add field separator.
* Improve grammar in screen reader text.
* Fix lint errors.
* Add error logging to remote inbox notifications data source poller
* Change DataSourcePoller to use WC_Logger
* Remove test feed
* Tidy up log messages
Co-authored-by: Rebecca Scott <me@becdetat.com>
Fixeswoocommerce/woocommerce-admin#4464
`wcadmin_tasklist_shipping_label_printing` events were being filtered into rejected events because the data being passed was in camel case instead of snake case. This fixes that issue.
* Remove store page creation during new onboarding experience
* Remove onboarding feature flag
* Add back in onboarding feature flag to enable feature loading
* Add onboarding task status API endpoint.
* Add task status to onboarding data store.
* Update appearance task to use onboarding store for status info.
* Update main task list component to use onboarding data store for status info.
* Clear onboarding status info "cache" when setting shipping rates in the task list.
* Clear onboarding status info "cache" when enabling payment methods from the task list.
* Fix onboarding data store reducer tests.
* Clean up redundant code, nest task status settings under new key for hydration.
* Include tasks status in onboarding data hydration.
* Update tax task to use onboarding data store for status info.
* Avoid continually rehydrating onboarding data.
* Refactor payment task method retrieval to use onboarding data store.
* Fix bug with disappearing appearance tax steps.
* Update appearance completion faster by using hydrated onboarding value.
* Avoid PHP warnings when onboarding isn't enabled.
* Remove unused imports.
Working towards woocommerce/woocommerce-admin#4654 this refactors the `<Header>` component to be functional so that it can use hooks. The plan is to use the `useUserPreferences` hook there to determine if the mobile banner should be rendered or not.
This uses a generator action and hooks to reimplement the CTA as a more
simple and logicless component, with most of the logic now in the
HOC component.
* Add export ID to success response and fix typos in endpoint schema.
* Initial export data store.
Allows for starting export, but not checking progress.
* Use new export data store in analytics report tables.
* Remove defunct report export wc-api files.
* Apply review feedback from another wp.data PR.
* Use getResourceName() util for more DRYness.
* Fix linter error.
* Add response status code to fetchWithHeaders control.
* Use HTTP status rather than response body to determine success.
* Fix tests.
* Remove unused import from actions.
* Move controls to data package root
* Add reports data store in wp data
* Move report utils to data package
* Update error state and actions to match existing methods
* Update references to reports data store
* Add error setters
* Fix control registration path
* Add reports reducer tests
* Remove remaining report wc-api references
* Handle PR feedback
* reference packgage, not lib/date
Co-authored-by: Paul Sealock <psealock@gmail.com>
* Delete customer lookup rows when their corresponding user is deleted.
* Asynchronously delete users from customer lookup table.
* Add user deletion test case.
* Fix user deletion test.
* Add initial notes data store using wp data
* Cache individual note queries
* Update notes undo endpoint to batch update endpoint
* Allow batch updates of notes
* Add requesting state
* Update components to use new note store
* Remove old notes store from wc-api
* Get note IDs from json and validate data in REST API
* Add an updating state to each note
* Throw errors in actions so they can be caught by client
* Add store reducer tests
* Handle PR feedback
* Fix failing tests
* Don't set inbox panel visibility while batch updating
* Move woocommerce block to external dependencies
Recently there have been significant slowdowns
of the test suite in Jest. I frequently had the test suite
taking 130-150 seconds to run.
After some exploration and trial/error I found that
https://github.com/facebook/jest/issues/9457 is likely the cause.
This was confirmed after the downgrade where I saw test runs drop
to an average of about 35 seconds per run.
* Fix industry args type in REST API
* Only allow object for industry param
* Fix onboarding industry object shape in test case.
Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
* Don't require package tag or file comment inside src
* Removed package tag from files inside src
* Fixed tests directory in phpcs.xml.dist
* Fixed usage of package tag
* Fixed new classes
* Fixed coding standards
* Fixed coding standards in tests
* Remove task list payment actions
* Check that the payments task has been marked complete in checkout note
* Track payments completion via enabled gateways
* Allow toggling to unfinish task when no payments enabled
* Set up profile completed action
* Stub out the steps
* Only run if Jetpack is installed and connected
* Return if WCS isn't active
* Return unless physical is selected as a product type
* Return if there are existing shipping zones
* Shipping labels are enabled when WCS is installed
* Set up free local shipping
* Comment for the profiler complete action
* By default there is no international/catch-all shipping method set up
* Add review shipping settings note
* Record tracks event
* Fix logic
* Add unit test around setting up free local shipping
* Rename some functions
* Use countries service to get all countries
* Drop duplicated possibly_add_note()
* Check the old value when determining if the profiler has completed
* Fall back to country code if country name doesn't exist
* Use admin_url fn to build up URL
Co-authored-by: Rebecca Scott <me@becdetat.com>
* scaffold out reviews store
* hook up dataStore
* get controls working
* getReviews working
* get count working
* get errors working
* indicators working
* reducer tests
* reviews
* Remove wc-api
* cleanup
* better way to fetch with headers
* add comment with issue
* better resolver
Fixeswoocommerce/woocommerce-admin#4592
This adds the functionality to support a store setup tab displayed in ActivityPanel. The tab currently just redirects to the home page, rather than implementing the nice-to-haves of displaying the task list in the panel. The reason for this, is that I found it would require significant refactoring of the task list to support this currently.
As part of this I have also refactored rendering of tabs inside into 2 new functional components: <Tabs> and <Tab>. The reason for this is to decompose large untestable components, test them and by virtue of being decomposed they will also be more reusable in future. Ideally would have been refactored to a functional component as well, but it would have been too large a task.
Fixeswoocommerce/woocommerce-admin#4590
This implements a paged modal via the Gutenberg Guide component. Some styling adjustment was needed to match the designs exactly.
This also introduces 3 SVG based illustrations for display in the modal. According to this comment there is a need to color them based on the theme at some point, but based on a current lack of requirements for that, I felt that could be done at a separate time (that was suggested in the comment as well).
* Require the correct autoloader file.
* Include composer file when updating version numbers.
* Add notice for development builds not using JETPACK_AUTOLOAD_DEV.
* Only bump version numbers when preparing a release.
* Added personalization to purchase extension task
This commit adds personalization to purchase extension task
* Removed unnecessary naming fix
This commit removes an unnecessary naming fix
* Corrected param description
* Solved translation problem
* Naming corrected
The method 'getGroupedOnboardingProducts' was given a more accurate name.
* Modified string substitution
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* add new woocommerce/eslint-plugin
* implement eslint-plugin (switch scripts to use wp-scripts etc)
* various linting fixes
* more lint fixes
* improve fix script
* more eslint fixes
* more eslint fixes
* temporary convert rules to warnings until they are all handled
* linting fixes
* update package-lock.json
* remove duplicates
* remove unnecessary `@wordpress/dependency-group` rule config
* add docs and adjust rules
* prettier fix
* fix merge artifact
* convert more rules to warnings
* change order to reflect importance
* install babel-preset-default
* remove unnecessary configuration for babel
* fix dependency group rule and test
* fix test
* handle collapsible whitespace
* add react testing library eslint plugin
* linter errors
* Add back in prettierrc
* package-lock update
* js lint fix with --fix
* disable whitespace in translation
* package-lock update
* make eslint actual dependency, not peer dependency
* pin eslint to v7
* I don't know why, but its working
* fix lint js
Co-authored-by: Paul Sealock <psealock@gmail.com>
* Lint detail solved
This commit resolves a small lint warning in the file Loader.php
* Removed "profiler" from menu
This commit removes the item "profiler" from the menu.
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Added Test Checkout note
This commit adds a note to test the checkout process
# Conflicts:
# src/Events.php
# src/FeaturePlugin.php
* Replaced method "site_url" with "wc_get_page_permalink"
* Removed products with state draft verifcation from "check_task_completion"
This commit modifies the code to not set the products task list item as done when they have state draft.
* Added published date control
This commit adds a product published date control to the note
* Half-hour calculation changed
* Typo error corrected
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Use sanitize_text_field instead of sanitize_title_with_dashes to clean up the theme name during theme activation and installation. Remove another sanitize_title because it also need to allow non-lowercase slug as well. Use the sanitized theme name as slug for:
- Checking whether current theme is allowed to activate
- Checking whether current theme is one of installed theme
- Slug of theme on Onboarding::get_theme_data() method.