HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.

Home Page:https://habitica.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FAQ Code Refactor

CuriousMagpie opened this issue · comments

The FAQ code needs to be refactored to take into account differing numbers of questions between platforms, retired questions, and reordered questions.

Files affected (these may not be the only ones):

  • website/client/src/components/static/faq.vue
  • website/common/script/content/faq.js
  • website/common/locales/en/faq.json
  • test/content/faq.js

Specific things to overhaul:

  • faq.js in common/script/content supposes that all platforms will have the same number of questions and that we will never remove a question from the list. So...
    • Change the structure of common/script/content/faq.js to something like { platformA: [ 1, 2, 4, 8 ], platformB: [ 2, 3. 4. 5 ] } or similar
    • ...somehow keep the actual response in the content API the same? But if a breaking change is unavoidable, coordinate with mobile so the apps can parse the server data correctly
  • faq.vue doesn't actually use the content API or even the relevant common script, it just maps a hardcoded list of headings to string tokens by index. So...
    • Add headings to the FAQ API
    • Make faq.vue call the API, or at least pull data about available FAQ questions from common/script/content

I can help with this! It seems like there are three separate action items here though. so I'm going to start with the hardcoded lists in faq.js first and have subsequent PRs for the API changes

Hi there! I'm working on this--we usually only have one contributor working on an issue at a time. Is there anything else that strikes your fancy?

Oh sorry, didn't know if you were active on it or not. I'll look at the other issues thanks

Changing our approach to this problem.