Skip to content
Extraits de code Groupes Projets
Valider 99e8c33f rédigé par Mohamed Lemine BAILLAHI's avatar Mohamed Lemine BAILLAHI
Parcourir les fichiers

Merge branch 'feature/MS-88' into 'develop'

MS-88/Fix relay point display in order info of back office

Closes MS-88

See merge request !484
parents 65679320 159822a4
Branches
1 requête de fusion!484MS-88/Fix relay point display in order info of back office
......@@ -8,23 +8,23 @@ import { RefundOrderItem } from "./refundOrder";
export enum NoteType {
PRIVATE = 'PRIVATE',
TO_CLIENT = 'TO_CLIENT',
FROM_CLIENT="FROM_CLIENT"
FROM_CLIENT = "FROM_CLIENT"
}
export const noteTypeLabels: Record<NoteType, string> = {
[NoteType.PRIVATE]: 'Privé',
[NoteType.TO_CLIENT]: 'Pour le client',
[NoteType.FROM_CLIENT]: 'du client',
[NoteType.PRIVATE]: 'Privé',
[NoteType.TO_CLIENT]: 'Pour le client',
[NoteType.FROM_CLIENT]: 'du client',
};
export const order_options = {
FAILED: "Échoué",
ON_HOLD: "En attente",
IN_PROGRESS: "En cours",
FINISHED: "Terminé",
CANCELED: "Annulé",
PARTIALLY_REFUNDED: "Remboursé partiellement",
REFUNDED: "Remboursé",
DELETED: "Supprimé",
FAILED: "Échoué",
ON_HOLD: "En attente",
IN_PROGRESS: "En cours",
FINISHED: "Terminé",
CANCELED: "Annulé",
PARTIALLY_REFUNDED: "Remboursé partiellement",
REFUNDED: "Remboursé",
DELETED: "Supprimé",
};
export enum ItemSource {
......@@ -137,8 +137,8 @@ export type OrderAddress = {
export interface OrderWithClientDetails extends Order {
clientFullName: string;
clientEmail: string;
clientFullName: string;
clientEmail: string;
}
export interface Order {
id: string;
......@@ -160,6 +160,13 @@ export interface Order {
shippingMethodType: ShippingMethodType;
shippingPrice: number;
shippingAddress: OrderAddress;
relayRef: string;
relayPointName: string;
relayPointAddress1: string;
relayPointAddress2: string;
relayPointZipCode: string;
relayPointCity: string;
relayPointCountry: string;
billingAddress: OrderAddress;
paymentMethodType: string;
transactionId?: string;
......@@ -179,27 +186,27 @@ export interface Order {
voucherBalanceUsed: number;
}
export interface IOrderPage {
content: OrderWithClientDetails[];
pageable: {
content: OrderWithClientDetails[];
pageable: {
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
offset: number;
pageNumber: number;
pageSize: number;
unpaged: boolean;
paged: boolean;
};
totalPages: number;
totalElements: number;
last: boolean;
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
offset: number;
pageNumber: number;
pageSize: number;
unpaged: boolean;
paged: boolean;
};
totalPages: number;
totalElements: number;
last: boolean;
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
}
......
......@@ -4,10 +4,10 @@ import Stack from "@mui/material/Stack";
import Divider from "@mui/material/Divider";
import CardHeader from "@mui/material/CardHeader";
import Typography from "@mui/material/Typography";
import {CardContent,Chip,Grid,Pagination,Table,TableBody,TableCell,TableContainer,TableRow} from "@mui/material";
import { CardContent, Chip, Grid, Pagination, Table, TableBody, TableCell, TableContainer, TableRow } from "@mui/material";
import CircularProgress from "@mui/material/CircularProgress";
import {OrderStatusHistoryDTO,getStatusInFrench,OrderStatus} from "../../../types/order";
import { findUserById, useGetUserById } from "@/shared/api/user";
import { OrderStatusHistoryDTO, getStatusInFrench, OrderStatus } from "../../../types/order";
import { findUserById } from "@/shared/api/user";
import { useCallback, useEffect, useState } from "react";
import { noteTypeLabels, Order } from "@/contexts/types/main-order";
import { IClientItem } from "@/shared/types/user";
......@@ -227,9 +227,9 @@ export default function OrderDetailsInfo({ order }: Props) {
const sortedNotes = order?.notes
? order.notes.sort(
(a, b) =>
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
)
(a, b) =>
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
)
: [];
const paginatedNotes = sortedNotes.slice(
......@@ -293,10 +293,10 @@ export default function OrderDetailsInfo({ order }: Props) {
type === "page"
? `PageNote ${page}`
: type === "next"
? "PageNote suivante"
: type === "previous"
? "PageNote précédente"
: ""
? "PageNote suivante"
: type === "previous"
? "PageNote précédente"
: ""
}
sx={{
mt: 2,
......@@ -366,9 +366,8 @@ export default function OrderDetailsInfo({ order }: Props) {
>
Adresse
</Box>
{`${order.billingAddress.street || ""} ${
order.billingAddress.home || ""
}`}
{`${order.billingAddress.street || ""} ${order.billingAddress.home || ""
}`}
</Stack>
<Stack direction="row">
<Box
......@@ -418,9 +417,8 @@ export default function OrderDetailsInfo({ order }: Props) {
>
Adresse
</Box>
{`${order.shippingAddress.street || ""} ${
order.shippingAddress.home || ""
}`}
{`${order.shippingAddress.street || ""} ${order.shippingAddress.home || ""
}`}
</Stack>
<Stack direction="row">
<Box
......@@ -449,22 +447,92 @@ export default function OrderDetailsInfo({ order }: Props) {
</Box>
{order.shippingAddress.country || ""}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Mode d’expédition
</Box>
{getShippingMethodNameInFrench(order.shippingMethodType) || ""}
</Stack>
</Stack>
) : (
<Box sx={{ p: 3, typography: "body2", color: "text.secondary" }}>
Commande n'a pas d'adresse de livraison
</Box>
)}
<Stack spacing={1.5} sx={{ p: 3, typography: "body2" }}>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Mode d’expédition
</Box>
{getShippingMethodNameInFrench(order.shippingMethodType) || ""}
</Stack>
<Typography
variant="subtitle1"
sx={{
fontWeight: "bold",
textTransform: "uppercase",
color: "primary.main",
mt: 2,
mb: 1,
}}
>
Point de retrait du Mondial Relay
</Typography>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Nom
</Box>
{order?.relayPointName}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Addresse 1
</Box>
{order?.relayPointAddress1}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Addresse 2
</Box>
{order?.relayPointAddress2}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Code postal
</Box>
{order?.relayPointZipCode}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Ville
</Box>
{order?.relayPointCity}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Pays
</Box>
{order?.relayPointCountry}
</Stack>
</Stack>
</>
);
......
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