The idea is to wait for ADB runtimes to be available before trying to render the initial route.
This way if we happen to find the runtime matching the current runtime, and if we still have a connected client for it, we can display the same runtime page.
Differential Revision: https://phabricator.services.mozilla.com/D28094
The notion of unknown runtime is only relevant to aboutdebugging
As we will complexify this to handle unplugged devices, moving it to aboutdebugging seems reasonable.
Differential Revision: https://phabricator.services.mozilla.com/D25779
This approach forces to have a new action here, but the alternative was to create
the store after initializing l10n.js, which breaks all the tests because our current helper
waitForRequestsSuccess is quite fragile.
Differential Revision: https://phabricator.services.mozilla.com/D16455
I'm sorry this is just one commit, I should have split it :( I will submit tests in another patch.
- Vendored [react-router-dom](https://www.npmjs.com/package/react-router-dom) library.
- Removed `getSelectedPageComponent` from `App` component and changed it to use React Router's `Route` components.
- Made the sidebar links to point to proper URL's. Thanks to this we don't need a lot of code/props we were passing to these items to select the proper page.
Some considerations over the implementation:
- React Router's `Switch` is used to wrap our routes, to ensure only one is rendered. Right now is not strictly necessary, but I think it helps to clarify that the routes are _not_ nested.
- We need to pass a `key` prop to the `RuntimePage` rendered in the route, so when we change the actual runtime shown, the page gets updated.
- The action `selectPage` gets called on `componentWillMount`, so it doesn't change state while rendering.
- When we reload the page and a device runtime is selected, we redirect to "This Firefox" page.
(Click on this GIF to see navigation 👇)
{F1100903}
I'm sorry this has taken this long, it has been a bit of a headache 🙏
Differential Revision: https://phabricator.services.mozilla.com/D12147
Maybe we want to land the simplest solution for now and discuss
quickly how to style the message to reduce confusion in a follow up?
Differential Revision: https://phabricator.services.mozilla.com/D8334
Maybe we want to land the simplest solution for now and discuss
quickly how to style the message to reduce confusion in a follow up?
Differential Revision: https://phabricator.services.mozilla.com/D8334
Maybe we want to land the simplest solution for now and discuss
quickly how to style the message to reduce confusion in a follow up?
Differential Revision: https://phabricator.services.mozilla.com/D8334
This patch adds:
- a new action actions/ui:selectPage
- takes a page id in argument
- returns type PAGE_SELECTED, with selected page id as 'page'
- a new reducer reducers/ui-state
- on PAGE_SELECTED, updates the state by setting 'page' in 'selectedPage'
The state of the application after this patch looks as follows:
{
ui: {
selectedPage: String
}
}
As we add more devices the way we identify the selected page might change
(maybe use an index instead of an id) but that is good enough for now.
The "dispatch" helper is forwarded to the App component via connect.
From that point, components are responsible for forwarding the dispatch
property to all components who need to dispatch actions.
Differential Revision: https://phabricator.services.mozilla.com/D2549
In this patch, implement following basic things of 'ThisFirefox' page for new
about:debugging.
* Add a pref devtools.aboutdebbugging.enabled-new to enable new about:debbugging.
* Add a function which switches new/old about:debugging page by the pref.
* Add devtools/client/aboutdebugging-new directory for new about:debugging.
* Add basic html, css, JavaScript and React component.
MozReview-Commit-ID: 5DtV7rRcS0S