Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-200: Add a new block that can be nested or ability for Query Block to be nested #201

Merged
merged 35 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2d3d283
WIP: issue-200
mogmarsh Jul 15, 2024
6a7c332
adding subquery block and breaking out sidebar controls
mogmarsh Jul 15, 2024
253888d
fixing controls
mogmarsh Jul 16, 2024
f34fed2
setting up subquery
mogmarsh Jul 16, 2024
57701fc
displaying, but mainDedupe disabled
mogmarsh Jul 22, 2024
f6c8259
setting up attributes
mogmarsh Jul 22, 2024
b3881e8
more debugging
mogmarsh Jul 24, 2024
0d785c8
merging in develop
mogmarsh Jul 24, 2024
669492f
remove useeffects and usestate
mogmarsh Jul 24, 2024
7e9df09
remove some useEffect and rest api calls
mogmarsh Jul 31, 2024
f0a0efb
Merge remote-tracking branch 'origin/develop' into feature/issue-200/…
mogmarsh Jul 31, 2024
0e4b347
somewhat working with subquery
mogmarsh Jul 31, 2024
2a9e0c8
editor works. trying to get front end to render
mogmarsh Aug 6, 2024
726808b
trying to fix front end
mogmarsh Aug 13, 2024
8a7ba80
merging in develop
mogmarsh Aug 16, 2024
aec17dd
subquery should only render first time
mogmarsh Aug 16, 2024
7738a64
save inner blocks
mogmarsh Aug 16, 2024
b837c09
temporary troubleshooting
mogmarsh Aug 19, 2024
a1450c6
merging in develop
mogmarsh Aug 26, 2024
a0c9288
Merge remote-tracking branch 'origin/hotfix/small-block-buttons' into…
mogmarsh Aug 26, 2024
fb1da6d
merging in hotfixes
mogmarsh Aug 26, 2024
359887b
clean up and version bump
mogmarsh Aug 28, 2024
f80e9fe
Ready for review
mogmarsh Aug 28, 2024
5a94533
fix all the checks
mogmarsh Aug 28, 2024
7d16609
allow nulls
mogmarsh Aug 28, 2024
e8b5174
merging in develop
mogmarsh Sep 12, 2024
f481767
code review feedback
mogmarsh Sep 12, 2024
9186ddf
merge in deleted posts fix
mogmarsh Sep 16, 2024
97bf696
dedupe fix
mogmarsh Sep 16, 2024
aa55a14
Merge remote-tracking branch 'origin/hotfix/unpublished-posts-filter'…
mogmarsh Sep 16, 2024
afa68c4
phpstan fix
mogmarsh Sep 16, 2024
03baa3f
Merge remote-tracking branch 'origin/develop' into feature/issue-200/…
mogmarsh Sep 16, 2024
695f536
restore this
mogmarsh Sep 16, 2024
906df2a
fix phpstan again
mogmarsh Sep 17, 2024
4ffd42e
updating subquery block with other recent additions
mogmarsh Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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.
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
Loading