Skip to content

Commit 05a27c7

Browse files
authored
Merge pull request #14227 from DefectDojo/bugfix
Release 2.55.0: Merge Bugfix into Dev
2 parents 910ae60 + 5cedfa1 commit 05a27c7

263 files changed

Lines changed: 3840 additions & 1137 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
-64.9 KB
Loading
490 KB
Loading
171 KB
Loading
174 KB
Loading
4.64 MB
Loading
284 KB
Loading

docs/assets/js/custom.js

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,60 @@
1-
// Put your custom JS code here
1+
// custom js
2+
3+
4+
// version toggler
5+
(() => {
6+
"use strict";
7+
8+
console.log("[VersionToggle] custom.js loaded");
9+
10+
const setVersion = (version) => {
11+
console.log("[VersionToggle] Setting version to:", version);
12+
13+
document.querySelectorAll(".version-opensource, .version-pro").forEach(el => {
14+
el.style.display = el.classList.contains(`version-${version}`) ? "" : "none";
15+
});
16+
17+
localStorage.setItem("version", version);
18+
console.log("[VersionToggle] localStorage updated:", localStorage.getItem("version"));
19+
20+
// Update dropdown
21+
const selects = document.querySelectorAll("#version-select");
22+
selects.forEach(sel => {
23+
sel.value = version;
24+
sel.dataset.version = version;
25+
sel.style.visibility = "visible";
26+
});
27+
28+
// unhide sidebar after version is applied
29+
const sidebar = document.querySelector(".docs-sidebar");
30+
if (sidebar) {
31+
sidebar.style.visibility = "visible";
32+
console.log("[VersionToggle] Sidebar revealed");
33+
}
34+
};
35+
36+
const initVersionToggle = () => {
37+
const storedVersion = localStorage.getItem("version") || "opensource";
38+
console.log("[VersionToggle] Stored version:", storedVersion);
39+
setVersion(storedVersion);
40+
};
41+
42+
// Delegated listener on body
43+
document.body.addEventListener("change", (e) => {
44+
if (e.target && e.target.id === "version-select") {
45+
console.log("[VersionToggle] Dropdown changed to:", e.target.value);
46+
setVersion(e.target.value);
47+
}
48+
});
49+
50+
// Run on DOM ready
51+
window.addEventListener("DOMContentLoaded", initVersionToggle);
52+
53+
// MutationObserver to detect dynamically replaced sidebar
54+
const observer = new MutationObserver(() => {
55+
// Re-run init to make sure menus match stored version
56+
initVersionToggle();
57+
});
58+
observer.observe(document.body, { childList: true, subtree: true });
59+
60+
})();

docs/assets/scss/common/_custom.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,38 @@
4343
.DocSearch-Modal {
4444
position: fixed !important;
4545
}
46+
}
47+
48+
.logo-darkmode {
49+
display: none;
50+
}
51+
52+
[data-bs-theme="dark"] .logo-lightmode {
53+
display: none;
54+
}
55+
56+
[data-bs-theme="dark"] .logo-darkmode {
57+
display: inline-block;
58+
}
59+
60+
html {
61+
font-size: 85%; /* scales all rem/em fonts */
62+
}
63+
64+
/* Hide sidebar until version is resolved */
65+
.docs-sidebar {
66+
visibility: hidden;
67+
}
68+
69+
70+
#version-select[data-version="opensource"] {
71+
background-color: #003964b7;
72+
border: 2px solid #003864;
73+
color: white;
74+
}
75+
76+
#version-select[data-version="pro"] {
77+
background-color: #a84e32b7;
78+
border: 2px solid #a84e32;
79+
color: white;
4680
}

docs/config/_default/menus/menus.en.toml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,48 @@
11
[[main]]
2-
name = "Docs Home"
3-
url = "/en/about_defectdojo/about_docs/"
2+
name = "Get started ⏷"
3+
url = "/get_started/about/about_defectdojo"
44
weight = 10
55

66
[[main]]
7-
name = "Supported Tools"
8-
url = "/supported_tools/"
9-
weight = 11
7+
name = "Import data ⏷"
8+
url = "/import_data/import_intro/comparison/"
9+
weight = 12
1010

1111
[[main]]
12-
name = "Pro Features"
13-
url = "/en/about_defectdojo/pro_features"
12+
name = "Triage Findings ⏷"
13+
url = "/triage_findings/findings_workflows/intro_to_findings/"
1414
weight = 12
1515

1616
[[main]]
17-
name = "Changelog"
18-
url = "/en/changelog/changelog/"
17+
name = "Model your assets ⏷"
18+
url = "/asset_modelling/hierarchy/pro__assets_organizations/"
1919
weight = 13
2020

2121
[[main]]
22-
name = "Support"
23-
url = "/en/about_defectdojo/contact_defectdojo_support"
22+
name = "Metrics & reports ⏷"
23+
url = "/metrics_reports/dashboards/introduction_dashboard/"
2424
weight = 14
2525

26+
[[main]]
27+
name = "Admin ⏷"
28+
url = "/admin/admin_intro/intro/"
29+
weight = 16
30+
31+
[[main]]
32+
name = "Issue tracking ⏷"
33+
url = "/issue_tracking/intro/intro/"
34+
weight = 15
35+
36+
[[main]]
37+
name = "Automation ⏷"
38+
url = "/automation/api/api-v2-docs/"
39+
weight = 15
40+
41+
[[main]]
42+
name = "Supported tools ⏷"
43+
url = "/supported_tools/"
44+
weight = 16
45+
2646
[[social]]
2747
name = "YouTube"
2848
pre = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-youtube" viewBox="0 0 16 16"><path d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.01 2.01 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.01 2.01 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31 31 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.01 2.01 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A100 100 0 0 1 7.858 2zM6.4 5.209v4.818l4.157-2.408z"/></svg>'

docs/config/_default/params.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,21 @@ mainSections = ["docs"]
4444
bootstrapJavascript = false # false (default) or true
4545

4646
# Nav
47-
sectionNav = ["docs", "en", "supported_tools"] # ["docs"] (default) or list of sections (e.g. ["docs", "guides"])
47+
sectionNav = [
48+
"docs",
49+
"en",
50+
"supported_tools",
51+
"get_started",
52+
"import_data",
53+
"triage_findings",
54+
"metrics_reports",
55+
"admin",
56+
"automation",
57+
"asset_modelling",
58+
"issue_tracking"] # ["docs"] (default) or list of sections (e.g. ["docs", "guides"])
59+
4860
toTopButton = false # false (default) or true
49-
breadcrumbTrail = true # false (default) or true
61+
breadcrumbTrail = false # false (default) or true
5062
headlineHash = true # true (default) or false
5163
scrollSpy = true # true (default) or false
5264

0 commit comments

Comments
 (0)