Merge branch 'trunk' into update/add-edit
This commit is contained in:
commit
bbd0b4e7e4
|
@ -22,8 +22,9 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@woocommerce/dependency-extraction-webpack-plugin": "1.4.0",
|
"@woocommerce/dependency-extraction-webpack-plugin": "1.4.0",
|
||||||
"@woocommerce/eslint-plugin": "1.1.0",
|
"@woocommerce/eslint-plugin": "1.1.0",
|
||||||
|
"@wordpress/prettier-config": "^1.0.1",
|
||||||
"@wordpress/scripts": "^13.0.3",
|
"@wordpress/scripts": "^13.0.3",
|
||||||
"prop-types": "^15.7.2"
|
"prettier": "^2.2.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@woocommerce/data": "^1.1.1",
|
"@woocommerce/data": "^1.1.1",
|
||||||
|
|
|
@ -11,26 +11,23 @@ import { AdminNotes } from '../admin-notes';
|
||||||
import { Tools } from '../tools';
|
import { Tools } from '../tools';
|
||||||
import { default as Options } from '../options';
|
import { default as Options } from '../options';
|
||||||
|
|
||||||
const tabs = applyFilters(
|
const tabs = applyFilters('woocommerce_admin_test_helper_tabs', [
|
||||||
'woocommerce_admin_test_helper_tabs',
|
{
|
||||||
[
|
name: 'options',
|
||||||
{
|
title: 'Options',
|
||||||
name: 'options',
|
content: <Options />,
|
||||||
title: 'Options',
|
},
|
||||||
content: <Options/>,
|
{
|
||||||
},
|
name: 'admin-notes',
|
||||||
{
|
title: 'Admin notes',
|
||||||
name: 'admin-notes',
|
content: <AdminNotes />,
|
||||||
title: 'Admin notes',
|
},
|
||||||
content: <AdminNotes/>,
|
{
|
||||||
},
|
name: 'tools',
|
||||||
{
|
title: 'Tools',
|
||||||
name: 'tools',
|
content: <Tools />,
|
||||||
title: 'Tools',
|
},
|
||||||
content: <Tools/>,
|
]);
|
||||||
},
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
export function App() {
|
export function App() {
|
||||||
return (
|
return (
|
||||||
|
@ -39,18 +36,18 @@ export function App() {
|
||||||
<TabPanel
|
<TabPanel
|
||||||
className="woocommerce-admin-test-helper__main-tab-panel"
|
className="woocommerce-admin-test-helper__main-tab-panel"
|
||||||
activeClass="active-tab"
|
activeClass="active-tab"
|
||||||
tabs={ tabs }
|
tabs={tabs}
|
||||||
initialTabName={ tabs[ 0 ].name }
|
initialTabName={tabs[0].name}
|
||||||
>
|
>
|
||||||
{ ( tab ) => (
|
{(tab) => (
|
||||||
<>
|
<>
|
||||||
{ tab.content }
|
{tab.content}
|
||||||
{ applyFilters(
|
{applyFilters(
|
||||||
`woocommerce_admin_test_helper_tab_${ tab.name }`,
|
`woocommerce_admin_test_helper_tab_${tab.name}`,
|
||||||
[]
|
[]
|
||||||
) }
|
)}
|
||||||
</>
|
</>
|
||||||
) }
|
)}
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
10
src/index.js
10
src/index.js
|
@ -9,8 +9,10 @@ import { render } from '@wordpress/element';
|
||||||
import { App } from './app';
|
import { App } from './app';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
|
||||||
const appRoot = document.getElementById( 'woocommerce-admin-test-helper-app-root' );
|
const appRoot = document.getElementById(
|
||||||
|
'woocommerce-admin-test-helper-app-root'
|
||||||
|
);
|
||||||
|
|
||||||
if ( appRoot ) {
|
if (appRoot) {
|
||||||
render( <App/>, appRoot );
|
render(<App />, appRoot);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue