Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
The most significant changes involve renaming and replacing functions…
Browse files Browse the repository at this point in the history
… 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)
Aloento committed Feb 12, 2024
1 parent a081f6c commit a899aac
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Components/OrderInfo.tsx
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ const useStyles = makeStyles({
*/
interface IOrderInfo {
OrderId: number;
Order: OrderEntity.Order;
Order?: OrderEntity.Order;
Admin?: true;
}

2 changes: 1 addition & 1 deletion src/Pages/Admin/Order/Append.tsx
Original file line number Diff line number Diff line change
@@ -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<string>();

4 changes: 2 additions & 2 deletions src/Pages/Admin/Order/Detail.tsx
Original file line number Diff line number Diff line change
@@ -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; }) {

<OrderComment Comments={data?.Comments} />

<AdminOrderAppend OrderId={OrderId} Refresh={run} />
<AdminCommentAppend OrderId={OrderId} Refresh={run} />

<AdminOrderAction OrderId={OrderId} Status={order?.Status} Refresh={run} />
</DrawerBody>
2 changes: 1 addition & 1 deletion src/Pages/History/Append.tsx
Original file line number Diff line number Diff line change
@@ -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();
4 changes: 2 additions & 2 deletions src/Pages/History/Detail.tsx
Original file line number Diff line number Diff line change
@@ -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

<OrderComment Comments={data?.Comments} />

<OrderAppend OrderId={OrderId} Status={order?.Status} Refresh={run} ParentLog={log} />
<CommentAppend OrderId={OrderId} Status={order?.Status} Refresh={run} ParentLog={log} />

<OrderAction OrderId={OrderId} Status={order?.Status} Refresh={run} ParentLog={log} />
</div>
2 changes: 2 additions & 0 deletions src/ShopNet/Order/Entity.ts
Original file line number Diff line number Diff line change
@@ -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<OrderEntity.Order> {
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<OrderEntity.Comment> {
this.EnsureLogin();

0 comments on commit a899aac

Please sign in to comment.