mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
reverted AddPermissions
This commit is contained in:
@@ -4,20 +4,17 @@ import { TeamPicker, Team } from 'app/core/components/Picker/TeamPicker';
|
||||
import DescriptionPicker, { OptionWithDescription } from 'app/core/components/Picker/DescriptionPicker';
|
||||
import { User } from 'app/types';
|
||||
import {
|
||||
dashboardPermissionLevels,
|
||||
dashboardAclTargets,
|
||||
AclTarget,
|
||||
PermissionLevel,
|
||||
NewDashboardAclItem,
|
||||
OrgRole,
|
||||
DashboardPermissionInfo,
|
||||
AclTargetInfo,
|
||||
} from 'app/types/acl';
|
||||
|
||||
export interface Props {
|
||||
onAddPermission: (item: NewDashboardAclItem) => void;
|
||||
onCancel: () => void;
|
||||
showPermissionLevels?: boolean;
|
||||
dashboardPermissionLevels?: DashboardPermissionInfo[];
|
||||
dashboardAclTargets: AclTargetInfo[];
|
||||
}
|
||||
|
||||
class AddPermissions extends Component<Props, NewDashboardAclItem> {
|
||||
@@ -85,7 +82,7 @@ class AddPermissions extends Component<Props, NewDashboardAclItem> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { onCancel, showPermissionLevels, dashboardPermissionLevels, dashboardAclTargets } = this.props;
|
||||
const { onCancel } = this.props;
|
||||
const newItem = this.state;
|
||||
const pickerClassName = 'width-20';
|
||||
const isValid = this.isValid();
|
||||
@@ -132,17 +129,15 @@ class AddPermissions extends Component<Props, NewDashboardAclItem> {
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{showPermissionLevels && (
|
||||
<div className="gf-form">
|
||||
<DescriptionPicker
|
||||
optionsWithDesc={dashboardPermissionLevels}
|
||||
onSelected={this.onPermissionChanged}
|
||||
value={newItem.permission}
|
||||
disabled={false}
|
||||
className={'gf-form-input--form-dropdown-right'}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="gf-form">
|
||||
<DescriptionPicker
|
||||
optionsWithDesc={dashboardPermissionLevels}
|
||||
onSelected={this.onPermissionChanged}
|
||||
value={newItem.permission}
|
||||
disabled={false}
|
||||
className={'gf-form-input--form-dropdown-right'}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="gf-form">
|
||||
<button data-save-permission className="btn btn-success" type="submit" disabled={!isValid}>
|
||||
|
||||
@@ -3,13 +3,7 @@ import { connect } from 'react-redux';
|
||||
import Tooltip from 'app/core/components/Tooltip/Tooltip';
|
||||
import SlideDown from 'app/core/components/Animations/SlideDown';
|
||||
import { StoreState, FolderInfo } from 'app/types';
|
||||
import {
|
||||
dashboardAclTargets,
|
||||
dashboardPermissionLevels,
|
||||
DashboardAcl,
|
||||
PermissionLevel,
|
||||
NewDashboardAclItem,
|
||||
} from 'app/types/acl';
|
||||
import { DashboardAcl, PermissionLevel, NewDashboardAclItem } from 'app/types/acl';
|
||||
import {
|
||||
getDashboardPermissions,
|
||||
addDashboardPermission,
|
||||
@@ -87,12 +81,7 @@ export class DashboardPermissions extends PureComponent<Props, State> {
|
||||
</div>
|
||||
</div>
|
||||
<SlideDown in={isAdding}>
|
||||
<AddPermission
|
||||
dashboardAclTargets={dashboardAclTargets}
|
||||
dashboardPermissionLevels={dashboardPermissionLevels}
|
||||
onAddPermission={this.onAddPermission}
|
||||
onCancel={this.onCancelAddPermission}
|
||||
/>
|
||||
<AddPermission onAddPermission={this.onAddPermission} onCancel={this.onCancelAddPermission} />
|
||||
</SlideDown>
|
||||
<PermissionList
|
||||
items={permissions}
|
||||
|
||||
@@ -6,13 +6,7 @@ import Tooltip from 'app/core/components/Tooltip/Tooltip';
|
||||
import SlideDown from 'app/core/components/Animations/SlideDown';
|
||||
import { getNavModel } from 'app/core/selectors/navModel';
|
||||
import { NavModel, StoreState, FolderState } from 'app/types';
|
||||
import {
|
||||
dashboardAclTargets,
|
||||
dashboardPermissionLevels,
|
||||
DashboardAcl,
|
||||
PermissionLevel,
|
||||
NewDashboardAclItem,
|
||||
} from 'app/types/acl';
|
||||
import { DashboardAcl, PermissionLevel, NewDashboardAclItem } from 'app/types/acl';
|
||||
import {
|
||||
getFolderByUid,
|
||||
getFolderPermissions,
|
||||
@@ -99,12 +93,7 @@ export class FolderPermissions extends PureComponent<Props, State> {
|
||||
</button>
|
||||
</div>
|
||||
<SlideDown in={isAdding}>
|
||||
<AddPermission
|
||||
dashboardAclTargets={dashboardAclTargets}
|
||||
dashboardPermissionLevels={dashboardPermissionLevels}
|
||||
onAddPermission={this.onAddPermission}
|
||||
onCancel={this.onCancelAddPermission}
|
||||
/>
|
||||
<AddPermission onAddPermission={this.onAddPermission} onCancel={this.onCancelAddPermission} />
|
||||
</SlideDown>
|
||||
<PermissionList
|
||||
items={folder.permissions}
|
||||
|
||||
Reference in New Issue
Block a user