Skip to content

Commit 44bb5ca

Browse files
authored
Merge branch 'develop' into feature/content-search-debounce
2 parents 367a1fa + 68d2d81 commit 44bb5ca

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

components/content-picker/SortableList.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,23 @@ const SortableList: React.FC<SortableListProps> = ({
9797
const { getEntityRecord, hasFinishedResolution } = select(coreStore);
9898

9999
return posts.reduce<{ [key: string]: PickedItemType | null }>((acc, item) => {
100-
const getEntityRecordParameters = [entityKind, item.type, item.id] as const;
100+
const fields = ['link', 'type', 'id'];
101+
if (mode === 'user') {
102+
fields.push('name');
103+
} else if (mode === 'post') {
104+
fields.push('title');
105+
fields.push('url');
106+
fields.push('subtype');
107+
} else {
108+
fields.push('name');
109+
fields.push('taxonomy');
110+
}
111+
const getEntityRecordParameters = [
112+
entityKind,
113+
item.type,
114+
item.id,
115+
{ _fields: fields },
116+
] as const;
101117
const result = getEntityRecord<Post | Term | User>(...getEntityRecordParameters);
102118

103119
if (result) {

components/content-search/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const prepareSearchQuery = ({
5151
case 'user':
5252
searchQuery = addQueryArgs('wp/v2/users', {
5353
search: keyword,
54+
_fields: ['id', 'link', 'url', 'type', 'name', 'subtype'],
5455
});
5556
break;
5657
default:
@@ -61,6 +62,7 @@ export const prepareSearchQuery = ({
6162
_embed: true,
6263
per_page: perPage,
6364
page,
65+
_fields: ['id', 'link', 'url', 'type', 'title', 'subtype'],
6466
});
6567

6668
break;

cypress/e2e/Link.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ context('Link', () => {
1414
cy.get('.tenup-block-components-link__label').first().click();
1515
cy.wait(50);
1616
cy.get('.tenup-block-components-link__label').first().scrollIntoView({offset: {top: 100}}).type('First Link Label', { delay: 50, waitForAnimations: true });
17-
cy.get('.block-editor-url-input__input').first().type('https://10up.com/{enter}', { delay: 50, waitForAnimations: true });
17+
cy.get('.components-input-control__input').first().type('https://10up.com/{enter}', { delay: 50, waitForAnimations: true });
1818

1919
// create the second link
2020
cy.get('.tenup-block-components-link__label').eq(1).click();
2121
cy.wait(50);
2222
cy.get('.tenup-block-components-link__label').eq(1).type('Second Link Label', { delay: 50, waitForAnimations: true });
23-
cy.get('.block-editor-url-input__input').first().type('https://10up.com/our-work/{enter}', { delay: 50, waitForAnimations: true });
23+
cy.get('.components-input-control__input').first().type('https://10up.com/our-work/{enter}', { delay: 50, waitForAnimations: true });
2424

2525
cy.savePost();
2626

cypress/e2e/PostFeaturedImage.spec.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,8 @@ context('PostFeaturedImage', () => {
4444

4545
cy.get('[data-tab-id="edit-post/document"]').click();
4646

47-
cy.get('.components-button.components-panel__body-toggle').contains('Featured image').then($button => {
48-
if ($button.attr('aria-expanded') === 'false') {
49-
cy.get('.components-button.components-panel__body-toggle').contains('Featured image').click();
50-
}
51-
})
5247

53-
cy.get('.editor-post-featured-image img').should('exist').then(($a) => {
48+
cy.get('.editor-post-featured-image__preview-image').should('exist').then(($a) => {
5449
const src1 = $a.attr('src');
5550
const cleanedSrc1 = src1.replace(/-\d+x\d+(?=\.\w+$)/, '');
5651

@@ -65,7 +60,7 @@ context('PostFeaturedImage', () => {
6560
});
6661
});
6762

68-
cy.get('.components-button.editor-post-featured-image__action').contains('Remove').click();
63+
cy.get('.editor-post-featured-image__action').contains('Remove').click({force: true});
6964
cy.get('.wp-block-example-custom-post-featured-image__image').should('not.exist');
7065
})
7166
})

cypress/support/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Cypress.Commands.add('savePost', () => {
8484
Cypress.Commands.add('insertBlock', (blockName) => {
8585
cy.get('button[aria-label="Add block"]').first().click();
8686
cy.focused().type(blockName);
87-
cy.get('button').contains(blockName).click();
87+
cy.get('.block-editor-inserter__quick-inserter-results button').contains(blockName).click();
8888
});
8989

9090
Cypress.Commands.add('openSettingsSidebar', () => {

example/.wp-env.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"plugins": [ ".", "https://downloads.wordpress.org/plugin/wordpress-seo.21.9.1.zip" ],
2+
"plugins": [ ".", "https://downloads.wordpress.org/plugin/wordpress-seo.24.6.zip" ],
33
"mappings": {
44
"/var/www/html/images": "./images"
55
}

example/src/blocks/color-settings-example/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"apiVersion": 3,
2+
"apiVersion": 2,
33
"name": "example/color-settings-example",
44
"title": "Color Settings Component Example",
55
"description": "Example Block to show the Color settings component",

0 commit comments

Comments
 (0)