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

Use available channels from context #1115

Merged
merged 2 commits into from
May 18, 2021
Merged

Use available channels from context #1115

merged 2 commits into from
May 18, 2021

Conversation

jwm0
Copy link
Contributor

@jwm0 jwm0 commented May 14, 2021

I want to merge this change because it reduces the number of api calls and instead uses available channels from global state. Additionally this fixes the issue where users without MANAGE_CHANNELS permission cannot fetch basic channels metadata. An example would be a user with MANAGE_PRODUCTS who cannot see to which channels a product is available in.

QA instructions
The following views have changed and should work the same as our current staging:

  1. Collection Create
  2. CollectionUpdate
  3. Sales Create
  4. Sales Update
  5. Voucher Create
  6. Voucher Update
  7. Product Create
  8. Product Update
  9. Shipping Zone Details

PR intended to be tested with API branch: master

Screenshots

Pull Request Checklist

  1. This code contains UI changes
  2. All visible strings are translated with proper context including data-formatting
  3. Attributes [data-test-id] are added for new elements
  4. Changes are mentioned in the changelog
  5. The changes are tested in different browsers and in light/dark mode

Test environment config

API_URI=https://qa.staging.saleor.cloud/graphql/

@github-actions github-actions bot temporarily deployed to do-not-overfetch-channels May 14, 2021 11:32 Inactive
@github-actions github-actions bot temporarily deployed to storybook do-not-overfetch-channels May 14, 2021 11:32 Inactive
@dominik-zeglen
Copy link
Contributor

Just a quick note, I think availableChannels field can be dropped from AppChannelContext since it's just memozing apollo output

@jwm0
Copy link
Contributor Author

jwm0 commented May 17, 2021

Just a quick note, I think availableChannels field can be dropped from AppChannelContext since it's just memozing apollo output

Having them defined in context does us no harm and I believe it makes sense to include them together with the rest

@jwm0 jwm0 merged commit 1a9b557 into master May 18, 2021
@jwm0 jwm0 deleted the do-not-overfetch-channels branch May 18, 2021 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants