Skip to content

Commit

Permalink
Merge pull request #4046 from 10up/fix/deprecated-bottom-margin-warning
Browse files Browse the repository at this point in the history
Fix: Bottom margin style is deprecated since version 6.7
  • Loading branch information
felipeelia authored Dec 11, 2024
2 parents f1397eb + 80a28d0 commit 48ccfa2
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default ({ onChange, checked }) => {
checked={checked}
label={__('Display count', 'elasticpress')}
onChange={onChange}
__nextHasNoMarginBottom
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default ({ onChange, value }) => {
onChange={onChange}
options={options}
value={value}
__nextHasNoMarginBottom
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default ({ onChange, orderby, order }) => {
}}
options={options}
value={`${orderby}/${order}`}
__nextHasNoMarginBottom
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default ({ onChange, value }) => {
label={__('Search field placeholder', 'elasticpress')}
value={value}
onChange={onChange}
__nextHasNoMarginBottom
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default ({ onChange, value }) => {
onChange={onChange}
options={options}
value={value}
__nextHasNoMarginBottom
/>
);
};
1 change: 1 addition & 0 deletions assets/js/blocks/facets/date/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const FacetDate = (props) => {
label={__('Display custom date option', 'elasticpress')}
checked={displayCustomDate}
onChange={(displayCustomDate) => setAttributes({ displayCustomDate })}
__nextHasNoMarginBottom
/>
</PanelBody>
</InspectorControls>
Expand Down
2 changes: 2 additions & 0 deletions assets/js/blocks/facets/meta-range/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ export default ({ attributes, name, setAttributes }) => {
label={__('Value prefix', 'elasticpress')}
onChange={onChangePrefix}
value={prefix}
__nextHasNoMarginBottom
/>
</FlexItem>
<FlexItem>
<TextControl
label={__('Value suffix', 'elasticpress')}
onChange={onChangeSuffix}
value={suffix}
__nextHasNoMarginBottom
/>
</FlexItem>
</Flex>
Expand Down
5 changes: 5 additions & 0 deletions assets/js/features/components/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default ({
label={label}
onChange={onChangeCheckbox}
disabled={isDisabled}
__nextHasNoMarginBottom
/>
);
}
Expand All @@ -184,6 +185,7 @@ export default ({
disabled={isDisabled}
suggestions={suggestions}
value={values}
__nextHasNoMarginBottom
/>
);
}
Expand All @@ -208,6 +210,7 @@ export default ({
options={options}
disabled={isDisabled}
value={value}
__nextHasNoMarginBottom
/>
);
}
Expand All @@ -219,6 +222,7 @@ export default ({
label={label}
onChange={onChange}
disabled={isDisabled}
__nextHasNoMarginBottom
/>
);
}
Expand All @@ -242,6 +246,7 @@ export default ({
disabled={isDisabled}
value={value}
type={type}
__nextHasNoMarginBottom
/>
);
}
Expand Down
15 changes: 5 additions & 10 deletions assets/js/search/editor/plugins/exclude-from-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<WrapperElement>
Expand All @@ -38,7 +33,7 @@ export default () => {
)}
checked={ep_exclude_from_search}
onChange={onChange}
{...marginBottomProp}
__nextHasNoMarginBottom
/>
</WrapperElement>
);
Expand Down
1 change: 1 addition & 0 deletions assets/js/sites-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const ElasticPressToggleControl = ({ blogId, isDefaultChecked }) => {
disabled={isLoading}
label={isChecked ? __('On', 'elasticpress') : __('Off', 'elasticpress')}
onChange={onChange}
__nextHasNoMarginBottom
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions assets/js/sync-ui/components/include.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default () => {
onChange={onChange}
saveTransform={saveTransform}
value={args.include}
__nextHasNoMarginBottom
/>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions assets/js/sync-ui/components/indexables.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default () => {
key={indexable}
label={label}
onChange={(checked) => onChange(indexable, checked)}
__nextHasNoMarginBottom
/>
))}
</fieldset>
Expand Down
2 changes: 2 additions & 0 deletions assets/js/sync-ui/components/limits.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default () => {
onChange={onChangeLower}
type="number"
value={args.lower_limit_object_id}
__nextHasNoMarginBottom
/>
</FlexItem>
<FlexItem grow="2">
Expand All @@ -67,6 +68,7 @@ export default () => {
onChange={onChangeUpper}
type="number"
value={args.upper_limit_object_id}
__nextHasNoMarginBottom
/>
</FlexItem>
</Flex>
Expand Down
1 change: 1 addition & 0 deletions assets/js/sync-ui/components/offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default () => {
onChange={(offset) => setArgs({ ...args, offset })}
type="number"
value={args.offset}
__nextHasNoMarginBottom
/>
);
};
1 change: 1 addition & 0 deletions assets/js/sync-ui/components/post-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default () => {
key={postType}
label={label}
onChange={(checked) => onChange(postType, checked)}
__nextHasNoMarginBottom
/>
))}
</fieldset>
Expand Down
1 change: 1 addition & 0 deletions assets/js/sync-ui/components/put-mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
/>
</>
);
Expand Down
4 changes: 4 additions & 0 deletions assets/js/sync-ui/css/advanced-control.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
&.components-flex .components-flex-item {
flex-grow: 2;
}

& .components-checkbox-control {
margin-bottom: 1em;
}
}

.ep-sync-advanced-control__label {
Expand Down
4 changes: 4 additions & 0 deletions assets/js/sync-ui/css/controls.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
justify-self: end;
}
}

.ep-sync-delete {
margin-bottom: 1em;
}
3 changes: 3 additions & 0 deletions assets/js/synonyms/components/common/edit-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const EditPanel = (
label={labels.primary}
onChange={onChangePrimary}
value={primaryValue.map((p) => p.value).join('')}
__nextHasNoMarginBottom
/>
) : null}
{mode === 'replacements' ? (
Expand All @@ -77,13 +78,15 @@ const EditPanel = (
label={labels.primary}
onChange={onChangePrimary}
value={primaryValue.map((p) => p.value)}
__nextHasNoMarginBottom
/>
) : null}
<FormTokenField
disabled={disabled}
label={labels.synonyms}
onChange={onChangeSynonyms}
value={synonymsValue.map((h) => h.value)}
__nextHasNoMarginBottom
/>
<Flex justify="start">
<FlexItem>
Expand Down
1 change: 1 addition & 0 deletions assets/js/synonyms/components/common/list-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default ({ children, Colgroup, Head, onDelete, ...props }) => {
checked={isAllChecked}
indeterminate={checked.length && !isAllChecked}
onChange={onCheckAll}
__nextHasNoMarginBottom
/>
),
[checked, isAllChecked, onCheckAll],
Expand Down
1 change: 1 addition & 0 deletions assets/js/synonyms/components/editors/solr-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const SolrEditor = () => {
rows="20"
value={solr}
onChange={onChange}
__nextHasNoMarginBottom
/>
);
};
Expand Down
1 change: 1 addition & 0 deletions assets/js/synonyms/components/editors/visual-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export default ({ labels, messages, mode, rules }) => {
<CheckboxControl
checked={checked.includes(i)}
onChange={(isChecked) => check(i, isChecked)}
__nextHasNoMarginBottom
/>
</td>
{labels.primary ? (
Expand Down
9 changes: 9 additions & 0 deletions assets/js/synonyms/css/edit-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 2 additions & 0 deletions assets/js/weighting/components/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default ({ label, onChange, onDelete, value, showTooltip }) => {
checked={enabled}
label={__('Searchable', 'elasticpress')}
onChange={onChangeSearchable}
__nextHasNoMarginBottom
/>
</div>
<div className="ep-weighting-field__weighting">
Expand All @@ -70,6 +71,7 @@ export default ({ label, onChange, onDelete, value, showTooltip }) => {
min={1}
onChange={onChangeWeight}
value={weight}
__nextHasNoMarginBottom
/>
</div>
<div className="ep-weighting-field__actions">
Expand Down
1 change: 1 addition & 0 deletions assets/js/weighting/components/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export default ({ group, postType }) => {
onKeyDown={onKeyDown}
placeholder={__('Metadata key', 'elasticpress')}
value={toAdd}
__nextHasNoMarginBottom
/>
<Button disabled={!toAdd} isSecondary onClick={onClick} variant="secondary">
{__('Add', 'elasticpress')}
Expand Down

0 comments on commit 48ccfa2

Please sign in to comment.