From a899aacd0696e68cc157d97ad8cf60cf85a17b6d Mon Sep 17 00:00:00 2001 From: Aloento <11802769+Aloento@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:43:43 +0100 Subject: [PATCH] The most significant changes involve renaming and replacing functions and components in `Append.tsx` and `Detail.tsx`. The `Order` property in the `IOrderInfo` interface has also been made optional, and a `@liveSafe` comment has been added to the `OrderEntity` class. 1. The `Order` property in the `IOrderInfo` interface in `OrderInfo.tsx` has been made optional. This change allows for instances where an order may not be present or necessary. (OrderInfo.tsx) 2. The `AdminOrderAppend` function in `Append.tsx` has been renamed to `AdminCommentAppend`. This change reflects a shift in functionality from appending orders to appending comments. (Append.tsx) 3. The `AdminOrderAppend` component in `Detail.tsx` has been replaced with `AdminCommentAppend`. This change ensures that the updated function is correctly referenced and used in the `Detail.tsx` file. (Detail.tsx) 4. The `OrderAppend` function in `Append.tsx` has been renamed to `CommentAppend`. Similar to the previous renaming, this change reflects a shift in functionality from appending orders to appending comments. (Append.tsx) 5. The `OrderAppend` component in `Detail.tsx` has been replaced with `CommentAppend`. This change ensures that the updated function is correctly referenced and used in the `Detail.tsx` file. (Detail.tsx) 6. The `OrderEntity` class in `Entity.ts` has been updated with a `@liveSafe` comment for the `Order` and `Comment` methods. This comment likely indicates that these methods have been reviewed and deemed safe for live deployment. (Entity.ts) --- src/Components/OrderInfo.tsx | 2 +- src/Pages/Admin/Order/Append.tsx | 2 +- src/Pages/Admin/Order/Detail.tsx | 4 ++-- src/Pages/History/Append.tsx | 2 +- src/Pages/History/Detail.tsx | 4 ++-- src/ShopNet/Order/Entity.ts | 2 ++ 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Components/OrderInfo.tsx b/src/Components/OrderInfo.tsx index 726c017a..8be239bb 100644 --- a/src/Components/OrderInfo.tsx +++ b/src/Components/OrderInfo.tsx @@ -27,7 +27,7 @@ const useStyles = makeStyles({ */ interface IOrderInfo { OrderId: number; - Order: OrderEntity.Order; + Order?: OrderEntity.Order; Admin?: true; } diff --git a/src/Pages/Admin/Order/Append.tsx b/src/Pages/Admin/Order/Append.tsx index 74dead5b..6d6091f8 100644 --- a/src/Pages/Admin/Order/Append.tsx +++ b/src/Pages/Admin/Order/Append.tsx @@ -29,7 +29,7 @@ const log = new Logger("Admin", "Order", "Detail", "Append"); * @since 0.5.0 * @version 0.2.2 */ -export function AdminOrderAppend({ OrderId, Refresh }: IAdminOrderAppend) { +export function AdminCommentAppend({ OrderId, Refresh }: IAdminOrderAppend) { const style = useStyles(); const [cmt, setCmt] = useState(); diff --git a/src/Pages/Admin/Order/Detail.tsx b/src/Pages/Admin/Order/Detail.tsx index ae2060b9..7ff36b29 100644 --- a/src/Pages/Admin/Order/Detail.tsx +++ b/src/Pages/Admin/Order/Detail.tsx @@ -10,7 +10,7 @@ import { ColFlex } from "~/Helpers/Styles"; import { OrderComment } from "~/Pages/History/Comment"; import { AdminHub } from "~/ShopNet/Admin"; import { AdminOrderAction } from "./Action"; -import { AdminOrderAppend } from "./Append"; +import { AdminCommentAppend } from "./Append"; import { AdminOrderList } from "./List"; import { Shipment } from "./Ship"; @@ -104,7 +104,7 @@ export function AdminOrderDetail({ OrderId }: { OrderId: number; }) { - + diff --git a/src/Pages/History/Append.tsx b/src/Pages/History/Append.tsx index 4484cb63..b4c03cb1 100644 --- a/src/Pages/History/Append.tsx +++ b/src/Pages/History/Append.tsx @@ -35,7 +35,7 @@ interface IOrderAppend { * @since 0.5.0 * @version 0.4.2 */ -export function OrderAppend({ OrderId, Status, Refresh, ParentLog }: IOrderAppend) { +export function CommentAppend({ OrderId, Status, Refresh, ParentLog }: IOrderAppend) { const log = useConst(() => ParentLog.With("Append")); const style = useStyles(); diff --git a/src/Pages/History/Detail.tsx b/src/Pages/History/Detail.tsx index 545e557c..e8b33fd3 100644 --- a/src/Pages/History/Detail.tsx +++ b/src/Pages/History/Detail.tsx @@ -13,7 +13,7 @@ import { ICompLog } from "~/Helpers/Logger"; import { ColFlex } from "~/Helpers/Styles"; import { Hub } from "~/ShopNet"; import { OrderAction } from "./Action"; -import { OrderAppend } from "./Append"; +import { CommentAppend } from "./Append"; import { IComment, OrderComment } from "./Comment"; /** @@ -166,7 +166,7 @@ export function OrderDetail({ OrderId, ParentLog }: { OrderId: number } & ICompL - + diff --git a/src/ShopNet/Order/Entity.ts b/src/ShopNet/Order/Entity.ts index ebbb059b..f33ba4d4 100644 --- a/src/ShopNet/Order/Entity.ts +++ b/src/ShopNet/Order/Entity.ts @@ -25,6 +25,7 @@ export abstract class OrderEntity extends ShopNet { * @author Aloento * @since 1.0.0 * @version 0.1.0 + * @liveSafe */ public static Order(key: number): Promise { this.EnsureLogin(); @@ -35,6 +36,7 @@ export abstract class OrderEntity extends ShopNet { * @author Aloento * @since 1.0.0 * @version 0.1.0 + * @liveSafe */ public static Comment(key: number): Promise { this.EnsureLogin();