From 74ea1ea05819a4bc55be8e3f0838af1f846d41b1 Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Wed, 11 Dec 2024 19:32:02 +0500 Subject: [PATCH 1/2] Fix: Bottom margin style is deprecated since version 6.7 --- .../components/facet-display-count-control.js | 1 + .../common/components/facet-meta-control.js | 1 + .../common/components/facet-order-control.js | 1 + .../facet-search-placeholder-control.js | 1 + .../common/components/facet-taxonomy-control.js | 1 + assets/js/blocks/facets/date/edit.js | 1 + assets/js/blocks/facets/meta-range/edit.js | 2 ++ assets/js/features/components/control.js | 5 +++++ .../search/editor/plugins/exclude-from-search.js | 15 +++++---------- assets/js/sync-ui/components/include.js | 1 + assets/js/sync-ui/components/indexables.js | 1 + assets/js/sync-ui/components/limits.js | 2 ++ assets/js/sync-ui/components/offset.js | 1 + assets/js/sync-ui/components/post-types.js | 1 + assets/js/sync-ui/components/put-mapping.js | 1 + assets/js/sync-ui/css/advanced-control.css | 4 ++++ assets/js/sync-ui/css/controls.css | 4 ++++ .../js/synonyms/components/common/edit-panel.js | 3 +++ .../js/synonyms/components/common/list-table.js | 1 + .../js/synonyms/components/editors/solr-editor.js | 1 + .../synonyms/components/editors/visual-editor.js | 1 + assets/js/synonyms/css/edit-panel.css | 9 +++++++++ assets/js/weighting/components/field.js | 2 ++ assets/js/weighting/components/group.js | 1 + 24 files changed, 51 insertions(+), 10 deletions(-) diff --git a/assets/js/blocks/facets/common/components/facet-display-count-control.js b/assets/js/blocks/facets/common/components/facet-display-count-control.js index d21f635d0d..aca22778b5 100644 --- a/assets/js/blocks/facets/common/components/facet-display-count-control.js +++ b/assets/js/blocks/facets/common/components/facet-display-count-control.js @@ -19,6 +19,7 @@ export default ({ onChange, checked }) => { checked={checked} label={__('Display count', 'elasticpress')} onChange={onChange} + __nextHasNoMarginBottom /> ); }; diff --git a/assets/js/blocks/facets/common/components/facet-meta-control.js b/assets/js/blocks/facets/common/components/facet-meta-control.js index 670605cff3..7850c82c2b 100644 --- a/assets/js/blocks/facets/common/components/facet-meta-control.js +++ b/assets/js/blocks/facets/common/components/facet-meta-control.js @@ -50,6 +50,7 @@ export default ({ onChange, value }) => { onChange={onChange} options={options} value={value} + __nextHasNoMarginBottom /> ); }; diff --git a/assets/js/blocks/facets/common/components/facet-order-control.js b/assets/js/blocks/facets/common/components/facet-order-control.js index 11aef3bcfe..d8a19ff093 100644 --- a/assets/js/blocks/facets/common/components/facet-order-control.js +++ b/assets/js/blocks/facets/common/components/facet-order-control.js @@ -52,6 +52,7 @@ export default ({ onChange, orderby, order }) => { }} options={options} value={`${orderby}/${order}`} + __nextHasNoMarginBottom /> ); }; diff --git a/assets/js/blocks/facets/common/components/facet-search-placeholder-control.js b/assets/js/blocks/facets/common/components/facet-search-placeholder-control.js index 5626f09a0c..07a0f3e6e8 100644 --- a/assets/js/blocks/facets/common/components/facet-search-placeholder-control.js +++ b/assets/js/blocks/facets/common/components/facet-search-placeholder-control.js @@ -19,6 +19,7 @@ export default ({ onChange, value }) => { label={__('Search field placeholder', 'elasticpress')} value={value} onChange={onChange} + __nextHasNoMarginBottom /> ); }; diff --git a/assets/js/blocks/facets/common/components/facet-taxonomy-control.js b/assets/js/blocks/facets/common/components/facet-taxonomy-control.js index fb3f41ae20..cecc370640 100644 --- a/assets/js/blocks/facets/common/components/facet-taxonomy-control.js +++ b/assets/js/blocks/facets/common/components/facet-taxonomy-control.js @@ -44,6 +44,7 @@ export default ({ onChange, value }) => { onChange={onChange} options={options} value={value} + __nextHasNoMarginBottom /> ); }; diff --git a/assets/js/blocks/facets/date/edit.js b/assets/js/blocks/facets/date/edit.js index e71da66bd1..f71aae3c85 100644 --- a/assets/js/blocks/facets/date/edit.js +++ b/assets/js/blocks/facets/date/edit.js @@ -25,6 +25,7 @@ const FacetDate = (props) => { label={__('Display custom date option', 'elasticpress')} checked={displayCustomDate} onChange={(displayCustomDate) => setAttributes({ displayCustomDate })} + __nextHasNoMarginBottom /> diff --git a/assets/js/blocks/facets/meta-range/edit.js b/assets/js/blocks/facets/meta-range/edit.js index 5f28ecdc76..f0952c2713 100644 --- a/assets/js/blocks/facets/meta-range/edit.js +++ b/assets/js/blocks/facets/meta-range/edit.js @@ -94,6 +94,7 @@ export default ({ attributes, name, setAttributes }) => { label={__('Value prefix', 'elasticpress')} onChange={onChangePrefix} value={prefix} + __nextHasNoMarginBottom /> @@ -101,6 +102,7 @@ export default ({ attributes, name, setAttributes }) => { label={__('Value suffix', 'elasticpress')} onChange={onChangeSuffix} value={suffix} + __nextHasNoMarginBottom /> diff --git a/assets/js/features/components/control.js b/assets/js/features/components/control.js index 719cb40cc0..bbf97b405e 100644 --- a/assets/js/features/components/control.js +++ b/assets/js/features/components/control.js @@ -159,6 +159,7 @@ export default ({ label={label} onChange={onChangeCheckbox} disabled={isDisabled} + __nextHasNoMarginBottom /> ); } @@ -184,6 +185,7 @@ export default ({ disabled={isDisabled} suggestions={suggestions} value={values} + __nextHasNoMarginBottom /> ); } @@ -208,6 +210,7 @@ export default ({ options={options} disabled={isDisabled} value={value} + __nextHasNoMarginBottom /> ); } @@ -219,6 +222,7 @@ export default ({ label={label} onChange={onChange} disabled={isDisabled} + __nextHasNoMarginBottom /> ); } @@ -242,6 +246,7 @@ export default ({ disabled={isDisabled} value={value} type={type} + __nextHasNoMarginBottom /> ); } diff --git a/assets/js/search/editor/plugins/exclude-from-search.js b/assets/js/search/editor/plugins/exclude-from-search.js index bf99b258ee..f588b5484a 100644 --- a/assets/js/search/editor/plugins/exclude-from-search.js +++ b/assets/js/search/editor/plugins/exclude-from-search.js @@ -18,15 +18,10 @@ export default () => { editPost({ meta: { ...meta, ep_exclude_from_search } }); }; - let WrapperElement = null; - let marginBottomProp = {}; - - if (typeof PluginPostStatusInfo !== 'undefined') { - WrapperElement = PluginPostStatusInfo; - marginBottomProp = { __nextHasNoMarginBottom: true }; - } else { - WrapperElement = PluginPostStatusInfoLegacy; - } + const WrapperElement = + typeof PluginPostStatusInfo !== 'undefined' + ? PluginPostStatusInfo + : PluginPostStatusInfoLegacy; return ( @@ -38,7 +33,7 @@ export default () => { )} checked={ep_exclude_from_search} onChange={onChange} - {...marginBottomProp} + __nextHasNoMarginBottom /> ); diff --git a/assets/js/sync-ui/components/include.js b/assets/js/sync-ui/components/include.js index 2c6ef6a0eb..0c5f7800a7 100644 --- a/assets/js/sync-ui/components/include.js +++ b/assets/js/sync-ui/components/include.js @@ -53,6 +53,7 @@ export default () => { onChange={onChange} saveTransform={saveTransform} value={args.include} + __nextHasNoMarginBottom /> ); diff --git a/assets/js/sync-ui/components/indexables.js b/assets/js/sync-ui/components/indexables.js index 7fc721129a..eceddc3368 100644 --- a/assets/js/sync-ui/components/indexables.js +++ b/assets/js/sync-ui/components/indexables.js @@ -57,6 +57,7 @@ export default () => { key={indexable} label={label} onChange={(checked) => onChange(indexable, checked)} + __nextHasNoMarginBottom /> ))} diff --git a/assets/js/sync-ui/components/limits.js b/assets/js/sync-ui/components/limits.js index b280246bb0..7922b4c005 100644 --- a/assets/js/sync-ui/components/limits.js +++ b/assets/js/sync-ui/components/limits.js @@ -56,6 +56,7 @@ export default () => { onChange={onChangeLower} type="number" value={args.lower_limit_object_id} + __nextHasNoMarginBottom /> @@ -67,6 +68,7 @@ export default () => { onChange={onChangeUpper} type="number" value={args.upper_limit_object_id} + __nextHasNoMarginBottom /> diff --git a/assets/js/sync-ui/components/offset.js b/assets/js/sync-ui/components/offset.js index c40e02d8f4..f63c64bc32 100644 --- a/assets/js/sync-ui/components/offset.js +++ b/assets/js/sync-ui/components/offset.js @@ -29,6 +29,7 @@ export default () => { onChange={(offset) => setArgs({ ...args, offset })} type="number" value={args.offset} + __nextHasNoMarginBottom /> ); }; diff --git a/assets/js/sync-ui/components/post-types.js b/assets/js/sync-ui/components/post-types.js index f41014cf28..d89197d757 100644 --- a/assets/js/sync-ui/components/post-types.js +++ b/assets/js/sync-ui/components/post-types.js @@ -52,6 +52,7 @@ export default () => { key={postType} label={label} onChange={(checked) => onChange(postType, checked)} + __nextHasNoMarginBottom /> ))} diff --git a/assets/js/sync-ui/components/put-mapping.js b/assets/js/sync-ui/components/put-mapping.js index e684db7753..5caf4c2417 100644 --- a/assets/js/sync-ui/components/put-mapping.js +++ b/assets/js/sync-ui/components/put-mapping.js @@ -41,6 +41,7 @@ export default () => { indeterminate={isSyncing && isDeleting && !args.put_mapping} label={__('Delete all data and start fresh sync', 'elasticpress')} onChange={(checked) => setArgs({ ...args, put_mapping: checked })} + __nextHasNoMarginBottom /> ); diff --git a/assets/js/sync-ui/css/advanced-control.css b/assets/js/sync-ui/css/advanced-control.css index 4c36813d8f..4757c3abf9 100644 --- a/assets/js/sync-ui/css/advanced-control.css +++ b/assets/js/sync-ui/css/advanced-control.css @@ -8,6 +8,10 @@ &.components-flex .components-flex-item { flex-grow: 2; } + + & .components-checkbox-control { + margin-bottom: 1em; + } } .ep-sync-advanced-control__label { diff --git a/assets/js/sync-ui/css/controls.css b/assets/js/sync-ui/css/controls.css index 1a38d306b5..165eafab9a 100644 --- a/assets/js/sync-ui/css/controls.css +++ b/assets/js/sync-ui/css/controls.css @@ -9,3 +9,7 @@ justify-self: end; } } + +.ep-sync-delete { + margin-bottom: 1em; +} diff --git a/assets/js/synonyms/components/common/edit-panel.js b/assets/js/synonyms/components/common/edit-panel.js index ba712daa74..0377902f40 100644 --- a/assets/js/synonyms/components/common/edit-panel.js +++ b/assets/js/synonyms/components/common/edit-panel.js @@ -69,6 +69,7 @@ const EditPanel = ( label={labels.primary} onChange={onChangePrimary} value={primaryValue.map((p) => p.value).join('')} + __nextHasNoMarginBottom /> ) : null} {mode === 'replacements' ? ( @@ -77,6 +78,7 @@ const EditPanel = ( label={labels.primary} onChange={onChangePrimary} value={primaryValue.map((p) => p.value)} + __nextHasNoMarginBottom /> ) : null} h.value)} + __nextHasNoMarginBottom /> diff --git a/assets/js/synonyms/components/common/list-table.js b/assets/js/synonyms/components/common/list-table.js index d19ae3836d..95f67d9a09 100644 --- a/assets/js/synonyms/components/common/list-table.js +++ b/assets/js/synonyms/components/common/list-table.js @@ -130,6 +130,7 @@ export default ({ children, Colgroup, Head, onDelete, ...props }) => { checked={isAllChecked} indeterminate={checked.length && !isAllChecked} onChange={onCheckAll} + __nextHasNoMarginBottom /> ), [checked, isAllChecked, onCheckAll], diff --git a/assets/js/synonyms/components/editors/solr-editor.js b/assets/js/synonyms/components/editors/solr-editor.js index 41496565c9..71331b5608 100644 --- a/assets/js/synonyms/components/editors/solr-editor.js +++ b/assets/js/synonyms/components/editors/solr-editor.js @@ -35,6 +35,7 @@ const SolrEditor = () => { rows="20" value={solr} onChange={onChange} + __nextHasNoMarginBottom /> ); }; diff --git a/assets/js/synonyms/components/editors/visual-editor.js b/assets/js/synonyms/components/editors/visual-editor.js index b767a0b1e5..b4ed044ae1 100644 --- a/assets/js/synonyms/components/editors/visual-editor.js +++ b/assets/js/synonyms/components/editors/visual-editor.js @@ -300,6 +300,7 @@ export default ({ labels, messages, mode, rules }) => { check(i, isChecked)} + __nextHasNoMarginBottom /> {labels.primary ? ( diff --git a/assets/js/synonyms/css/edit-panel.css b/assets/js/synonyms/css/edit-panel.css index 4973fc7909..978e8727a0 100644 --- a/assets/js/synonyms/css/edit-panel.css +++ b/assets/js/synonyms/css/edit-panel.css @@ -11,5 +11,14 @@ padding-bottom: 4px; padding-top: 4px; } + + & .components-form-token-field__help { + margin-bottom: 1em; + margin-top: 1em; + } + } + + & .components-text-control__input { + margin-bottom: 1em; } } diff --git a/assets/js/weighting/components/field.js b/assets/js/weighting/components/field.js index 814542eb53..576d6fdbdf 100644 --- a/assets/js/weighting/components/field.js +++ b/assets/js/weighting/components/field.js @@ -60,6 +60,7 @@ export default ({ label, onChange, onDelete, value, showTooltip }) => { checked={enabled} label={__('Searchable', 'elasticpress')} onChange={onChangeSearchable} + __nextHasNoMarginBottom />
@@ -70,6 +71,7 @@ export default ({ label, onChange, onDelete, value, showTooltip }) => { min={1} onChange={onChangeWeight} value={weight} + __nextHasNoMarginBottom />
diff --git a/assets/js/weighting/components/group.js b/assets/js/weighting/components/group.js index faf9d38c80..effc260369 100644 --- a/assets/js/weighting/components/group.js +++ b/assets/js/weighting/components/group.js @@ -184,6 +184,7 @@ export default ({ group, postType }) => { onKeyDown={onKeyDown} placeholder={__('Metadata key', 'elasticpress')} value={toAdd} + __nextHasNoMarginBottom />