Skip to content

Commit

Permalink
Merge branch 'develop' into chore/issue-3987
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia authored Dec 11, 2024
2 parents 4f07e96 + b125998 commit 81882ef
Show file tree
Hide file tree
Showing 36 changed files with 283 additions and 143 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
6 changes: 5 additions & 1 deletion assets/js/blocks/facets/date/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const initFacet = () => {
form.addEventListener('submit', function (event) {
event.preventDefault();

const { value } = this.querySelector(`[name="${filterName}"]:checked`);
const { value } = this.querySelector(`[name="${filterName}"]:checked`) || '';
if (!value) {
return;
}

const { value: startDateValue } =
this.querySelector('.ep-date-range-picker')?.querySelector(
`[name="${filterName}_from"]`,
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
2 changes: 1 addition & 1 deletion assets/js/ordering/pointers.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class Pointers extends Component {

items.forEach((item, index) => {
// Reordering an existing pointer or adding a default post to the pointers array
if (item.order || item.ID === result.draggableId) {
if (item.order || Number(item.ID) === Number(result.draggableId)) {
pointers.push({
ID: item.ID,
order: index + 1,
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
Loading

0 comments on commit 81882ef

Please sign in to comment.