Skip to content

Commit 7ff995f

Browse files
authored
docs: update version table (#6266)
1 parent 90a0cf7 commit 7ff995f

File tree

2 files changed

+69
-11
lines changed

2 files changed

+69
-11
lines changed

.storybook/components/VersionTable.tsx

+67-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import { MessageStrip } from '@ui5/webcomponents-react';
1+
import { Button, MessageStrip } from '@ui5/webcomponents-react';
2+
import { ThemingParameters } from '@ui5/webcomponents-react-base';
3+
import { Fragment, useState } from 'react';
24
import versionInfo from '../../config/version-info.json';
5+
import iconArrowRight from '@ui5/webcomponents-icons/dist/slim-arrow-right.js';
6+
import iconArrowDown from '@ui5/webcomponents-icons/dist/slim-arrow-down.js';
37

4-
const allWCRVersions = Object.values(versionInfo);
8+
const allWCRVersions: string[] = Object.values(versionInfo);
59

610
export function VersionTable() {
11+
const [expanded, setExpanded] = useState(false);
712
return (
813
<>
914
<MessageStrip hideCloseButton>
@@ -34,7 +39,8 @@ export function VersionTable() {
3439
const nextVersion = allWCRVersions[currentWCRIndex + 1];
3540
const currentMajor = parseInt(wcrVersion.split('.')[0]);
3641
const currentMinor = parseInt(wcrVersion.split('.')[1]);
37-
const wcrVersions = [`~${wcrVersion}`];
42+
const lastV1 = currentMajor === 1 && currentMinor === 27;
43+
const wcrVersions = [lastV1 ? wcrVersion : `~${wcrVersion}`];
3844
if (nextVersion) {
3945
let minor = parseInt(nextVersion.split('.')[1]);
4046
for (let i = currentMinor + 1; i < minor; i++) {
@@ -43,13 +49,64 @@ export function VersionTable() {
4349
}
4450

4551
return (
46-
<tr key={wcrVersion}>
47-
<td>
48-
{lastEntry ? '>= ' : ''}
49-
{wcrVersions.join(', ')}
50-
</td>
51-
<td>~{wcVersion}</td>
52-
</tr>
52+
<Fragment key={wcrVersion}>
53+
{wcrVersion === '1.0.1' && (
54+
<tr>
55+
<td colSpan={2}>
56+
<Button
57+
data-ui5-compact-size
58+
icon={expanded ? iconArrowDown : iconArrowRight}
59+
design="Transparent"
60+
onClick={() => {
61+
setExpanded((prev) => !prev);
62+
}}
63+
/>
64+
<span
65+
style={{
66+
fontSize: ThemingParameters.sapFontLargeSize,
67+
fontFamily: ThemingParameters.sapFontBoldFamily,
68+
marginInlineStart: '0.5rem'
69+
}}
70+
>
71+
Version 1
72+
</span>
73+
</td>
74+
</tr>
75+
)}
76+
{currentMajor === 1 && expanded && (
77+
<tr>
78+
<td>
79+
{lastV1 ? '^' : ''}
80+
{wcrVersions.join(', ')}
81+
</td>
82+
<td>~{wcVersion}</td>
83+
</tr>
84+
)}
85+
{wcrVersion === '2.0.0' && (
86+
<tr>
87+
<td colSpan={2}>
88+
<span
89+
style={{
90+
fontSize: ThemingParameters.sapFontLargeSize,
91+
fontFamily: ThemingParameters.sapFontBoldFamily,
92+
marginInlineEnd: '0.5rem'
93+
}}
94+
>
95+
Version 2
96+
</span>
97+
</td>
98+
</tr>
99+
)}
100+
{currentMajor === 2 && (
101+
<tr>
102+
<td>
103+
{lastEntry ? '>= ' : ''}
104+
{wcrVersions.join(', ')}
105+
</td>
106+
<td>~{wcVersion}</td>
107+
</tr>
108+
)}
109+
</Fragment>
53110
);
54111
})}
55112
</tbody>

config/version-info.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
"1.21.0": "1.24.0",
4343
"1.22.0": "1.25.0",
4444
"1.23.1": "1.26.0",
45-
"1.24.0": "1.27.0"
45+
"1.24.0": "1.27.0",
46+
"2.1.2": "2.0.0"
4647
}

0 commit comments

Comments
 (0)