Fixeswoocommerce/woocommerce-admin#4732
This updates `@wordpress/base-styles`, and because `@wordpress/components` depends on variables from it, that must be updated as well.
There are 3 major changes required as part of updating:
1. The $theme-color variable is no longer exposed by base-styles. Instead there are 3 css vars exposed. These are made available by use of a provided mixin. Situations where $theme-color was darkened using scss have been mapped as best as possible to the 2 other darkened shades of the css var that are available such as `--wp-admin-theme-color-darker-20` and `--wp-admin-theme-color-darker-10`. In some cases this means the colors are not exactly the same as before.
2. The post css `theme()` call is no longer available. All uses of this have been consolidated to use of the main theme css var `--wp-admin-theme-color`. This means that calls like `theme(secondary)` or `theme(outline)` etc have all been consolidated to the one color.
3. Many of the variables used for different shades of gray have been deprecated. These have been mapped across to the new gray variables. (Mapped according to the list described in woocommerce/woocommerce-admin#4732)
* Add initial (rough) help panel.
Only includes "products" task items.
* Add help links for other tasks.
* Add header to help tab content.
* Toggle activity panel tabs when performing a setup task.
* Move query string parsing up a level.
* Pass query string as prop to ActivityPanel.
Fixes rerendering issue when entering a task.
* Pass current task to Help panel.
* Filter payments task help items by available payment methods.
* Filter shipping and tax help items based on WCS install.
* Add generic docs link to all help panels.
* Track help panel open.
* Track help panel link clicks.
* Show WCS help items when prompted to install.
* Tasks are only performed on the main route.
E.g. no value for "path".
* Small tweaks to make AcivityPanel more easily testable.
* Add initial tests for ActivityPanel tab logic.
* Modify HelpPanel component for easier testing.
* Add tests for conditional help panel links.
* Fix tracking keyboard "clicks" on help links.
* Fix query prop on embedded pages.
* Allow filtering of help tab items.
* Preventing refresh after answering a survey note
This commit adds the code necessary to prevent a webpage refresh after answering a survey note.
* Modified `action` URL check
This commit refactors the check we do for the action URL.
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Added event prop to be recorded
This commit adds the event prop `screen` to `wcadmin_wcadmin_inbox_action_click`
* Getting screen name from referer
Now the we get the screen name from the referer
* The screen name is not being sent anymore to the API
The screen name is not sent anymore to the API. Also, the $screen_name is set as empty in the API to make the method more defensive.
* Created method `get_screen_name`
This commit moves the code related to getting the screen name to a specific method.
* Added screen name recording for individual posts
This commits adds screen name recording for individual posts
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Fix: Actioned inbox notifications now are visible
This commit fixes the actioned inbox notifications, now they are always visible.
* Fixed getUnreadNotes method
This commit fixes the getUnreadNotes method since it was returning the wrong information.
* Added two @todo
This commit adds two @todo referring to a few changes to do after implementing pagination
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Add Insight note
* Change actioned_label to actioned_text
* Move actioned text up a level
* Fix comment
* Rename insight class
* Add deny action to insight first sale and fix the button actions
* fix spacing
* Tweak conditions in the inbox card
Co-authored-by: Rebecca Scott <me@becdetat.com>
* Dismiss dropdown styles fixed
This commit fixes the "Dismiss" dropdown styles
* Text color replaced in Dismiss dropdown
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Initial user preferences custom hook (wc meta).
* Organize dependencies.
* Specify dependencies in useSelect() call.
* Remove specifying preference keys.
There's currently no performance benefit to be had.
* Add HoC for hydrating current user data.
* Add user prefs update method.
* Export user prefs hook and HoC in data package.
* Handle error condition when updating user preferences.
* Use closure to get user ID for prefs update.
* Refactor analytics dashboard to use new user hook.
* Refactor ReportTable component to use new user hook.
* Move prop access to top of function component.
* Add todo for potential manual resolution logic.
* Refactor DashboardCharts component to use new user preferences hook.
* Move code out of functional component where possible.
* Fix chart interval query property.
* Refactor Leaderboards component to use new user preferences hook.
* Move code out of functional component where possible.
* Refactor Inbox panel to use user prefs hook.
@todo - updating last read isn't working.
* Use user prefs hook in StatsOverview component.
* Export user preferences store name.
* Use new store for unread inbox indicator.
* Hydrate current user data higher up in the app.
* Update "last read" timestamp in inbox panel.
* Fix StatsOverview test.
* Remove unused dispatch method from StorePerformance component.
* Remove now defunct user methods from wc-api spec.
* Add tests for isRequesting.
* JSON decode WC meta on updated user object.
* Test user prefs retrieval and save.
* Remove todo comment.
* Use user prefs hook in Jetpack install CTA on homepage.
* Added refactor in "handleBlur" for IE compatibility
This commit adds a refactor in the method "handleBlur" for IE compatibility
* Modified styles for IE compatibility
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Removed URLSearchParams method
This commit removes the method URLSearchParams to use something compatible with IE
* Revert "Removed URLSearchParams method"
This reverts commit c2b24b34c93d16264c62b3bf522f4fbc94354d58.
* Removed URLSearchParams method
This commit removes the method URLSearchParams to use something compatible with IE
* Created folder utils with global utils
This commit moves the method "getUrlParams" to a utils file. Also some unit test were added
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)
* Added notes layout and image to the API
Added note layout and note image to the API and the DB
* Unit test modified
Unit test where modified to adapt them to the new elements
* Changed the frontend following the new designs.
The fronted was changed to follow the new inbox messages design.
* Changed default layout type in DB
* Added all the requested visual element
Changed the cards' js, css and actions to achieve the visual requirements
* Added "layout" and "image" to inboxQuery
* Modal confirmation buttons repaired
* Added "layout" and "image" to docs examples.
* Removed "updateNote" from action.js
Removed "updateNote" from action.js, I left it by mistake.
* Spelling error corrected
The button text "Dismiss all message" was corrected
* noteName removed and icon added to make code reviewing easier
This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier
* Dismiss action button refactor
Refactor of the dismiss action button in the InboxNoteCard class
* Removed unnecessary control
* Destructured all the note properties
* Colors replaced by existing variable
* Removed setting of layout and image in the creation of the notes
* Removed blank lines added by mistake
* Close dismiss dropdown when clicking away from the popover.
* Prevented the closing of the inbox panel with an action in the modal
* Added small design changes
* Removed unused "Gridicon" import
* Prevent showing the image tag when the layout is blank
* The method name getDismissButton was changed to getDismissConfirmationButton
* Removed unnecessary vendor-prefixed properties
* Improved note filtering in unreadNotes method
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)
* Info icon removed from inbox notifications
The info icon was removed from inbox notifications
# Conflicts:
# src/Notes/DataStore.php
* Removed "icon" from inboxQuery
* Tests repeared
Some problems with the unit tests were repaired in this commit
# Conflicts:
# docs/examples/activity-panel-inbox.md
# Conflicts:
# tests/api/admin-notes.php
* Removed icon from card.js
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Inbox notification: Add dismiss functionality (https://github.com/woocommerce/woocommerce-admin/pull/4262)
* Added is_deleted param to soft delete
# Conflicts:
# src/API/Notes.php
# src/Install.php
# src/Notes/DataStore.php
# src/Notes/WC_Admin_Note.php
# src/Notes/WC_Admin_Notes.php
# tests/api/admin-notes.php
* Added the Dismiss functionality
# Conflicts:
# client/header/activity-panel/panels/inbox/action.js
* Where clause repeared
* Added Snackbar after action.
* API modified to dismiss notes
* Small refactor in "get_item" method
This commit adds a small refactor in "get_item" method to use "prepare_note_data_for_response"
* Added missing logic to Dismiss note
This commit adds missing client logic to Dismiss note.
# Conflicts:
# client/header/activity-panel/panels/inbox/action.js
# client/header/activity-panel/panels/inbox/card.js
* Moved the delete action to WC_Admin_Notes.php
The delete action was moved to WC_Admin_Notes.php to follow the pattern.
* Added changes to dismiss messages
This commit addeds changes to the messages soft delete.
* DataStore.php repaired
This commits adds some code that was deleted by mistake and the param "is_deleted" has been escaped.
* Spelling error corrected
The button text "Dismiss all message" was corrected
* Repaired "get_notes_where_clauses" method
A problem with the deleted notes was repaired
* Added a comment to DataStore.php
* Stopped sending the "dismissType" to action.js
The "dismissType" is not sent to action.js anymore.
* Bugfix: now the method get_notes_with_name also returns deleted notes
* Bugfix: repaired empty notification list
This commit repairs a bug that happens when there isn't anything in the inbox notification list
* Small refactor to not use "some" Lodash method anymore
* Small refactor in rednderNotes method
* Added check to set_layout
* Added small refactor to delete_all_notes method
* Fixed code comment error
* Bugfix: repaired the "delete_note" call
* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)
* Added notes layout and image to the API
Added note layout and note image to the API and the DB
* Unit test modified
Unit test where modified to adapt them to the new elements
* Changed the frontend following the new designs.
The fronted was changed to follow the new inbox messages design.
* Changed default layout type in DB
* Added all the requested visual element
Changed the cards' js, css and actions to achieve the visual requirements
* Added "layout" and "image" to inboxQuery
* Modal confirmation buttons repaired
* Added "layout" and "image" to docs examples.
* Removed "updateNote" from action.js
Removed "updateNote" from action.js, I left it by mistake.
* Spelling error corrected
The button text "Dismiss all message" was corrected
* noteName removed and icon added to make code reviewing easier
This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier
* Dismiss action button refactor
Refactor of the dismiss action button in the InboxNoteCard class
* Removed unnecessary control
* Destructured all the note properties
* Colors replaced by existing variable
* Removed setting of layout and image in the creation of the notes
* Removed blank lines added by mistake
* Close dismiss dropdown when clicking away from the popover.
* Prevented the closing of the inbox panel with an action in the modal
* Added small design changes
* Removed unused "Gridicon" import
* Prevent showing the image tag when the layout is blank
* The method name getDismissButton was changed to getDismissConfirmationButton
* Removed unnecessary vendor-prefixed properties
* Improved note filtering in unreadNotes method
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)
* Info icon removed from inbox notifications
The info icon was removed from inbox notifications
# Conflicts:
# src/Notes/DataStore.php
* Removed "icon" from inboxQuery
* Tests repeared
Some problems with the unit tests were repaired in this commit
# Conflicts:
# docs/examples/activity-panel-inbox.md
# Conflicts:
# tests/api/admin-notes.php
* Removed icon from card.js
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Improved error handling for the set_layout method
* Bugfix: fixed error handling clicks inside dropdowns
* Bugfix: repaired dropdown onBlur handler
This commit repairs a weird behavior that the dropdown onBlur handler method had sometimes.
* Text error changed
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Inbox notification: Add undo snackbar button after deletion (https://github.com/woocommerce/woocommerce-admin/pull/4281)
* Added undo snakbar button for a single note
# Conflicts:
# client/wc-api/notes/mutations.js
# src/Notes/DataStore.php
# src/Notes/WC_Admin_Notes.php
* Added a button to undo the deletion of all notes
# Conflicts:
# client/wc-api/notes/operations.js
# src/API/Notes.php
* Code adapted to make code reviewing easier
There was some code that also was present in another PR, that code was removed to make code reviewing easier.
* UnitTest added
This commit adds some unit tests
* Added verification for API response
* Added casting to $note_id
* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)
* Added notes layout and image to the API
Added note layout and note image to the API and the DB
* Unit test modified
Unit test where modified to adapt them to the new elements
* Changed the frontend following the new designs.
The fronted was changed to follow the new inbox messages design.
* Changed default layout type in DB
* Added all the requested visual element
Changed the cards' js, css and actions to achieve the visual requirements
* Added "layout" and "image" to inboxQuery
* Modal confirmation buttons repaired
* Added "layout" and "image" to docs examples.
* Removed "updateNote" from action.js
Removed "updateNote" from action.js, I left it by mistake.
* Spelling error corrected
The button text "Dismiss all message" was corrected
* noteName removed and icon added to make code reviewing easier
This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier
* Dismiss action button refactor
Refactor of the dismiss action button in the InboxNoteCard class
* Removed unnecessary control
* Destructured all the note properties
* Colors replaced by existing variable
* Removed setting of layout and image in the creation of the notes
* Removed blank lines added by mistake
* Close dismiss dropdown when clicking away from the popover.
* Prevented the closing of the inbox panel with an action in the modal
* Added small design changes
* Removed unused "Gridicon" import
* Prevent showing the image tag when the layout is blank
* The method name getDismissButton was changed to getDismissConfirmationButton
* Removed unnecessary vendor-prefixed properties
* Improved note filtering in unreadNotes method
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)
* Info icon removed from inbox notifications
The info icon was removed from inbox notifications
# Conflicts:
# src/Notes/DataStore.php
* Removed "icon" from inboxQuery
* Tests repeared
Some problems with the unit tests were repaired in this commit
# Conflicts:
# docs/examples/activity-panel-inbox.md
# Conflicts:
# tests/api/admin-notes.php
* Removed icon from card.js
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Inbox notification: Add dismiss functionality (https://github.com/woocommerce/woocommerce-admin/pull/4262)
* Added is_deleted param to soft delete
# Conflicts:
# src/API/Notes.php
# src/Install.php
# src/Notes/DataStore.php
# src/Notes/WC_Admin_Note.php
# src/Notes/WC_Admin_Notes.php
# tests/api/admin-notes.php
* Added the Dismiss functionality
# Conflicts:
# client/header/activity-panel/panels/inbox/action.js
* Where clause repeared
* Added Snackbar after action.
* API modified to dismiss notes
* Small refactor in "get_item" method
This commit adds a small refactor in "get_item" method to use "prepare_note_data_for_response"
* Added missing logic to Dismiss note
This commit adds missing client logic to Dismiss note.
# Conflicts:
# client/header/activity-panel/panels/inbox/action.js
# client/header/activity-panel/panels/inbox/card.js
* Moved the delete action to WC_Admin_Notes.php
The delete action was moved to WC_Admin_Notes.php to follow the pattern.
* Added changes to dismiss messages
This commit addeds changes to the messages soft delete.
* DataStore.php repaired
This commits adds some code that was deleted by mistake and the param "is_deleted" has been escaped.
* Spelling error corrected
The button text "Dismiss all message" was corrected
* Repaired "get_notes_where_clauses" method
A problem with the deleted notes was repaired
* Added a comment to DataStore.php
* Stopped sending the "dismissType" to action.js
The "dismissType" is not sent to action.js anymore.
* Bugfix: now the method get_notes_with_name also returns deleted notes
* Bugfix: repaired empty notification list
This commit repairs a bug that happens when there isn't anything in the inbox notification list
* Small refactor to not use "some" Lodash method anymore
* Small refactor in rednderNotes method
* Added check to set_layout
* Added small refactor to delete_all_notes method
* Fixed code comment error
* Bugfix: repaired the "delete_note" call
* Inbox notification: Added layout changes (https://github.com/woocommerce/woocommerce-admin/pull/4256)
* Added notes layout and image to the API
Added note layout and note image to the API and the DB
* Unit test modified
Unit test where modified to adapt them to the new elements
* Changed the frontend following the new designs.
The fronted was changed to follow the new inbox messages design.
* Changed default layout type in DB
* Added all the requested visual element
Changed the cards' js, css and actions to achieve the visual requirements
* Added "layout" and "image" to inboxQuery
* Modal confirmation buttons repaired
* Added "layout" and "image" to docs examples.
* Removed "updateNote" from action.js
Removed "updateNote" from action.js, I left it by mistake.
* Spelling error corrected
The button text "Dismiss all message" was corrected
* noteName removed and icon added to make code reviewing easier
This commit removes the "noteName" from card.js and adds the icon to make code reviewing easier
* Dismiss action button refactor
Refactor of the dismiss action button in the InboxNoteCard class
* Removed unnecessary control
* Destructured all the note properties
* Colors replaced by existing variable
* Removed setting of layout and image in the creation of the notes
* Removed blank lines added by mistake
* Close dismiss dropdown when clicking away from the popover.
* Prevented the closing of the inbox panel with an action in the modal
* Added small design changes
* Removed unused "Gridicon" import
* Prevent showing the image tag when the layout is blank
* The method name getDismissButton was changed to getDismissConfirmationButton
* Removed unnecessary vendor-prefixed properties
* Improved note filtering in unreadNotes method
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Update client/header/activity-panel/panels/inbox/style.scss
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Inbox notification: Remove icons (https://github.com/woocommerce/woocommerce-admin/pull/4258)
* Info icon removed from inbox notifications
The info icon was removed from inbox notifications
# Conflicts:
# src/Notes/DataStore.php
* Removed "icon" from inboxQuery
* Tests repeared
Some problems with the unit tests were repaired in this commit
# Conflicts:
# docs/examples/activity-panel-inbox.md
# Conflicts:
# tests/api/admin-notes.php
* Removed icon from card.js
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Improved error handling for the set_layout method
* Bugfix: fixed error handling clicks inside dropdowns
* Bugfix: repaired dropdown onBlur handler
This commit repairs a weird behavior that the dropdown onBlur handler method had sometimes.
* Text error changed
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Stopped sending the "dismissType" to action.js
The "dismissType" is not sent to action.js anymore.
# Conflicts:
# client/header/activity-panel/panels/inbox/card.js
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Bugfix: solved problem when a note was undismissed
There was a problem with the undismiss functionality. When a note was undismissed, it always was recovered with "plain" layout. This commit solves this problem.
* Inbox notification: add event recording (https://github.com/woocommerce/woocommerce-admin/pull/4320)
* Added events recording
This commit adds events recording to the inbox notifications
# Conflicts:
# client/header/activity-panel/panels/inbox/index.js
* Added 'home_screen' verification
Changed recorded name, now when the client is in the WooCommerce 'home' page we record 'home_screen' instead of 'wc-admin'.
* Added a naming fix and a new prop to the recordEvent
* bugfix: added control before interaction with bodyNotificationRef
* Added more unit tests for new endpoints
This commit adds tests for deleting a single note and for deleting all the notes, both without permission.
* Modified variable name
* Refactor: prop rename and small logic change
* Screen name getter moved into the InboxNoteCard
This commit moves the screen name getter inside the InboxNoteCard.
# Conflicts:
# client/header/activity-panel/panels/inbox/index.js
* Removed "screen" from state
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Refactor in admin-notes unit tests
Some unnecessary controls were removed from the admin-notes unit tests
* Indentation fixed in Install.php. Replaced spaces with tabs.
* Inbox notification: added new placeholder and empty card (https://github.com/woocommerce/woocommerce-admin/pull/4379)
* Added a new placeholder and an empty card
This commit adds a new placeholder and a new empty card to the inbox panel
# Conflicts:
# client/header/activity-panel/panels/inbox/index.js
# client/header/activity-panel/panels/inbox/style.scss
* Added border to read notes
* Improved note filtering in unreadNotes method and validNotes
# Conflicts:
# client/header/activity-panel/panels/inbox/index.js
* Actions render refactored
The actions render was refactored in InboxNoteCard component
* Refactor of InboxPanel component
The methods getUnreadNotesCount and hasValidNotes were separated from the InboxPanel component
# Conflicts:
# client/header/activity-panel/panels/inbox/index.js
* Refactor inbox panel subtitle classes
* Added changes for when a note is undismissed
This commit adds the requested changes in behavior and design for when a note is dismissed.
# Conflicts:
# client/header/activity-panel/panels/inbox/index.js
* Bugfix: Added key to itemlist
The InboxNotePlaceholder is shown as an itemlist but it didn't have a key. This commit adds it.
* Removed unnecessary validation
* Refactored actionList map
This commit adds a refactor to the actionList map
* Changes to the getUndoDismissRequesting functionality
This commit adds a few changes to the getUndoDismissRequesting functionality
* Changed className prop
* Changed other className prop
* Modified InboxPanel rendering
* Removed unnecessary method in placeholder.js
* Simplified the card.js renderActions method
* Change renderActions return in card.js
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Inbox notification: add client unit tests (https://github.com/woocommerce/woocommerce-admin/pull/4386)
* Added client unit tests
* Added test cases for getUnreadNotesCount and hasValidNotes
* Corrected typo error
* Removed Enzyme and added React Testing Library
* Removed unnecessary param
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
* Resolved some conflicts with master
* Marketing note test repaired
This commit repairs the marketing note test
* Added note type 'marketing' to delete all functionality
* Removed set_icon method from some notes and docs
* Added set_icon method as deprecated to prevent errors.
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
add data store for settings using wp.data
add use-select-with-refresh example
replace fresh-data usage with new settings data store for settings page
Add data package
move to packages
Fix isDirty after save
Add isBusy to primary button when saving
update Readme
remove comment
readme to use useSelect
Revert "update Readme"
This reverts commit 7402fd49b8f384fde5878e0bee0616f0a87bb4f6.
Data Layer: Settings page to use Settings store (https://github.com/woocommerce/woocommerce-admin/pull/3430)
* Data Layer: Settings store as source of truth for settings page
This reverts commit 7402fd49b8f384fde5878e0bee0616f0a87bb4f6.
* fixup
* save on reset
* non mutable constants
* add set/getSettings
* save using setSettings
* separate HOC
* cleanup
* remove settingsToData
* withHydration
* remove withSettings HOC
* renmove useSettins for now
* withSettingsHydration updates
* Revert "withSettingsHydration updates"
This reverts commit f2adf108fbe19b574978fea5925a1a18e7ed3007.
* rename withSettingsHydration
* redo withSettingsHydration simplification
* restore
* useSettings
* render using useSettings
* handleInputChange working
* get setIsDirty working
* saving works
* reset and cleanup
* cleanup
* use snake case on hook files
* use clearIsDirty
* Avoid mutation on setting update
* remove @todo
* persiting -> isPersisting
* better reducer ternaries
* add wcSettings as arg to withSettingsHydration
reset package-lock
Settings: split out mutable wcAdminSettings (https://github.com/woocommerce/woocommerce-admin/pull/3675)
Settings: handle async settings groups (https://github.com/woocommerce/woocommerce-admin/pull/3707)
* align code styles with the same configuration as Woo-Blocks
* initial pass of reformat-files
* applies manual fixes to various new linting errors surfaced by the configuration change.
* Fix state mutation in image-upload
* remove unused pre-commit-hook.js
* requestAnimationFrame -> window.requestAnimationFrame
* wc-api eslint changes
* eslint fixes on client/lib and client/settings
* client/header eslint changes
* fixes for client/dashboard part 1
* fixes client/dashboard part 2 of 2
* client/analytics part 1
* client/analytics continued
* client/analytics, last batch
* rename __mock__ directory
* pass in useEffect, useState from React component or function
* remove '+' from sprintf string argument
* use ref instead of findDOMNode
* reformat and repaply package.json changes
* install deps before running linter in Travis
* useGetCountryStateAutofill
* counryStateAutofill
* countryStateAutofill
Co-authored-by: Paul Sealock <psealock@gmail.com>
* Relabel Net Revenue to Net Sales, revert previous refund work on Gross revenue and rename to total sales. Update the orer of all the things
* Add gross sales calculation to revenue stats endpoint.
* Restore coupon_total when updating order stats.
* Wire up gross sales to revenue report.
* Fix revenue report refunds calculation when there are no refunds.
* update net sales labels and cases in order, product and category tables
* Subtract refunded shipping and taxes from gross sales.
* pluses to minuses to fix the gross revenue and refund totals when refunding
* Add gross_sales to revenue stats orderby enum.
* Change refund labels to Returns
* Remove usage of defunct coupon_total column.
* Store refunded amount in stats table.
* Rename "gross_total" column to "total_sales".
* Net total for refund orders can be used instead of a new column.
* Rename gross_revenue to total_sales.
* Coalesce coupons total in order stats query.
SUM()ing all nulls gives null, not zero.
* Use segmentation selections to backfill missing data.
Fo when report columns and segmentation columns don't match.
* Remove errant gross_sales from expected interval test data.
* Fix gross sales tests for revenue/stats.
* Move missing segment fills back to their original locations.
* Fix remaining tests failing because of gross sales.
* Fix db upgrade function rename of gross_total column.
* Fix linter errors.
* Remove wcSettings dependency from currency and number packages.
Either take a configuration object in function calls or in a new class constructor.
* Use new Currency class and number format methods in client/.
Compose with store settings to keep the same API.
* Don't reintroduce lodash dependency to currency package.
* Add changelog entries to currency and number packages.
* Update docs, example, and changelog for AdvancedFilters component.
* Use precision-less formatValue() for integer report values.
* Make Currency instance immutable.
* Move inbox note actions to a bespoke component.
* Set busy state on action buttons on click.
* Allow for Note actions to be deleted.
* Update FB extension note after installation is complete.
* Link actions don't get busy treatment.
* Re-fetch note actions after updating.
Get new action IDs from the database.
* Add tracking to inbox note views. (https://github.com/woocommerce/woocommerce-admin/pull/3096)
* Move inbox note content to its own component.
* Send a tracks event when inbox notes are in the viewport.
Uses react-visibility-sensor.
* Match event data to `inbox_action_click`.
* refactor wcSettings in components to use new api
* update test snapshot
* refactor wcSettings in other packages
* fix how defaults are set for setting
* decouple siteLocale from ReportsFilters and AdvancedFilters
* Decouple currency settings from packages
AdvancedFilters, ReportFilters, and NumberFilters now receive currency info as props.
* decouple currency settings from `ReportChart`
* decouple `wcAdminAssetsUrl` setting from `EmptyContent`
- also refactors to remove the need for `ImageAsset` component.
* decouple OrderStatus from wcSettings
* decouple wcAdminUrl setting from ProductImage component
- this also implements a SVG for default product image.
* remove export for image-asset that is no longer present
* remove console.log
* update test snapshots for ProductImage
* integrate with new asset data registration (php side)
- includes back-compatibility.
* update js configuration and implement settings alias
- this aliases `@woocommerce/wc-admin-settings` to the settings api exposed via blocks (either the blocks plugin or core) and all the settings provided via the server.
- Adds fallback for back-compat if `wc.wcSettings` is not available in the environment (fallsback to `wcSettings`).
* initial pass to update all wcSettings direct usage to the new api
- this is just an initial pass, more can be done in separate pulls.
* missed one spot for adding new filter implementation
* fix incorrect jest config
* Avoid unnecessary assignment and directly return.
* Remove unnecessary defaults
* Fix inline comment text case.
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* Remove unnecessary inline comment.
* use @todo instead of TODO
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* fix incorrect reference in webpack config.
* add missing import and slightly delay dependency injection for scripts
* update get-setting and set-setting callbacks
* disable lint rule for console.error on dev doc builds
* Remove updated stock products from Activity Panel
* Use prefers-reduced-motion preference
* Update comparison to check if stock quantity is 'lower or equal to' lowStockAmount
* Focus quantityInput on 'beginEdit' instead of 'componentDidUpdate'
* Add comment explaining why we hide cards
* Refactor updateProductStock action
* Add type and parent_id properties to update