11/**
22 * External dependencies
33 * */
4- import { CheckboxControl } from '@wordpress/components' ;
4+ import { CheckboxControl , __experimentalVStack as VStack } from '@wordpress/components' ;
55import { __ } from '@wordpress/i18n' ;
66
77/**
@@ -20,62 +20,64 @@ export default ({ taxonomies, postType }) => {
2020 < div >
2121 < h4 > { __ ( 'Taxonomies' , 'elasticpress-labs' ) } </ h4 >
2222 { hasTaxonomies > 0 ? (
23- Object . keys ( taxonomies ) . map ( ( taxonomy ) => {
24- const { label, termsInclude, termsExclude, enabled } = taxonomies [ taxonomy ] ;
25- return (
26- < >
27- < CheckboxControl
28- label = { label }
29- checked = { enabled }
30- onChange = { ( ) => {
31- setEmbeddingForPostType ( key , taxonomy , 'enabled' , ! enabled ) ;
32- } }
33- />
34- { enabled && (
35- < >
36- < Group indent >
37- < TermSelect
38- postType = { postType }
39- taxonomy = { taxonomy }
40- label = { __ (
41- 'Include posts that have any of these terms' ,
42- 'elasticpress-labs' ,
43- ) }
44- value = { termsInclude }
45- onChange = { ( terms ) =>
46- setEmbeddingForPostType (
47- key ,
48- taxonomy ,
49- 'termsInclude' ,
50- terms ,
51- )
52- }
53- />
54- </ Group >
55- < Group indent >
56- < TermSelect
57- postType = { postType }
58- taxonomy = { taxonomy }
59- label = { __ (
60- 'Exclude posts that have any of these terms' ,
61- 'elasticpress-labs' ,
62- ) }
63- onChange = { ( terms ) =>
64- setEmbeddingForPostType (
65- key ,
66- taxonomy ,
67- 'termsExclude' ,
68- terms ,
69- )
70- }
71- value = { termsExclude }
72- />
73- </ Group >
74- </ >
75- ) }
76- </ >
77- ) ;
78- } )
23+ < VStack >
24+ { Object . keys ( taxonomies ) . map ( ( taxonomy ) => {
25+ const { label, termsInclude, termsExclude, enabled } = taxonomies [ taxonomy ] ;
26+ return (
27+ < >
28+ < CheckboxControl
29+ label = { label }
30+ checked = { enabled }
31+ onChange = { ( ) => {
32+ setEmbeddingForPostType ( key , taxonomy , 'enabled' , ! enabled ) ;
33+ } }
34+ />
35+ { enabled && (
36+ < >
37+ < Group indent >
38+ < TermSelect
39+ postType = { postType }
40+ taxonomy = { taxonomy }
41+ label = { __ (
42+ 'Include posts that have any of these terms' ,
43+ 'elasticpress-labs' ,
44+ ) }
45+ value = { termsInclude }
46+ onChange = { ( terms ) =>
47+ setEmbeddingForPostType (
48+ key ,
49+ taxonomy ,
50+ 'termsInclude' ,
51+ terms ,
52+ )
53+ }
54+ />
55+ </ Group >
56+ < Group indent >
57+ < TermSelect
58+ postType = { postType }
59+ taxonomy = { taxonomy }
60+ label = { __ (
61+ 'Exclude posts that have any of these terms' ,
62+ 'elasticpress-labs' ,
63+ ) }
64+ onChange = { ( terms ) =>
65+ setEmbeddingForPostType (
66+ key ,
67+ taxonomy ,
68+ 'termsExclude' ,
69+ terms ,
70+ )
71+ }
72+ value = { termsExclude }
73+ />
74+ </ Group >
75+ </ >
76+ ) }
77+ </ >
78+ ) ;
79+ } ) }
80+ </ VStack >
7981 ) : (
8082 < p >
8183 { __ (
0 commit comments