Closed crypto-supporter closed 5 years ago
iteration: 1 status: PASSED environment: LOCAL
Test Condition:
go back to dashboard
link on proposal details page THEN user should still see the list of proposals under the selected tab. Hey @crypto-supporter, just a heads up. We reverted your changes temporarily because we noticed that the API endpoint for filtering proposal likes by stage is not available for some stage values. We'll bring the change back once the endpoint has been fixed.
http://localhost:3005/proposals?stage=<stage>
does not work for some values of stage
because the filter list in the API is incomplete. So what happens is that the likes counter on the dashboard will be 0
for some proposals.
Are you familiar with developing in Ruby on Rails? I believe this should be an easy fix in the dao-server
repository. We just need to add the missing filters in app/models/concerns/stage_field.rb
.
# frozen_string_literal: true
module StageField
extend ActiveSupport::Concern
included do
enum stage: { idea: 1, draft: 2, archived: 9 } # add missing filters here
end
end
The numerical values are arbitrary, though let's not change the existing ones (so we don't have to do a migration) and let's keep them in order (e.g. the value for idea
should be less than draft
, which is less than proposal
).
If you have questions or encounter any problems, feel free to tag @FrancisMurillo in your dao-server
PR. He will be the one reviewing dao-server
changes.
It looks like additional changes will be needed to accommodate the all
filter. We either change the logic in the frontend to remove the all
filter and replace the usage of REST endpoints with GraphQL, or we update the backend to accommodate all the filters. Regardless, this PR is reverted for now until either change is made.
@crypto-supporter
WHY
Going to a proposal page from the
review tab
and then clicking back button takes you to theAll tab
. It would be more logical to go back to the tab where you left off.WHAT
Move the stage react state to redux to preserv that data even if a user moves to another page. That way the state will be preserved even if a user moves to another page.
HOW TO TEST
PS
I would consider refactoring the menu logic a bit. Make links of them so it would be https://localhost:3000/#/all, https://localhost:3000/#/review, etc.. That way we get a lot of good UX for free from the way the browser behaves. It would also be easier to maintain and codesplit if needed and also fix the issue that the whole components get rerendered even if the data is the same.