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

Broken sort settings field for List of Pages #1997

Merged
merged 2 commits into from Nov 5, 2021

Conversation

dibenso
Copy link
Contributor

@dibenso dibenso commented Oct 27, 2021

Starting point for fix: #1994

Changes

change sort argument type to [PbListPagesSort!] and remove page arguments from LIST_PUBLISHED_PAGES query used in pagesLists for render and editor plugins. Also remove no longer existing fields from meta in LIST_PUBLISHED_PAGES:

export const LIST_PUBLISHED_PAGES = gql`
    query ListPublishedPages(
        $where: PbListPublishedPagesWhereInput
        $limit: Int
        $sort: [PbListPagesSort!]
        $exclude: [String]
    ) {
        pageBuilder {
            listPublishedPages(where: $where, sort: $sort, limit: $limit, exclude: $exclude) {
                data {
                    id
                    title
                    path
                    url
                    snippet
                    tags
                    images {
                        general {
                            src
                        }
                    }
                    publishedOn
                    createdBy {
                        id
                        displayName
                    }
                    category {
                        slug
                        name
                    }
                }
                meta {
                    totalCount
                }
            }
        }
    }
`;

How Has This Been Tested?

Manually. By Adding the list of pages page builder element to page and validating that it works as expected (before breaking). Would be happy to add some test if anyone can point me in the right direction 😄

@Ashu96 Ashu96 self-requested a review November 2, 2021 06:02
@Ashu96 Ashu96 added the bug label Nov 2, 2021
Copy link
Contributor

@Ashu96 Ashu96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks good! Thanks for contributing @dibenso 💯

I've left a few comments to answer your questions. I hope it helps.
If you need any help regarding this, please feel free to ask :)

@dibenso
Copy link
Contributor Author

dibenso commented Nov 3, 2021

Thanks @Ashu96 very helpful review! I've included what you've described to implement pagination.

@Ashu96 Ashu96 self-requested a review November 5, 2021 06:42
Copy link
Contributor

@Ashu96 Ashu96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good @dibenso 👍

Let's wait for the CI checks to pass.

@Ashu96 Ashu96 merged commit 61225b3 into webiny:next Nov 5, 2021
@Pavel910 Pavel910 changed the title fix(app-page-builder): starting point to fix #1994 Broken sort settings field for List of Pages Broken sort settings field for List of Pages Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken sort settings field for List of Pages
2 participants