Commit Graph

27 Commits

Author SHA1 Message Date
Adrian Duffell e45b59b71f
Update the link color in legal disclaimers on core profiler (#50830)
* Revert t&c link colors in core profiler

* Add changelog
2024-08-21 17:11:07 +08:00
RJ 905fe2246f
fix: reduce core profiler sticky footer height (#50788)
* fix: reduce core profiler sticky footer height

* increased height to 120px
2024-08-20 18:48:49 +08:00
RJ fd30c4460e
fix: core profiler sticky footer button variable vh breakpoints (#50727)
* fix: core profiler sticky footer button variable vh breakpoints

* lint

* lint
2024-08-20 07:37:32 +08:00
Chi-Hsuan Huang 701a5cbb60
Update Continue button container on core profiler extension screen (#50582)
* Update core profiler continue button container

On desktop screens 900px and smaller, add a 140px tall container stuck to the bottom of the viewport
Add a transparent to solid white gradient to the container (top to bottom)
Vertically center align the continue button and dislaimer text inside the container

* Add docs

* Update style
2024-08-13 11:49:07 +08:00
Chi-Hsuan Huang af75166a07
Fix the spacing between the "Set up my store" button and TOS is too tight on small desktop screens (#50579)
Fix core profiler set up my store button and TOS are too close to each other
2024-08-13 11:48:05 +08:00
Moon 0468bdbe82
blueprint - add php package and cli commands (#49763)
* Add blueprint package

* Add blueprint to composer

* Register blueprint cli commands

* Add feature flag

* Add changefile(s) from automation for the following project(s): woocommerce

* Update packages/php/blueprint/src/Exporters/HasAlias.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update packages/php/blueprint/src/Exporters/ExportInstallThemeSteps.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update packages/php/blueprint/src/UseWPFunctions.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Set destination correctly

* Make sure the given path is within wp content dir

* Remove debug code

* Fix typo

* Fix typo

* Fix lint errors with README

* Move READMD.md from src to the root directory and add development.md

* Add run-unit-tests.sh

* Setup test env

* Create dirs recursively

* Remove debug code

* Update packages/php/blueprint/src/Util.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update packages/php/blueprint/src/ZipExportedSchema.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Check for steps key

* Use if statement

* Add hook comment for wooblueprint_exporters and wooblueprint_importers

* Fix plugin activation condition

* Check for download_link -- it can be empty

* Check to make sure a file was written

* Plugin must be deactivated before attemping to delete it

* Lint fixes

* Lint fixes

* blueprint - add rest api (#49765)

* Add blueprint rest api endpoint

* Rename process to import

* Add changefile(s) from automation for the following project(s): woocommerce

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Init.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Remove unavailable 2nd argument from get_param -- default values are already set from the rest api def.

* blueprint - add builder page  (#49774)

* Add blueprint builder page

* Change to the correct endpoint

* Add changefile(s) from automation for the following project(s): woocommerce

* Note that the builder intro page is temporary

* Remove unused code

---------

Co-authored-by: github-actions <github-actions@github.com>

* blueprint - add blueprint settings page (#49775)

* Add blueprint settings page

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>

* Fix broken test

* Lint fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update unit test env

* Added composer scripts to setup and run tests
* Moved tests to Unit dir to make space for Integration tests later

* WIP Add tests

* Use full if statement

* Use the correct step names

* Use activate_plugin and wp_get_thmes from wp functions trait

* Skip inactive plugins

* Use plural for collections

* Add a comment for StepExporter

* Remove unused construct code

* Correct function return types

* Update packages/php/blueprint/src/Importers/ImportActivateTheme.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Use full if statement

* Make sure plugin is installed

* Use functions from trait

* Remove unused functions

* Pass $force_convert correctly

* Correctly assign $this->validator

* Fix lint issues

* Rename setOptions to setSiteOptions

* Do not use die() -- throw an exception instead

* Make sure slug is a valid WP plugin slug

* Remove hardcoded string with get_step_name()

* Fix lint issues

* Update json example files

* Removed woo-specific examples -- these should be placed in the core
* Updated the built-in steps to reflect the recent changes

* Update packages/php/blueprint/src/docs/json-examples/deletePlugin.json

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/RestApi.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Rename to correct filename

* Set version number

* Use mime_content_type for checking mime type

* Catch all exceptions

* Only allow zip and json

* Remove unused function

* Remove unused functions

* Add PHPCS command and ruleset

* PHP lint fixes

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Init.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Add back removed functions

* blueprint - Add woo blueprint exporters and importers (#50057)

* Add woo blueprint exporters and importers

* Comment fix

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce/src/Admin/Features/Blueprint/Exporters/ExportWCSettings.php

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Add a test for ImportSetWCTaxRates

* Lint fixes

* Lint fixes

* Fix setWCShipping schema and data format

* Add woocommerce_default_country option

* Lint fixes

* Fix typo -- it should be decode, not encode

* Fix incorrect argument order

* Fix typo

* Export and import shipping method settings

* Lint fixes

* Lint fixes

* Type functions -- base PR has changed

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Require admin for import and export

* Use mime type from $_FILES -- mime_content_type can return incorrect mime type depending on the system configuration

* Enable export button when backend errors out

* Enable export button when backend errors out

* Allow WooCommerce export

* Change copy text

* Remove redundant check

* Fix lint issues

* Fix lint issues

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-08-12 16:33:05 -07:00
Chi-Hsuan Huang 4112c97d13
Handle core profiler get countries error (#48317)
* Handle core profiler get countries error

* Update style

* Add changefile(s) from automation for the following project(s): woocommerce

* Update button and code style

* Address feedback

* Fix lint

* Record skip step track and rename event

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-06-13 12:42:30 +08:00
Adrian Duffell 8cbc799067
Update Core Profiler Industries (#47605)
* Update indistries list order

* Add arts and crafts

* Add sports and recreation

* Tweak size of dropdown to allow 9 items

* Add small screen size height restriction

* Add changelogs

* Update documentation

* Fix lint issues
2024-05-20 23:10:53 +08:00
Chi-Hsuan Huang 75bb52c310
Fix core profiler email field overlapping with continue button in mobile screen (#47077)
* Fix core profiler email field is not positioned correctly in mobile screens

* Add changelog
2024-05-02 16:09:58 +08:00
Paul Sealock 619804cff3
Stylelint: Update config to double quotes (#45607)
* Add eslint override

* bump versions stylelint config

* re pnpm install

* fix config

* move to double quotes in scss

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* lint fix new scss files

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-26 10:41:34 -03:00
rjchow 5468ce68b8 fix: core profiler email opt in validation 2023-11-01 12:42:16 +08:00
RJ e01e6f8b2a
add: core profiler email marketing opt in (#40869)
* add: core profiler email marketing opt in

* tests

* changed mailchimp feature flag

* fix: made experiment name static

* lint
2023-10-24 17:07:26 +02:00
RJ cb2cf79342
dev: refactor core profiler loader (#39735)
* dev: refactor core profiler loader

* dev: added storybook example for loader

* lint

* Apply suggestions from code review

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* addressed review feedback

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-08-22 19:58:33 +10:00
RJ 615393be39
dev: core profiler pages storybook (#39046)
* dev: core profiler pages storybook

* changed css path to pre-build zip path
2023-07-24 20:34:38 +08:00
Moon 68ff03063a
Core profiler -- fix the gap at the top on iPad and iPad Mini (#39108)
* Fix unexpected gap on iPad and iPad Mini

* Fix css lint
2023-07-07 10:51:48 -07:00
Moon 7bbffd3284
Update CSS styles for core profiler headers (#39059)
* Remove letter-spacing and use 500 for font-weight

* Add changelog

* Style updates for the header

* Set letter-spacing to normal
* Use 500 for font-weight
* Remove max-width

* Add changelog
2023-07-03 10:54:48 -07:00
Chi-Hsuan Huang 5fb8183682
Fix Core Profiler UI issues (#38872)
* Fix overlapping button position when the height is less than 667px (iphone SE)

* Fix misaligned check icon on mobile

* Prevent the menu from closing when clicking on a selected item

* Add changelog

* Fix lint

---------

Co-authored-by: moon <moon.kyong@automattic.com>
2023-06-22 20:54:14 -07:00
Moon bc827cf16b
Update/38743 loading changes in core profiler (#38750)
* Skip teh plugin page when all the plugins are activated

* Fix the if statement so that stageIndex becomes 2 when progress is over 60

* Add a 2nd loader stage for the skipped guided setup

* Add changelog

* Lint fix -- css

* fix: banished core profiler page spinners

* addressed pr comments

* update jest snapshot

---------

Co-authored-by: rjchow <me@rjchow.com>
2023-06-19 13:33:28 +08:00
Moon 00e4e94c89
Change select option hover color on core profiler pages (#38724)
* Use theme color for the option hover

* Add Changelog

* Remvoe absolute position -- can't predict correct value for bottom

* Fix css lint error

* Fix button width

* Use gray-0 for dropdown item hover color

* Fix border style for Give your store a name field

* Fix hover color for the platform options

* Remove light color on hover

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-06-19 11:03:55 +08:00
Ilyas Foo b490e56a40
Various UI fixes in Core profiler steps (#38759)
* Fix font heading font style and adjust main component max width to match design

* Remove redundant #FunWooFact

* Reset button font color to follow admin theme

* Fix Installed label vertical alignment

* Changelog

* Remove permanent borders from consent checkbox, lint fix

* Remove box shadow on checkboxes in plugins page

* Standardize checkbox styling across core profiler

* Fix heading font styling

* Lint

* More lint

* Update snapshot
2023-06-17 13:14:13 +08:00
Moon 604132391a
Visual changes for Intro, guided setup, and skipped guided setup pages (#38709)
* Change Skip this setup to Skip this step

* Visual changes on intro, user profile, and skip guided page

* Always check tracking agreement

* Change border to 2px

* Change Give yoru store a name font-size to 13

* Add Changelog

* Update test to reflect the text change

* Remove !important

* Update test snapshot

* Update test snapshot

* Remove test that is no longer necessary
2023-06-13 22:10:43 -07:00
Moon 620ff93e5a
Additional changes for the core profiler plugins page (#38616)
* Add install-and-activate-plugins-async action to onboarding

* Add label and learn_more_link types

* Use label and learn_more_link

* Fix type

* Add changelog

* Add changelog

* Add install_priority -- this will be used in the core profiler

* Sort selected plugins by install_priority for installation

* Remove unused imports

* dev: refactor installAndActivatePlugins to xstate

* ts fixes

* Sort plugins by install_priority

* Make sure WooCommerce Shipping is always visible

* Update free extension list content

* Updated WC payment description
* Updated logo images

* Visual changes on the plugin page

* Change CTA font size from 13px to 14px
* Change spacing between the chebox and logo to 24px
* Change heading font-weight to 500

* Fix css lint error

* Fix gray-900 variable name

* Hide learn more link on mobile view

* Add back learn more link that was removed from rebase

* Send pluginsAvailable to pluginInstallermachine

* Use is_activated to determine plugin availability and install status

* Update packages/js/data/src/onboarding/types.ts

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Add back recordTracksPluginsLearnMoreLinkClicked

* Use install-and-activate-plugins-async when timer is up

* Record plugin and link with learn more linked clicked event

* Fix failign tests

* Add comment for install_priority

---------

Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-06-13 15:03:03 -07:00
RJ ab18828e84
add: core profiler business info page (#38412)
* add: core profiler business info page
2023-05-30 15:05:38 +08:00
Moon 6946ef384a
Core Profiler - Add extensions page (#38405)
* Initial design impl. without the full functionality

* Delete unused icons

* Add is_installed and plugins_page_skipped

* Add plugin-card component to render an installable plugin

* Implement plugins page

* Add loaders for plugins

* Add changelog

* Remove unused type

* Add changelog

* Remove unnecessary return statement

* Add obw/core-profiler

* Replace extensions with plugins

* Temp -- use window.location.href for Woo Home redirection

* Minor: code refactor

* Refactor isntallAndActivatedPlugins

* Skip plugins page when there is no available plugin

* Apply mobile styles

* Update plugins/woocommerce-admin/client/core-profiler/components/plugin-card/plugin-card.scss

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce-admin/client/core-profiler/components/plugin-card/plugin-card.scss

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce-admin/client/core-profiler/style.scss

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Bold errored plugin name

* Fix checkbox alignment

* Update changelog

* Fix object type for formatToParts function

* Fix lint issues

* Fix CSS lint issues

* Fallback to en-US when locale is not available

* Fix error with siteLocale

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-05-29 07:45:30 -07:00
Chi-Hsuan Huang 4547922f3f
Add core profiler user profile page (#38328) 2023-05-22 11:21:16 +08:00
Moon 0bf6859383
Add Business Location page to the core profiler (#38019)
* Add core profiler - welcome to woo page

* Update checkbox styles

* Add tracks

* Update default tracking value

* Update copies

* using invoked promise instead of useState

- take advantage of xstate's built ins for side effects instead of  useEffect/hooks
- discovered that error result wasn't really handled in original useEffect
- use text labels instead of inline functions so that we can decouple the implementation from the machine model
- todo: can move the invoked function out elsewhere and also tests if needed (not necessary here because it's a simple call)

* add: core profiler scaffolding using xstate

* Add navigation and progress-bar components

* fix css lint error

* Update plugins/woocommerce-admin/client/core-profiler/components/navigation/woologo.tsx

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce-admin/client/core-profiler/components/progress-bar/progress-bar.tsx

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce-admin/client/core-profiler/components/navigation/navigation.tsx

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Remove var from __ function

* Use woocommerce prefix for classnames

* Fix css lint error

* Fix broken tests

* Add business location page

* Remove unwanted changes from rebase

* Remove unwanted changes from rebase

* Redirect to Woo Home on exit

* Add tracks

* Fix js lint error

* Add loader page

* Support meta value from nested states

* Use navigateTo

* Add tests for getCountryStateOptions

* Use Country type from navigation package

* Rename useStages to getLoaderStageMeta

* Add changelog

* Move progress from 20 to 80

* Fix xstate warning

* Fix broken pnpm lock

* Fix eslint errors

* Update plugins/woocommerce-admin/client/core-profiler/services/country.ts

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>

* Update plugins/woocommerce-admin/client/core-profiler/index.tsx

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>

* Save country to option

* Fix jslint error

* Update plugins/woocommerce-admin/client/core-profiler/services/country.ts

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Update plugins/woocommerce-admin/client/core-profiler/style.scss

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>

* Fix eslint error

* Use decodeEntities directly

* Update comment for artificial 3 seconds wait

* Disable Go to my store button when country is empty

* Style for mobile devices

* Style updates for the country dropdown

* Fix js lint error

* Update country dropdown border color

* Style the loader

* Fix css lint

---------

Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
2023-05-15 04:56:47 +08:00
Chi-Hsuan Huang ea58ae339a
Add core profiler "Welcome to Woo!" page (#37952)
* Add core profiler - welcome to woo page

* Add changelog

* Update checkbox styles

* Update copies

* Add test

* Add enable prop to window.wcTracks type

* Add tracks

* Add explat changelog

* Fix import

* Update default tracking value

* Update copies

* Fix test

* using invoked promise instead of useState

- take advantage of xstate's built ins for side effects instead of  useEffect/hooks
- discovered that error result wasn't really handled in original useEffect
- use text labels instead of inline functions so that we can decouple the implementation from the machine model
- todo: can move the invoked function out elsewhere and also tests if needed (not necessary here because it's a simple call)

* use actions.choose instead of branching inside action 

- https://stately.ai/docs/xstate/transitions-and-choices/guarded-actions#the-choose-action
- makes it so that the machine model is serializeable
- todo: in the distant future i wonder if it might be tidier to have tracks be its own actor that just receives the same events that this machine does, that way it's just standalone instead of mixing up tracks with the implementation

* use dispatch instead of useDispatch

- decouples the implementation of the handler from the react component
- makes the handler testable on its own if needed
- makes the state machine testable without relying on external dependencies

* decoupled remaining function calls

* Fix lint error

* Fix style lint

* address xstate console warnings

- .withConfig() is a function call that returns a new object every invocation so we need to wrap it in useMemo to keep it stable

* Add optInDataSharing is false test

* Fix lint

---------

Co-authored-by: rjchow <me@rjchow.com>
2023-05-03 15:54:28 +08:00