Skip to content
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