Web: Fix CAN options visibility for non-CAN boards#209
Web: Fix CAN options visibility for non-CAN boards#209garvit000 wants to merge 26 commits intoArduPilot:mainfrom
Conversation
| f"Redis connection established with {redis_host}:{redis_port}" | ||
| ) | ||
| self.__boards_key_prefix = "boards-" | ||
| # bump version to invalidate stale board metadata in cache |
There was a problem hiding this comment.
Please remove this change. We can handle the upgrade by manually clearing the cache.
There was a problem hiding this comment.
Needs to be documented in the comment.
There was a problem hiding this comment.
Let's remove this as well. No need to worry about the upgrade due to cached stuff. We can clear it manually.
web/app.py
Outdated
There was a problem hiding this comment.
Better define a class for board with id, name and attributes, in the attributed put the has_can thing.
There was a problem hiding this comment.
Defined a BoardMetadata class for above listed
|
Hey @shiv-tyagi thanks for reviewing, I have addressed all the requested changes could you re-review it. |
There was a problem hiding this comment.
| self.attributes = attributes | |
| self.attributes = dict(attributes) |
Let us make sure the board is not affected even it the passed attributes get mutated externally.
There was a problem hiding this comment.
Either keep the has_can thing at top level or inside attributes property. Not both.
There was a problem hiding this comment.
I don't think there is anything like "(legacy)" in our case which we need to handle..
There was a problem hiding this comment.
The repo needs to stay locked till you are done doing everything.
There was a problem hiding this comment.
Instead of these dictionaries. We should just return a list of Board objects. We would also need to handle the caching of those.
There was a problem hiding this comment.
| list: A list of board metadata dictionaries, each containing | |
| the board name and whether it supports CAN (has_can). | |
| list: A list of Boards. |
web/static/js/add_build.js
Outdated
There was a problem hiding this comment.
Instead of hiding stuff at the frontend, we should make sure they don't even get returned from the backend. The filtering logic has to go in the backend.
Also, when we make some features disappear the features which are dependent on those should also disappear.
There was a problem hiding this comment.
Please follow the pattern in the codebase. Define a separate method in this class to do this parsing. You can prefix the method names with underscores to avoid potential external usage.
…EN for web service
There is no advantage of an extra route to open the same page. The query parameter on main route should do.
|
Closing this in favor of #227 . The new PR has a cleaner commit history and addresses all review feedback in a single refactored commit. |
This PR fixes Issue #151 where the "CAN" feature category remained visible even when selecting a board that does not support CAN.
The Fix:
fillBuildOptionsin JS to re-render the category list whenever the board selection changes.has_can: false.includedirectives inhwdef.dat.Test Plan:
Closes #151