Skip to content
Extraits de code Groupes Projets
Valider 3df8a0b4 rédigé par aicha.elyamalhi's avatar aicha.elyamalhi
Parcourir les fichiers

some changes

parents 4b2c2903 ae5575ed
Branches
1 requête de fusion!233MYD-170/some changes
Pipeline #5511 réussi avec l'étape
in 5 minutes et 13 secondes
......@@ -100,7 +100,7 @@ export function useAllGetProducts() {
export function useAllGetProductsWithVariation(searchData: IProductSessionSerchTerm) {
const URL = "/api/stock/products/ProductWithvariations";
const URL = "/api/stock/products/ProductWithVariations";
const { data, isLoading, error, isValidating } = useSWR<IProductSessionItem[]>(
[URL, searchData],
......
......@@ -485,7 +485,7 @@ export default function ProductVariationsCard({ product,onSelect }: Props) {
/>
</Stack>
<Stack direction="column">
{variation.stockLiveConfig.quantity !== 0 ? (
{variation.stockLiveConfig.quantity > 0 ? (
<Chip
label="en stock"
size="small"
......@@ -528,13 +528,13 @@ export default function ProductVariationsCard({ product,onSelect }: Props) {
/>
) : (
<Chip
label="Edition limité"
label="réapprovisionnement non autorisé"
size="small"
sx={{
backgroundColor: warning, // Rouge clair pour rupture de stock
color: "000", // Rouge foncé pour le texte
mt: 0.5,
maxWidth: "130px",
maxWidth: "230px",
overflow: "hidden",
textOverflow: "ellipsis",
}}
......
......@@ -56,7 +56,7 @@ export default function ProductListDialog({ open, onClose, onSelect }: Props) {
// Use the debounced search term to fetch products
const { products, productsLoading, productsError } = useAllGetProductsWithVariation({ searchTerm: debouncedQuery });
console.log("products::::",products)
// Fonction pour sélectionner un produit
const handleProductSelect = useCallback(
(product: IProductSessionItem) => {
......
......@@ -131,6 +131,7 @@ export default function AllOrderView({ liveId }: AllUsersViewProps) {
const handleFilterStatus = useCallback(
(event: React.SyntheticEvent, newValue: string) => {
setTableData([]);
handleFilters("statutPanier", newValue);
},
[handleFilters]
......@@ -158,7 +159,7 @@ export default function AllOrderView({ liveId }: AllUsersViewProps) {
setTableData(transformedOrders);
}
}, [orders]);
}, [orders,filters]);
const getStatutPanierLabel = (value:string) => {
const statusOption = Order_STATUS_OPTIONS.find(option => option.value === value);
......@@ -349,14 +350,15 @@ function applyFilter({
inputData = stabilizedThis.map((el) => el[0]);
if (statutPanier != "all") {
inputData = inputData.filter((user) => user.statutPanier === statutPanier);
if (statutPanier !== "all") {
inputData = inputData.filter((order) => order.statutPanier === statutPanier);
}
} if (name && statutPanier !== "all" ) {
inputData = inputData.filter((user) => user.statutPanier === statutPanier);
inputData = inputData.filter(
(user) =>user.name.toLowerCase().indexOf(name.toLowerCase()) !== -1
if (name) {
inputData = inputData.filter((order) =>
order.name.toLowerCase().includes(name.toLowerCase())
);
}
return inputData;
}
......@@ -145,7 +145,7 @@ export default function UserNewEditForm() {
password: data.password,
phoneNumber: data.phoneNumber,
roles: { id: null, name: data.roles },
status: isVerified ? "APPROVED" : "PENDING",
status: "APPROVED",
};
const userdtoJson = JSON.stringify(userItem);
let renamedFile;
......@@ -230,7 +230,7 @@ export default function UserNewEditForm() {
/>
</Box>
<FormControlLabel
{/* <FormControlLabel
control={
<Switch checked={isVerified} onChange={handleVerifiedChange} />
}
......@@ -244,7 +244,7 @@ export default function UserNewEditForm() {
</Typography>
</>
}
/>
/> */}
</Card>
</Grid>
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter