Skip to content

Commit

Permalink
Strict null fixes: updates return type of getMessageFromError, fixes …
Browse files Browse the repository at this point in the history
…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"
  • Loading branch information
Lukas Siatka committed May 14, 2020
1 parent 25e1238 commit ee12f5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions public/app/core/directives/dropdown_typeahead.ts
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/utils/errors.ts
@@ -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;
Expand Down

0 comments on commit ee12f5e

Please sign in to comment.