Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 0 additions & 206 deletions packages/kbn-ui-framework/dist/ui_framework.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export class CollapsiblePanel extends Component {

getTitle = () => {
return (
<EuiFlexGroup alignItems={'baseline'}>
<EuiFlexGroup alignItems={'baseline'} gutterSize="s" responsive={false}>
<EuiFlexItem grow={false}>
<EuiTitle>
<div>
<EuiIcon type={this.props.iconType} size={'l'} className={'collapsiblePanel__logo'} /> {this.props.title}
</div>
<h2>
<EuiIcon type={this.props.iconType} size={'xl'} className={'collapsiblePanel__logo'} /> {this.props.title}
</h2>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.collapsiblePanel__logo {
margin-right: 10px;
margin-right: 8px;
vertical-align: text-bottom;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { get } from 'lodash';
import { toastNotifications } from 'ui/notify';
import {
EuiPanel,
EuiText,
EuiTitle,
EuiSpacer,
EuiPage,
EuiPageContent,
EuiButtonEmpty,
EuiForm,
EuiFormRow,
EuiFieldText,
Expand Down Expand Up @@ -57,27 +57,21 @@ export class EditRolePage extends Component {
<div>
<PageHeader breadcrumbs={this.props.breadcrumbs} />
<EuiPage className="editRolePage">
<EuiPageContent className="editRolePage__content">
<EuiForm {...this.state.formError}>
{this.getFormTitle()}
<EuiForm {...this.state.formError}>
{this.getFormTitle()}

<EuiSpacer />
<EuiSpacer />

{this.getRoleName()}
{this.getRoleName()}

<EuiSpacer />
{this.getElasticsearchPrivileges()}

{this.getElasticsearchPrivileges()}
{this.getKibanaPrivileges()}

<EuiSpacer />
<EuiSpacer />

{this.getKibanaPrivileges()}

<EuiSpacer size={'xl'} />

{this.getFormButtons()}
</EuiForm>
</EuiPageContent>
{this.getFormButtons()}
</EuiForm>
</EuiPage>
</div>
);
Expand All @@ -94,12 +88,7 @@ export class EditRolePage extends Component {
}

return (
<EuiFlexGroup justifyContent={'spaceBetween'}>
<EuiFlexItem grow={false}>
<EuiText><h1>{titleText}</h1></EuiText>
</EuiFlexItem>
{this.getActionButton()}
</EuiFlexGroup>
<EuiTitle size="l"><h1>{titleText} <ReservedRoleBadge role={this.props.role} /></h1></EuiTitle>
);
};

Expand All @@ -118,19 +107,22 @@ export class EditRolePage extends Component {
getRoleName = () => {
return (
<EuiPanel>
<EuiFlexGroup>
<EuiFlexItem>
<EuiFormRow label={'Role name'} {...this.validator.validateRoleName(this.state.role)}>
<EuiFieldText
name={'name'}
value={this.state.role.name || ''}
onChange={this.onNameChange}
readOnly={isReservedRole(this.props.role) || this.editingExistingRole()}
/>
</EuiFormRow>
</EuiFlexItem>
<ReservedRoleBadge role={this.props.role} />
</EuiFlexGroup>
<EuiFormRow
label={'Role name'}
helpText={
!isReservedRole(this.props.role) && this.editingExistingRole() ?
"A role's name cannot be changed once it has been created." : undefined
}
{...this.validator.validateRoleName(this.state.role)}
>

<EuiFieldText
name={'name'}
value={this.state.role.name || ''}
onChange={this.onNameChange}
readOnly={isReservedRole(this.props.role) || this.editingExistingRole()}
/>
</EuiFormRow>
</EuiPanel>
);
}
Expand All @@ -149,17 +141,20 @@ export class EditRolePage extends Component {

getElasticsearchPrivileges() {
return (
<ElasticsearchPrivileges
role={this.state.role}
editable={!isReservedRole(this.state.role)}
httpClient={this.props.httpClient}
onChange={this.onRoleChange}
runAsUsers={this.props.runAsUsers}
validator={this.validator}
indexPatterns={this.props.indexPatterns}
allowDocumentLevelSecurity={this.props.allowDocumentLevelSecurity}
allowFieldLevelSecurity={this.props.allowFieldLevelSecurity}
/>
<div>
<EuiSpacer />
<ElasticsearchPrivileges
role={this.state.role}
editable={!isReservedRole(this.state.role)}
httpClient={this.props.httpClient}
onChange={this.onRoleChange}
runAsUsers={this.props.runAsUsers}
validator={this.validator}
indexPatterns={this.props.indexPatterns}
allowDocumentLevelSecurity={this.props.allowDocumentLevelSecurity}
allowFieldLevelSecurity={this.props.allowFieldLevelSecurity}
/>
</div>
);
}

Expand All @@ -175,40 +170,41 @@ export class EditRolePage extends Component {
}

return (
<KibanaPrivileges
kibanaAppPrivileges={this.props.kibanaAppPrivileges}
rbacApplication={this.props.rbacApplication}
role={this.state.role}
onChange={this.onRoleChange}
/>
<div>
<EuiSpacer />
<KibanaPrivileges
kibanaAppPrivileges={this.props.kibanaAppPrivileges}
rbacApplication={this.props.rbacApplication}
role={this.state.role}
onChange={this.onRoleChange}
/>
</div>
);
};

getFormButtons = () => {
if (isReservedRole(this.props.role)) {
return (
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiButton onClick={this.backToRoleList}>
Return to role list
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
<EuiButton onClick={this.backToRoleList}>
Return to role list
</EuiButton>
);
}

const saveText = this.editingExistingRole() ? 'Update role' : 'Create role';

return (
<EuiFlexGroup>
<EuiFlexGroup responsive={false}>
<EuiFlexItem grow={false}>
<EuiButton fill onClick={this.saveRole} disabled={isReservedRole(this.props.role)}>{saveText}</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton onClick={this.backToRoleList}>
<EuiButtonEmpty onClick={this.backToRoleList}>
Cancel
</EuiButton>
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={true} />
{this.getActionButton()}
</EuiFlexGroup>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ import {
EuiSpacer,
EuiComboBox,
EuiFormRow,
EuiFlexGroup,
EuiFlexItem,
EuiButton,
EuiDescribedFormGroup,
EuiTitle,
EuiHorizontalRule,
EuiLink,
EuiIcon,
} from '@elastic/eui';
import './elasticsearch_privileges.less';
import { ClusterPrivileges } from './cluster_privileges';
Expand Down Expand Up @@ -71,29 +68,29 @@ export class ElasticsearchPrivileges extends Component {
return (
<Fragment>
<EuiDescribedFormGroup
title={<p>Cluster privileges {this.learnMore(documentationLinks.esClusterPrivileges)}</p>}
title={<h3>Cluster privileges</h3>}
description={
<p>
Manage the actions this role can perform against your cluster.
Manage the actions this role can perform against your cluster. {this.learnMore(documentationLinks.esClusterPrivileges)}
</p>
}
>
<EuiFormRow fullWidth={true}>
<EuiFormRow fullWidth={true} hasEmptyLabelSpace>
<ClusterPrivileges role={this.props.role} onChange={this.onClusterPrivilegesChange} />
</EuiFormRow>
</EuiDescribedFormGroup>

<EuiSpacer />

<EuiDescribedFormGroup
title={<p>Run As privileges {this.learnMore(documentationLinks.esRunAsPrivileges)}</p>}
title={<h3>Run As privileges</h3>}
description={
<p>
Allow requests to be submitted on behalf of other users.
Allow requests to be submitted on the behalf of other users. {this.learnMore(documentationLinks.esRunAsPrivileges)}
</p>
}
>
<EuiFormRow>
<EuiFormRow hasEmptyLabelSpace>
<EuiComboBox
placeholder={this.props.editable ? 'Add a user...' : null}
options={this.props.runAsUsers.map(username => ({ id: username, label: username }))}
Expand All @@ -106,32 +103,26 @@ export class ElasticsearchPrivileges extends Component {

<EuiSpacer />

<EuiFormRow fullWidth={true}>
<div>
<EuiFlexGroup>
<EuiFlexItem>
<EuiTitle size={'xs'}><p>Index privileges {this.learnMore(documentationLinks.esIndicesPrivileges)}</p></EuiTitle>
<EuiText size={'s'} color={'subdued'}><p>Control access to the data in your cluster.</p></EuiText>
</EuiFlexItem>
{this.props.editable && (
<EuiFlexItem grow={false}>
<EuiButton size={'s'} iconType={'plusInCircle'} onClick={this.addIndexPrivilege}>Add Index Privilege</EuiButton>
</EuiFlexItem>
)}
</EuiFlexGroup>
<EuiHorizontalRule margin={'xs'} />
</div>
</EuiFormRow>
<EuiFormRow fullWidth={true}>
<IndexPrivileges {...indexProps} />
</EuiFormRow>
<EuiTitle size={'xs'}><h3>Index privileges</h3></EuiTitle>
<EuiSpacer size={'s'} />
<EuiText size={'s'} color={'subdued'}>
<p>Control access to the data in your cluster. {this.learnMore(documentationLinks.esIndicesPrivileges)}</p>
</EuiText>

<IndexPrivileges {...indexProps} />

<EuiHorizontalRule />

{this.props.editable && (
<EuiButton size={'s'} iconType={'plusInCircle'} onClick={this.addIndexPrivilege}>Add index privilege</EuiButton>
)}
</Fragment>
);
}

learnMore = (href) => (
<EuiLink className="editRole__learnMore" href={href} target={'_blank'}>
<EuiIcon size={"s"} type="questionInCircle" />
Learn more
</EuiLink>
);

Expand Down
Loading