Skip to content

Commit

Permalink
Changeset (#5329)
Browse files Browse the repository at this point in the history
Co-authored-by: Paweł Chyła <[email protected]>
  • Loading branch information
andrzejewsky and poulch authored Jan 7, 2025
1 parent 763a180 commit 9b33a11
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 306 deletions.
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

0 comments on commit 9b33a11

Please sign in to comment.