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

Discount view no longer blocks the user that has no permissions for managing channels #5329

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/weak-apples-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Discounts no longer blocks the UI when the user has no permissions for managing channels.
22 changes: 1 addition & 21 deletions src/discounts/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,27 +229,7 @@ export const PromotionDetailsQuery = /* GraphQL */ `
name
description
channels {
id
isActive
name
slug
currencyCode
defaultCountry {
code
country
}
stockSettings {
allocationStrategy
}
hasOrders
orderSettings {
markAsPaidStrategy
deleteExpiredOrdersAfter
allowUnpaidOrders
}
paymentSettings {
defaultTransactionFlowStrategy
}
...PromotionRuleChannel
}
giftIds
rewardType
Expand Down
16 changes: 15 additions & 1 deletion src/fragments/discounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,27 @@ export const voucherDetailsFragment = gql`
}
`;

export const promotionRuleChannelFragment = gql`
fragment PromotionRuleChannel on Channel {
id
isActive
name
slug
currencyCode
defaultCountry {
code
country
}
}
`;

export const promotionRuleDetailsFragment = gql`
fragment PromotionRuleDetails on PromotionRule {
id
name
description
channels {
...ChannelDetails
...PromotionRuleChannel
}
giftIds
rewardType
Expand Down
Loading
Loading