Add current tab permissions alert in options menu
Created by: lguychard
Rel #2799
Removes the generic "Extension not working on your private code host?" warning in favour of a red alert displayed if:
- Connection to the server URL is successful.
- The server URL is not sourcegraph.com.
- The current tab's URL doesn't have permissions.
The user can grant permissions for the current tab's URL directly from the options menu.
Also:
- Adds tests for
<OptionsMenu/>
- Removes unused
OptionsContainerProps.fetchCurrentUser()
- Fixes unhandled promise rejection warning when running tests by injecting
hasPermissions()
inOptionsContainerProps
- Uses
onChange
instead ofonClick
for feature flag toggles to fix the following React warning:
Warning: Failed prop type: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.