diff --git a/.circleci/config.yml b/.circleci/config.yml index a4bb2d67855..72b478fca9d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,7 +126,7 @@ jobs: build-all: docker: - - image: grafana/build-container:1.1.0 + - image: grafana/build-container:1.2.0 working_directory: /go/src/github.com/grafana/grafana steps: - checkout @@ -173,7 +173,7 @@ jobs: build: docker: - - image: grafana/build-container:1.1.0 + - image: grafana/build-container:1.2.0 working_directory: /go/src/github.com/grafana/grafana steps: - checkout diff --git a/package.json b/package.json index 5577579e0e5..a9c31b11ff3 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@types/react": "^16.4.14", "@types/react-custom-scrollbars": "^4.0.5", "@types/react-dom": "^16.0.7", + "@types/react-select": "^2.0.4", "angular-mocks": "1.6.6", "autoprefixer": "^6.4.0", "axios": "^0.17.1", @@ -86,7 +87,7 @@ "tslint-loader": "^3.5.3", "typescript": "^3.0.3", "uglifyjs-webpack-plugin": "^1.2.7", - "webpack": "^4.8.0", + "webpack": "4.19.1", "webpack-bundle-analyzer": "^2.9.0", "webpack-cleanup-plugin": "^0.5.1", "webpack-cli": "^2.1.4", @@ -157,7 +158,7 @@ "react-highlight-words": "^0.10.0", "react-popper": "^0.7.5", "react-redux": "^5.0.7", - "react-select": "^1.1.0", + "react-select": "2.1.0", "react-sizeme": "^2.3.6", "react-transition-group": "^2.2.1", "redux": "^4.0.0", diff --git a/pkg/api/org_users.go b/pkg/api/org_users.go index 4e2ed36431e..13af654e4c7 100644 --- a/pkg/api/org_users.go +++ b/pkg/api/org_users.go @@ -45,7 +45,7 @@ func addOrgUserHelper(cmd m.AddOrgUserCommand) Response { // GET /api/org/users func GetOrgUsersForCurrentOrg(c *m.ReqContext) Response { - return getOrgUsersHelper(c.OrgId, c.Params("query"), c.ParamsInt("limit")) + return getOrgUsersHelper(c.OrgId, c.Query("query"), c.QueryInt("limit")) } // GET /api/orgs/:orgId/users diff --git a/public/app/app.ts b/public/app/app.ts index 7fed8d5a44b..ba22c09bc56 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -35,8 +35,6 @@ enterpriseIndex.keys().forEach(key => { enterpriseIndex(key); }); -declare var System: any; - export class GrafanaApp { registerFunctions: any; ngModuleDependencies: any[]; @@ -125,7 +123,7 @@ export class GrafanaApp { coreModule.config(setupAngularRoutes); registerAngularDirectives(); - const preBootRequires = [System.import('app/features/all')]; + const preBootRequires = [import('app/features/all')]; Promise.all(preBootRequires) .then(() => { diff --git a/public/app/core/components/PermissionList/AddPermission.tsx b/public/app/core/components/PermissionList/AddPermission.tsx index fc062ce63e4..a60a7dd4af6 100644 --- a/public/app/core/components/PermissionList/AddPermission.tsx +++ b/public/app/core/components/PermissionList/AddPermission.tsx @@ -50,11 +50,11 @@ class AddPermissions extends Component { }; onUserSelected = (user: User) => { - this.setState({ userId: user ? user.id : 0 }); + this.setState({ userId: user && !Array.isArray(user) ? user.id : 0 }); }; onTeamSelected = (team: Team) => { - this.setState({ teamId: team ? team.id : 0 }); + this.setState({ teamId: team && !Array.isArray(team) ? team.id : 0 }); }; onPermissionChanged = (permission: OptionWithDescription) => { @@ -82,7 +82,6 @@ class AddPermissions extends Component { const newItem = this.state; const pickerClassName = 'width-20'; const isValid = this.isValid(); - return (
diff --git a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx index d648d06e414..ff679f67ae2 100644 --- a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx +++ b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx @@ -26,9 +26,9 @@ export default class DisabledPermissionListItem extends Component { {}} - value={item.permission} disabled={true} - className={'gf-form-input--form-dropdown-right'} + className={'gf-form-select-box__control--menu-right'} + value={item.permission} /> diff --git a/public/app/core/components/PermissionList/PermissionListItem.tsx b/public/app/core/components/PermissionList/PermissionListItem.tsx index b846f98a063..56b6114d236 100644 --- a/public/app/core/components/PermissionList/PermissionListItem.tsx +++ b/public/app/core/components/PermissionList/PermissionListItem.tsx @@ -77,9 +77,9 @@ export default class PermissionsListItem extends PureComponent { diff --git a/public/app/core/components/Picker/DescriptionOption.tsx b/public/app/core/components/Picker/DescriptionOption.tsx index 1bcb7100489..9ddf13f7532 100644 --- a/public/app/core/components/Picker/DescriptionOption.tsx +++ b/public/app/core/components/Picker/DescriptionOption.tsx @@ -1,56 +1,25 @@ -import React, { Component } from 'react'; +import React from 'react'; +import { components } from 'react-select'; +import { OptionProps } from 'react-select/lib/components/Option'; -export interface Props { - onSelect: any; - onFocus: any; - option: any; - isFocused: any; - className: any; +// https://github.com/JedWatson/react-select/issues/3038 +interface ExtendedOptionProps extends OptionProps { + data: any; } -class DescriptionOption extends Component { - constructor(props) { - super(props); - this.handleMouseDown = this.handleMouseDown.bind(this); - this.handleMouseEnter = this.handleMouseEnter.bind(this); - this.handleMouseMove = this.handleMouseMove.bind(this); - } - - handleMouseDown(event) { - event.preventDefault(); - event.stopPropagation(); - this.props.onSelect(this.props.option, event); - } - - handleMouseEnter(event) { - this.props.onFocus(this.props.option, event); - } - - handleMouseMove(event) { - if (this.props.isFocused) { - return; - } - this.props.onFocus(this.props.option, event); - } - - render() { - const { option, children, className } = this.props; - return ( -