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

No skill stats showing in pane & console TypeError #74

Closed
erezvish opened this issue Mar 3, 2019 · 1 comment · Fixed by #75
Closed

No skill stats showing in pane & console TypeError #74

erezvish opened this issue Mar 3, 2019 · 1 comment · Fixed by #75

Comments

@erezvish
Copy link
Contributor

erezvish commented Mar 3, 2019

What is the current behavior?

  1. Console error:

TypeError: string.charAt is not a function at VueComponent.capitalizeFirstLetter

  1. Stats tab is not showing skills

If the current behavior is a bug, please provide the exact steps to reproduce.

  1. login into the game (I'm using the guest login)
  2. open the console
  3. observe the error
    *if the error doesn't appear try moving the player around a bit

What is the expected behavior?

  1. No error
  2. When clicking the stats tab in the right pane, observe a list of skills

Additional context
This error seems to be due to the behavior of the v-for in Stats.vue . My Vue is a little rusty, but I believe the syntax used is suitable for working with object properties, whereas the stats are received as an array.
This results in capitalizeFirstLetter method getting the number 0 and failing.

To fix the issue, the v-for should probably be on skill in skills and the capitalizeFirstLetter method should receive skill.name
*capitalizeFirstLetter should protect itself by addressing cases where non string input is received is not a string. Alternatively we can replace it with css text-transform: capitalize.

@naknode
I'm opening new issues for new things I encounter if I'm submitting a pull request shortly after. I think I read somewhere that pull requests will only be accepted for issues, and even if not, I thought it's a good such things documented. Please let me know if you want me to keep doing that or just submit a pull request.

erezvish added a commit to erezvish/game that referenced this issue Mar 3, 2019
…r - fixed v-for in Stats.vue to work as expected. removed captializing method and replaced with a css class. Also updated player.json and added _id to skills
naknode pushed a commit that referenced this issue Mar 3, 2019
Fixing issue #74 - No skill stats showing in pane & console TypeError
@naknode
Copy link
Member

naknode commented Mar 3, 2019

@erezvish Yes, it's good that we document via Issues so this is a good way to go about it. But I believe it should be a your discretion.

For example, prominent issues or feature requests should always be documented. Small UI fixes and errors can just have PRs and no issues needed.

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 a pull request may close this issue.

2 participants