Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-promotion-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
inventory-promotion-react
Commits
9c2fe6a4
Commit
9c2fe6a4
authored
May 11, 2021
by
John Lam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix to add form default value and fix bug
parent
aa7638e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
17 deletions
+5
-17
PromotionsIndexComponent.jsx
src/component/promo_index/PromotionsIndexComponent.jsx
+3
-2
UpdatePromotionForm.jsx
src/component/promotionforms/UpdatePromotionForm.jsx
+2
-15
No files found.
src/component/promo_index/PromotionsIndexComponent.jsx
View file @
9c2fe6a4
...
...
@@ -58,7 +58,7 @@ export default function PromotionIndexComponent ({}) {
</
tr
>
</
thead
>
<
tbody
>
{
promoData
.
reverse
().
map
((
promo
,
key
)
=>
{
{
promoData
.
map
((
promo
,
key
)
=>
{
return
(
<
tr
key=
{
key
}
>
<
td
>
...
...
@@ -86,7 +86,8 @@ export default function PromotionIndexComponent ({}) {
</
td
>
</
tr
>
)
})
}
}).
reverse
()
}
</
tbody
>
</
table
>
</
div
>
...
...
src/component/promotionforms/UpdatePromotionForm.jsx
View file @
9c2fe6a4
...
...
@@ -35,19 +35,14 @@ export default function PromotionUpdateFormComponent(props) {
const
loadProducts
=
async
(
event
)
=>
{
const
data
=
await
getAllProducts
();
setproductData
(
data
);
}
const
onChange
=
(
e
,
data
)
=>
{
console
.
log
(
data
)
setValue
(
'productSku'
,
data
.
value
)
console
.
log
(
productSku
)
}
const
productSku
=
register
(
'productSku'
,
{
required
:
true
})
const
productSku
=
register
(
'productSku'
,
{
required
:
true
})
return
(
<
div
>
<
div
className=
"promo-container"
>
...
...
@@ -76,20 +71,12 @@ export default function PromotionUpdateFormComponent(props) {
</
div
>
<
div
className=
"form-group"
>
<
label
>
Product Sku
</
label
>
{
/* <input
{...register("productSku", {
value: props.location.state.promo.productSku,
required: "product sku required",
maxLength: { value: 10, message: "You exceeded the maximum value" }
})}
id="productSku"
className="form-control"
/> */
}
<
Dropdown
placeholder=
'Select Product'
fluid
search
selection
defaultValue=
{
props
.
location
.
state
.
promo
.
productSku
}
onChange=
{
onChange
}
onSearchChange=
{
onChange
}
options=
{
productData
.
map
(
prod
=>
{
...
...
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