Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-54107
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jan 7, 2020
2 parents 1cb1792 + 367354c commit 2a3f268
Show file tree
Hide file tree
Showing 13 changed files with 477 additions and 537 deletions.
24 changes: 24 additions & 0 deletions docs/user/security/reporting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@ that provides read and write privileges in
Go to *Management > Users*, add a new user, and assign the user the built-in
`reporting_user` role and your new custom role, `custom_reporting_user`.

[float]
==== With a custom index

If you are using Reporting with a custom index,
the `xpack.reporting.index` setting should begin
with `.reporting-*`. The default {kib} system user has
`all` privileges against the `.reporting-*` pattern of indices.

[source,js]
xpack.reporting.index: '.reporting-custom-index'

If you use a different pattern for the `xpack.reporting.index` setting,
you must create a custom role with appropriate access to the index, similar
to the following:

. Go to *Management > Roles*, and click *Create role*.
. Name the role `custom-reporting-user`.
. Specify the custom index and assign it the `all` index privilege.
. Go to *Management > Users* and create a new user with
the `kibana_system` role and the `custom-reporting-user` role.
. Configure {kib} to use the new account:
[source,js]
elasticsearch.username: 'custom_kibana_system'

[float]
[[reporting-roles-user-api]]
==== With the user API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import {
Droppable,
} from 'react-beautiful-dnd';
import { connect } from 'react-redux';
import styled, { css } from 'styled-components';
import styled from 'styled-components';
import { ActionCreator } from 'typescript-fsa';

import { EuiPortal } from '@elastic/eui';
import { dragAndDropActions } from '../../store/drag_and_drop';
import { DataProvider } from '../timeline/data_providers/data_provider';
import { STATEFUL_EVENT_CSS_CLASS_NAME } from '../timeline/helpers';
import { TruncatableText } from '../truncatable_text';
import { getDraggableId, getDroppableId } from './helpers';
import { ProviderContainer } from './provider_container';

// As right now, we do not know what we want there, we will keep it as a placeholder
export const DragEffects = styled.div``;
Expand All @@ -42,143 +42,12 @@ const Wrapper = styled.div`

Wrapper.displayName = 'Wrapper';

const ProviderContainer = styled.div<{ isDragging: boolean }>`
&,
&::before,
&::after {
transition: background ${({ theme }) => theme.eui.euiAnimSpeedFast} ease,
color ${({ theme }) => theme.eui.euiAnimSpeedFast} ease;
const ProviderContentWrapper = styled.span`
> span.euiToolTipAnchor {
display: block; /* allow EuiTooltip content to be truncatable */
}
${({ isDragging }) =>
!isDragging &&
css`
& {
border-radius: 2px;
padding: 0 4px 0 8px;
position: relative;
z-index: ${({ theme }) => theme.eui.euiZLevel0} !important;
&::before {
background-image: linear-gradient(
135deg,
${({ theme }) => theme.eui.euiColorMediumShade} 25%,
transparent 25%
),
linear-gradient(
-135deg,
${({ theme }) => theme.eui.euiColorMediumShade} 25%,
transparent 25%
),
linear-gradient(
135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorMediumShade} 75%
),
linear-gradient(
-135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorMediumShade} 75%
);
background-position: 0 0, 1px 0, 1px -1px, 0px 1px;
background-size: 2px 2px;
bottom: 2px;
content: '';
display: block;
left: 2px;
position: absolute;
top: 2px;
width: 4px;
}
}
&:hover {
&,
& .euiBadge,
& .euiBadge__text {
cursor: move; /* Fallback for IE11 */
cursor: grab;
}
}
.${STATEFUL_EVENT_CSS_CLASS_NAME}:hover &,
tr:hover & {
background-color: ${({ theme }) => theme.eui.euiColorLightShade};
&::before {
background-image: linear-gradient(
135deg,
${({ theme }) => theme.eui.euiColorDarkShade} 25%,
transparent 25%
),
linear-gradient(
-135deg,
${({ theme }) => theme.eui.euiColorDarkShade} 25%,
transparent 25%
),
linear-gradient(
135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorDarkShade} 75%
),
linear-gradient(
-135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorDarkShade} 75%
);
}
}
&:hover,
&:focus,
.${STATEFUL_EVENT_CSS_CLASS_NAME}:hover &:hover,
.${STATEFUL_EVENT_CSS_CLASS_NAME}:focus &:focus,
tr:hover &:hover,
tr:hover &:focus {
background-color: ${({ theme }) => theme.eui.euiColorPrimary};
&,
& a,
& a:hover {
color: ${({ theme }) => theme.eui.euiColorEmptyShade};
}
&::before {
background-image: linear-gradient(
135deg,
${({ theme }) => theme.eui.euiColorEmptyShade} 25%,
transparent 25%
),
linear-gradient(
-135deg,
${({ theme }) => theme.eui.euiColorEmptyShade} 25%,
transparent 25%
),
linear-gradient(
135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorEmptyShade} 75%
),
linear-gradient(
-135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorEmptyShade} 75%
);
}
}
`}
${({ isDragging }) =>
isDragging &&
css`
& {
z-index: 9999 !important;
}
`}
`;

ProviderContainer.displayName = 'ProviderContainer';

interface OwnProps {
dataProvider: DataProvider;
inline?: boolean;
Expand Down Expand Up @@ -244,9 +113,11 @@ const DraggableWrapperComponent = React.memo<Props>(
{render(dataProvider, provided, snapshot)}
</TruncatableText>
) : (
<span data-test-subj={`draggable-content-${dataProvider.queryMatch.field}`}>
<ProviderContentWrapper
data-test-subj={`draggable-content-${dataProvider.queryMatch.field}`}
>
{render(dataProvider, provided, snapshot)}
</span>
</ProviderContentWrapper>
)}
</ProviderContainer>
</ConditionalPortal>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import styled, { css } from 'styled-components';
import { STATEFUL_EVENT_CSS_CLASS_NAME } from '../timeline/helpers';

interface ProviderContainerProps {
isDragging: boolean;
}

const ProviderContainerComponent = styled.div<ProviderContainerProps>`
&,
&::before,
&::after {
transition: background ${({ theme }) => theme.eui.euiAnimSpeedFast} ease,
color ${({ theme }) => theme.eui.euiAnimSpeedFast} ease;
}
${({ isDragging }) =>
!isDragging &&
css`
& {
border-radius: 2px;
padding: 0 4px 0 8px;
position: relative;
z-index: ${({ theme }) => theme.eui.euiZLevel0} !important;
&::before {
background-image: linear-gradient(
135deg,
${({ theme }) => theme.eui.euiColorMediumShade} 25%,
transparent 25%
),
linear-gradient(
-135deg,
${({ theme }) => theme.eui.euiColorMediumShade} 25%,
transparent 25%
),
linear-gradient(
135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorMediumShade} 75%
),
linear-gradient(
-135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorMediumShade} 75%
);
background-position: 0 0, 1px 0, 1px -1px, 0px 1px;
background-size: 2px 2px;
bottom: 2px;
content: '';
display: block;
left: 2px;
position: absolute;
top: 2px;
width: 4px;
}
}
&:hover {
&,
& .euiBadge,
& .euiBadge__text {
cursor: move; /* Fallback for IE11 */
cursor: grab;
}
}
.${STATEFUL_EVENT_CSS_CLASS_NAME}:hover &,
tr:hover & {
background-color: ${({ theme }) => theme.eui.euiColorLightShade};
&::before {
background-image: linear-gradient(
135deg,
${({ theme }) => theme.eui.euiColorDarkShade} 25%,
transparent 25%
),
linear-gradient(
-135deg,
${({ theme }) => theme.eui.euiColorDarkShade} 25%,
transparent 25%
),
linear-gradient(
135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorDarkShade} 75%
),
linear-gradient(
-135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorDarkShade} 75%
);
}
}
&:hover,
&:focus,
.${STATEFUL_EVENT_CSS_CLASS_NAME}:hover &:hover,
.${STATEFUL_EVENT_CSS_CLASS_NAME}:focus &:focus,
tr:hover &:hover,
tr:hover &:focus {
background-color: ${({ theme }) => theme.eui.euiColorPrimary};
&,
& a,
& a:hover {
color: ${({ theme }) => theme.eui.euiColorEmptyShade};
}
&::before {
background-image: linear-gradient(
135deg,
${({ theme }) => theme.eui.euiColorEmptyShade} 25%,
transparent 25%
),
linear-gradient(
-135deg,
${({ theme }) => theme.eui.euiColorEmptyShade} 25%,
transparent 25%
),
linear-gradient(
135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorEmptyShade} 75%
),
linear-gradient(
-135deg,
transparent 75%,
${({ theme }) => theme.eui.euiColorEmptyShade} 75%
);
}
}
`}
${({ isDragging }) =>
isDragging &&
css`
& {
z-index: 9999 !important;
}
`}
`;

ProviderContainerComponent.displayName = 'ProviderContainerComponent';

export const ProviderContainer = React.memo(ProviderContainerComponent);

ProviderContainer.displayName = 'ProviderContainer';
Loading

0 comments on commit 2a3f268

Please sign in to comment.