@@ -3,11 +3,6 @@ import { useNavigate } from "react-router-dom";
3
3
import { useMutation , useQuery } from "@apollo/client" ;
4
4
import { CellProps , Column } from "react-table" ;
5
5
import {
6
- Alert ,
7
- AlertDescription ,
8
- AlertIcon ,
9
- AlertTitle ,
10
- Box ,
11
6
Button ,
12
7
Heading ,
13
8
Skeleton ,
@@ -97,37 +92,6 @@ export const DISABLE_STANDARD_PRODUCT_MUTATION = graphql(
97
92
[ PRODUCT_BASIC_FIELDS_FRAGMENT ] ,
98
93
) ;
99
94
100
- function InStockProductAlert ( {
101
- instockItemsCount,
102
- productName,
103
- } : {
104
- instockItemsCount ?: number ;
105
- productName ?: string ;
106
- // locations?: string, // TODO: should be derived from product locations somehow
107
- } ) {
108
- return (
109
- < Alert status = "error" data-testid = "ErrorAlertProduct" >
110
- < >
111
- < AlertIcon />
112
- < Box display = "flex" flexDirection = "column" >
113
- < AlertTitle > Disabling Product with Active Stock</ AlertTitle >
114
- < AlertDescription >
115
- You are attempting to disable the product { productName } with { instockItemsCount } { " " }
116
- < Text fontWeight = "600" color = "#659A7E" display = "inline" >
117
- InStock, MarkedForShipment, InTransit, or Receiving
118
- </ Text > { " " }
119
- items in one or more locations. To continue, you must first reclassify all{ " " }
120
- < Text fontWeight = "600" color = "#659A7E" display = "inline" >
121
- InStock
122
- </ Text > { " " }
123
- boxes as a different product, or complete your shipments.
124
- </ AlertDescription >
125
- </ Box >
126
- </ >
127
- </ Alert >
128
- ) ;
129
- }
130
-
131
95
function Products ( ) {
132
96
const { isLoading : isGlobalStateLoading } = useLoadAndSetGlobalPreferences ( ) ;
133
97
const baseId = useAtomValue ( selectedBaseIdAtom ) ;
@@ -163,10 +127,22 @@ function Products() {
163
127
( instantiationId ?: string , instockItemsCount ?: number , productName ?: string ) => {
164
128
if ( instockItemsCount !== undefined && instockItemsCount > 0 ) {
165
129
createToast ( {
166
- duration : 6000 ,
167
- render : ( ) => (
168
- < InStockProductAlert instockItemsCount = { instockItemsCount } productName = { productName } />
130
+ title : "Disabling Product with Active Stock" ,
131
+ message : (
132
+ < >
133
+ You are attempting to disable the product { productName } with { instockItemsCount } { " " }
134
+ < Text fontWeight = "600" color = "#659A7E" display = "inline" >
135
+ InStock, MarkedForShipment, InTransit, or Receiving
136
+ </ Text > { " " }
137
+ items in one or more locations. To continue, you must first reclassify all{ " " }
138
+ < Text fontWeight = "600" color = "#659A7E" display = "inline" >
139
+ InStock
140
+ </ Text > { " " }
141
+ boxes as a different product, or complete your shipments.
142
+ </ >
169
143
) ,
144
+ type : "error" ,
145
+ duration : 10000
170
146
} ) ;
171
147
} else if ( instantiationId ) {
172
148
disableStandardProductMutation ( {
0 commit comments