Skip to content

[GraphQl] Excluding the disabled parent category from the category breadcrumbs #30619

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

Conversation

eduard13
Copy link
Contributor

@eduard13 eduard13 commented Oct 23, 2020

Description (*)

This PR excludes the disabled parent category from the category's breadcrumbs, as the category won't be available on clicking on it.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes [Atwix]products query returns breadcrumb data for categories whose parent category is disabled #30468

Manual testing scenarios (*)

  1. Create the following tree: Category 1 / Category 1.1 / Category 1.2
  2. Disable the Category 1.1
  3. Run the following query to get the breadcrumbs for Category 1.2
categoryId = Category 1.2 ID

{
  category(id: <categoryId>) {
    name
    breadcrumbs {
        category_name
    }
  }
}

Expected Result

{
  "data": {
    "category": {
      "name": "Category 1.2",
      "breadcrumbs": [
        {
          "category_name": "Category 1"
        }
      ]
    }
  }
}

Questions or comments

As an alternative, we may try to add a new attribute for Breadcrumb type , in order to mark the breadcrumb as enabled/disabled.

type Breadcrumb @doc(description: "Breadcrumb item."){
category_id: Int @doc(description: "Category ID.")
category_name: String @doc(description: "Category name.")
category_level: Int @doc(description: "Category level.")
category_url_key: String @doc(description: "Category URL key.")
category_url_path: String @doc(description: "Category URL path.")
}

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Oct 23, 2020

Hi @eduard13. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@eduard13
Copy link
Contributor Author

@magento run all tests

1 similar comment
@gabrieldagama
Copy link
Contributor

@magento run all tests

@eduard13 eduard13 added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Oct 23, 2020
@coderimus coderimus self-assigned this Oct 23, 2020
@coderimus coderimus self-requested a review October 23, 2020 19:51
@eduard13 eduard13 changed the title [Catalog] Excluding the disabled parent category from the category breadcrumbs [GraphQl] Excluding the disabled parent category from the category breadcrumbs Oct 23, 2020
@nrkapoor nrkapoor added this to the 2.4.2 milestone Oct 24, 2020
@coderimus
Copy link
Contributor

@magento run Functional Tests B2B

@coderimus
Copy link
Contributor

@magento run Functional Tests CE

@coderimus
Copy link
Contributor

@magento run Functional Tests B2B

Copy link
Contributor

@coderimus coderimus left a comment

Choose a reason for hiding this comment

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

Hello @eduard13 ,
Thank you for the provided changes. 👍 Approve from my side. Let's wait for others review.

@magento-engcom-team
Copy link
Contributor

Hi @coderimus, thank you for the review.
ENGCOM-8386 has been created to process this Pull Request
✳️ @coderimus, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@ghost ghost added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Oct 24, 2020
@coderimus coderimus added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Oct 25, 2020
@rogyar rogyar self-assigned this Oct 26, 2020
@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-8386 has been created to process this Pull Request

@eduard13 eduard13 removed the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Oct 26, 2020
@m2-assistant
Copy link

m2-assistant bot commented Nov 3, 2020

Hi @eduard13, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@eduard13 eduard13 deleted the graphql-breadcrumbs-30468-issue branch July 30, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage Component: CatalogGraphQl Event: MageCONF CD 2020 Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: ready for testing Project: GraphQL Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Atwix]products query returns breadcrumb data for categories whose parent category is disabled
8 participants