Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3278 Limit input for user could not submit lower than minimum offer … #3324

Merged
merged 7 commits into from
Jul 9, 2022

Conversation

prachi00
Copy link
Member

@prachi00 prachi00 commented Jul 3, 2022

…size

Thank you for your contribution to the KodaDot NFT gallery.
👇 _ Let's make a quick check before the contribution.

PR type

  • Bugfix
  • Feature
  • Refactoring

What's new?

Before submitting Pull Request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality
  • I've posted a screenshot of demonstrated change in this PR

Optional

  • I've tested it at </rmrk/collection/26902bc2f7c20c546a-1FVG7>
  • I've tested PR on mobile and everything seems works
  • I found edge cases
  • I've written some unit tests 🧪

Had issue bounty label?

  • Fill up your KSM address:
    Payout

Community participation

Screenshot

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

@prachi00 prachi00 requested a review from a team as a code owner July 3, 2022 23:43
@prachi00 prachi00 requested review from roiLeo and removed request for a team July 3, 2022 23:43
@kodabot
Copy link
Collaborator

kodabot commented Jul 3, 2022

WARNING @prachi00 PR for issue #3278 which isn't assigned to you. Please be warned that this PR may get rejected if there's another assignee for issue #3278

@netlify
Copy link

netlify bot commented Jul 3, 2022

Deploy Preview for koda-nuxt ready!

Name Link
🔨 Latest commit 53ccabf
🔍 Latest deploy log https://app.netlify.com/sites/koda-nuxt/deploys/62c8599ad619a60008f8a786
😎 Deploy Preview https://deploy-preview-3324--koda-nuxt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@roiLeo roiLeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could work out but I think a better solution would be to update min attribute from BalanceInput component

@prachi00
Copy link
Member Author

prachi00 commented Jul 6, 2022

BalanceInput

Screen Shot 2022-07-05 at 9 14 39 PM

yeah it wont work tho because even if the input will throw error, button will not be disabled and user can still click on it, so we kinda do need he disabled attribute on the button

@roiLeo
Copy link
Contributor

roiLeo commented Jul 6, 2022

This could work out but I think a better solution would be to update min attribute from BalanceInput component

max attribute could be user balance ref #3346

@roiLeo
Copy link
Contributor

roiLeo commented Jul 6, 2022

yeah it wont work tho because even if the input will throw error, button will not be disabled and user can still click on it, so we kinda do need he disabled attribute on the button

Things is I find disabled "buttons/switch/inputs" a bad design pratice, this issue can be solved using simple html form validation.

You solution is working but mobile experience will be bad since user won't be able to know why the button is disabled.

@vikiival vikiival linked an issue Jul 7, 2022 that may be closed by this pull request
3 tasks
@vikiival vikiival mentioned this pull request Jul 7, 2022
3 tasks
@yangwao
Copy link
Member

yangwao commented Jul 7, 2022

You solution is working but mobile experience will be bad since user won't be able to know why the button is disabled.

(In safari,) Do you need to connect your wallet first? 👀 Or do you mean like for Nova wallet?

image

You solution is working but mobile experience will be bad since user won't be able to know why the button is disabled.

Let's create a separate issue for a mobile experience @roiLeo ?

@roiLeo
Copy link
Contributor

roiLeo commented Jul 7, 2022

Screenshot_20220707-133936.png

I just feel like we're making it harder for ourselves, instead I would like to see a simple form

@prachi00
Copy link
Member Author

prachi00 commented Jul 7, 2022

@roiLeo used min max and buefy input validation method to check it now

Copy link
Contributor

@roiLeo roiLeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min is always same value for me (10 000), could you check why?

Form validation looks way better now! didn't knew about buefy checkHtml5Validity method

@prachi00
Copy link
Member Author

prachi00 commented Jul 8, 2022

not sure about min (calculating through api.consts.marketplace.minimumOfferAmount), its 10k for me too, its probably fixed?

@roiLeo
Copy link
Contributor

roiLeo commented Jul 8, 2022

not sure about min (calculating through api.consts.marketplace.minimumOfferAmount), its 10k for me too, its probably fixed?

this looks like it will always be at 10k since it's not related to current item

@vikiival any idea where we can find documentation of this feature?

@vikiival
Copy link
Member

vikiival commented Jul 8, 2022

@vikiival any idea where we can find documentation of this feature?

Unfortunately no.

The code is currently set to 10k
https://github.com/galacticcouncil/Basilisk-node/blob/b3b0b63c0b4098b0f0ca18ac43e748da85540f7c/runtime/basilisk/src/lib.rs#L803
But it can change so I would use api.consts.marketplace.minimumOfferAmount instead of setting 10k there

Also be aware that the api call can return you a special type (like u128) so you need to apply proper formatting

@prachi00
Copy link
Member Author

prachi00 commented Jul 8, 2022

@roiLeo can we merge this now?

@yangwao
Copy link
Member

yangwao commented Jul 9, 2022

Seems on account with 19000 bsx

image

is ok

when I submit offer for 21000 BSX where account balance is 19000 bsx got error, could be fixed in #3346

image

#3361 seems doesn't happen to me

@yangwao
Copy link
Member

yangwao commented Jul 9, 2022

pay 50 usd

@yangwao yangwao merged commit f290067 into main Jul 9, 2022
@yangwao yangwao deleted the feat-offer-fix branch July 9, 2022 12:03
@yangwao
Copy link
Member

yangwao commented Jul 9, 2022

😍 Perfect, I’ve sent the payout
💵 $50 @ 52.86 USD/KSM ~ 0.946 $KSM
🧗 EzGc4s9PgCPx1YnF3fqzhLzVHpHMTL4LWPScwpDrR8JKgSU
🔗 0xd37fd1edfc3485cf72d95659aa44d8a4322605ae3d5490e6046c3f652f8329f9

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Jul 9, 2022
@roiLeo roiLeo mentioned this pull request Jul 19, 2022
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paid pull-request has been paid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid prop: tooltipOfferLabel Limit input for user could not submit lower than minimum offer size
5 participants