box-ui-elements 23.4.0-beta.16 → 23.4.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/explorer.js +1 -1
- package/dist/preview.js +1 -1
- package/dist/sidebar.js +1 -1
- package/es/elements/common/nav-button/BackButton.js +5 -8
- package/es/elements/common/nav-button/BackButton.js.flow +8 -18
- package/es/elements/common/nav-button/BackButton.js.map +1 -1
- package/{src/elements/common/types/SidebarNavigation.flow.js → es/elements/common/types/SidebarNavigation.js.flow} +9 -23
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js +6 -3
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.flow +47 -42
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsGroup.js.flow +3 -0
- package/es/elements/content-sidebar/versions/VersionsGroup.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsList.js +16 -8
- package/es/elements/content-sidebar/versions/VersionsList.js.flow +35 -17
- package/es/elements/content-sidebar/versions/VersionsList.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsMenu.js.flow +3 -0
- package/es/elements/content-sidebar/versions/VersionsMenu.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsSidebar.js +6 -3
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.flow +48 -39
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.map +1 -1
- package/es/src/test-utils/testing-library.d.ts +2 -1
- package/es/test-utils/testing-library.js +4 -1
- package/es/test-utils/testing-library.js.map +1 -1
- package/package.json +3 -3
- package/src/elements/common/nav-button/BackButton.js +8 -18
- package/src/elements/common/nav-button/__tests__/BackButton.test.js +36 -27
- package/{es/elements/common/types/SidebarNavigation.flow.js.flow → src/elements/common/types/SidebarNavigation.js.flow} +9 -23
- package/src/elements/content-sidebar/versions/StaticVersionSidebar.js +47 -42
- package/src/elements/content-sidebar/versions/VersionsGroup.js +3 -0
- package/src/elements/content-sidebar/versions/VersionsList.js +35 -17
- package/src/elements/content-sidebar/versions/VersionsMenu.js +3 -0
- package/src/elements/content-sidebar/versions/VersionsSidebar.js +48 -39
- package/src/elements/content-sidebar/versions/__tests__/StaticVersionSidebar.test.js +171 -0
- package/src/elements/content-sidebar/versions/__tests__/VersionsList.test.js +138 -13
- package/src/elements/content-sidebar/versions/__tests__/VersionsMenu.test.js +75 -23
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebar.test.js +147 -20
- package/src/test-utils/testing-library.tsx +4 -1
- package/es/elements/common/types/SidebarNavigation.flow.js +0 -14
- package/es/elements/common/types/SidebarNavigation.flow.js.map +0 -1
- package/src/elements/common/nav-button/__tests__/__snapshots__/BackButton.test.js.snap +0 -64
- package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsList.test.js.snap +0 -45
- package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebar.test.js.snap +0 -92
|
@@ -1,38 +1,165 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { MemoryRouter, Route } from 'react-router-dom';
|
|
3
|
+
import { render, screen, userEvent } from '../../../../test-utils/testing-library';
|
|
4
4
|
import messages from '../messages';
|
|
5
|
-
import VersionsMenu from '../VersionsMenu';
|
|
6
5
|
import VersionsSidebar from '../VersionsSidebar';
|
|
7
6
|
|
|
8
7
|
jest.mock('../../../common/nav-button', () => ({
|
|
9
|
-
BackButton: () =>
|
|
8
|
+
BackButton: ({ onClick, 'data-resin-target': dataResinTarget }) => (
|
|
9
|
+
<button type="button" onClick={onClick} data-resin-target={dataResinTarget} data-testid="back-button">
|
|
10
|
+
Back
|
|
11
|
+
</button>
|
|
12
|
+
),
|
|
10
13
|
}));
|
|
11
14
|
|
|
15
|
+
jest.mock('../VersionsMenu', () => ({ versions, fileId, versionCount, versionLimit }) => (
|
|
16
|
+
<div data-testid="versions-menu">
|
|
17
|
+
Versions: {versions.length}, FileId: {fileId}, Count: {versionCount}, Limit: {versionLimit}
|
|
18
|
+
</div>
|
|
19
|
+
));
|
|
20
|
+
|
|
21
|
+
jest.mock('../../../../components/loading-indicator', () => ({
|
|
22
|
+
LoadingIndicatorWrapper: ({ children, isLoading, className, crawlerPosition }) => (
|
|
23
|
+
<div
|
|
24
|
+
className={className}
|
|
25
|
+
data-testid="loading-wrapper"
|
|
26
|
+
data-loading={isLoading}
|
|
27
|
+
data-crawler-position={crawlerPosition}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
),
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
jest.mock('../../../../components/inline-error', () => ({ title, children }) => (
|
|
35
|
+
<div data-testid="inline-error">
|
|
36
|
+
<div data-testid="error-title">{title}</div>
|
|
37
|
+
<div data-testid="error-message">{children}</div>
|
|
38
|
+
</div>
|
|
39
|
+
));
|
|
40
|
+
|
|
12
41
|
describe('elements/content-sidebar/versions/VersionsSidebar', () => {
|
|
13
|
-
const
|
|
42
|
+
const defaultProps = {
|
|
43
|
+
fileId: '123',
|
|
44
|
+
isLoading: false,
|
|
45
|
+
parentName: 'activity',
|
|
46
|
+
versionCount: 1,
|
|
47
|
+
versionLimit: 10,
|
|
48
|
+
versions: [{ id: '12345' }],
|
|
49
|
+
};
|
|
14
50
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
51
|
+
const renderComponent = (props = {}) => {
|
|
52
|
+
return render(
|
|
53
|
+
<MemoryRouter initialEntries={['/versions']}>
|
|
54
|
+
<VersionsSidebar {...defaultProps} {...props} />
|
|
55
|
+
</MemoryRouter>,
|
|
56
|
+
);
|
|
57
|
+
};
|
|
18
58
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
expect(wrapper).toMatchSnapshot();
|
|
22
|
-
});
|
|
59
|
+
test('should show the versions list if no error prop is provided', () => {
|
|
60
|
+
renderComponent({ versions: [{ id: '12345' }] });
|
|
23
61
|
|
|
24
|
-
|
|
25
|
-
|
|
62
|
+
expect(screen.queryByTestId('inline-error')).not.toBeInTheDocument();
|
|
63
|
+
expect(screen.getByTestId('versions-menu')).toBeInTheDocument();
|
|
64
|
+
expect(screen.getByText('Version History')).toBeInTheDocument();
|
|
65
|
+
expect(screen.getByTestId('back-button')).toBeInTheDocument();
|
|
66
|
+
});
|
|
26
67
|
|
|
27
|
-
|
|
28
|
-
|
|
68
|
+
test('should show an inline error if the prop is provided', () => {
|
|
69
|
+
renderComponent({
|
|
70
|
+
error: messages.versionFetchError,
|
|
71
|
+
versions: [],
|
|
29
72
|
});
|
|
30
73
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
74
|
+
expect(screen.getByTestId('inline-error')).toBeInTheDocument();
|
|
75
|
+
expect(screen.getByTestId('error-title')).toBeInTheDocument();
|
|
76
|
+
expect(screen.getByTestId('error-message')).toBeInTheDocument();
|
|
77
|
+
expect(screen.queryByTestId('versions-menu')).not.toBeInTheDocument();
|
|
78
|
+
expect(screen.queryByTestId('max-versions')).not.toBeInTheDocument();
|
|
79
|
+
expect(screen.getByText('Version History')).toBeInTheDocument();
|
|
80
|
+
expect(screen.getByTestId('back-button')).toBeInTheDocument();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('should show max versions text if max versions provided', () => {
|
|
84
|
+
const versions = Array.from({ length: 1000 }, (_, index) => ({ id: index }));
|
|
85
|
+
renderComponent({ versions });
|
|
86
|
+
|
|
87
|
+
expect(screen.getByTestId('max-versions')).toBeInTheDocument();
|
|
88
|
+
expect(screen.queryByTestId('inline-error')).not.toBeInTheDocument();
|
|
89
|
+
expect(screen.getByText('Version History')).toBeInTheDocument();
|
|
90
|
+
expect(screen.getByTestId('back-button')).toBeInTheDocument();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('should not show max versions text if few versions provided', () => {
|
|
94
|
+
renderComponent({ versions: [{ id: '1' }, { id: '2' }] });
|
|
34
95
|
|
|
35
|
-
|
|
96
|
+
expect(screen.queryByTestId('max-versions')).not.toBeInTheDocument();
|
|
97
|
+
expect(screen.queryByTestId('inline-error')).not.toBeInTheDocument();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test('should show empty state when no versions and not loading', () => {
|
|
101
|
+
renderComponent({
|
|
102
|
+
versions: [],
|
|
103
|
+
isLoading: false,
|
|
36
104
|
});
|
|
105
|
+
|
|
106
|
+
expect(screen.getByText('No prior versions are available for this file.')).toBeInTheDocument();
|
|
107
|
+
expect(screen.queryByTestId('versions-menu')).not.toBeInTheDocument();
|
|
108
|
+
expect(screen.queryByTestId('max-versions')).not.toBeInTheDocument();
|
|
109
|
+
expect(screen.queryByTestId('inline-error')).not.toBeInTheDocument();
|
|
110
|
+
expect(screen.getByText('Version History')).toBeInTheDocument();
|
|
111
|
+
expect(screen.getByTestId('back-button')).toBeInTheDocument();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test('should pass loading state to LoadingIndicatorWrapper', () => {
|
|
115
|
+
renderComponent({ isLoading: true });
|
|
116
|
+
|
|
117
|
+
const loadingWrapper = screen.getByTestId('loading-wrapper');
|
|
118
|
+
expect(loadingWrapper).toHaveAttribute('data-loading', 'true');
|
|
119
|
+
expect(loadingWrapper).toHaveAttribute('data-crawler-position', 'top');
|
|
120
|
+
expect(loadingWrapper).toHaveClass('bcs-Versions-content');
|
|
121
|
+
expect(screen.queryByTestId('inline-error')).not.toBeInTheDocument();
|
|
122
|
+
expect(screen.getByText('Version History')).toBeInTheDocument();
|
|
123
|
+
expect(screen.getByTestId('back-button')).toBeInTheDocument();
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test('should pass correct props to VersionsMenu', () => {
|
|
127
|
+
renderComponent();
|
|
128
|
+
|
|
129
|
+
const versionsMenu = screen.getByTestId('versions-menu');
|
|
130
|
+
expect(versionsMenu).toHaveTextContent('Versions: 1, FileId: 123, Count: 1, Limit: 10');
|
|
131
|
+
expect(screen.queryByTestId('inline-error')).not.toBeInTheDocument();
|
|
132
|
+
expect(screen.getByText('Version History')).toBeInTheDocument();
|
|
133
|
+
expect(screen.getByTestId('back-button')).toBeInTheDocument();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('should navigate to parent name when back button is clicked', async () => {
|
|
137
|
+
let currentLocation;
|
|
138
|
+
|
|
139
|
+
const TestWrapper = ({ children }) => (
|
|
140
|
+
<MemoryRouter initialEntries={['/versions']}>
|
|
141
|
+
<Route
|
|
142
|
+
path="*"
|
|
143
|
+
render={({ location }) => {
|
|
144
|
+
currentLocation = location;
|
|
145
|
+
return children;
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
</MemoryRouter>
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
render(
|
|
152
|
+
<TestWrapper>
|
|
153
|
+
<VersionsSidebar {...defaultProps} parentName="activity" />
|
|
154
|
+
</TestWrapper>,
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
expect(currentLocation.pathname).toBe('/versions');
|
|
158
|
+
|
|
159
|
+
const backButton = screen.getByTestId('back-button');
|
|
160
|
+
const user = userEvent();
|
|
161
|
+
await user.click(backButton);
|
|
162
|
+
|
|
163
|
+
expect(currentLocation.pathname).toBe('/activity');
|
|
37
164
|
});
|
|
38
165
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, type RenderOptions } from '@testing-library/react';
|
|
3
|
+
import userEventInit from '@testing-library/user-event';
|
|
3
4
|
|
|
4
5
|
// Data Providers
|
|
5
6
|
import { TooltipProvider } from '@box/blueprint-web';
|
|
@@ -26,5 +27,7 @@ const renderConnected = (element, options: RenderConnectedOptions = {}) =>
|
|
|
26
27
|
...options,
|
|
27
28
|
});
|
|
28
29
|
|
|
30
|
+
const createUserEvent = () => userEventInit.setup(); // factory function to create isolated userEvent instances
|
|
31
|
+
|
|
29
32
|
export * from '@testing-library/react';
|
|
30
|
-
export { renderConnected as render };
|
|
33
|
+
export { renderConnected as render, createUserEvent as userEvent };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const ViewType = Object.freeze({
|
|
2
|
-
BOXAI: 'boxai',
|
|
3
|
-
SKILLS: 'skills',
|
|
4
|
-
ACTIVITY: 'activity',
|
|
5
|
-
DETAILS: 'details',
|
|
6
|
-
METADATA: 'metadata',
|
|
7
|
-
DOCGEN: 'docgen'
|
|
8
|
-
});
|
|
9
|
-
export const FeedEntryType = Object.freeze({
|
|
10
|
-
ANNOTATIONS: 'annotations',
|
|
11
|
-
COMMENTS: 'comments',
|
|
12
|
-
TASKS: 'tasks'
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=SidebarNavigation.flow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarNavigation.flow.js","names":["ViewType","Object","freeze","BOXAI","SKILLS","ACTIVITY","DETAILS","METADATA","DOCGEN","FeedEntryType","ANNOTATIONS","COMMENTS","TASKS"],"sources":["../../../../src/elements/common/types/SidebarNavigation.flow.js"],"sourcesContent":["/* @flow */\n\nexport const ViewType = Object.freeze({\n BOXAI: 'boxai',\n SKILLS: 'skills',\n ACTIVITY: 'activity',\n DETAILS: 'details',\n METADATA: 'metadata',\n DOCGEN: 'docgen',\n});\n\nexport const FeedEntryType = Object.freeze({\n ANNOTATIONS: 'annotations',\n COMMENTS: 'comments',\n TASKS: 'tasks',\n});\n\nexport type ViewTypeValues = $Values<typeof ViewType>;\nexport type FeedEntryTypeValues = $Values<typeof FeedEntryType>;\n\ntype VersionSidebarView = {\n sidebar: 'activity' | 'details',\n versionId: string,\n};\n\nexport type ActivityAnnotationsSidebarView = {\n sidebar: 'activity',\n activeFeedEntryType: 'annotations',\n fileVersionId: string,\n activeFeedEntryId: string,\n};\ntype ActivityCommentsSidebarView = {\n sidebar: 'activity',\n activeFeedEntryType: 'comments' | 'tasks',\n activeFeedEntryId: string,\n};\n\nexport type SidebarNavigation =\n | {|\n sidebar: ViewTypeValues,\n |}\n | VersionSidebarView\n | ActivityCommentsSidebarView\n | ActivityAnnotationsSidebarView;\n\nexport type InternalSidebarNavigation = SidebarNavigation & {\n open: boolean,\n};\n\nexport type SidebarNavigationHandler = (sidebar: SidebarNavigation, replace?: boolean) => void;\n\nexport type InternalSidebarNavigationHandler = (sidebar: InternalSidebarNavigation, replace?: boolean) => void;\n"],"mappings":"AAEA,OAAO,MAAMA,QAAQ,GAAGC,MAAM,CAACC,MAAM,CAAC;EAClCC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,MAAM,EAAE;AACZ,CAAC,CAAC;AAEF,OAAO,MAAMC,aAAa,GAAGR,MAAM,CAACC,MAAM,CAAC;EACvCQ,WAAW,EAAE,aAAa;EAC1BC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`elements/common/nav-button/BackButton should match its snapshot 1`] = `
|
|
4
|
-
<BackButton>
|
|
5
|
-
<Route>
|
|
6
|
-
<PlainButton
|
|
7
|
-
className="bdl-BackButton"
|
|
8
|
-
onClick={[Function]}
|
|
9
|
-
type="button"
|
|
10
|
-
>
|
|
11
|
-
<button
|
|
12
|
-
className="btn-plain bdl-BackButton"
|
|
13
|
-
onClick={[Function]}
|
|
14
|
-
type="button"
|
|
15
|
-
>
|
|
16
|
-
<IconNavigateLeft
|
|
17
|
-
height={24}
|
|
18
|
-
width={24}
|
|
19
|
-
>
|
|
20
|
-
<AccessibleSVG
|
|
21
|
-
className="icon-navigate-left "
|
|
22
|
-
focusable="false"
|
|
23
|
-
height={24}
|
|
24
|
-
viewBox="0 0 48 48"
|
|
25
|
-
width={24}
|
|
26
|
-
>
|
|
27
|
-
<svg
|
|
28
|
-
aria-hidden="true"
|
|
29
|
-
className="icon-navigate-left "
|
|
30
|
-
focusable="false"
|
|
31
|
-
height={24}
|
|
32
|
-
role="presentation"
|
|
33
|
-
viewBox="0 0 48 48"
|
|
34
|
-
width={24}
|
|
35
|
-
>
|
|
36
|
-
<path
|
|
37
|
-
d="M30.8,33.2L21.7,24l9.2-9.2L28,12L16,24l12,12L30.8,33.2z"
|
|
38
|
-
fill="#494949"
|
|
39
|
-
stroke="#DCDCDC"
|
|
40
|
-
strokeMiterlimit="10"
|
|
41
|
-
/>
|
|
42
|
-
<path
|
|
43
|
-
d="M0,0h48v48H0V0z"
|
|
44
|
-
display="none"
|
|
45
|
-
fill="none"
|
|
46
|
-
/>
|
|
47
|
-
</svg>
|
|
48
|
-
</AccessibleSVG>
|
|
49
|
-
</IconNavigateLeft>
|
|
50
|
-
<span
|
|
51
|
-
className="accessibility-hidden"
|
|
52
|
-
>
|
|
53
|
-
<FormattedMessage
|
|
54
|
-
defaultMessage="Back"
|
|
55
|
-
id="be.back"
|
|
56
|
-
>
|
|
57
|
-
<div />
|
|
58
|
-
</FormattedMessage>
|
|
59
|
-
</span>
|
|
60
|
-
</button>
|
|
61
|
-
</PlainButton>
|
|
62
|
-
</Route>
|
|
63
|
-
</BackButton>
|
|
64
|
-
`;
|
package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsList.test.js.snap
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`elements/content-sidebar/versions/VersionsList render should match its snapshot 1`] = `
|
|
4
|
-
<ul
|
|
5
|
-
className="bcs-VersionsList"
|
|
6
|
-
/>
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
exports[`elements/content-sidebar/versions/VersionsList render should match its snapshot 2`] = `
|
|
10
|
-
<ul
|
|
11
|
-
className="bcs-VersionsList"
|
|
12
|
-
>
|
|
13
|
-
<li
|
|
14
|
-
className="bcs-VersionsList-item"
|
|
15
|
-
key="12345"
|
|
16
|
-
>
|
|
17
|
-
<Route
|
|
18
|
-
render={[Function]}
|
|
19
|
-
/>
|
|
20
|
-
</li>
|
|
21
|
-
</ul>
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
exports[`elements/content-sidebar/versions/VersionsList render should match its snapshot 3`] = `
|
|
25
|
-
<ul
|
|
26
|
-
className="bcs-VersionsList"
|
|
27
|
-
>
|
|
28
|
-
<li
|
|
29
|
-
className="bcs-VersionsList-item"
|
|
30
|
-
key="12345"
|
|
31
|
-
>
|
|
32
|
-
<Route
|
|
33
|
-
render={[Function]}
|
|
34
|
-
/>
|
|
35
|
-
</li>
|
|
36
|
-
<li
|
|
37
|
-
className="bcs-VersionsList-item"
|
|
38
|
-
key="45678"
|
|
39
|
-
>
|
|
40
|
-
<Route
|
|
41
|
-
render={[Function]}
|
|
42
|
-
/>
|
|
43
|
-
</li>
|
|
44
|
-
</ul>
|
|
45
|
-
`;
|
package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebar.test.js.snap
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`elements/content-sidebar/versions/VersionsSidebar render should show an inline error if the prop is provided 1`] = `
|
|
4
|
-
<SidebarContent
|
|
5
|
-
className="bcs-Versions"
|
|
6
|
-
data-resin-component="preview"
|
|
7
|
-
data-resin-feature="versions"
|
|
8
|
-
elementId=""
|
|
9
|
-
sidebarView=""
|
|
10
|
-
title={
|
|
11
|
-
<React.Fragment>
|
|
12
|
-
<BackButton
|
|
13
|
-
data-resin-target="back"
|
|
14
|
-
to="/activity"
|
|
15
|
-
/>
|
|
16
|
-
<FormattedMessage
|
|
17
|
-
defaultMessage="Version History"
|
|
18
|
-
id="be.sidebarVersions.title"
|
|
19
|
-
/>
|
|
20
|
-
</React.Fragment>
|
|
21
|
-
}
|
|
22
|
-
>
|
|
23
|
-
<LoadingIndicatorWrapper
|
|
24
|
-
className="bcs-Versions-content"
|
|
25
|
-
crawlerPosition="top"
|
|
26
|
-
>
|
|
27
|
-
<InlineError
|
|
28
|
-
title={
|
|
29
|
-
<FormattedMessage
|
|
30
|
-
defaultMessage="Server Error"
|
|
31
|
-
id="be.sidebarVersions.serverError"
|
|
32
|
-
/>
|
|
33
|
-
}
|
|
34
|
-
>
|
|
35
|
-
<FormattedMessage
|
|
36
|
-
defaultMessage="File versions could not be retrieved."
|
|
37
|
-
id="be.sidebarVersions.fetchError"
|
|
38
|
-
/>
|
|
39
|
-
</InlineError>
|
|
40
|
-
<div
|
|
41
|
-
className="bcs-Versions-empty"
|
|
42
|
-
>
|
|
43
|
-
<FormattedMessage
|
|
44
|
-
defaultMessage="No prior versions are available for this file."
|
|
45
|
-
id="be.sidebarVersions.empty"
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
</LoadingIndicatorWrapper>
|
|
49
|
-
</SidebarContent>
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
exports[`elements/content-sidebar/versions/VersionsSidebar render should show the versions list if no error prop is provided 1`] = `
|
|
53
|
-
<SidebarContent
|
|
54
|
-
className="bcs-Versions"
|
|
55
|
-
data-resin-component="preview"
|
|
56
|
-
data-resin-feature="versions"
|
|
57
|
-
elementId=""
|
|
58
|
-
sidebarView=""
|
|
59
|
-
title={
|
|
60
|
-
<React.Fragment>
|
|
61
|
-
<BackButton
|
|
62
|
-
data-resin-target="back"
|
|
63
|
-
to="/activity"
|
|
64
|
-
/>
|
|
65
|
-
<FormattedMessage
|
|
66
|
-
defaultMessage="Version History"
|
|
67
|
-
id="be.sidebarVersions.title"
|
|
68
|
-
/>
|
|
69
|
-
</React.Fragment>
|
|
70
|
-
}
|
|
71
|
-
>
|
|
72
|
-
<LoadingIndicatorWrapper
|
|
73
|
-
className="bcs-Versions-content"
|
|
74
|
-
crawlerPosition="top"
|
|
75
|
-
>
|
|
76
|
-
<div
|
|
77
|
-
className="bcs-Versions-menu"
|
|
78
|
-
data-testid="bcs-Versions-menu"
|
|
79
|
-
>
|
|
80
|
-
<Component
|
|
81
|
-
versions={
|
|
82
|
-
[
|
|
83
|
-
{
|
|
84
|
-
"id": "12345",
|
|
85
|
-
},
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
/>
|
|
89
|
-
</div>
|
|
90
|
-
</LoadingIndicatorWrapper>
|
|
91
|
-
</SidebarContent>
|
|
92
|
-
`;
|