Skip to content

Commit 27f03d3

Browse files
Bowen7michaelklishin
authored andcommitted
[RMQ-2053] Add support timelines to support page as a new tab
1 parent d7451d5 commit 27f03d3

File tree

4 files changed

+121
-4
lines changed

4 files changed

+121
-4
lines changed

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const config = {
8181
],
8282
},
8383
],
84-
end_of_support: "2026-04-15",
84+
end_of_support: "2028-04-30",
8585
},
8686
'4.0': {
8787
releases: [
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import Link from '@docusaurus/Link';
2+
import {getReleaseBranches} from '../RabbitMQServerReleaseInfo';
3+
import styles from "./index.module.css"
4+
5+
const dateOptions = { year: 'numeric', month: 'short', day: 'numeric' };
6+
7+
function getTimelineRows(releaseBranches) {
8+
const now = Date.now();
9+
const rows = [];
10+
let previousReleaseDate;
11+
12+
for (const branch in releaseBranches) {
13+
const releaseBranch = releaseBranches[branch];
14+
const isReleased = typeof releaseBranch.end_of_support !== 'undefined';
15+
const releases = releaseBranch.releases || [];
16+
if (!isReleased || releases.length === 0) {
17+
continue;
18+
}
19+
20+
const patchRelease = releases[0];
21+
const releaseDate = new Date(patchRelease.release_date);
22+
const endOfCommunitySupportDate = previousReleaseDate;
23+
const endOfCommercialSupportDate = new Date(releaseBranch.end_of_support);
24+
25+
const isCommunitySupported = endOfCommunitySupportDate === undefined || endOfCommunitySupportDate > now;
26+
const isCommercialSupported = endOfCommercialSupportDate > now;
27+
28+
const endOfCommunitySupport =
29+
endOfCommunitySupportDate === undefined
30+
? 'Next Release'
31+
: endOfCommunitySupportDate.toLocaleDateString('en-GB', dateOptions);
32+
const endOfCommercialSupport = endOfCommercialSupportDate.toLocaleDateString("en-GB", dateOptions);
33+
34+
rows.push({
35+
release: branch,
36+
patch: patchRelease.version,
37+
releaseDate: releaseDate.toLocaleDateString("en-GB", dateOptions),
38+
endOfCommunitySupport,
39+
endOfCommercialSupport,
40+
isCommunitySupported,
41+
isCommercialSupported
42+
});
43+
44+
previousReleaseDate = new Date(releases[releases.length - 1].release_date);
45+
}
46+
47+
return rows;
48+
}
49+
50+
export function CommercialSupportTimelines() {
51+
const releaseBranches = getReleaseBranches();
52+
53+
const rows = getTimelineRows(releaseBranches);
54+
console.log(rows)
55+
56+
return (
57+
<div className="release-information">
58+
<table className={styles.timelines_table}>
59+
<thead>
60+
<tr>
61+
<th>Release</th>
62+
<th>Patch</th>
63+
<th>Date of Release</th>
64+
<th>End of Community Support</th>
65+
<th>End of Commercial Support*</th>
66+
</tr>
67+
</thead>
68+
<tbody>
69+
{rows.map((row) => (
70+
<tr key={row.release}>
71+
<td>{row.release}</td>
72+
<td>{row.patch}</td>
73+
<td>{row.releaseDate}</td>
74+
<td className={row.isCommunitySupported ? styles.supported : styles.unsupported}>
75+
{row.endOfCommunitySupport}
76+
</td>
77+
<td className={row.isCommercialSupported ? styles.supported : styles.unsupported}>
78+
{row.endOfCommercialSupport}
79+
</td>
80+
</tr>
81+
))}
82+
</tbody>
83+
</table>
84+
<p>
85+
*End of Commercial Support dates are indicative. Official commercial support lifecycle information can be found on the <Link to="https://support.broadcom.com/web/ecx/productlifecycle">Broadcom support portal</Link>.
86+
</p>
87+
<div>
88+
<strong>Legend:</strong>
89+
<dl className="release-legend">
90+
<dt className="supported-release latest-release"></dt>
91+
<dd>Latest release, fully supported</dd>
92+
<dt className="unsupported-release"></dt>
93+
<dd>Old release, unsupported</dd>
94+
</dl>
95+
</div>
96+
</div>
97+
);
98+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.timelines_table {
2+
display: table;
3+
width: 100%;
4+
}
5+
6+
.timelines_table td, .timelines_table th {
7+
padding: calc(var(--ifm-table-cell-padding) / 2) var(--ifm-table-cell-padding);
8+
}
9+
10+
.supported {
11+
background-color: var(--ri-color-latest);
12+
}
13+
14+
.unsupported {
15+
background-color: var(--ri-color-unsupported);
16+
}

src/pages/contact.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from '@docusaurus/Link';
44
import Heading from '@theme/Heading';
55
import Tabs from '@theme/Tabs';
66
import TabItem from '@theme/TabItem';
7-
import Mermaid from '@theme/Mermaid';
7+
import { CommercialSupportTimelines } from '@site/src/components/CommercialSupportTimelines';
88

99
import styles from './index.module.css';
1010

@@ -60,7 +60,7 @@ export default function Support() {
6060
<Heading as="h4">Commercial RabbitMQ includes both 24/7 support and features not available in the open source version.</Heading>
6161

6262
<Tabs>
63-
<TabItem value="feature-1" label="Enterprise Support" default>
63+
<TabItem value="feature-1" label="Commercial Support">
6464
<Heading as="h2">Around the clock, around the globe support</Heading>
6565
<div className={styles.flex_columns}>
6666
<section>
@@ -87,7 +87,10 @@ export default function Support() {
8787
</section>
8888
</div>
8989
</TabItem>
90-
<TabItem value="feature-2" label="Enterprise Features">
90+
<TabItem value="feature-2" label="Support Timelines" default>
91+
<CommercialSupportTimelines />
92+
</TabItem>
93+
<TabItem value="feature-3" label="Enterprise Features">
9194
<Heading as="h2">Exclusive capabilities supporting your mission-critical apps</Heading>
9295
<div className={styles.flex_columns}>
9396
<section>

0 commit comments

Comments
 (0)