Commit Graph

67 Commits

Author SHA1 Message Date
Jeff Stieler d1c178a75b Use chunk id instead of generated name to reduce filename length. (https://github.com/woocommerce/woocommerce-admin/pull/4535) 2020-06-10 17:41:27 -05:00
Paul Sealock 134be1c08b Update/@wordpress components base styles (https://github.com/woocommerce/woocommerce-admin/pull/4427) 2020-06-10 13:55:06 +12:00
David Stone 8ebd33fe6b Use Route based code splitting to optimize bundle size (https://github.com/woocommerce/woocommerce-admin/pull/4094)
* Use lazy loading to split up the size of the js downloaded

* Use lazy loading to split up the size of the js downloaded

* Add Moment Timezone plugin to reduce size of data file.

* Lazy load header panels and use Dashicons for faster loading

* Load assets from the correct publicPath

* Load assets from the correct publicPath

* PHP cs fixes

* Fix missing quotes on string literal.

* Fix PropType warning for lazy loaded component.

* Separate the task list and dashboard chunks.

* Lazy load dashboard sections.

* Restore original icons and reduce size by importing only the icons needed

* Lazy load alerts to save more Kb on initial load

* Minify built JS in production mode.

* Add preload tags for WC Admin assets. (https://github.com/woocommerce/woocommerce-admin/pull/4162)

* Fix linting errors.

* Add modified UnminifiedWebpackPlugin.

* Produce minified and unminified bundles for all builds.

* Remove unused variable from webpack config.

* Run unminify after sourcemap generation.

* Only hook after optimization if we're using a devtool.

* Add minification suffix in Loader::get_url().

* Lazy load OBW on new home screen.

* Move OBW style up a level to layout.

* Hydrate ProfileWizard independently of withSelect and withDispatch

* Fix order of composition and fallback function when using hydration.

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-04-29 12:01:27 -06:00
Timmy Crawford acfae2c356 Setup Checklist: Remove Setup Menu Item and I'll Do This Later link (https://github.com/woocommerce/woocommerce-admin/pull/4085)
* Remove  menu item

* Remove 'do this later' link
2020-04-08 14:27:24 -07:00
Matt Sherman ee0eec8a40 Support IE11 in `wc-admin` (https://github.com/woocommerce/woocommerce-admin/pull/4037)
* Include `marked` in node_modules run through babel
* Fix adding of `Setup` menu item in IE11
2020-04-01 12:03:13 -04:00
Fernando Espinosa b71bc861fb WooCommerce Shipping order page prompt (https://github.com/woocommerce/woocommerce-admin/pull/3955)
Co-authored-by: David Stone <david@nnucomputerwhiz.com>
Co-authored-by: Chris Shultz <chris.shultz@automattic.com>
Co-authored-by: Harris Wong <harris.wong@a8c.com>
2020-03-27 13:42:58 -07:00
Darren Ethier 783f613815 wp.data Settings refactor
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)
2020-03-25 16:20:17 +13:00
renovate[bot] 7777a7b727 Update dependency sass-loader to v8 (https://github.com/woocommerce/woocommerce-admin/pull/3925)
* Update dependency sass-loader to v8

* Address node-sass webpack breaking changes

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Paul Sealock <psealock@gmail.com>
2020-03-24 14:15:45 +13:00
Bec Scott 893aecfa4b Improve focus on task list (https://github.com/woocommerce/woocommerce-admin/pull/3796)
* Script that hides or shows menu items

* Hook up buttons to task list, hook up options to onboarding-experience to set up the menu

* Fix some little code style issues

* Remove LinkButton in favour of the existing Button in @wordpress/components

* Remove reference to removed style file

* Move menu experience script to /client/wp-admin-scripts to match current style

* Only load the onboarding menu experience script if onboarding is enabled

* Localise some strings

* Separate the "Setup" link from the existing items to avoid conflicts with extensions that modify the menu

* Use the item key instead of title to report back completed tasks

* Change from skip_option to reason to make this easier to grok

* Use existing woocommerce_task_list_hidden option instead of creating a new one

* Tweak options to get menu experience working again

* Simplify skip actions logic

* Preload woocommerce_task_list_do_this_later option

* Nicer event key names

* Clean  up the styling

* Remove wcSettings.onboarding check from the task items list in `customizable`

* Remove spinner from customizable

* Fix translated string for WooCommerce menu setup anchor

* Use predef color instead of a hard-coded hex code

* Remove superfluous ={ true } from markup

Co-authored-by: Rebecca Scott <me@becdetat.com>
2020-03-13 14:34:53 +10:00
Darren Ethier 33c5b41e3f Align WooCommerce javascript code standards/linting/styles with WordPress core. (https://github.com/woocommerce/woocommerce-admin/pull/3674)
* 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>
2020-02-14 15:23:21 +13:00
Justin Shreve a0e47e8dfd Add a button to continue setup after importing products (https://github.com/woocommerce/woocommerce-admin/pull/3402) 2019-12-10 14:28:19 -05:00
Justin Shreve 448e1f3e11 Remove Newspack Dependency (https://github.com/woocommerce/woocommerce-admin/pull/3302)
* Switch to @wordpress/component's Button

* Finish button conversion

* Move to @wp/component's CheckboxControl

* Add  ImageUpload component

* Remove Newspack package

* CSS Cleanup

* Handle PR feedback: Fix tests, add ImageUploader basic test, fix FireFox/Safari Display issues, and  currency input bug
2019-12-02 12:39:22 -05:00
Paul Sealock 0db5cbb6a0 Component styles: Explicitly import from Gutenberg (https://github.com/woocommerce/woocommerce-admin/pull/3292)
* Fix Gutenberg style imports

* remove duplicate variables

* remove extra variables

* remove duplicate imports

* move base style imports to webpack
2019-11-22 13:19:37 +13:00
Paul Sealock 03399a034c Create GH tag release process (https://github.com/woocommerce/woocommerce-admin/pull/3190)
Add core to the release

no need to re-run docs

simplify build command

add gh release script

fix errant comment

fix errant comment

force add feature-config.php

gitattributes

moar attributes

add language files
2019-11-18 11:39:27 +13:00
Joshua T Flowers 642b17c1aa Onboarding: Update return to task list notices (https://github.com/woocommerce/woocommerce-admin/pull/3192)
* Use core/notices for product creation notices

* Only show task list return notice on first save of taxes

* Update tax completion notice

* Check if tax task is complete before loading script
2019-11-12 09:17:36 +08:00
Joshua T Flowers 73b11a1338 Onboarding: Add return to task list after saving taxes (https://github.com/woocommerce/woocommerce-admin/pull/3170) 2019-11-07 08:17:46 +08:00
Justin Shreve f888079fe7 Add notices to return to task list on product and homepage tasks. (https://github.com/woocommerce/woocommerce-admin/pull/3061)
* Add notices to return to task list on product and homepage tasks.

* Handle PR feedback, simplifiy check.
2019-10-21 14:13:25 -04:00
Justin Shreve 8fe0f93c03 Add the ability to create custom plugin builds (https://github.com/woocommerce/woocommerce-admin/pull/3044)
* Add the ability to create custom plugin builds

* Use $_ENV instead of $_SERVER inside the generate-feature-config CLI script.
2019-10-17 14:00:20 -04:00
Jeff Stieler e53d5daa94 Hook up download button to export endpoint. (https://github.com/woocommerce/woocommerce-admin/pull/2900)
* Move TableCard actions from packaged component to ReportTable.

* Build an IE stylesheet for the main app.

* Remove defunct TableCard download test.

* Update components changelog.

* Fix pagination.

Pull query from table data instead of ReportTable props.

* Initiate report export from download button (https://github.com/woocommerce/woocommerce-admin/pull/2951)

* Add report export operations to API spec.

* Initiate a report export job when there is more than one page of report data.

* Add report download "type" to Tracks event.

* Ensure WC_Emails class is hooked in before sending report download emails.

* Set email parameter for background CSV download requests.
2019-10-08 15:02:26 -07:00
Jeff Stieler 0be875d898 Reduce size of bundled JS, and overall plugin file size. (https://github.com/woocommerce/woocommerce-admin/pull/2933)
* Remove embed-page-specific Webpack entry.

* Stop @woocommerce/components from being bundled with the app code.
2019-09-24 08:55:39 -07:00
Darren Ethier d728d38219 Refactor: Alternative approach to implementing extendable settings from the server (https://github.com/woocommerce/woocommerce-admin/pull/2917)
* 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
2019-09-23 17:47:08 -04:00
Albert Juhé Lluveras 5b0af85472 Use upstream webpack-rtl-plugin (https://github.com/woocommerce/woocommerce-admin/pull/2870) 2019-09-06 16:12:50 +02:00
Jeff Stieler 41b4100235 Fix react-spring breaking IE11. 2019-07-24 09:37:37 -06:00
Paul Sealock d98eceffc7 Revert "Revert "Update to new Snackbar component and notice store"" (https://github.com/woocommerce/woocommerce-admin/pull/2643)
* Revert "Revert "Update to new Snackbar component and notice store""

* Update uploader component to use createNotice

* Bump required WP version to 5.2

* Update required PHP and WP versions in plugin header
2019-07-23 11:26:46 +08:00
Paul Sealock 821115aa54 Webpack
: Use wp.url instead of bundling package
2019-07-17 13:35:43 +12:00
Timmy Crawford f4735658d7 Revert "Update to new Snackbar component and notice store (https://github.com/woocommerce/woocommerce-admin/pull/2596)"
This reverts commit 980ff6fa71.
2019-07-10 09:58:51 -07:00
Joshua T Flowers 980ff6fa71 Update to new Snackbar component and notice store (https://github.com/woocommerce/woocommerce-admin/pull/2596)
* Add new wordpress/components version and fix dependencies

* Add in snackbar styling and gutenberg variables

* Convert all existing notice actions to wordpress/notices

* Fix linting errors

* Add package.lock changes

* Update search list control snapshots with new attributes
2019-07-08 12:10:34 +08:00
Albert Juhé Lluveras 1939ea084c Transpile newspack-components package (https://github.com/woocommerce/woocommerce-admin/pull/2348) 2019-05-31 10:34:26 +02:00
Justin Shreve 821408fc83 Add Muriel/Newspack components for use in onboarding (https://github.com/woocommerce/woocommerce-admin/pull/2313)
* Add Muriel/Newspack components for use in onboarding

* Adjust some alignment
2019-05-28 10:05:55 -04:00
Albert Juhé Lluveras 3c433a24b3 Transpile acorn-jsx package (https://github.com/woocommerce/woocommerce-admin/pull/2064) 2019-04-17 10:34:45 +02:00
Paul Sealock 2e3b3467a5 Remove lodash from bundle 2019-04-16 10:44:32 +12:00
Joshua T Flowers 08f6d757ab Minify in safe mode for RTL styles to prevent stripping z-index (https://github.com/woocommerce/woocommerce-admin/pull/1838) 2019-03-20 10:55:43 +08:00
Albert Juhé Lluveras c1b6c3d8ce Load RTL CSS files (https://github.com/woocommerce/woocommerce-admin/pull/1781)
* Load RTL CSS files

* Remove RTL specific CSS rules

* Generate RTL files of app style

* Simplify require route
2019-03-14 11:18:54 +01:00
Justin Shreve 0fe061b97d Add Feature Flags (https://github.com/woocommerce/woocommerce-admin/pull/1500)
* First pass at adding feature flags. Accessible over PHP and JS.

* Hook up dev config to test enviornments, hook up features to their flags.

* Cleanup some code and add documentation. Remove beta config.

* Handle PR Feedback: Add devdocs flag, remove categories flag, fix auto-generated PHP warning.

* Add todo for beta phase.

* Handle PR feedback: Simplify is_array check, update build command, simplify test mock, remove empty webpack line.
2019-02-12 15:02:02 -05:00
Timmy Crawford 10c6016d4c Update usage of lib/number to @woocommerce/number (https://github.com/woocommerce/woocommerce-admin/pull/1400)
* Remove usage of lib/number

* Remove formatNumber usage when currency is used.

* Add wc-number as a dependency of wc-currency.

* Add locutus as a dev dependency.

* Add number to test helper.
2019-01-29 08:48:46 -08:00
Albert Juhé Lluveras 8b341f0981 Replace 'extract-text-webpack-plugin' with 'mini-css-extract-plugin' (https://github.com/woocommerce/woocommerce-admin/pull/1299) 2019-01-15 11:55:54 +01:00
Joshua T Flowers ab310320dd Fix ie11 blank screen by babel transforms (https://github.com/woocommerce/woocommerce-admin/pull/1170)
* Add specific vendor packages to babel loader to fix ie11 transforms

* Remove unused buble
2018-12-26 10:46:32 +08:00
Justin Shreve 8d4b0fcc07 Fix Activity Panel on existing WooCommerce pages (https://github.com/woocommerce/woocommerce-admin/pull/1004)
* Fix Activity Panel on embedded pages

* Fix comment typo
2018-12-06 17:08:40 -05:00
Kelly Dwan 2a9cb6509b Build: Move components to packages dir (https://github.com/woocommerce/woocommerce-admin/pull/804)
* Move components to packages folder

* Update documentation generator to handle packages/components and client/components

* Update component locations

* Update CSS build process

* Remove react-dates css, this is already included by gutenberg

* Fix CSS style - single quotes

* Fix incorrect imports

* Update package-lock with new dependencies

* Update component locations for devdocs

* Fix location of tests
2018-11-15 13:16:23 -05:00
Kelly Dwan 8af82f3dee Build: Move `lib/csv` to packages (https://github.com/woocommerce/woocommerce-admin/pull/756)
* Move CSV to packages

* Update CSV imports

* Add some basic usage documentation

* Add csv lib to the enqueued assets

* Change name to `csv-export`

* Update webpack build process to allow for package names with dashes

* Fix capitalization

* Update readme with docs extracted from jsdoc

* Fix merge conflict commit 😣

* Check that generateCSVFileName is called with correct params
2018-11-06 16:53:22 -05:00
Kelly Dwan d27cb26ef7 Build: Move `lib/nav-utils` and `lib/history` to `@woocommerce/navigation` (https://github.com/woocommerce/woocommerce-admin/pull/763)
* Move nav-utils and history to new package

* Update config to build and use new navigation package

* Update all imports to use new navigation package

* Remove unnecessary README

* Update nav-utils path
2018-11-05 16:02:04 -05:00
Kelly Dwan f62537fc17 Try: Add Lerna to split out utility packages (https://github.com/woocommerce/woocommerce-admin/pull/678)
* Add lerna & GB package-building script

* Move currency library to lerna module

* Update lerna config

* Add publish commands

* Add currency as an faux-external module

* Add separate command to build just core files

* Update dependency path

* Update build script to build all packages into `dist`

* Add packages to the jest test setup

* Move date library to packages

* Update imports to use @woocommerce/date

* Output wcSettings definition before any scripts are output

Fixes issues where wc-dates lib relies on settings object

* Add the build step into travis

* Update jest config to dynamically get package paths

* Update package postcss config to match wc-admin’s main config

* Add combined watch scripts for package+app, add a `clean` command to clean up old build files

* Ignore PHPCS error (leave todo message to fix)

* Concat files with a space, fix issue where all files join in one continuous string and fail the check
2018-10-30 14:57:48 -04:00
Jonathan Belcher a947d304dc Reafctors code to vanila js and removes jQuery 2018-10-10 10:24:57 -04:00
Kelly Dwan 5dc1addbf8 Build: Update i18n generation to combine JS + PHP translations (https://github.com/woocommerce/woocommerce-admin/pull/481)
* Generate the PHP translations file from the POT file after building the project

* Remove unused tasks

* Update i18n task to generate JS pot file, then convert that to PHP, then run grunt php pot generation

* Update docs

* Pipe babel file output to null, not entire output of command

Helps with debugging the babel command itself
2018-09-26 10:23:55 -04:00
Kelly Dwan 62276fb361 Add visual component docs from markdown examples (https://github.com/woocommerce/woocommerce-admin/pull/470)
* Remove content from README, leaving only the example

* Rename edited READMEs

* Add a devdocs page rendering from markdown example files

* Add more components to devdocs

* Add the rest of the component examples

* Add navigation to single components, show generated readme on single component view

* Style devdocs like calypso

* Split devdocs into two columns at “desktop” sizes

* Update segmented selection example

* Update link

* Add header to avoid notices error
2018-09-24 11:36:35 -04:00
Kelly Dwan 39ca2cc627 Remove apiRequest in favor of apiFetch (https://github.com/woocommerce/woocommerce-admin/pull/309) 2018-08-21 15:02:49 -04:00
Kelly Dwan dec97d178e Components: Export reusable components to a separate file + global (https://github.com/woocommerce/woocommerce-admin/pull/297)
* Importing all components from a root components file

* Update Ratings component to avoid circular dependencies, fix tests

* Export components on `wc.components`, use this for importing

* Move react-dates initialize to the components file

* Push query changes to history

Fixes an issues where native a links do not update the query in `history`

* Update test config for new @woocommerce/components path

* Update chart components import

* Merge simple/complex & alphabetize by first exported name

* Add a readme with info about how to call these components
2018-08-20 17:18:13 -04:00
Kelly Dwan ddeacb84e5 Move non-reset SCSS to new files, add folder structure (https://github.com/woocommerce/woocommerce-admin/pull/274)
* Move non-reset SCSS to a new file

* Split shared files and “meta” files into two folders

This also creates two new base scss files for the different app vs embedded CSS files

* Move notice & embed-specific css out of reset

* Update README with folder structure notes
2018-08-06 11:30:43 -04:00
Paul Sealock 45231f9049 add theming to Gutenberg components' 2018-08-02 12:25:00 +12:00
Justin Shreve e27af517a4 Add CSS autoprefixer (https://github.com/woocommerce/woocommerce-admin/pull/244) 2018-07-30 10:05:22 -04:00