From 8ab2d8b0b9abb135fa002748cbc6a1042e160cb4 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Thu, 11 Oct 2018 15:32:13 +0200 Subject: [PATCH] fix mutability bug, removed unused constructor --- public/app/core/components/Picker/DescriptionPicker.tsx | 5 ----- .../app/features/datasources/DataSourcePermissionsList.tsx | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/public/app/core/components/Picker/DescriptionPicker.tsx b/public/app/core/components/Picker/DescriptionPicker.tsx index 2e53d096e08..d3528062221 100644 --- a/public/app/core/components/Picker/DescriptionPicker.tsx +++ b/public/app/core/components/Picker/DescriptionPicker.tsx @@ -17,11 +17,6 @@ export interface OptionWithDescription { } class DescriptionPicker extends Component { - constructor(props) { - super(props); - this.state = {}; - } - render() { const { optionsWithDesc, onSelected, value, disabled, className } = this.props; diff --git a/public/app/features/datasources/DataSourcePermissionsList.tsx b/public/app/features/datasources/DataSourcePermissionsList.tsx index 5b7aae6047e..635f2cd87e8 100644 --- a/public/app/features/datasources/DataSourcePermissionsList.tsx +++ b/public/app/features/datasources/DataSourcePermissionsList.tsx @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; -import { DataSourcePermission } from '../../types'; -import { dataSourceAclLevels, DataSourcePermissionLevel } from '../../types/acl'; +import { DataSourcePermission } from 'app/types'; +import { dataSourceAclLevels, DataSourcePermissionLevel } from 'app/types/acl'; import DescriptionPicker from '../../core/components/Picker/DescriptionPicker'; export interface Props { @@ -41,7 +41,7 @@ export class DataSourcePermissionsList extends PureComponent { render() { const { items } = this.props; - const permissionLevels = dataSourceAclLevels; + const permissionLevels = [...dataSourceAclLevels]; permissionLevels.push({ value: DataSourcePermissionLevel.Admin, label: 'Admin', description: '' }); return (