Skip to content

Commit 1ca72bb

Browse files
Merge branch '7.x' into backport/7.x/pr-72331
2 parents ee5b097 + e88a4cd commit 1ca72bb

6 files changed

Lines changed: 165 additions & 20 deletions

File tree

src/plugins/data/common/es_query/kuery/node_types/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface NamedArgTypeBuildNode {
7676
}
7777

7878
interface WildcardType {
79+
wildcardSymbol: string;
7980
buildNode: (value: string) => WildcardTypeBuildNode | KueryNode;
8081
test: (node: any, string: string) => boolean;
8182
toElasticsearchQuery: (node: any) => string;
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
.user-icon {
2+
border-radius: 50%;
3+
overflow: hidden;
4+
width: 70px;
5+
height: 70px;
6+
display: inline-flex;
7+
justify-content: center;
8+
align-items: center;
9+
flex-shrink: 0;
10+
position: relative;
11+
font-weight: 500;
12+
background: $euiColorPrimary;
13+
color: $euiColorEmptyShade;
14+
15+
&:not(.user-icon--small) {
16+
font-size: 1.75rem;
17+
}
18+
19+
&--small {
20+
width: 30px;
21+
height: 30px;
22+
font-size: .875rem;
23+
margin-right: .5rem;
24+
}
25+
26+
&__text {
27+
text-shadow: 0 1px 2px rgba(black, 0.08);
28+
justify-content: center;
29+
align-items: center;
30+
font-size: 1.125rem;
31+
color: $euiColorEmptyShade;
32+
font-weight: 500;
33+
34+
.user-icon--small & {
35+
font-size: .87rem;
36+
}
37+
}
38+
39+
&__image {
40+
max-width: 100%;
41+
width: 100%;
42+
height: auto;
43+
top: 50%;
44+
left: 50%;
45+
transform: translate(-50%, -50%);
46+
}
47+
}
48+
49+
.group-avatars {
50+
display: flex;
51+
flex-direction: row;
52+
justify-content: flex-start;
53+
padding-top: 4px;
54+
55+
&__additional {
56+
line-height: 2;
57+
vertical-align: middle;
58+
padding-left: 4px;
59+
}
60+
61+
.group-user-icon {
62+
display: flex;
63+
justify-content: center;
64+
align-items: center;
65+
position: relative;
66+
overflow: hidden;
67+
width: 32px;
68+
height: 32px;
69+
70+
& > * {
71+
pointer-events: none;
72+
top: 50%;
73+
left: 50%;
74+
transform: translate(-50%, -50%);
75+
}
76+
77+
&__text {
78+
padding-bottom: 2px;
79+
z-index: 2;
80+
line-height: 1;
81+
font-weight: 500;
82+
color: $euiColorEmptyShade;
83+
font-size: .875rem;
84+
text-shadow: 0 1px 2px rgba(black, 0.08);
85+
}
86+
87+
&__image {
88+
width: 24px;
89+
height: 24px;
90+
}
91+
}
92+
}
93+
94+
.groups-tooltip {
95+
position: relative;
96+
display: inline-block;
97+
98+
&:hover &__container {
99+
visibility: visible;
100+
}
101+
102+
&__container {
103+
visibility: hidden;
104+
position: absolute;
105+
display: flex;
106+
flex-direction: column;
107+
align-items: flex-start;
108+
box-shadow: 0px 0px 12px rgba(black, 0.15);
109+
background: white;
110+
text-align: left;
111+
text-overflow: ellipsis;
112+
min-width: 125px;
113+
padding: 6px 10px 6px 10px;
114+
border-radius: 3px;
115+
z-index: 5;
116+
top: 100%;
117+
margin-left: -10px;
118+
}
119+
120+
&__text {
121+
line-height: 1.5;
122+
white-space: nowrap;
123+
}
124+
125+
&__text:before {
126+
content:'';
127+
display:block;
128+
width:0;
129+
height:0;
130+
position:absolute;
131+
border-left: 6px solid transparent;
132+
border-right: 6px solid transparent;
133+
border-bottom: 6px solid white;
134+
top: -6px;
135+
left: 16px;
136+
}
137+
}

x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/user_icon/user_icon.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('SourcesTable', () => {
1515
it('renders with picture', () => {
1616
const wrapper = shallow(<UserIcon {...users[0]} />);
1717

18-
expect(wrapper.find('.avatar')).toHaveLength(1);
18+
expect(wrapper.find('.user-icon')).toHaveLength(1);
1919
expect(wrapper.find('.avatar__image')).toHaveLength(1);
2020
});
2121

@@ -26,7 +26,7 @@ describe('SourcesTable', () => {
2626
};
2727
const wrapper = shallow(<UserIcon {...user} />);
2828

29-
expect(wrapper.find('.avatar')).toHaveLength(1);
29+
expect(wrapper.find('.user-icon')).toHaveLength(1);
3030
expect(wrapper.find('.avatar__text')).toHaveLength(1);
3131
});
3232

x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/user_icon/user_icon.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import React from 'react';
88

99
import { IUser } from '../../../types';
1010

11+
import './user_icon.scss';
12+
1113
export const UserIcon: React.FC<IUser> = ({ name, pictureUrl, color, initials, email }) => (
12-
<div className="avatar avatar--small" style={{ backgroundColor: color }}>
14+
<div className="user-icon user-icon--small" style={{ backgroundColor: color }}>
1315
{pictureUrl ? (
1416
<img src={pictureUrl} className="avatar__image" alt={name || email} />
1517
) : (

x-pack/plugins/ingest_manager/server/services/agents/actions.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,19 @@ export async function getAgentActionsForCheckin(
7474
const filter = nodeTypes.function.buildNode('and', [
7575
nodeTypes.function.buildNode(
7676
'not',
77-
nodeTypes.function.buildNode(
78-
'is',
79-
`${AGENT_ACTION_SAVED_OBJECT_TYPE}.attributes.sent_at`,
80-
'*'
81-
)
82-
),
83-
nodeTypes.function.buildNode(
84-
'is',
85-
`${AGENT_ACTION_SAVED_OBJECT_TYPE}.attributes.agent_id`,
86-
agentId
77+
nodeTypes.function.buildNodeWithArgumentNodes('is', [
78+
nodeTypes.literal.buildNode(`${AGENT_ACTION_SAVED_OBJECT_TYPE}.attributes.sent_at`),
79+
nodeTypes.wildcard.buildNode(nodeTypes.wildcard.wildcardSymbol),
80+
nodeTypes.literal.buildNode(false),
81+
])
8782
),
83+
nodeTypes.function.buildNodeWithArgumentNodes('is', [
84+
nodeTypes.literal.buildNode(`${AGENT_ACTION_SAVED_OBJECT_TYPE}.attributes.agent_id`),
85+
nodeTypes.literal.buildNode(agentId),
86+
nodeTypes.literal.buildNode(false),
87+
]),
8888
]);
89+
8990
const res = await soClient.find<AgentActionSOAttributes>({
9091
type: AGENT_ACTION_SAVED_OBJECT_TYPE,
9192
filter,
@@ -176,11 +177,11 @@ export async function getNewActionsSince(soClient: SavedObjectsClientContract, t
176177
const filter = nodeTypes.function.buildNode('and', [
177178
nodeTypes.function.buildNode(
178179
'not',
179-
nodeTypes.function.buildNode(
180-
'is',
181-
`${AGENT_ACTION_SAVED_OBJECT_TYPE}.attributes.sent_at`,
182-
'*'
183-
)
180+
nodeTypes.function.buildNodeWithArgumentNodes('is', [
181+
nodeTypes.literal.buildNode(`${AGENT_ACTION_SAVED_OBJECT_TYPE}.attributes.sent_at`),
182+
nodeTypes.wildcard.buildNode(nodeTypes.wildcard.wildcardSymbol),
183+
nodeTypes.literal.buildNode(false),
184+
])
184185
),
185186
nodeTypes.function.buildNode(
186187
'range',

x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ function getInternalUserSOClient() {
5353
}
5454

5555
function createNewActionsSharedObservable(): Observable<AgentAction[]> {
56-
const internalSOClient = getInternalUserSOClient();
56+
let lastTimestamp = new Date().toISOString();
5757

5858
return timer(0, AGENT_UPDATE_ACTIONS_INTERVAL_MS).pipe(
5959
switchMap(() => {
60-
return from(getNewActionsSince(internalSOClient, new Date().toISOString()));
60+
const internalSOClient = getInternalUserSOClient();
61+
62+
const timestamp = lastTimestamp;
63+
lastTimestamp = new Date().toISOString();
64+
return from(getNewActionsSince(internalSOClient, timestamp));
6165
}),
6266
shareReplay({ refCount: true, bufferSize: 1 })
6367
);

0 commit comments

Comments
 (0)