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

Jordan/1754 forms #1807

Merged
merged 83 commits into from
Jan 23, 2019
Merged

Jordan/1754 forms #1807

merged 83 commits into from
Jan 23, 2019

Conversation

jbibla
Copy link
Collaborator

@jbibla jbibla commented Jan 7, 2019

Closes #1754
Closes #1803

Description:

  • standardized action modals
  • cleaned up some inconsistent styles

send-modal

❤️ Thank you!


  • Added entries in CHANGELOG.md with issue # and GitHub username
  • Reviewed Files changed in the github PR explorer

@@ -126,7 +126,6 @@ export default {

.tm-form-msg.tm-form-msg--error {
color: var(--danger);
position: absolute;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jbibla important as the styling was bad for the message on the signup page

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

noooooooooooooooooooo

i will fix the sign up page

titleMaxLength: 64,
descriptionMinLength: 1,
descriptionMaxLength: 200,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

do we actually need a descriptionMaxLength?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@fedekunze @cwgoes do we have a max length in the SDK?

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK yes, the body will be cut after some charachters, but I don't know the exact size of it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it would be nice if this matched the size from the SDK. but we can adjust later.

Copy link

Choose a reason for hiding this comment

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

There's a general size limit for messages, but not a specific one for description.

@@ -188,8 +205,7 @@ export default {
},
amount: {
required,
isInteger,
between: between(1, this.balance)
between: x => x >= 1 && x <= this.balance
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why not use the between validator from vuelidate?

Copy link
Collaborator

Choose a reason for hiding this comment

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

probably didn't work well

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would not accept 1

Copy link
Contributor

Choose a reason for hiding this comment

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

given that we are here I will propose to fix a thing.
If my balance is 0 this form let me submit 1 succesfully, send the TX, and fail miserably.

I would like fail earlier and this between should be (this.balance > 0 ? 1 : 0, ...)
Or in the new format either this.balance > 0 && ...same...

Copy link
Contributor

Choose a reason for hiding this comment

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

I.e. in app/src/renderer/components/wallet/SendModal.vue it's done in this way

</tm-form-group>

<tm-form-group
:error="$v.amount.$dirty && $v.amount.$invalid"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
:error="$v.amount.$dirty && $v.amount.$invalid"
:error="$v.amount.$error && $v.amount.$invalid"

/>
<tm-form-msg
v-if="!$v.amount.between && amount > 0"
v-if="$v.amount.$dirty && $v.amount.$invalid && !$v.amount.between"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
v-if="$v.amount.$dirty && $v.amount.$invalid && !$v.amount.between"
v-if="$v.amount.$error && $v.amount.$invalid && !$v.amount.between"

Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

utACK and code is mostly good. I have some comments, mostly regarding consistency. We need a tested ACK approval before merging this

<tm-form-msg
v-if="!$v.amount.between && amount > 0 && balance > 0"
v-if="
$v.amount.$error && !$v.amount.between && amount > 0 && balance > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

on the other modals we're using v.amount.$error && !$v.amount.between && amount === 0 we should stick with one for consistency

Copy link
Contributor

Choose a reason for hiding this comment

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

uhh it seems we have different msg types for required and between on the other modal, can we make that consistent ?

<span class="input-suffix">{{ denom }}</span>
<tm-field id="amount" v-model="amount" type="number" />
<tm-form-msg
v-if="$v.amount.$error && !$v.amount.between && amount === 0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I took the above example from here ^^

min-width: 9rem;
}
</style>
<style></style>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<style></style>

<tm-btn
v-else
id="send-btn"
:disabled="$v.fields.$invalid"
Copy link
Contributor

Choose a reason for hiding this comment

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

this shouldn't be disabled as with the other modals

@@ -76,7 +73,7 @@ export default [
path: `/wallet/send/:denom?`,
Copy link
Contributor

Choose a reason for hiding this comment

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

curious why we need the ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

means it is an optional param

@faboweb faboweb merged commit 01caf65 into develop Jan 23, 2019
@faboweb faboweb deleted the jordan/1754-forms branch January 23, 2019 15:52
@faboweb
Copy link
Collaborator

faboweb commented Jan 23, 2019

@fedekunze didn't see you comments, will implement them on the follow up PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Header issue on PageProposal improve form styling, sizing, and error messaging
5 participants