Skip to content

Commit

Permalink
docs(headless-react): add strings stating the beta status of ssr comm…
Browse files Browse the repository at this point in the history
…erce (#4960)

https://coveord.atlassian.net/browse/DOC-16522

The `(Open Beta)` string will appear in titles for everything under `SSR
Commerce`.

![Screenshot 2025-02-12 at 9 32
43 AM](https://github.com/user-attachments/assets/8ae91295-7421-4f7f-a022-4c854e197563)
  • Loading branch information
jpmarceau authored Feb 13, 2025
1 parent eea90a2 commit ce3f9c2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/headless-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`@coveo/headless-react` provides React utilities for server-side rendering with headless controllers. This package includes two sub-packages:

- `@coveo/headless-react/ssr`: For general server-side rendering with headless controllers.
- `@coveo/headless-react/ssr-commerce`: For implementing a commerce storefront with server-side rendering.
- `@coveo/headless-react/ssr-commerce`: (Open Beta) For implementing a commerce storefront with server-side rendering.

## Learn more

Expand Down
4 changes: 2 additions & 2 deletions packages/headless-react/typedoc/COMMERCEREADME.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Headless React Utils for SSR
# Headless React Utils for SSR (Open Beta)

`@coveo/headless-react/ssr-commerce` provides React utilities for server-side rendering with Headless Commerce controllers.
`@coveo/headless-react/ssr-commerce` is currently in Open Beta and provides React utilities for server-side rendering with Headless Commerce controllers.

## Learn more

Expand Down
4 changes: 4 additions & 0 deletions packages/headless-react/typedoc/lib/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {fileURLToPath} from 'node:url';
// eslint-disable-next-line n/no-unpublished-import
import {Application, JSX, RendererEvent, Converter} from 'typedoc';
import {insertAtomicSearchBox} from './insertAtomicSearchBox.js';
import {insertBetaNote} from './insertBetaNote.js';
import {insertCoveoLogo} from './insertCoveoLogo.js';
import {insertCustomComments} from './insertCustomComments.js';
import {insertOneTrust} from './insertOneTrust.js';
Expand Down Expand Up @@ -39,6 +40,9 @@ export function load(app: Application) {
<script>
<JSX.Raw html={`(${insertOneTrust.toString()})();`} />
</script>
<script>
<JSX.Raw html={`(${insertBetaNote.toString()})();`} />
</script>
<script>
<JSX.Raw
html={`(${insertCoveoLogo.toString()})('${event.relativeURL('assets/coveo-docs-logo.svg')}');`}
Expand Down
17 changes: 17 additions & 0 deletions packages/headless-react/typedoc/lib/insertBetaNote.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export function insertBetaNote() {
document.addEventListener('DOMContentLoaded', () => {
const breadcrumbs = document.querySelector('ul.tsd-breadcrumb');
if (breadcrumbs) {
const IsSSRCommercePage = Array.from(
breadcrumbs.querySelectorAll('a')
).find((link) => link.textContent?.trim() === 'SSR Commerce');

if (IsSSRCommercePage) {
const h1Element = document.querySelector('h1');
if (h1Element) {
h1Element.textContent += ' (Open Beta)';
}
}
}
});
}

0 comments on commit ce3f9c2

Please sign in to comment.