Strict null fixes: updates return type of getMessageFromError, fixes QueryOperationAction props (#24690)

* Chore: updates getMessageFromError return type

* Chore: updates the position of incorrectly placed bang operator

* Chore: updates typing on dropdown typeahead directive

* Chore: updates QueryOperationAction props to require title

* Revert "Chore: updates QueryOperationAction props to require title"
This commit is contained in:
Lukas Siatka 2020-05-14 17:08:52 +02:00 committed by GitHub
parent 25e1238022
commit ee12f5e742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -64,7 +64,7 @@ class AddPermissions extends Component<Props, NewDashboardAclItem> {
};
onPermissionChanged = (permission: SelectableValue<PermissionLevel>) => {
this.setState({ permission: permission!.value });
this.setState({ permission: permission.value! });
};
onSubmit = async (evt: React.SyntheticEvent) => {

View File

@ -44,7 +44,7 @@ export function dropdownTypeahead($compile: any) {
const typeaheadValues = _.reduce(
$scope.menuItems,
(memo, value, index) => {
(memo: any[], value, index) => {
if (!value.submenu) {
value.click = 'menuItemSelected(' + index + ')';
memo.push(value.text);
@ -184,7 +184,7 @@ export function dropdownTypeahead2($compile: any) {
const typeaheadValues = _.reduce(
$scope.menuItems,
(memo, value, index) => {
(memo: any[], value, index) => {
if (!value.submenu) {
value.click = 'menuItemSelected(' + index + ')';
memo.push(value.text);

View File

@ -1,6 +1,6 @@
import _ from 'lodash';
export function getMessageFromError(err: string | (Error & { data?: any; statusText?: string })): string | null {
export function getMessageFromError(err: string | (Error & { data?: any; statusText?: string })): string {
if (err && !_.isString(err)) {
if (err.message) {
return err.message;