woocommerce/plugins/woocommerce-admin/client/analytics/settings
Albert Juhé Lluveras 5d01cee56c Add progress bars to Historical Data Import screen (https://github.com/woocommerce/woocommerce-admin/pull/2312)
* Hook up import/status endpoint to Historical Data Import screen

* Fix PHP tests

* Add speak message when the import is complete

* Several fixes

* Cleanup

* Update progress bars every 3 seconds and bugfixes

* Rename ongoingImport to activeImport

* Use timestamp to identify queries

* Use timestamps for historical data state

* Add 'initializing' status

* Cleanup

* Pass less props around

* Refactor getStatus

* Set stop timestamp on request error

* Typo
2019-06-11 14:47:53 +02:00
..
historical-data Add progress bars to Historical Data Import screen (https://github.com/woocommerce/woocommerce-admin/pull/2312) 2019-06-11 14:47:53 +02:00
README.md Update text domain. (https://github.com/woocommerce/woocommerce-admin/pull/1795) 2019-03-13 11:14:02 -06:00
config.js Replace Rebuild reports settings with Import Historical Data (https://github.com/woocommerce/woocommerce-admin/pull/2198) 2019-05-10 11:34:03 +02:00
index.js Update settings wc-api to accept multiple setting groups (https://github.com/woocommerce/woocommerce-admin/pull/2293) 2019-05-24 15:22:21 +08:00
index.scss CSSLint: Remove whitespace at the end of line (https://github.com/woocommerce/woocommerce-admin/pull/1845) 2019-03-20 00:34:22 +01:00
setting.js Add rebuild tool to settings page (https://github.com/woocommerce/woocommerce-admin/pull/1737) 2019-03-06 13:32:05 +08:00
setting.scss Add rebuild tool to settings page (https://github.com/woocommerce/woocommerce-admin/pull/1737) 2019-03-06 13:32:05 +08:00

README.md

Settings

The settings used to modify the way data is retreived or displayed in WooCommerce reports.

Extending Settings

Settings can be added, removed, or modified outside oc wc-admin by hooking into woocommerce_admin_analytics_settings. For example:

addFilter( 'woocommerce_admin_analytics_settings', 'wc-example/my-setting', settings => {
	return [
		...settings,
		{
            name: 'custom_setting',
            label: __( 'Custom setting:', 'woocommerce-admin' ),
            inputType: 'text',
            helpText: __( 'Help text to describe what the setting does.' ),
            initialValue: 'Initial value used',
            defaultValue: 'Default value',
		},
	];
} );

Each settings has the following properties:

  • name (string): The slug of the setting to be updated.
  • label (string): The label used to describe and displayed next to the setting.
  • inputType (enum: text|checkbox|checkboxGroup): The type of input to use.
  • helpText (string): Text displayed beneath the setting.
  • options (array): Array of options used for inputs with selectable options.
  • initialValue (string|array): Initial value used when rendering the setting.
  • defaultValue (string|array): Value used when resetting to default settings.