Skip to content

Commit 029f589

Browse files
authored
ProductDoctor: Add support for the new availability mode (#6545)
* Update ProductDoctor to support new stock availability mode introduced in Saleor 3.23 * Add changeset * Test through user-visible UI in ProductDoctor availability card * Rename "blocking" issue terminology in ProductDoctor Renamed across the channel availability code so the name describes the UI role (these are the issues that are promoted into the channel header and surface a badge) rather than implying that warnings block: - `getBlockingIssueBadgeProps` → `getHeaderIssueBadgeProps` - `BlockingIssueType` → `HeaderIssueType` - `hasBlockingIssues` → `hasHeaderIssues` * Share LEGACY_MODE_FALLBACK across ProductDoctor consumers * Trigger CI * Trigger CI
1 parent dcfe1a8 commit 029f589

18 files changed

Lines changed: 1235 additions & 54 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"saleor-dashboard": patch
3+
---
4+
5+
ProductDoctor: Add support for new availability mode introduced in Saleor 3.23

locale/defaultMessages.json

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@
192192
"context": "expired on label",
193193
"string": "Expired on {date}"
194194
},
195+
"/0QqzO": {
196+
"context": "aria-label for the warning icon inside a channel issue badge",
197+
"string": "Warning"
198+
},
195199
"/0gMCW": {
196200
"string": "Try to refresh the page or go navigate to a different page and back."
197201
},
@@ -226,6 +230,10 @@
226230
"context": "button",
227231
"string": "Show"
228232
},
233+
"/8a4cU": {
234+
"context": "Description for stock-outside-channel-warehouses info",
235+
"string": "This product has stock in warehouses that are not linked to this channel. Assign the warehouse to the channel for the stock to count toward availability."
236+
},
229237
"/AbHy4": {
230238
"context": "creation label",
231239
"string": "Creation"
@@ -1583,6 +1591,10 @@
15831591
"context": "link",
15841592
"string": "View profile"
15851593
},
1594+
"7CZ8Tp": {
1595+
"context": "Description for no shipping zones info when shop uses direct warehouse-channel stock availability",
1596+
"string": "Customers can browse and add this product to cart, but no shipping methods will be available at checkout. Add at least one shipping zone to this channel to enable shipping."
1597+
},
15861598
"7Chrsf": {
15871599
"string": "Passwords do not match"
15881600
},
@@ -1695,6 +1707,10 @@
16951707
"context": "action",
16961708
"string": "Include postal codes"
16971709
},
1710+
"7sSOgb": {
1711+
"context": "Indicator label shown when shop has Shop.useLegacyShippingZoneStockAvailability=true",
1712+
"string": "Stock availability uses shipping zones (legacy)"
1713+
},
16981714
"7scATx": {
16991715
"context": "select title",
17001716
"string": "Select channels you want for {contentType} to be available on"
@@ -2361,6 +2377,10 @@
23612377
"context": "header",
23622378
"string": "Address Information"
23632379
},
2380+
"BfhUcl": {
2381+
"context": "Indicator label shown when shop has Shop.useLegacyShippingZoneStockAvailability=false",
2382+
"string": "Stock availability uses direct warehouse-channel link"
2383+
},
23642384
"Bkxrhw": {
23652385
"context": "no webhooks message",
23662386
"string": "No webhooks found"
@@ -2778,10 +2798,6 @@
27782798
"EAGfdH": {
27792799
"string": "Page updated"
27802800
},
2781-
"EAKKtg": {
2782-
"context": "Description for no shipping zones warning",
2783-
"string": "Customers cannot checkout without shipping methods. Add shipping zones to this channel."
2784-
},
27852801
"EDihQs": {
27862802
"string": "Staff member updated"
27872803
},
@@ -3247,6 +3263,10 @@
32473263
"context": "column title",
32483264
"string": "Value"
32493265
},
3266+
"GYBoVb": {
3267+
"context": "Tooltip explanation for legacy stock-availability mode",
3268+
"string": "Stock is considered available only when the warehouse is both assigned to this channel and covered by an active shipping zone for the destination address."
3269+
},
32503270
"GbBCmr": {
32513271
"context": "window title",
32523272
"string": "Order #{orderNumber}"
@@ -5331,6 +5351,10 @@
53315351
"RrCui3": {
53325352
"string": "Summary"
53335353
},
5354+
"Rt95cf": {
5355+
"context": "Info when channel has no shipping zones in direct stock-availability mode",
5356+
"string": "No shipping zones for \"{channelName}\""
5357+
},
53345358
"RyZd9J": {
53355359
"context": "error message",
53365360
"string": "Please wait a moment before trying again."
@@ -7306,6 +7330,10 @@
73067330
"cY42ht": {
73077331
"string": "Password cannot be entirely numeric"
73087332
},
7333+
"cYjzDx": {
7334+
"context": "aria-label for the info icon inside an availability issue callout",
7335+
"string": "Information"
7336+
},
73097337
"cZN5Jd": {
73107338
"context": "Webhook details events",
73117339
"string": "Events"
@@ -7598,6 +7626,10 @@
75987626
"context": "button",
75997627
"string": "Choose file"
76007628
},
7629+
"eXcTEd": {
7630+
"context": "aria-label for the error icon inside an availability issue callout",
7631+
"string": "Error"
7632+
},
76017633
"eY+BKQ": {
76027634
"string": "The extension manifest was not found. ({errorCode})"
76037635
},
@@ -8192,6 +8224,10 @@
81928224
"context": "button",
81938225
"string": "Apply"
81948226
},
8227+
"iBY7aI": {
8228+
"context": "aria-label for the warning icon inside an availability issue callout",
8229+
"string": "Warning"
8230+
},
81958231
"iEeIhY": {
81968232
"context": "draft order",
81978233
"string": "Customer"
@@ -8696,6 +8732,10 @@
86968732
"context": "btn label",
86978733
"string": "Go to orders"
86988734
},
8735+
"kyOwDW": {
8736+
"context": "aria-label for the error icon inside a channel issue badge",
8737+
"string": "Error"
8738+
},
86998739
"l0a2tU": {
87008740
"context": "onboarding step description",
87018741
"string": "Go to all products from where you can create a new product and view it in all product list. View the product in GraphQL"
@@ -10161,6 +10201,10 @@
1016110201
"context": "radio option for capturing order total",
1016210202
"string": "Order total"
1016310203
},
10204+
"tSmJPv": {
10205+
"context": "Tooltip explanation for direct stock-availability mode",
10206+
"string": "Stock is considered available whenever the warehouse is assigned to this channel. Shipping zones only affect order fulfillment, not availability."
10207+
},
1016410208
"tTuCYj": {
1016510209
"context": "all gift cards label",
1016610210
"string": "All Gift Cards"
@@ -10379,6 +10423,10 @@
1037910423
"context": "button label to cancel product removal",
1038010424
"string": "Keep product"
1038110425
},
10426+
"uaZNZS": {
10427+
"context": "Info when product has stock only in warehouses not linked to the channel",
10428+
"string": "Stock is in warehouses not assigned to \"{channelName}\""
10429+
},
1038210430
"ubasgL": {
1038310431
"context": "order history message",
1038410432
"string": "Order was confirmed"
@@ -10708,6 +10756,10 @@
1070810756
"vuKrlW": {
1070910757
"string": "Stock"
1071010758
},
10759+
"vuOZYs": {
10760+
"context": "Description for no shipping zones warning",
10761+
"string": "Without shipping zones, this product will appear unavailable to customers and orders cannot be shipped. Add at least one shipping zone to this channel."
10762+
},
1071110763
"vwA9Fq": {
1071210764
"context": "notification",
1071310765
"string": "Selected models were deleted."

src/graphql/hooks.generated.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16212,6 +16212,10 @@ export type GridWarehousesLazyQueryHookResult = ReturnType<typeof useGridWarehou
1621216212
export type GridWarehousesQueryResult = Apollo.QueryResult<Types.GridWarehousesQuery, Types.GridWarehousesQueryVariables>;
1621316213
export const ChannelDiagnosticsDocument = gql`
1621416214
query ChannelDiagnostics {
16215+
shop {
16216+
id
16217+
useLegacyShippingZoneStockAvailability
16218+
}
1621516219
channels {
1621616220
id
1621716221
name

src/graphql/types.generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13041,7 +13041,7 @@ export type GridWarehousesQuery = { __typename: 'Query', selectedWarehouses: { _
1304113041
export type ChannelDiagnosticsQueryVariables = Exact<{ [key: string]: never; }>;
1304213042

1304313043

13044-
export type ChannelDiagnosticsQuery = { __typename: 'Query', channels: Array<{ __typename: 'Channel', id: string, name: string, slug: string, currencyCode: string, isActive: boolean, warehouses: Array<{ __typename: 'Warehouse', id: string, name: string }> }> | null, shippingZones: { __typename: 'ShippingZoneCountableConnection', edges: Array<{ __typename: 'ShippingZoneCountableEdge', node: { __typename: 'ShippingZone', id: string, name: string, channels: Array<{ __typename: 'Channel', id: string }>, warehouses: Array<{ __typename: 'Warehouse', id: string, name: string }>, countries: Array<{ __typename: 'CountryDisplay', code: string, country: string }> } }> } | null };
13044+
export type ChannelDiagnosticsQuery = { __typename: 'Query', shop: { __typename: 'Shop', id: string, useLegacyShippingZoneStockAvailability: boolean }, channels: Array<{ __typename: 'Channel', id: string, name: string, slug: string, currencyCode: string, isActive: boolean, warehouses: Array<{ __typename: 'Warehouse', id: string, name: string }> }> | null, shippingZones: { __typename: 'ShippingZoneCountableConnection', edges: Array<{ __typename: 'ShippingZoneCountableEdge', node: { __typename: 'ShippingZone', id: string, name: string, channels: Array<{ __typename: 'Channel', id: string }>, warehouses: Array<{ __typename: 'Warehouse', id: string, name: string }>, countries: Array<{ __typename: 'CountryDisplay', code: string, country: string }> } }> } | null };
1304513045

1304613046
export type SetRefundReasonTypeMutationVariables = Exact<{
1304713047
modelTypeId: Scalars['ID'];

0 commit comments

Comments
 (0)