Skip to content

Commit

Permalink
Use action index to give labels unique name (IntersectMBO#3234)
Browse files Browse the repository at this point in the history
  • Loading branch information
luigy authored May 21, 2021
1 parent 9098479 commit 867551d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plutus-pab-client/src/View/Contracts.purs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ actionCard contractInstanceId wrapper endpointForm =
col4_
[ card_
[ cardHeader_ [ h2_ [ text $ view (_schema <<< _FunctionSchema <<< _endpointDescription <<< _getEndpointDescription) endpointForm ] ]
, cardBody_ [ actionArgumentForm wrapper (view _argument endpointForm) ]
, cardBody_ [ actionArgumentForm 0 wrapper (view _argument endpointForm) ]
, cardFooter_
[ button
[ classes [ btn, btnSmall, btnPrimary ]
Expand Down
2 changes: 1 addition & 1 deletion plutus-playground-client/src/Action/View.purs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ actionPaneBody index (CallEndpoint { caller, argumentValues }) =
, text ": "
, text $ view (_FunctionSchema <<< _endpointDescription <<< _getEndpointDescription) argumentValues
]
, actionArgumentForm (PopulateAction index) $ view (_FunctionSchema <<< _argument) argumentValues
, actionArgumentForm index (PopulateAction index) $ view (_FunctionSchema <<< _argument) argumentValues
]

actionPaneBody index (PayToWallet { sender, recipient, amount }) =
Expand Down
5 changes: 3 additions & 2 deletions web-common-plutus/src/Schema/View.purs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ import ValueEditor (valueForm)

actionArgumentForm ::
forall p i.
Int ->
(FormEvent -> i) ->
FormArgument ->
HTML p i
actionArgumentForm wrapper argument =
actionArgumentForm index wrapper argument =
div [ class_ wasValidated ]
[ wrapper <$> actionArgumentField [] false argument ]
[ wrapper <$> actionArgumentField [ show index ] false argument ]

actionArgumentField ::
forall p.
Expand Down

0 comments on commit 867551d

Please sign in to comment.