Skip to content

Commit 5760b92

Browse files
authored
Tooltips in TOC (#2561)
* Add tooltip * Simplify usage * Remove tooltip test from sidebar * Get clickable "notice" components that expands upon click * Convert it to hover effect * Refine tooltip style further * Refine tooltip examples in sidebars.js * Fix styles * Refine tooltips examples & styles * Slightly tweak dark mode tooltip styles * Translate code comment * Translate code comment * Add comment on how to use value in HTML notices * Fix gitignore * Apply various examples of tooltips to TOC * Adjust CSS * Rename properties for HTML type to better handle tooltips * Fix admin panel custom. tooltip
1 parent 4a13bef commit 5760b92

File tree

8 files changed

+683
-23
lines changed

8 files changed

+683
-23
lines changed

docusaurus/.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ docs/node_modules/**
2929
*.py
3030

3131
# LLMs.txt files and related
32-
# llms*.txt
33-
# **/llms*.txt
34-
35-
# Internal tmp tests
32+
llms*.txt
33+
**/llm*.txt
3634
pr-*.diff
3735
*-results.json

docusaurus/sidebars.js

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ const sidebars = {
213213
collapsible: false,
214214
className: 'category-cms-configurations',
215215
items: [
216+
216217
{
217218
type: 'doc',
218219
label: 'Configurations introduction',
@@ -223,9 +224,25 @@ const sidebars = {
223224
label: 'Admin panel',
224225
collapsed: true,
225226
customProps: {
226-
updated: true,
227+
updated: false,
228+
text: "The section has been simplified",
229+
tooltip: `We simplified the admin panel configuration section to make it easier to navigate and find what you need.</div>
230+
<div>The new structure groups configurations by their purpose, making it more intuitive to locate specific settings.</div>
231+
<div><em>Notes: </em>
232+
<ul>
233+
<li>Lifecycle functions documentation has been moved to the Development section.</li>
234+
<li>Email and Upload Providers documentation have been included in the corresponding Features pages.</li>
235+
</div>`
227236
},
228237
items: [
238+
// {
239+
// type: 'html',
240+
// value: 'placeholder', // a value is required for the HTML type, but it is not rendered
241+
// customProps: {
242+
// text: "The section has been simplified",
243+
// tooltip: `We simplified the admin panel configuration section to make it easier to navigate and find what you need.</div><div>The new structure groups configurations by their purpose, making it more intuitive to locate specific settings.</div>`
244+
// }
245+
// },
229246
{
230247
type: 'link',
231248
label: 'Introduction',
@@ -284,14 +301,27 @@ const sidebars = {
284301
]
285302
},
286303
'cms/configurations/api',
287-
'cms/configurations/cron',
304+
{
305+
type: 'doc',
306+
id: 'cms/configurations/cron',
307+
customProps: {
308+
updated: false,
309+
// tooltip: `<strong>Important changes</strong><br/><br/>
310+
// <span>This tooltip can be used to display short pieces of information.</span><br><br>
311+
// We may use bullets in the tooltip as well:<br>
312+
// <ul>
313+
// <li>This item is purely informative</li>
314+
// <li>Please avoid using links here as those tooltips are not hoverable</li>
315+
// </ul><br/>`
316+
},
317+
},
288318
{
289319
type: 'category',
290320
collapsed: true,
291321
collapsible: true,
292322
label: "Database",
293323
customProps: {
294-
updated: false,
324+
tooltip: 'This section now regroups all the database-related configurations and guides, including migrations and transactions.'
295325
},
296326
items: [
297327
{
@@ -369,9 +399,32 @@ const sidebars = {
369399
label: 'Admin panel customization',
370400
collapsed: true,
371401
customProps: {
372-
updated: true,
402+
updated: false,
403+
// text: `The section has been reorganized`,
404+
// tooltip: `We have reorganized the admin panel customization section to make it easier to navigate and find what you need.</div>
405+
// <div>The new structure groups customizations by their purpose, making it more intuitive to locate specific settings.</div>
406+
// <div><em>Notes: </em>
407+
// <ul>
408+
// <li>Deployment-related configuration has been moved to the Configurations > Admin panel > Admin panel server page.</li>
409+
// <li>Host, port, and path configuration documentation has been moved to the Configurations > Server page.</li>
410+
// </ul>`
411+
tooltip: "This section has been reorganized, see details below.",
373412
},
374413
items: [
414+
{
415+
type: 'html',
416+
value: 'placeholder', // a value is required for the HTML type, but it is not rendered
417+
customProps: {
418+
tooltipTitle: `The section has been reorganized`,
419+
tooltipContent: `We have reorganized the admin panel customization section to make it easier to navigate and find what you need.</div>
420+
<br/><br/>
421+
<div>The new structure groups customizations by their purpose, making it more intuitive to locate specific settings.</div>
422+
<br/>
423+
<div><em>Note: </em>
424+
Deployment-related configuration, including host, port, and path configuration, has been moved to the Configurations > Admin panel > <a href="/cms/configurations/admin-panel#admin-panel-server">Admin panel server</a> page.
425+
</div>`
426+
},
427+
},
375428
{
376429
type: 'doc',
377430
id: 'cms/admin-panel-customization',
@@ -423,6 +476,14 @@ const sidebars = {
423476
collapsible: false,
424477
className: 'category-cms-typescript', // TODO: add CSS for icon
425478
items: [
479+
{
480+
type: 'html',
481+
value: 'placeholder', // a value is required for the HTML type, but it is not rendered
482+
customProps: {
483+
tooltipTitle: "This section is new",
484+
tooltipContent: "We grouped all the TypeScript-related content into a new section, including configurations, development tips, and guides."
485+
}
486+
},
426487
{
427488
type: 'doc',
428489
id: 'cms/typescript',
@@ -1002,4 +1063,4 @@ const sidebars = {
10021063
// ]
10031064
};
10041065

1005-
module.exports = sidebars;
1066+
module.exports = sidebars;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
4+
export default function InfoIcon({ tooltip, className }) {
5+
if (!tooltip) return null;
6+
7+
return (
8+
<span className={clsx('info-icon', className)}>
9+
<div className="info-icon__tooltip">
10+
<div dangerouslySetInnerHTML={{ __html: tooltip }} />
11+
<div className="tooltip-arrow"></div>
12+
</div>
13+
</span>
14+
);
15+
}

0 commit comments

Comments
 (0)