Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/typescript-5.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mogmarsh authored Sep 17, 2024
2 parents 0285e65 + c5052b3 commit 3d3d473
Show file tree
Hide file tree
Showing 22 changed files with 19,567 additions and 379 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to `WP Curate` will be documented in this file.

## 2.4.0 - 2024-08-28

- Enhancement: Subquery block added to allow a separate set of posts within a query block.
see https://github.com/alleyinteractive/wp-curate/issues/200

## 2.3.3 - 2024-09-16

- Bug Fix: Hold space on the front end for curated posts that were deleted.

## 2.3.2 - 2024-09-09

- Bug Fix: Prevent block transforms from crashing the Query block.
Expand Down
8 changes: 6 additions & 2 deletions blocks/post/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,24 @@ export default function Edit({
isSelected,
}: PostEditProps) {
// @ts-ignore
const queryParentId = select('core/block-editor').getBlockParentsByBlockName(clientId, 'wp-curate/query')[0];
const queryParents = select('core/block-editor').getBlockParentsByBlockName(clientId, ['wp-curate/query', 'wp-curate/subquery']);
const queryParentId = queryParents.pop();

// @ts-ignore
const queryParent = select('core/block-editor').getBlock(queryParentId) ?? {
attributes: {
posts: [],
postTypes: [],
},
};

const queryBlocks = select('core/block-editor').getBlocksByName('wp-curate/query');
const {
attributes: {
posts = [],
postTypes = [],
} = {},
name: parentName,
} = queryParent;

const queryInclude = include.split(',').map((id: string) => parseInt(id, 10));
Expand Down Expand Up @@ -175,7 +179,7 @@ export default function Edit({
'wp-curate-post-block',
{ 'wp-curate-post-block--selected': isParentOfSelectedBlock },
{ 'wp-curate-post-block--backfill': !selected || postDeleted },
{ 'curate-droppable': moveData.postId && moveData.postId !== postId },
{ 'curate-droppable': parentName === 'wp-curate/query' && moveData.postId && moveData.postId !== postId },
{ 'wp-curate-error': postDeleted },
),
},
Expand Down
Loading

0 comments on commit 3d3d473

Please sign in to comment.