Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
order-management-react
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
order-management-react
Commits
95fcb0be
Commit
95fcb0be
authored
May 11, 2021
by
Kevin Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-NA] fix order date display and order created date display
parent
68388055
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10617 additions
and
11018 deletions
+10617
-11018
OrderDetails.tsx
src/components/OrderDetails.tsx
+1
-1
OrderIndexPage.tsx
src/pages/OrderIndexPage.tsx
+7
-7
OrderShowPage.tsx
src/pages/OrderShowPage.tsx
+2
-2
MainRouter.tsx
src/router/MainRouter.tsx
+1
-3
yarn.lock
yarn.lock
+10606
-11005
No files found.
src/components/OrderDetails.tsx
View file @
95fcb0be
...
@@ -21,7 +21,7 @@ const OrderDetails = (props: any) => {
...
@@ -21,7 +21,7 @@ const OrderDetails = (props: any) => {
const
status
=
props
.
status
const
status
=
props
.
status
return
(
return
(
<>
<>
<
Td
><
Link
to=
{
"/orders/"
+
orderNumber
}
>
{
orderNumber
}
</
Link
></
Td
>
<
Td
><
Link
to=
{
"/orders/"
+
orderNumber
}
>
{
orderNumber
.
slice
(
orderNumber
.
length
-
7
).
toUpperCase
()
}
</
Link
></
Td
>
<
Td
>
{
date
}
</
Td
>
<
Td
>
{
date
}
</
Td
>
<
Td
>
{
status
}
</
Td
>
<
Td
>
{
status
}
</
Td
>
</>
</>
...
...
src/pages/OrderIndexPage.tsx
View file @
95fcb0be
...
@@ -19,8 +19,8 @@ const OrderIndexPage = () => {
...
@@ -19,8 +19,8 @@ const OrderIndexPage = () => {
const
[
orderDetailsArr
,
setOrderDetailsArr
]
=
useState
<
any
>
([])
const
[
orderDetailsArr
,
setOrderDetailsArr
]
=
useState
<
any
>
([])
const
orderDetailsArrCreator
=
(
orders
:
Order
[])
=>
{
const
orderDetailsArrCreator
=
(
orders
:
Order
[])
=>
{
return
orders
.
map
((
order
:
Order
,
idx
:
any
)
=>
{
return
orders
.
map
((
order
:
Order
,
idx
:
any
)
=>
{
return
<
Tr
key=
{
idx
}
><
OrderDetails
return
<
Tr
key=
{
idx
}
><
OrderDetails
date=
{
order
.
orderCreatedAt
}
date=
{
new
Date
(
order
.
orderCreatedAt
).
toLocaleDateString
()
}
orderNumber=
{
order
.
id
}
orderNumber=
{
order
.
id
}
status=
{
order
.
orderStatus
}
status=
{
order
.
orderStatus
}
/></
Tr
>
/></
Tr
>
...
@@ -42,11 +42,11 @@ const OrderIndexPage = () => {
...
@@ -42,11 +42,11 @@ const OrderIndexPage = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
const
newArray
:
Order
[]
=
[]
const
newArray
:
Order
[]
=
[]
for
(
const
ele
of
allOrders
)
{
for
(
const
ele
of
allOrders
)
{
if
(
ele
.
id
.
includes
(
searchInput
))
{
if
(
ele
.
id
.
includes
(
searchInput
))
{
newArray
.
push
(
ele
)
newArray
.
push
(
ele
)
}
}
}
}
setFilteredOrders
(
newArray
)
setFilteredOrders
(
newArray
)
},
[
searchInput
,
allOrders
])
},
[
searchInput
,
allOrders
])
...
@@ -72,7 +72,7 @@ const OrderIndexPage = () => {
...
@@ -72,7 +72,7 @@ const OrderIndexPage = () => {
<
Thead
>
<
Thead
>
<
Tr
>
<
Tr
>
<
Th
>
Order number
</
Th
>
<
Th
>
Order number
</
Th
>
<
Th
>
Created
</
Th
>
<
Th
>
Order Date
</
Th
>
<
Th
>
Order Status
</
Th
>
<
Th
>
Order Status
</
Th
>
</
Tr
>
</
Tr
>
</
Thead
>
</
Thead
>
...
...
src/pages/OrderShowPage.tsx
View file @
95fcb0be
...
@@ -35,8 +35,8 @@ const OrderShowPage = (props: any) => {
...
@@ -35,8 +35,8 @@ const OrderShowPage = (props: any) => {
<>
<>
<
div
className=
"show-div"
>
<
div
className=
"show-div"
>
<
Flex
justify=
"space-around"
>
<
Flex
justify=
"space-around"
>
<
Box
><
strong
>
Order Date:
</
strong
>
{
order
.
orderCreatedAt
}
</
Box
>
<
Box
><
strong
>
Order Date:
</
strong
>
{
new
Date
(
order
.
orderCreatedAt
).
toLocaleDateString
()
}
</
Box
>
<
Box
><
strong
>
Order Number:
</
strong
>
{
order
.
id
}
</
Box
>
<
Box
><
strong
>
Order Number:
</
strong
>
{
order
.
id
.
slice
(
order
.
id
.
length
-
7
).
toUpperCase
()
}
</
Box
>
<
Box
><
strong
>
Order Status:
</
strong
>
{
order
.
orderStatus
}
</
Box
>
<
Box
><
strong
>
Order Status:
</
strong
>
{
order
.
orderStatus
}
</
Box
>
</
Flex
>
</
Flex
>
<
br
/>
<
br
/>
...
...
src/router/MainRouter.tsx
View file @
95fcb0be
...
@@ -28,6 +28,4 @@ const MainRouter: React.FC = () => {
...
@@ -28,6 +28,4 @@ const MainRouter: React.FC = () => {
)
)
}
}
export
default
MainRouter
export
default
MainRouter
\ No newline at end of file
\ No newline at end of file
yarn.lock
View file @
95fcb0be
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment