mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-01 02:49:52 +03:00
DOP-3612: modify labels for versioning (#30)
This commit is contained in:
parent
42e70be345
commit
176757f5ab
|
@ -60,7 +60,10 @@ export class Redoc extends React.Component<RedocProps> {
|
||||||
backNavigationPath={options.backNavigationPath}
|
backNavigationPath={options.backNavigationPath}
|
||||||
siteTitle={options.siteTitle}
|
siteTitle={options.siteTitle}
|
||||||
/>
|
/>
|
||||||
<SideMenuTitle>{store.spec.info.title}</SideMenuTitle>
|
<SideMenuTitle>
|
||||||
|
{store.spec.info.title}
|
||||||
|
{options.versionData && ` ${options.versionData.active.apiVersion}`}
|
||||||
|
</SideMenuTitle>
|
||||||
{(!options.disableSearch && (
|
{(!options.disableSearch && (
|
||||||
<SearchBox
|
<SearchBox
|
||||||
search={search!}
|
search={search!}
|
||||||
|
|
|
@ -46,7 +46,7 @@ const VersionSelectorComponent = ({
|
||||||
return (
|
return (
|
||||||
<StyledWrapper ref={menuListRef}>
|
<StyledWrapper ref={menuListRef}>
|
||||||
<StyledSelectWrapper>
|
<StyledSelectWrapper>
|
||||||
<StyledLabel>Version Selector: v{active.apiVersion}</StyledLabel>
|
<StyledLabel>Resource Version:</StyledLabel>
|
||||||
{description && <StyledDescription>{description}</StyledDescription>}
|
{description && <StyledDescription>{description}</StyledDescription>}
|
||||||
<StyledButton onClick={() => setOpen(!open)}>
|
<StyledButton onClick={() => setOpen(!open)}>
|
||||||
<StyledDisplay>
|
<StyledDisplay>
|
||||||
|
|
|
@ -22,9 +22,7 @@ describe('VersionSelector', () => {
|
||||||
it('should correctly render VersionSelector', () => {
|
it('should correctly render VersionSelector', () => {
|
||||||
const wrapper = render(<VersionSelector {...versionData} />);
|
const wrapper = render(<VersionSelector {...versionData} />);
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
expect(wrapper.find('label').text()).toBe(
|
expect(wrapper.find('label').text()).toBe(`Resource Version:`);
|
||||||
`Version Selector: v${versionData.active.apiVersion}`,
|
|
||||||
);
|
|
||||||
expect(wrapper.find('button').text()).toBe(versionData.resourceVersions.slice(-1)[0]);
|
expect(wrapper.find('button').text()).toBe(versionData.resourceVersions.slice(-1)[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ exports[`VersionSelector should correctly render VersionSelector 1`] = `
|
||||||
<label
|
<label
|
||||||
class="sc-eCApnc kkTJUz"
|
class="sc-eCApnc kkTJUz"
|
||||||
>
|
>
|
||||||
Version Selector: v2.0
|
Resource Version:
|
||||||
</label>
|
</label>
|
||||||
<button
|
<button
|
||||||
aria-labelledby="View a different version of documentation."
|
aria-labelledby="View a different version of documentation."
|
||||||
|
|
Loading…
Reference in New Issue
Block a user