feat(dashboard): Rework route modals (#6459)

**What**
- Reworks how RouteModals are setup.

**Why**
- With the current implementation it was possible to create a race-condition in the logic that handled displaying a prompt if the user tried to close a modal, while a child form was dirty. The race condition would cause a new prompt to spawn each time the user clicked the screen, making it impossible to dismiss the prompt. This only occurred in a few specific cases.

**How**
- Creates two new components: RouteFocusModal and RouteDrawer. The component shares logic for handling their own open/closed state, and now accept a form prop, that allows the modals to keep track of whether their child form is dirty. This change ensures that race conditions cannot occur, and that the prompt always only renders once when needed.
This commit is contained in:
Kasper Fabricius Kristensen authored and GitHub committed 2024-02-22 09:03:40 +00:00
1 parent add861d205
commit 72a17d6cd7
88 files changed
+1750 -1799

No files matched your search

@@ -83,6 +83,7 @@
"gallery": "Gallery",
"titleHint": "Give your product a short and clear title.<0/>50-60 characters is the recommended length for search engines.",
"descriptionHint": "Give your product a short and clear description.<0/>120-160 characters is the recommended length for search engines.",
"discountableHint": "When unchecked discounts will not be applied to this product.",
"handleTooltip": "The handle is used to reference the product in your storefront. If not specified, the handle will be generated from the product title.",
"availableInSalesChannels": "Available in <0>{{x}}</0> of <1>{{y}}</1> sales channels",
"noSalesChannels": "Not available in any sales channels",
@@ -249,7 +250,12 @@
"taxInclusiveHint": "When enabled all prices in the region will be tax inclusive.",
"providersHint": "The providers that are available in the region.",
"shippingOptions": "Shipping Options",
"returnShippingOptions": "Return Shipping Options"
"returnShippingOptions": "Return Shipping Options",
"return": "Return",
"outbound": "Outbound",
"priceType": "Price Type",
"flatRate": "Flat Rate",
"calculated": "Calculated"
},
"locations": {
"domain": "Locations",
@@ -399,6 +405,7 @@
"dateIssued": "Date issued",
"issuedDate": "Issued date",
"expiryDate": "Expiry date",
"price": "Price",
"height": "Height",
"width": "Width",
"length": "Length",