Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
psorensen committed Jan 19, 2024
1 parent 8755ddb commit 850057e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions assets/js/admin/admin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../../css/admin/admin.css';
import './block-extension';
import './block-extension-post-template';
import './block-variation';
import './block-extension';
import './no-posts-selected';
6 changes: 1 addition & 5 deletions assets/js/admin/block-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ const BlockEdit = (props) => {

return (
<InspectorControls>
<PanelBody
title={__('Query Curation', 'curated-query-loop')}
initialOpen
instructions="asdasdf"
>
<PanelBody title={__('Query Curation', 'curated-query-loop')} initialOpen>
<ContentPicker
mode="post"
label={__(`Search for a ${query.postType}`, 'curated-query-loop')}
Expand Down
9 changes: 7 additions & 2 deletions assets/js/admin/block-variation.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ registerBlockVariation('core/query', {
innerBlocks: [
[
'core/post-template',
{},
[['core/post-title'], ['core/post-featured-image'], ['core/post-excerpt']],
{
layout: {
type: 'grid',
columns: 3,
},
},
[['core/post-featured-image'], ['core/post-title'], ['core/post-excerpt']],
],
],
scope: ['inserter'],
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/namespace.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const NAMESPACE = 'curated-query-loops';
export const NAMESPACE = 'curated-query-loop';
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
/**
* WordPress Dependencies
*/
import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';
import { Placeholder } from '@wordpress/components';
import { loop } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';

/**
* External Dependencies
* This file is responsible for displaying a placeholder when no posts
* are selected in a Curated Query Loop.
*
* By default, the core Query block displays a "No Results Found" message,
* however this is a bit confusing for users since they have not yet selected
* any posts to display. This file also adds a class when the selectedPosts attribute
* is empty in order to hide the confusing message.
*/
import classnames from 'classnames';

/**
* Display a placeholder when no posts are selected in a Curated Query Loop.
Expand Down Expand Up @@ -57,7 +60,7 @@ const withGettingStartedPlaceholder = createHigherOrderComponent((BlockEdit) =>
*
* Used to hide the core block's "No Results Found" message.
*/
const withClientIdClassName = createHigherOrderComponent((BlockListBlock) => {
const withNoPostsClass = createHigherOrderComponent((BlockListBlock) => {
return (props) => {
const { name, attributes, className } = props;
const { namespace } = attributes;
Expand All @@ -71,16 +74,12 @@ const withClientIdClassName = createHigherOrderComponent((BlockListBlock) => {
});
return <BlockListBlock {...props} className={cn} />;
};
}, 'withClientIdClassName');
}, 'withNoPostsClass');

addFilter(
'editor.BlockEdit',
'curated-query-loop/empty-posts-placeholder',
withGettingStartedPlaceholder,
);

addFilter(
'editor.BlockListBlock',
'curated-query-loop/empty-posts-classname',
withClientIdClassName,
);
addFilter('editor.BlockListBlock', 'curated-query-loop/empty-posts-classname', withNoPostsClass);
2 changes: 1 addition & 1 deletion includes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function style_url( $stylesheet, $context ) {
return new WP_Error( 'invalid_enqueue_context', 'Invalid $context specified in CuratedQueryLoop stylesheet loader.' );
}

return CQL_URL . "dist/css/${stylesheet}.css";
return CQL_URL . "dist/css/{$stylesheet}.css";

}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"prop-types": "^15.7.2"
},
"10up-toolkit": {
"devUrl": "http://query-loop-picker.local",
"devUrl": "http://localhost:8888",
"entry": {
"admin": "./assets/js/admin/admin.js",
"frontend": "./assets/js/frontend/frontend.js",
Expand Down

0 comments on commit 850057e

Please sign in to comment.