Skip to content

31075-added type to CustomizableDateValue for detect from one of three #31164

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

Merged
merged 4 commits into from
Feb 16, 2021
Merged

31075-added type to CustomizableDateValue for detect from one of three #31164

merged 4 commits into from
Feb 16, 2021

Conversation

korovitskyi
Copy link
Collaborator

Description (*)

Fixed the issue GraphQL: CustomizableDateOption or CustomizableDateValue should indicate the precise Date option type.
Was added type option to detect one of three CustomizableDateOption types: date, date_time or time.

Fixed Issues (if relevant)

  1. Fixes GraphQL: CustomizableDateOption or CustomizableDateValue should indicate the precise Date option type #31075

Manual testing scenarios (*)

  1. Add multiple Date customizable options to a product. Use different date types: Date, Date & Time, Time
  2. Query the previous product via graphQL and display the customizable options. Use sample query below:
{
  products(filter: {sku: {eq: "test-sku"}}) {
    items {
      sku
      __typename
      id
      name
      ... on SimpleProduct {
         options {
          __typename
          option_id
          required
          sort_order
          title
          ... on CustomizableDateOption {
            value {
              uid
              price
              price_type
              __typename
            }
            __typename
          }
        }
      }
    }
  }
}

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 Dec 4, 2020

Hi @korovitskyi. 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

@m2-community-project m2-community-project bot added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Dec 4, 2020
@rogyar rogyar self-assigned this Dec 5, 2020
@@ -153,6 +153,7 @@ type CustomizableDateOption implements CustomizableOptionInterface @doc(descript
type CustomizableDateValue @doc(description: "CustomizableDateValue defines the price and sku of a product whose page contains a customized date picker.") {
price: Float @doc(description: "The price assigned to this option.")
price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.")
type: String @doc(description: "date, date_time or time")
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest the ENUM type instead if we have a predefined set of values

https://graphql.org/learn/schema/#enumeration-types

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rogyar ,thanks for review.
This case was fixed.

@rogyar
Copy link
Contributor

rogyar commented Dec 14, 2020

@magento run Static Tests, WebAPI Tests

@rogyar
Copy link
Contributor

rogyar commented Dec 15, 2020

Hi @korovitskyi. Please, check the failing static tests.
Thank you!

@rogyar
Copy link
Contributor

rogyar commented Dec 25, 2020

@magento run Static Tests

Copy link
Contributor

@prabhuram93 prabhuram93 left a comment

Choose a reason for hiding this comment

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

@cpartica changes looks good to me. Looping you in to confirm the schema changes.

@@ -49,6 +49,12 @@ enum PriceTypeEnum @doc(description: "This enumeration the price type.") {
DYNAMIC
}

enum CustomizableDateTypeEnum @doc(description: "This enumeration customizable date type.") {
date
Copy link
Contributor

Choose a reason for hiding this comment

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

these should be all caps
I think you need a resolver for that or en enum value mapper converter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cpartica, thanks for the review.
Changes were added.

@korovitskyi
Copy link
Collaborator Author

@magento run Static Tests, WebAPI Tests

@prabhuram93
Copy link
Contributor

This pull request is being processed internally. Please do not add anymore commits on this PR.

@magento-engcom-team magento-engcom-team merged commit bec680f into magento:2.4-develop Feb 16, 2021
@m2-assistant
Copy link

m2-assistant bot commented Feb 16, 2021

Hi @korovitskyi, 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.

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: bug fix Award: test coverage Component: CatalogGraphQl Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for testing Project: GraphQL Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL: CustomizableDateOption or CustomizableDateValue should indicate the precise Date option type
6 participants