Skip to content

Commit 90fc81b

Browse files
committed
feat(ask-ai): Tailors placeholder for each version/product. Disables "Viewing <product>" in disclaimer note.
1 parent 3289052 commit 90fc81b

File tree

3 files changed

+30
-31
lines changed

3 files changed

+30
-31
lines changed

assets/js/ask-ai.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ function getProductInputPlaceholder(): string {
202202
}
203203

204204
function getProductDisclaimer(): string {
205-
// Build version-specific note if version is available
206-
const versionNote =
207-
version && version !== 'n/a' && productData?.product?.name
208-
? `**Viewing documentation for ${productData.product.name}**\n\n`
209-
: '';
205+
// Disabled: Version-specific "Viewing documentation for..." text
206+
// const versionNote =
207+
// version && version !== 'n/a' && productData?.product?.name
208+
// ? `**Viewing documentation for ${productData.product.name}**\n\n`
209+
// : '';
210210

211211
// Check for product-specific custom disclaimer note
212212
const customNote = getVersionSpecificConfig('ai_disclaimer_note') as
@@ -218,7 +218,7 @@ function getProductDisclaimer(): string {
218218
const baseDisclaimer =
219219
'This AI can access [documentation for InfluxDB, clients, and related tools](https://docs.influxdata.com). Information you submit is used in accordance with our [Privacy Policy](https://www.influxdata.com/legal/privacy-policy/).';
220220

221-
return `${versionNote}${noteContent}${baseDisclaimer}`;
221+
return `${noteContent}${baseDisclaimer}`;
222222
}
223223

224224
/**

cypress/e2e/content/ask-ai.cy.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,11 @@ describe('Ask AI Widget and Link', function () {
180180
);
181181
});
182182

183-
// ONLY test that opens widget via link - combines query pre-fill validation
183+
// This is the only test that opens the widget modal
184184
it('should open widget with pre-filled query when ask-ai-link is clicked', function () {
185185
cy.get('.article--content a.ask-ai-open')
186186
.contains('Ask InfluxData AI')
187187
.as('askAILink');
188-
// cy.get('@askAILink').scrollIntoView();
189188
cy.get('@askAILink').click();
190189
// Widget container MUST become visible
191190
cy.get('#kapa-modal-content', { includeShadowDom: true, timeout: 1000 })
@@ -251,45 +250,45 @@ describe('Ask AI Widget and Link', function () {
251250

252251
describe('Ask AI Widget Configuration', function () {
253252
describe('Input Placeholder', function () {
254-
it('should have unified InfluxDB placeholder on InfluxDB 3 pages', function () {
253+
it('should have the version name in the placeholder on v3 pages', function () {
255254
cy.visit('/influxdb3/core/');
256255
beforeTest();
257256

258257
cy.get('script[src*="kapa-widget.bundle.js"]').should(($script) => {
259258
const placeholder = $script.attr(
260259
'data-modal-ask-ai-input-placeholder'
261260
);
262-
expect(placeholder).to.equal(
263-
'Specify your version and product ("InfluxDB 3 Enterprise", "Core", "Enterprise v1") for better results'
264-
);
261+
expect(placeholder).to.contain(
262+
'Specify your version and product')
263+
.and.to.contain("Core");
265264
});
266265
});
267266

268-
it('should have unified InfluxDB placeholder on InfluxDB 2.x pages', function () {
267+
it('should have the version name in the placeholder on v2 pages', function () {
269268
cy.visit('/influxdb/v2/');
270269
beforeTest();
271270

272271
cy.get('script[src*="kapa-widget.bundle.js"]').should(($script) => {
273272
const placeholder = $script.attr(
274273
'data-modal-ask-ai-input-placeholder'
275274
);
276-
expect(placeholder).to.equal(
277-
'Specify your version and product ("InfluxDB 3 Enterprise", "Core", "Enterprise v1") for better results'
278-
);
275+
expect(placeholder).to.contain(
276+
'Specify your version and product')
277+
.and.to.contain("v2");
279278
});
280279
});
281280

282-
it('should have unified InfluxDB placeholder on InfluxDB 1.x pages', function () {
281+
it('should have the version name in the placeholder on v1 pages', function () {
283282
cy.visit('/influxdb/v1/');
284283
beforeTest();
285284

286285
cy.get('script[src*="kapa-widget.bundle.js"]').should(($script) => {
287286
const placeholder = $script.attr(
288287
'data-modal-ask-ai-input-placeholder'
289288
);
290-
expect(placeholder).to.equal(
291-
'Specify your version and product ("InfluxDB 3 Enterprise", "Core", "Enterprise v1") for better results'
292-
);
289+
expect(placeholder).to.contain(
290+
'Specify your version and product')
291+
.and.to.contain("v1");
293292
});
294293
});
295294

data/products.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ influxdb3_core:
2626
- What's my InfluxDB version?
2727
- How do I install and run InfluxDB 3 Core?
2828
- Help me write a plugin for the Python Processing engine using InfluxDB 3 Core
29-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
29+
ai_input_placeholder: "Specify your version and product (\"Core\", \"InfluxDB 3 Enterprise\", \"OSS v1\") for better results"
3030
ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262"
3131

3232
influxdb3_enterprise:
@@ -73,7 +73,7 @@ influxdb3_explorer:
7373
- How do I install and run Explorer?
7474
- How do I query data using Explorer?
7575
- How do I visualize data using Explorer?
76-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
76+
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Explorer and Enterprise\", \"InfluxDB 3 Explorer and Core\") for better results"
7777
ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262"
7878

7979
influxdb3_cloud_serverless:
@@ -103,7 +103,7 @@ influxdb3_cloud_serverless:
103103
- What's my InfluxDB version?
104104
- How do I migrate from Cloud (TSM) to Cloud Serverless?
105105
- What tools can I use to write data to InfluxDB Cloud Serverless?
106-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
106+
ai_input_placeholder: "Specify your version and product (\"InfluxDB Cloud Serverless\", \"InfluxDB 3 Enterprise\", \"Core\") for better results"
107107
ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262"
108108

109109
influxdb3_cloud_dedicated:
@@ -132,7 +132,7 @@ influxdb3_cloud_dedicated:
132132
- What's my InfluxDB version?
133133
- How do I migrate from InfluxDB v1 to Cloud Dedicated?
134134
- How do I use SQL and parameterized queries with InfluxDB Cloud Dedicated?
135-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
135+
ai_input_placeholder: "Specify your version and product (\"InfluxDB Cloud Dedicated\", \"InfluxDB 3 Enterprise\", \"Core\") for better results"
136136
ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262"
137137

138138
influxdb3_clustered:
@@ -161,7 +161,7 @@ influxdb3_clustered:
161161
- What's my InfluxDB version?
162162
- How do I use a Helm chart to configure InfluxDB Clustered?
163163
- How do I use SQL and parameterized queries with InfluxDB Clustered?
164-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
164+
ai_input_placeholder: "Specify your version and product (\"InfluxDB Clustered\", \"InfluxDB 3 Enterprise\", \"Core\") for better results"
165165
ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262"
166166

167167
influxdb:
@@ -201,7 +201,7 @@ influxdb:
201201
- What's my InfluxDB version?
202202
- How do I write and query data using InfluxDB OSS v2?
203203
- How can I migrate from InfluxDB OSS v2 to InfluxDB 3?
204-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
204+
ai_input_placeholder: "Specify your version and product (\"InfluxDB OSS v2\", \"InfluxDB v1\", \"InfluxDB 3 Core\") for better results"
205205
ai_source_group_ids: "3e905caa-dd6f-464b-abf9-c3880e09f128"
206206
ai_sample_questions__v1:
207207
- What's my InfluxDB version?
@@ -234,7 +234,7 @@ influxdb_cloud:
234234
- What's my InfluxDB version?
235235
- How do I write and query data using InfluxDB Cloud (TSM)?
236236
- How is Cloud (TSM) different from Cloud Serverless?
237-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
237+
ai_input_placeholder: "Specify your version and product (\"InfluxDB Cloud (TSM)\", \"InfluxDB 3 Enterprise\", \"Core\") for better results"
238238
ai_source_group_ids: "3e905caa-dd6f-464b-abf9-c3880e09f128"
239239

240240
telegraf:
@@ -250,7 +250,7 @@ telegraf:
250250
- How do I configure Telegraf for InfluxDB 3?
251251
- How do I write a custom Telegraf plugin?
252252
- How do I use Telegraf for MQTT?
253-
ai_input_placeholder: "Ask questions about Telegraf"
253+
ai_input_placeholder: "Ask questions about Telegraf and InfluxDB"
254254

255255
chronograf:
256256
name: Chronograf
@@ -265,7 +265,7 @@ chronograf:
265265
- How do I configure Chronograf for InfluxDB v1?
266266
- How do I create a dashboard in Chronograf?
267267
- How do I use Grafana to visualize data stored in InfluxDB 3?
268-
ai_input_placeholder: "Ask questions about Chronograf"
268+
ai_input_placeholder: "Ask questions about Chronograf and InfluxDB"
269269

270270
kapacitor:
271271
name: Kapacitor
@@ -307,7 +307,7 @@ enterprise_influxdb:
307307
- What's my InfluxDB version?
308308
- How can I configure InfluxDB Enterprise v1?
309309
- How do I replicate data from OSS to InfluxDB Enterprise v1?
310-
ai_input_placeholder: "Specify your version and product (\"InfluxDB 3 Enterprise\", \"Core\", \"Enterprise v1\") for better results"
310+
ai_input_placeholder: "Specify your version and product (\"Enterprise v1\", \"InfluxDB 3 Enterprise\", \"Core\") for better results"
311311
ai_source_group_ids: "d809f67b-867d-4f17-95f0-c33dbadbf15f"
312312

313313
flux:
@@ -321,5 +321,5 @@ flux:
321321
- How do I query with Flux?
322322
- How do I transform data with Flux?
323323
- How do I join data with Flux?
324-
ai_input_placeholder: "Ask questions about Flux"
324+
ai_input_placeholder: "Ask questions about Flux and InfluxDB"
325325
ai_source_group_ids: "d809f67b-867d-4f17-95f0-c33dbadbf15f,3e905caa-dd6f-464b-abf9-c3880e09f128"

0 commit comments

Comments
 (0)