Commit Graph

8531 Commits (chore-refactor-javascript-to-modules)

Author SHA1 Message Date
Jason Stirnaman 21c0d1ddc7 ### Refactor keybindings to a component and replace deprecated detection method
- Extracted platform detection to its own  reusable utility module
- Eliminates deprecated Navigator.platform API usage; uses the User-Agent Client Hints API as the primary method when available
- Handles iOS and Android devices correctly
2025-05-19 15:09:45 -05:00
Jason Stirnaman fc21bc6c6d Improve DocSearch loading
1. Refactor JavaScript from search.html into a new DocSearch Component Module. The component needs to include: - Asynchronous loading of Algolia docsearch.min.js - Proper Algolia search facets:

  - Nested arrays for AND conditions: In Algolia, filters in the same array are combined with OR, while arrays in an array are combined with AND
  - Space after colon: Algolia's parser expects this specific format
2. Update Search HTML Template: refactor the search.html to use the new component:

3. Register the Component in main.js: update main.js to import and register our new DocSearch component:

Improve SearchInteractions event handler coordination with DocSearch:

- Improve SearchInteractions to dynamically detect the dropdown added by Algolia DocSearch and ensure that blur and focus event handlers are registered after the dropdown loads.

Benefits of This Approach:

Asynchronous Loading: DocSearch.js is now loaded asynchronously, improving page load performance
Search functionality is encapsulated as a component
Clean Separation: HTML template only contains configuration data, not implementation
Event Communication: Components can react to DocSearch initialization via events
SearchInteractions dynamically detects dropdown: Instead of waiting for an event or using setTimeout, we actively observe DOM changes to detect when the dropdown is created.
Nested Observation: A second observer monitors changes to the dropdown itself, allowing code to respond to style changes.
Better Event Handling: The blur handler checks if the related target is inside the search components, preventing unwanted dropdown closing.
Resource Cleanup: The cleanup function disconnects all observers, preventing memory leaks.
Additional Interaction Control: Adds an event listener to the dropdown to prevent unwanted blur events when interacting with search results.
2025-05-19 15:09:45 -05:00
Jason Stirnaman 7ea1489654 fix(diagram): Mermaid.js: dynamic loading, support dark theme, background color for edgeLabel paragraph elements
- Fixes dynamic loading of Mermaid.js
- Adds MutationObserver to handle light/dark theme switching.
- Sets the background-color for edgeLabel p elements to override a white background that obscures text in the dark theme.
2025-05-19 15:09:45 -05:00
Jason Stirnaman 35626563ad fix(theme-switch): ThemeSwitch() should pass the component when calling Theme(). 2025-05-19 15:09:45 -05:00
Jason Stirnaman fae7e21c5d WIP: removed remaining scripts from footer/javascript.html. Migrated to components and utilities. Conditionally imports Mermaid if page has a diagram. 2025-05-19 15:09:45 -05:00
Jason Stirnaman add018834e WIP: Refactored all scripts from footer.js into components. Removed footer.js. Exports jQuery ($) to a window global for use by other scripts. Scripts bundled into footer.js didn't reliably load after jQuery. 2025-05-19 15:09:45 -05:00
Jason Stirnaman 555f6062dc WIP: Removed unused home-interactions.js 2025-05-19 15:08:30 -05:00
Jason Stirnaman 6f8707363d
Merge pull request #6075 from influxdata/6072-update-the-latest-stable-oss-callout-to-3-core
6072 update the latest stable oss callout to 3 core
2025-05-19 14:04:44 -05:00
Jason Stirnaman 8a7edf01d4
Merge branch 'master' into 6072-update-the-latest-stable-oss-callout-to-3-core 2025-05-19 14:01:19 -05:00
Jameelah Mercer 2cd8687246
Merge pull request #6002 from influxdata/5949-add-api-reference-examples-to-influxdb3
Adding adequate CLI examples for creating triggers
2025-05-19 10:43:43 -07:00
Jason Stirnaman 9da9b8570e
Apply suggestions from code review 2025-05-19 12:40:19 -05:00
Jason Stirnaman f81b2e27bc fix(layout): Missing closing paren 2025-05-19 12:35:17 -05:00
Jameelah Mercer 59dca83f14
Update content/shared/influxdb3-cli/create/token.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:33:35 -07:00
Jameelah Mercer adb3264f4d
Update content/shared/influxdb3-cli/create/token.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:33:18 -07:00
Jameelah Mercer 2540cee9cf
Update content/shared/influxdb3-cli/create/token.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:33:01 -07:00
Jameelah Mercer f245785139
Update content/shared/influxdb3-cli/create/table.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:32:44 -07:00
Jameelah Mercer 02035d2f52
Update content/shared/influxdb3-cli/create/table.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:32:25 -07:00
Jameelah Mercer 185c2faaa9
Update content/shared/influxdb3-cli/create/distinct_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:31:56 -07:00
Jameelah Mercer 9adda3e659
Update content/shared/influxdb3-cli/create/distinct_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:31:44 -07:00
Jameelah Mercer d16c2264d6
Update content/shared/influxdb3-cli/create/distinct_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:31:30 -07:00
Jameelah Mercer 138decaf3f
Update content/shared/influxdb3-cli/create/distinct_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:31:17 -07:00
Jameelah Mercer e0564330a2
Update content/shared/influxdb3-cli/create/distinct_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-19 10:30:55 -07:00
Jason Stirnaman 6ee0fb495f
Update layouts/index.html
Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
2025-05-19 11:57:00 -05:00
Jason Stirnaman 1dce052e56 fix(JS): Rename CommonJS scripts to .cjs extension, keep type: module as the project default. Update and fix ESLint configuration.
- Renames JavaScript files in flux-build-scripts and api-docs/openapi/plugins to .cjs file extension to declare them as CommonJS module syntax.
2025-05-19 11:34:42 -05:00
Jason Stirnaman f53eaf88d9 fix(example): Bad link 2025-05-19 09:55:50 -05:00
Jason Stirnaman da767f5228 chore(test): e2e test improvements:
- Link checker should report the first broken link
- Link checker should only test external links if the domains are in the allowed list
- If test subjects don't start with 'content/', treat them as URL paths and don't send them to map-files-to-urls.js.
2025-05-19 09:55:06 -05:00
Jason Stirnaman 02e10068ad - **Improved successor handling in stable-version.html**
- Fixed logic to maintain current product context while using successor for version info
  - Added appropriate successor product display in callout warning
  - Fixed conditions for when callout should appear
  - Fixed potential `isset <nil>` problems with proper nil checks before accessing properties

- **Added comprehensive Cypress tests for successor relationship**
  - Created `stable-version-callout.cy.js` for testing successor behavior
  - Tests that `/influxdb/v1/` and `/influxdb/v2/` pages show successor callout
  - Verifies "InfluxDB 3 Core" appears in callout with correct links
  - Checks product data configuration in `products.yml`
  - Includes JavaScript error detection

- **Configured environment-specific Hugo settings**
  - Added `/config/testing/config.yml` for test environment
  - Configured port 1315 for test environment
  - Added build parameters specific to testing context
  - Separated test environment from development environment

- **Updated Docker configuration**
  - Added new package.json script for building Docker image
  - Improved Docker-based testing commands
2025-05-19 09:55:06 -05:00
Jason Stirnaman 4cfff239f3 End-to-end testing, CI script, and JavaScript QoL improvements:
- **Environment variable formatting** - Updated environment variable configuration from array format to object format to comply with Lefthook schema validation requirements.
- **Unified link testing** - Consolidated multiple product-specific link testing commands into a single `e2e-links` command that processes all staged Markdown and HTML files across content directories.
- **Package script integration** - Modified commands to use centralized yarn scripts instead of direct execution, improving maintainability and consistency.
- **Source information extraction** - Enhanced to correctly extract and report source information from frontmatter.
- **URL and source mapping** - Improved handling of URL to source path mapping for better reporting.
- **Ignored anchor links configuration** - Added proper exclusion of behavior-triggering anchor links (like tab navigation) to prevent false positives.
- **Request options correction** - Fixed Cypress request options to ensure `failOnStatusCode` is properly set when `retryOnStatusCodeFailure` is enabled.
- **Improved error reporting** - Enhanced error reporting with more context about broken links.
- **New test scripts added** - Added centralized testing scripts for link checking and codeblock validation.
- **Product-specific test commands** - Added commands for each product version (InfluxDB v2, v3 Core, Enterprise, Cloud, etc.).
- **API docs testing** - Added specialized commands for testing API documentation links.
- **Comprehensive test runners** - Added commands to run all tests of a specific type (`test:links:all`, `test:codeblocks:all`).
- Fix Docker build command and update CONTRIBUTING.

chore(js): JavaScript QoL improvements:

- Refactor main.js with a componentRegistry object and clear initialization of components and globals
- Add a standard index.js with all necessary exports.
- Update javascript.html to use the index.js
- Remove jQuery script tag from header javascript.html (remains in footer)
- Update package file to improve module discovery.
- Improve Hugo and ESLint config for module discovery and ES6 syntax
2025-05-19 09:50:33 -05:00
Jason Stirnaman 853e628880 chore(ci): Shortcode tests using example.md. Support test-only files (such as example.md) without abusing draft mode.
- Add a frontmatter test-only attribute for files like example.md. Don't use draft: true for these files.
- Add support in index.html for the attribute so that the files are only rendered when running in the testing environment.
- e2e smoke test using example.md, ensure it renders without JavaScript errors.
2025-05-19 09:33:34 -05:00
meelahme b3b087bf45 Clarify token usage instructions and reinforce one-time visibility 2025-05-16 21:07:13 -07:00
meelahme 74039f1919 resolving lint check warning 2025-05-16 20:52:38 -07:00
meelahme 83d800be46 minor update to table.md 2025-05-16 20:50:53 -07:00
meelahme c60766be3e updating verification example to be more precise 2025-05-16 20:47:05 -07:00
meelahme fa8e6114f9 Fix pytest.mark.skip rendering issue in SHOW TABLES example output block 2025-05-16 20:38:32 -07:00
meelahme d8e043e193 Clarify table creation behavior in CLI docs; add note about automatic creation on write 2025-05-16 20:10:56 -07:00
Jameelah Mercer ed3aa1ff30
Update content/shared/influxdb3-cli/create/token.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 19:39:13 -07:00
Jameelah Mercer 7f1a3b6cec
Update trigger.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:21:36 -07:00
Jameelah Mercer 69170973f8
Update trigger.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:21:25 -07:00
Jameelah Mercer cf87936e97
Update trigger.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:21:18 -07:00
Jameelah Mercer a2145f0f98
Update trigger.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:21:12 -07:00
Jameelah Mercer ef239efffa
Update token.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:21:05 -07:00
Jameelah Mercer 3a39a927df
Update token.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:20:57 -07:00
Jameelah Mercer 7a390620d1
Update table.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:20:41 -07:00
Jameelah Mercer 2c3b3f8dad
Update table.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:19:59 -07:00
Jameelah Mercer af999045f2
Update table.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:19:53 -07:00
Jameelah Mercer 2ae9d67475
Update table.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:19:45 -07:00
Jameelah Mercer df24a224f8
Update last_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:19:14 -07:00
Jameelah Mercer dd8369b50b
Update last_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:19:07 -07:00
Jameelah Mercer 9834fab278
Update distinct_cache.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:19:00 -07:00
Jameelah Mercer 3edf4e7cc0
Update database.md
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-05-16 14:18:55 -07:00