Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion docs/Demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,20 @@ If you want to see what react-admin is capable of, or if you want to learn from
</div>
</div>
</div>
<div class="card">
<a href="#broadcom-layer-7-api-hub" class="no-decoration"><img src="https://marmelab.com/static/bcb26e245e6e50e8f13631a156727d2e/46097/API_Hub.png" alt="Developer Portal"></a>
<div class="content-card">
<a href="#broadcom-layer-7-api-hub" class="no-decoration">
<p class="title-card"><b>Developer portal</b></p>
<p class="description-card">Interactive documentation and rights administration for an API gateway</p>
</a>
</div>
<div class="card-footer">
<div class="links-container">
<p><b><a href="https://github.com/CAAPIM/APIHub" class="source-code link">Source code</a></b></p>
</div>
</div>
</div>
</div>

## E-commerce
Expand Down Expand Up @@ -433,6 +447,8 @@ The source shows how to implement the following features:

A Team Wiki board built with React-admin Enterprise edition.

[![Team wiki](./img/team-wiki.jpg)](https://marmelab.com/team-wiki/)

* Demo: [https://marmelab.com/team-wiki/](https://marmelab.com/team-wiki/)
* Source code: [https://github.com/marmelab/team-wiki](https://github.com/marmelab/team-wiki)

Expand All @@ -452,7 +468,7 @@ The source shows how to implement the following features:

A framework built on top of react-admin for building developer portals.

<div class="iframe-wrapper"><iframe src="https://www.youtube.com/embed/ecHsgNmug9E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>
[![Broadcom API Hub](https://marmelab.com/static/bcb26e245e6e50e8f13631a156727d2e/46097/API_Hub.png)](https://github.com/CAAPIM/APIHub)

* Source code: [https://github.com/CAAPIM/APIHub](https://github.com/CAAPIM/APIHub)

Expand Down
2 changes: 1 addition & 1 deletion docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
{% if page.storybook_path %}<meta name="storybook_path" content="{{ page.storybook_path }}" />{% endif %}
<meta name="storybook_path" content="{{ page.storybook_path }}" />
<link
rel="canonical"
href="{{ page.name | replace: '.md', '.html' | relative_url }}"
Expand Down
23 changes: 17 additions & 6 deletions docs/js/ra-navigation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
let allMenus, navLinks, versionsLinks;

const STORYBOOK_PATH_META_SELECTOR = 'meta[name="storybook_path"]';

function hideTips() {
const tipElement = document.getElementById('tip');
const tipContainer = document.getElementById('tip-container');
Expand Down Expand Up @@ -58,11 +60,11 @@ function buildPageToC() {
hasInnerContainers: true,
});

const storybookPathMeta = document.querySelector(
'meta[name="storybook_path"]'
);
const storybookPathMetaContent = document.querySelector(
STORYBOOK_PATH_META_SELECTOR
).content;
const tocList = document.querySelector('.toc-list');
if (!tocList || !storybookPathMeta) {
if (!tocList || !storybookPathMetaContent) {
return;
}

Expand All @@ -71,13 +73,13 @@ function buildPageToC() {

const storybookLink = document.createElement('a');
storybookLink.className = 'toc-link';
storybookLink.href = `https://react-admin-storybook.vercel.app?path=/story/${storybookPathMeta.content}`;
storybookLink.href = `https://react-admin-storybook.vercel.app?path=/story/${storybookPathMetaContent}`;
storybookLink.textContent = 'Storybook';
storybookLink.target = '_blank';
storybookLink.rel = 'noopener noreferrer';

const storybookLaunchIcon = document.createElement('img');
storybookLaunchIcon.src = '/img/icons/launch.png';
storybookLaunchIcon.src = './img/icons/launch.png';
storybookLaunchIcon.alt = 'Open Storybook';
storybookLaunchIcon.className = 'toc-link-icon';

Expand Down Expand Up @@ -106,6 +108,15 @@ function replaceContent(text) {
content.innerHTML = tmpContent.innerHTML;
}

const newStorybookPathMeta = tmpElement.querySelector(
STORYBOOK_PATH_META_SELECTOR
);

const newStorybookPathContent = newStorybookPathMeta?.content ?? '';
document
.querySelector(STORYBOOK_PATH_META_SELECTOR)
.setAttribute('content', newStorybookPathContent);

window.scrollTo(0, 0);

buildPageToC();
Expand Down