Skip to content

Commit 21a466e

Browse files
committed
Merge branch 'main' into feature/lambda_obs
2 parents f677d2c + 97938e8 commit 21a466e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3106
-1040
lines changed

.github/actions/aws-auth/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ runs:
3737
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
3838
f.write(f"result=arn:aws:iam::{os.environ["AWS_ACCOUNT_ID"]}:role/{prefix}{hash}")
3939
- name: Configure AWS Credentials
40-
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
40+
uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0
4141
with:
4242
role-to-assume: ${{ steps.role_arn.outputs.result }}
4343
aws-region: ${{ inputs.aws_region }}

.github/workflows/deploy-api-lambda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
zip -j "${ZIP_FILE}" ./bootstrap
4747
48-
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
48+
- uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0
4949
with:
5050
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-api-deployer-${{ inputs.environment }}
5151
aws-region: us-east-1

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
run: |
111111
zip -j "${ZIP_FILE}" ./bootstrap
112112
113-
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
113+
- uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0
114114
with:
115115
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-link-index-updater-deployer
116116
aws-region: us-east-2

actions/update-link-index/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ runs:
4242
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
4343
f.write(f"result=arn:aws:iam::{aws_account_id}:role/{prefix}{hash}")
4444
- name: Configure AWS Credentials
45-
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
45+
uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0
4646
with:
4747
role-to-assume: ${{ steps.role_arn.outputs.result }}
4848
aws-region: us-east-1

config/versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ versioning_systems:
1515
# Ece version updates are manual
1616
ece:
1717
base: 4.0
18-
current: 4.0.1
18+
current: 4.0.2
1919
ech: *all
2020
eck:
2121
base: 3.0

docs/syntax/icons.md

Lines changed: 462 additions & 456 deletions
Large diffs are not rendered by default.

src/Elastic.Documentation.Site/Assets/hljs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,6 @@ export function initHighlight() {
176176
hljs.highlightElement
177177
)
178178
}
179+
180+
// Export the configured hljs instance for reuse
181+
export { hljs }

src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/AskAiSuggestions.tsx

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,66 @@ import { useChatActions } from './chat.store'
33
import { EuiButton, useEuiTheme } from '@elastic/eui'
44
import { css } from '@emotion/react'
55
import * as React from 'react'
6-
7-
const buttonStyles = css`
8-
border: none;
9-
& > span {
10-
justify-content: flex-start;
11-
}
12-
`
6+
import { useMemo } from 'react'
137

148
export interface AskAiSuggestion {
159
question: string
1610
}
1711

18-
interface Props {
19-
suggestions: Set<AskAiSuggestion>
20-
}
12+
// Comprehensive list of AI suggestion questions
13+
const ALL_SUGGESTIONS: AskAiSuggestion[] = [
14+
{ question: 'How do I set up a data stream in Elasticsearch?' },
15+
{ question: 'What are the best practices for indexing performance?' },
16+
{ question: 'How can I create a dashboard in Kibana?' },
17+
{ question: 'What is the difference between a keyword and text field?' },
18+
{ question: 'How do I configure machine learning jobs?' },
19+
{ question: 'What are aggregations and how do I use them?' },
20+
{ question: 'How do I set up Elasticsearch security and authentication?' },
21+
{ question: 'What are the different types of Elasticsearch queries?' },
22+
{ question: 'How do I monitor cluster health and performance?' },
23+
{
24+
question:
25+
'What is the Elastic Stack and how do the components work together?',
26+
},
27+
{ question: 'How do I create and manage Elasticsearch indices?' },
28+
{ question: 'What are the best practices for Elasticsearch mapping?' },
29+
{ question: 'How do I set up log shipping with Beats?' },
30+
{ question: 'What is APM and how do I use it for application monitoring?' },
31+
{ question: 'How do I create custom visualizations in Kibana?' },
32+
{ question: 'What are Elasticsearch snapshots and how do I use them?' },
33+
{ question: 'How do I configure cross-cluster search?' },
34+
{
35+
question:
36+
'What are the different Elasticsearch node types and their roles?',
37+
},
38+
]
2139

22-
export const AskAiSuggestions = (props: Props) => {
40+
export const AskAiSuggestions = () => {
2341
const { submitQuestion } = useChatActions()
2442
const { setModalMode } = useModalActions()
2543
const { euiTheme } = useEuiTheme()
2644

27-
const dynamicButtonStyles = css`
28-
${buttonStyles}
29-
svg {
30-
color: ${euiTheme.colors.textSubdued};
31-
}
32-
`
45+
// Randomly select 3 questions from the comprehensive list
46+
const selectedSuggestions = useMemo(() => {
47+
// Shuffle the array and take first 3
48+
const shuffled = [...ALL_SUGGESTIONS].sort(() => Math.random() - 0.5)
49+
return shuffled.slice(0, 3)
50+
}, [])
3351

3452
return (
3553
<ul>
36-
{Array.from(props.suggestions).map((suggestion) => (
37-
<li key={suggestion.question}>
54+
{selectedSuggestions.map((suggestion) => (
55+
<li
56+
key={suggestion.question}
57+
css={css`
58+
margin-bottom: ${euiTheme.size.s};
59+
`}
60+
>
3861
<EuiButton
3962
iconType="newChat"
40-
color="text"
63+
color="primary"
4164
fullWidth
4265
size="s"
43-
css={dynamicButtonStyles}
4466
onClick={() => {
4567
submitQuestion(suggestion.question)
4668
setModalMode('askAi')

src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/Chat.tsx

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from '@elastic/eui'
1616
import { css } from '@emotion/react'
1717
import * as React from 'react'
18-
import { useCallback, useEffect, useRef } from 'react'
18+
import { useCallback, useEffect, useRef, useState } from 'react'
1919

2020
const containerStyles = css`
2121
height: 100%;
@@ -66,6 +66,7 @@ export const Chat = () => {
6666
const inputRef = useRef<HTMLInputElement>(null)
6767
const scrollRef = useRef<HTMLDivElement>(null)
6868
const lastMessageStatusRef = useRef<string | null>(null)
69+
const [inputValue, setInputValue] = useState('')
6970

7071
const dynamicScrollableStyles = css`
7172
${scrollableStyles}
@@ -81,6 +82,7 @@ export const Chat = () => {
8182
if (inputRef.current) {
8283
inputRef.current.value = ''
8384
}
85+
setInputValue('')
8486

8587
// Scroll to bottom after new message
8688
setTimeout(() => scrollToBottom(scrollRef.current), 100)
@@ -148,36 +150,7 @@ export const Chat = () => {
148150
<h3>Try asking me:</h3>
149151
</EuiTitle>
150152
<EuiSpacer size="s" />
151-
<AskAiSuggestions
152-
suggestions={
153-
new Set([
154-
{
155-
question:
156-
'How do I set up a data stream in Elasticsearch?',
157-
},
158-
{
159-
question:
160-
'What are the best practices for indexing performance?',
161-
},
162-
{
163-
question:
164-
'How can I create a dashboard in Kibana?',
165-
},
166-
{
167-
question:
168-
'What is the difference between a keyword and text field?',
169-
},
170-
{
171-
question:
172-
'How do I configure machine learning jobs?',
173-
},
174-
{
175-
question:
176-
'What are aggregations and how do I use them?',
177-
},
178-
])
179-
}
180-
/>
153+
<AskAiSuggestions />
181154
</>
182155
}
183156
/>
@@ -202,6 +175,7 @@ export const Chat = () => {
202175
inputRef={inputRef}
203176
fullWidth
204177
placeholder="Ask Elastic Docs AI Assistant"
178+
onChange={(e) => setInputValue(e.target.value)}
205179
onKeyDown={(e) => {
206180
if (e.key === 'Enter') {
207181
handleSubmit(e.currentTarget.value)
@@ -219,7 +193,7 @@ export const Chat = () => {
219193
`}
220194
color="primary"
221195
iconType="sortUp"
222-
display="base"
196+
display={inputValue.trim() ? 'fill' : 'base'}
223197
onClick={() => {
224198
if (inputRef.current) {
225199
handleSubmit(inputRef.current.value)

0 commit comments

Comments
 (0)