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
99c953ef
Commit
99c953ef
authored
May 05, 2021
by
Shanelle Valencia
Browse files
Options
Browse Files
Download
Plain Diff
[AFP-24]
🚧
Fix search issues with order type [@valencia]
parents
98cf432e
ef2fc702
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
SearchOrder.tsx
src/components/SearchOrder.tsx
+22
-0
No files found.
src/components/SearchOrder.tsx
View file @
99c953ef
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Link
}
from
'react-router-dom'
<<
<
<<<<
HEAD
import
{
Order
}
from
'
Order
';
=======
>
>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
const SearchOrder = (props: any) =
>
{
const
orders
=
props
.
orders
;
...
...
@@ -9,7 +12,10 @@ const SearchOrder = (props: any) => {
const
[
searchResult
,
setSearchResult
]
=
useState
([]);
console
.
log
(
"ORDERS"
,
orders
)
<<
<
<<<<
HEAD
// console.log("props", props)
=======
>
>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
const handleSearchInput = (event: any) =
>
{
setSearchInput
(
event
.
target
.
value
);
...
...
@@ -20,9 +26,16 @@ const SearchOrder = (props: any) => {
}
useEffect(() =
>
{
<
<<<<<<
HEAD
if
(
orders
.
length
>
0)
{
const
res
=
orders
.
filter
((
order
:
Order
)
=>
order
.
orderNumber
.
includes
(
searchInput
)
//|| order.date.includes(searchInput)
=======
if
(
orders
.
length
>
0
)
{
const
res
=
orders
.
filter
((
order
:
any
)
=>
order
.
orderNumber
.
includes
(
searchInput
)
||
order
.
date
.
includes
(
searchInput
)
// console.log(orderNum)
>>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
);
// debugger
setSearchResult
(
res
);
...
...
@@ -40,12 +53,21 @@ const SearchOrder = (props: any) => {
onChange=
{
handleSearchInput
}
/>
<
ul
>
<
<<<<<<
HEAD
{
searchResult
.
map
((
item
:
any
,
idx
)
=
>
{
// debugger
return
(
<
li
key=
{
idx
}
>
<
Link
to=
{
"/orders/"
+
item
.
orderNumber
}
>
{
item
.
orderNumber
}
</
Link
>
</
li
>
=======
{
searchResult
.
map
((
item
,
idx
)
=>
{
// debugger
return
(
<
tr
key=
{
idx
}
>
<
Link
to=
{
"/orders/"
+
item
}
>
item
</
Link
>
</
tr
>
>>>>>>>
ef2fc70222401291e5bd34259571daf7388cacca
)
})}
<
/
ul
>
...
...
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