Commit Graph

19 Commits

Author SHA1 Message Date
RJ 0190f4adea
fix: applied lint autofixes (#39942)
* woocommerce-admin lint fixes

* @woocommerce/* lint fixes

* Add changefile(s) from automation for the following project(s): @woocommerce/date, @woocommerce/data, @woocommerce/components, @woocommerce/admin-layout, woocommerce

* lints

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-08-30 06:40:45 +08:00
Nathan Silveira 89129cc62a
Revert "Always show pricing group fields, disable if not available for a product type (#38531)" (#38964)
* Revert "Always show pricing group fields, disable if not available for a product type (#38531)"

This reverts commit 18f2de2bc4.

* Add changelog and fix lint issues

* Remove call to removed function
2023-06-27 12:50:02 -03:00
Nathan Silveira 18f2de2bc4
Always show pricing group fields, disable if not available for a product type (#38531)
* Always show General product tab

* Add info messages for variable and grouped products

* Add logic to disable/enable fields and labels based on product type

* Tweak CSS and fix links

* Add tracks events for links

* Add filters to pricing disabled message

* Tweak logic to only enable fields on certain product types instead of disabling in the opposite ones

Add fallback message when pricing is disabled but it's not Variable or Grouped product

* Add docblocks

* Fix more lint issues

* Fix last lint issues

* Update selector in e2e test

* Refactor PHP echo

* Attach to #woocommerce-product-data instead of attaching to body
2023-06-12 12:58:26 -03:00
Nathan Silveira 869b897ddd
Rename tracks event `product_attributes_add` to `product_attributes_save` on the product page and update attributes (#38278)
* Change attributes of tracks event product_attributes_add

* Don't send used_for_variations_count if it's not variable product type

* Explicitly add null values in product_attributes_add when the attribute is sent on the other call

* Rename product_attributes_add on the product page to product_attributes_save
Fix inverted local and global attributes count
Remove unnecessary parameters
Refactor code

* Update changelog
2023-05-19 12:44:54 -03:00
Matt Sherman d11f50b5a3
Update empty state for product attributes tab (#38126)
* Remove empty state HTML

* Add empty attribute when product has no attributes

* Remove unused woocommerce_admin_meta_boxes.has_local_attributes

* Remove unused toggle_add_global_attribute_layout

* Remove unused button.add_attribute click handling (button doesn't exist anymore)

* Fix positioning of Expand / Close

* Remove unnecessary add-attribute-container div

* Refactor attribute search selection handling

* Remove empty attribute if adding an existing attribute

* Update e2e test clicking of "Add new" attribute button

* Update Tracks handling for "Add new" attribute button

* Changelog

* Fix action recorded when "Add new" button is clicked

* Remove console.log statements

* Allow propagation of click event on "Create value" button

* Move Tracks wcadmin_product_attributes_buttons action: 'add_existing' to product-tracking TS

* Make function names more descriptive. Add comment to clarify why event.preventDefault is used.
2023-05-09 20:04:29 -04:00
Matt Sherman 94599a14cf
Add product type options to product tracking (#38017)
* Add product_type_options to wcadmin_product_add_publish
* Add product_type_options to wcadmin_product_update
* Add product_type_options to other wcadmin_product_ events
2023-05-02 13:42:57 -04:00
Fernando Marichal a67b7df26f
Add tracks events to attributes tab (#37622)
* Refactor method `addProductAttributesTracks`

# Conflicts:
#	plugins/woocommerce-admin/client/wp-admin-scripts/product-tracking/shared.ts

* Add changelog

* Record remove attribute Tracks event

# Conflicts:
#	plugins/woocommerce/client/legacy/js/admin/meta-boxes-product.js

* Record `used for variations` and `visible on product page` events

* Record `used for variations` and `visible on product page` events

* Fix js error

* Remove not used code

* Refactor `add_existing` attribute recording

* Fix event action

* Refactor `attachEventListenerToParentForChildren`

---------

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-04-17 12:50:30 -03:00
Fernando Marichal 1187df9d82
Add Tracks events to variations tab (#37607)
* Refactor `product-tracking` file

* Add variations tracks events

* Add changelog

* Refactor method `addProductAttributesTracks`

* Add `remove_variation` Tracks event

* Modify code comments

* Rename `query` prop

* Modify `generate_variations` event to be recorded after confirmation

---------

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
2023-04-12 16:37:23 -03:00
Nathan Silveira 277f4aab12
Show tooltip in Save attributes button instead of using title attribute (#37345)
* Modify tipTip to allow showing dynamic content

* Show tooltip when button is disabled

* Add tipTip and disabled logic to create variations button

* Add header comment in tipTip plugin
2023-04-05 16:22:59 -03:00
Matt Sherman 4cabe5f6b5
Add Tracks events for product inventory tab (#37202) 2023-03-14 18:16:01 -04:00
Matt Sherman b94d38458d
Add components to @woocommerce/customer-effort-score (#37112)
* Update src structure of @woocommerce/customer-effort-score

* Changelog

* Add dependencies to @woocommerce/customer-effort-score

* Move useCustomerEffortScoreExitPageTracker and utils to @woocommerce/customer-effort-score

* Fix up imports from @woocommerce/customer-effort-score

* Changelog

* Fix import of constant

* Mock @woocommerce/customer-effort-score in tests

* Move tests to @woocommerce/customer-effort-score

* Update lock file

* Update lock file from trunk

* Update lock file again... this time, tests pass
2023-03-14 12:16:19 -04:00
Sam Seay 1834621d1a
Update the @woocommerce/eslint-plugin and fix bugs (#36988) 2023-03-02 11:36:38 +13:00
Nathan Silveira 41eab0d669
Add additional global attributes and local attributes information when saving product attributes (#36858)
* Add additional global attributes and local attributes information when saving product attributes

* Log only local attributes
Add attribute name
Fix issue with attribute_value and names selectors

* Save name and slug for global attributes and global terms
2023-02-20 23:55:01 +01:00
louwie17 613e58c061
CES exit prompt for product editing screens (#35728)
* Add exit page tracker logic and implement it for product pages

* Add changelog

* Fix lint errors and add comments

* Add ces_location prop

* Add mock to fix broken test

* Add CES exit page survey tests

* Fix a bug with React pages redirects and update actions

* Fix test

* Fix lint

* Add default inside location prop

* Remove exit prefix within action

* Address PR feedback and make sure its not triggered on save

* Update copy of exit feedback notice

* Add changelog

* Update name of param

* Fix lint error

* Use hasFinishedResolution vs isResolved in customerEffortScoreTracks
2022-12-12 09:56:28 -04:00
Nathan Silveira 121bfe3a29
Add tracks event for "View product" and dismiss action after update (#35582)
* Record an event 'product_view_product_click' when the 'View Product' link is clicked after creating or updating a product

* Add product_view_product_dismiss tracks events (WIP, not currently working)

* Add changelog

* Fix whitespace in addEventListener and remove console.logs

* Change link tag id to be more specific and comply with CSS guidelines
Move HTML code out of translation function

* Run phpcs in class-wc-admin-post-types

* Add tinyMCE types to add global tinymce variable in typescript code

* Add additional data in getProductData

TODO: I'm not sure if it's possible, or if it makes sense, to include stock_quantity_update in the object

* Add code review suggestions, including:

* Create isElementVisible function to backfill jQuery implementation
* Fix wrong value for is_downloadable, is_virtual, manage_stock
* Fix wrong radix
* Update menu_order implementation
* Add missing ? to weight

* Add stock_quantity_update implementation which is not working as intended

Since the page reloads after product update, the initialStockValue is updated as well

* Remove stock_quantity_update property and adjust is_downloadable, is_virtual, and manage_stock for consistency
2022-11-28 22:01:10 -03:00
Chi-Hsuan Huang 7068c78101
Fix JS lint errors (#33484)
* Fix @woocommerce/data lint errors

* Fix internal-e2e-builds lint error

* Fix lint errors
2022-06-21 16:37:34 +08:00
louwie17 574e00b6d5
Add/32676 category and tag tracks within products screen (#33121)
* Add logs for the attributes and tags on the product page

* Only trigger attributes_add on product screen when user hits save

* Add extra props to attribute add track

* Add tags delete track and fix count of tags add track

* Update use of wp_localize_script
2022-05-30 10:06:34 -03:00
Joshua T Flowers e4824b9660
Add tracks to new product and edit product screens (#33120)
* Move product list tracks to seperate file

* Change product list tracks to TS

* Check init of tracks on client-side

* Add new product tracks

* Add product screen tracks

* Add product edit tracks

* Localize product screen variable

* Add changelog entry

* Handle PR feedback

* Track date changes on edit
2022-05-26 16:56:22 -04:00
Joshua T Flowers 0702433531
Add tracks to products list page (#32949)
* Add tracks to products list page

* Remove duplicate tracks

* Add changelog entry

* Check for fields before getting values

* Add bulk actions cancel button

* Check for element before binding event listener

* Check for search input before getting value
2022-05-17 11:52:44 -04:00