box-ui-elements 23.4.0-beta.32 → 23.4.0-beta.34
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/types/SidebarNavigation.js +4 -2
- package/es/elements/common/types/SidebarNavigation.js.flow +7 -4
- package/es/elements/common/types/SidebarNavigation.js.map +1 -1
- package/es/elements/content-preview/PreviewNavigation.js +65 -2
- package/es/elements/content-preview/PreviewNavigation.js.flow +86 -2
- package/es/elements/content-preview/PreviewNavigation.js.map +1 -1
- package/es/elements/content-sidebar/ActivitySidebar.js +39 -7
- package/es/elements/content-sidebar/ActivitySidebar.js.flow +42 -6
- package/es/elements/content-sidebar/ActivitySidebar.js.map +1 -1
- package/es/src/elements/common/types/SidebarNavigation.d.ts +10 -4
- package/i18n/bn-IN.js +2 -2
- package/i18n/bn-IN.properties +8 -0
- package/i18n/da-DK.js +2 -2
- package/i18n/da-DK.properties +8 -0
- package/i18n/de-DE.js +2 -2
- package/i18n/de-DE.properties +8 -0
- package/i18n/en-AU.properties +8 -0
- package/i18n/en-CA.properties +8 -0
- package/i18n/en-GB.properties +8 -0
- package/i18n/en-x-pseudo.js +1020 -1020
- package/i18n/en-x-pseudo.properties +1024 -1016
- package/i18n/es-419.js +2 -2
- package/i18n/es-419.properties +8 -0
- package/i18n/es-ES.js +2 -2
- package/i18n/es-ES.properties +8 -0
- package/i18n/fi-FI.js +2 -2
- package/i18n/fi-FI.properties +8 -0
- package/i18n/fr-CA.js +2 -2
- package/i18n/fr-CA.properties +8 -0
- package/i18n/fr-FR.js +2 -2
- package/i18n/fr-FR.properties +8 -0
- package/i18n/hi-IN.js +2 -2
- package/i18n/hi-IN.properties +8 -0
- package/i18n/it-IT.js +2 -2
- package/i18n/it-IT.properties +8 -0
- package/i18n/ja-JP.properties +8 -0
- package/i18n/ko-KR.js +2 -2
- package/i18n/ko-KR.properties +8 -0
- package/i18n/nb-NO.js +2 -2
- package/i18n/nb-NO.properties +8 -0
- package/i18n/nl-NL.js +2 -2
- package/i18n/nl-NL.properties +8 -0
- package/i18n/pl-PL.js +2 -2
- package/i18n/pl-PL.properties +8 -0
- package/i18n/pt-BR.js +2 -2
- package/i18n/pt-BR.properties +8 -0
- package/i18n/ru-RU.js +2 -2
- package/i18n/ru-RU.properties +8 -0
- package/i18n/sv-SE.js +2 -2
- package/i18n/sv-SE.properties +8 -0
- package/i18n/tr-TR.js +2 -2
- package/i18n/tr-TR.properties +8 -0
- package/i18n/zh-CN.js +2 -2
- package/i18n/zh-CN.properties +8 -0
- package/i18n/zh-TW.js +2 -2
- package/i18n/zh-TW.properties +8 -0
- package/package.json +1 -1
- package/src/elements/common/types/SidebarNavigation.js.flow +7 -4
- package/src/elements/common/types/SidebarNavigation.ts +11 -3
- package/src/elements/content-preview/PreviewNavigation.js +86 -2
- package/src/elements/content-preview/__tests__/PreviewNavigation.test.js +202 -62
- package/src/elements/content-sidebar/ActivitySidebar.js +42 -6
- package/src/elements/content-sidebar/__tests__/ActivitySidebar.rtl.test.js +521 -0
- package/src/elements/content-sidebar/__tests__/ActivitySidebar.test.js +1 -123
- package/src/elements/content-sidebar/__tests__/AddTaskButton.test.js +6 -5
- package/src/elements/content-sidebar/versions/__tests__/StaticVersionSidebar.test.js +3 -5
- package/src/elements/content-preview/__tests__/__snapshots__/PreviewNavigation.test.js.snap +0 -361
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { render, screen, userEvent } from '../../../test-utils/testing-library';
|
|
3
3
|
import { AddTaskButtonComponent as AddTaskButton } from '../AddTaskButton';
|
|
4
|
+
import { ViewType, FeedEntryType } from '../../common/types/SidebarNavigation';
|
|
4
5
|
|
|
5
6
|
jest.mock('../AddTaskMenu', () => ({ onMenuItemClick, isDisabled, setAddTaskButtonRef }) => (
|
|
6
7
|
<div data-testid="add-task-menu">
|
|
@@ -51,7 +52,7 @@ describe('elements/content-sidebar/AddTaskButton', () => {
|
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
beforeEach(() => {
|
|
54
|
-
jest.
|
|
55
|
+
jest.resetAllMocks();
|
|
55
56
|
});
|
|
56
57
|
|
|
57
58
|
test('should call history.replace state with force open state when task menu items are clicked', async () => {
|
|
@@ -109,8 +110,8 @@ describe('elements/content-sidebar/AddTaskButton', () => {
|
|
|
109
110
|
test('should preserve internalSidebarNavigation state when using navigation handler', async () => {
|
|
110
111
|
const mockNavigationHandler = jest.fn();
|
|
111
112
|
const mockInternalSidebarNavigation = {
|
|
112
|
-
sidebar:
|
|
113
|
-
activeFeedEntryType:
|
|
113
|
+
sidebar: ViewType.ACTIVITY,
|
|
114
|
+
activeFeedEntryType: FeedEntryType.COMMENTS,
|
|
114
115
|
activeFeedEntryId: '123',
|
|
115
116
|
};
|
|
116
117
|
const user = userEvent();
|
|
@@ -127,8 +128,8 @@ describe('elements/content-sidebar/AddTaskButton', () => {
|
|
|
127
128
|
expect(mockNavigationHandler).toHaveBeenCalledTimes(1);
|
|
128
129
|
expect(mockNavigationHandler).toHaveBeenCalledWith(
|
|
129
130
|
{
|
|
130
|
-
sidebar:
|
|
131
|
-
activeFeedEntryType:
|
|
131
|
+
sidebar: ViewType.ACTIVITY,
|
|
132
|
+
activeFeedEntryType: FeedEntryType.COMMENTS,
|
|
132
133
|
activeFeedEntryId: '123',
|
|
133
134
|
open: true,
|
|
134
135
|
},
|
|
@@ -118,8 +118,8 @@ describe('elements/content-sidebar/versions/StaticVersionSidebar', () => {
|
|
|
118
118
|
|
|
119
119
|
render(
|
|
120
120
|
<TestWrapper>
|
|
121
|
-
<StaticVersionSidebar
|
|
122
|
-
{...defaultProps}
|
|
121
|
+
<StaticVersionSidebar
|
|
122
|
+
{...defaultProps}
|
|
123
123
|
parentName="details"
|
|
124
124
|
internalSidebarNavigationHandler={mockNavigationHandler}
|
|
125
125
|
/>
|
|
@@ -191,7 +191,7 @@ describe('elements/content-sidebar/versions/StaticVersionSidebar', () => {
|
|
|
191
191
|
test('should use internalSidebarNavigationHandler when BackButton is clicked', async () => {
|
|
192
192
|
const mockNavigationHandler = jest.fn();
|
|
193
193
|
const user = userEvent();
|
|
194
|
-
|
|
194
|
+
|
|
195
195
|
renderComponentWithoutRouter({
|
|
196
196
|
internalSidebarNavigationHandler: mockNavigationHandler,
|
|
197
197
|
parentName: 'details',
|
|
@@ -218,6 +218,4 @@ describe('elements/content-sidebar/versions/StaticVersionSidebar', () => {
|
|
|
218
218
|
expect(screen.getByTestId('versions-menu')).toBeInTheDocument();
|
|
219
219
|
});
|
|
220
220
|
});
|
|
221
|
-
|
|
222
|
-
|
|
223
221
|
});
|
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`elements/content-preview/PreviewNavigation render() should render correctly with a filled collection 0 1`] = `
|
|
4
|
-
<Router
|
|
5
|
-
history={
|
|
6
|
-
{
|
|
7
|
-
"entries": [
|
|
8
|
-
{},
|
|
9
|
-
],
|
|
10
|
-
"listen": [MockFunction] {
|
|
11
|
-
"calls": [
|
|
12
|
-
[
|
|
13
|
-
[Function],
|
|
14
|
-
],
|
|
15
|
-
[
|
|
16
|
-
[Function],
|
|
17
|
-
],
|
|
18
|
-
],
|
|
19
|
-
"results": [
|
|
20
|
-
{
|
|
21
|
-
"type": "return",
|
|
22
|
-
"value": undefined,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"type": "return",
|
|
26
|
-
"value": undefined,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
"location": {
|
|
31
|
-
"hash": "",
|
|
32
|
-
"pathname": "/activity/tasks/1234",
|
|
33
|
-
},
|
|
34
|
-
"push": [MockFunction],
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
>
|
|
38
|
-
<PreviewNavigation
|
|
39
|
-
collection={
|
|
40
|
-
[
|
|
41
|
-
"a",
|
|
42
|
-
"b",
|
|
43
|
-
"c",
|
|
44
|
-
"d",
|
|
45
|
-
"e",
|
|
46
|
-
"f",
|
|
47
|
-
"g",
|
|
48
|
-
"h",
|
|
49
|
-
"i",
|
|
50
|
-
"j",
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
history={
|
|
54
|
-
{
|
|
55
|
-
"entries": [
|
|
56
|
-
{},
|
|
57
|
-
],
|
|
58
|
-
"listen": [MockFunction] {
|
|
59
|
-
"calls": [
|
|
60
|
-
[
|
|
61
|
-
[Function],
|
|
62
|
-
],
|
|
63
|
-
[
|
|
64
|
-
[Function],
|
|
65
|
-
],
|
|
66
|
-
],
|
|
67
|
-
"results": [
|
|
68
|
-
{
|
|
69
|
-
"type": "return",
|
|
70
|
-
"value": undefined,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"type": "return",
|
|
74
|
-
"value": undefined,
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
"location": {
|
|
79
|
-
"hash": "",
|
|
80
|
-
"pathname": "/activity/tasks/1234",
|
|
81
|
-
},
|
|
82
|
-
"push": [MockFunction],
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
intl={
|
|
86
|
-
{
|
|
87
|
-
"formatMessage": [MockFunction],
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
onNavigateLeft={[Function]}
|
|
91
|
-
onNavigateRight={[Function]}
|
|
92
|
-
/>
|
|
93
|
-
</Router>
|
|
94
|
-
`;
|
|
95
|
-
|
|
96
|
-
exports[`elements/content-preview/PreviewNavigation render() should render correctly with a filled collection 1 1`] = `
|
|
97
|
-
<Router
|
|
98
|
-
history={
|
|
99
|
-
{
|
|
100
|
-
"entries": [
|
|
101
|
-
{},
|
|
102
|
-
],
|
|
103
|
-
"listen": [MockFunction] {
|
|
104
|
-
"calls": [
|
|
105
|
-
[
|
|
106
|
-
[Function],
|
|
107
|
-
],
|
|
108
|
-
[
|
|
109
|
-
[Function],
|
|
110
|
-
],
|
|
111
|
-
],
|
|
112
|
-
"results": [
|
|
113
|
-
{
|
|
114
|
-
"type": "return",
|
|
115
|
-
"value": undefined,
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"type": "return",
|
|
119
|
-
"value": undefined,
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
"location": {
|
|
124
|
-
"hash": "",
|
|
125
|
-
"pathname": "/activity/tasks/1234",
|
|
126
|
-
},
|
|
127
|
-
"push": [MockFunction],
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
>
|
|
131
|
-
<PreviewNavigation
|
|
132
|
-
collection={
|
|
133
|
-
[
|
|
134
|
-
"a",
|
|
135
|
-
"b",
|
|
136
|
-
"c",
|
|
137
|
-
"d",
|
|
138
|
-
"e",
|
|
139
|
-
"f",
|
|
140
|
-
"g",
|
|
141
|
-
"h",
|
|
142
|
-
"i",
|
|
143
|
-
"j",
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
history={
|
|
147
|
-
{
|
|
148
|
-
"entries": [
|
|
149
|
-
{},
|
|
150
|
-
],
|
|
151
|
-
"listen": [MockFunction] {
|
|
152
|
-
"calls": [
|
|
153
|
-
[
|
|
154
|
-
[Function],
|
|
155
|
-
],
|
|
156
|
-
[
|
|
157
|
-
[Function],
|
|
158
|
-
],
|
|
159
|
-
],
|
|
160
|
-
"results": [
|
|
161
|
-
{
|
|
162
|
-
"type": "return",
|
|
163
|
-
"value": undefined,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"type": "return",
|
|
167
|
-
"value": undefined,
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
},
|
|
171
|
-
"location": {
|
|
172
|
-
"hash": "",
|
|
173
|
-
"pathname": "/activity/tasks/1234",
|
|
174
|
-
},
|
|
175
|
-
"push": [MockFunction],
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
intl={
|
|
179
|
-
{
|
|
180
|
-
"formatMessage": [MockFunction],
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
onNavigateLeft={[Function]}
|
|
184
|
-
onNavigateRight={[Function]}
|
|
185
|
-
/>
|
|
186
|
-
</Router>
|
|
187
|
-
`;
|
|
188
|
-
|
|
189
|
-
exports[`elements/content-preview/PreviewNavigation render() should render correctly with a filled collection 9 1`] = `
|
|
190
|
-
<Router
|
|
191
|
-
history={
|
|
192
|
-
{
|
|
193
|
-
"entries": [
|
|
194
|
-
{},
|
|
195
|
-
],
|
|
196
|
-
"listen": [MockFunction] {
|
|
197
|
-
"calls": [
|
|
198
|
-
[
|
|
199
|
-
[Function],
|
|
200
|
-
],
|
|
201
|
-
[
|
|
202
|
-
[Function],
|
|
203
|
-
],
|
|
204
|
-
],
|
|
205
|
-
"results": [
|
|
206
|
-
{
|
|
207
|
-
"type": "return",
|
|
208
|
-
"value": undefined,
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"type": "return",
|
|
212
|
-
"value": undefined,
|
|
213
|
-
},
|
|
214
|
-
],
|
|
215
|
-
},
|
|
216
|
-
"location": {
|
|
217
|
-
"hash": "",
|
|
218
|
-
"pathname": "/activity/tasks/1234",
|
|
219
|
-
},
|
|
220
|
-
"push": [MockFunction],
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
>
|
|
224
|
-
<PreviewNavigation
|
|
225
|
-
collection={
|
|
226
|
-
[
|
|
227
|
-
"a",
|
|
228
|
-
"b",
|
|
229
|
-
"c",
|
|
230
|
-
"d",
|
|
231
|
-
"e",
|
|
232
|
-
"f",
|
|
233
|
-
"g",
|
|
234
|
-
"h",
|
|
235
|
-
"i",
|
|
236
|
-
"j",
|
|
237
|
-
]
|
|
238
|
-
}
|
|
239
|
-
history={
|
|
240
|
-
{
|
|
241
|
-
"entries": [
|
|
242
|
-
{},
|
|
243
|
-
],
|
|
244
|
-
"listen": [MockFunction] {
|
|
245
|
-
"calls": [
|
|
246
|
-
[
|
|
247
|
-
[Function],
|
|
248
|
-
],
|
|
249
|
-
[
|
|
250
|
-
[Function],
|
|
251
|
-
],
|
|
252
|
-
],
|
|
253
|
-
"results": [
|
|
254
|
-
{
|
|
255
|
-
"type": "return",
|
|
256
|
-
"value": undefined,
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"type": "return",
|
|
260
|
-
"value": undefined,
|
|
261
|
-
},
|
|
262
|
-
],
|
|
263
|
-
},
|
|
264
|
-
"location": {
|
|
265
|
-
"hash": "",
|
|
266
|
-
"pathname": "/activity/tasks/1234",
|
|
267
|
-
},
|
|
268
|
-
"push": [MockFunction],
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
intl={
|
|
272
|
-
{
|
|
273
|
-
"formatMessage": [MockFunction],
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
onNavigateLeft={[Function]}
|
|
277
|
-
onNavigateRight={[Function]}
|
|
278
|
-
/>
|
|
279
|
-
</Router>
|
|
280
|
-
`;
|
|
281
|
-
|
|
282
|
-
exports[`elements/content-preview/PreviewNavigation render() should render correctly with an empty collection 1`] = `
|
|
283
|
-
<Router
|
|
284
|
-
history={
|
|
285
|
-
{
|
|
286
|
-
"entries": [
|
|
287
|
-
{},
|
|
288
|
-
],
|
|
289
|
-
"listen": [MockFunction] {
|
|
290
|
-
"calls": [
|
|
291
|
-
[
|
|
292
|
-
[Function],
|
|
293
|
-
],
|
|
294
|
-
[
|
|
295
|
-
[Function],
|
|
296
|
-
],
|
|
297
|
-
],
|
|
298
|
-
"results": [
|
|
299
|
-
{
|
|
300
|
-
"type": "return",
|
|
301
|
-
"value": undefined,
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"type": "return",
|
|
305
|
-
"value": undefined,
|
|
306
|
-
},
|
|
307
|
-
],
|
|
308
|
-
},
|
|
309
|
-
"location": {
|
|
310
|
-
"hash": "",
|
|
311
|
-
"pathname": "/activity/tasks/1234",
|
|
312
|
-
},
|
|
313
|
-
"push": [MockFunction],
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
>
|
|
317
|
-
<PreviewNavigation
|
|
318
|
-
collection={[]}
|
|
319
|
-
currentIndex={0}
|
|
320
|
-
history={
|
|
321
|
-
{
|
|
322
|
-
"entries": [
|
|
323
|
-
{},
|
|
324
|
-
],
|
|
325
|
-
"listen": [MockFunction] {
|
|
326
|
-
"calls": [
|
|
327
|
-
[
|
|
328
|
-
[Function],
|
|
329
|
-
],
|
|
330
|
-
[
|
|
331
|
-
[Function],
|
|
332
|
-
],
|
|
333
|
-
],
|
|
334
|
-
"results": [
|
|
335
|
-
{
|
|
336
|
-
"type": "return",
|
|
337
|
-
"value": undefined,
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
"type": "return",
|
|
341
|
-
"value": undefined,
|
|
342
|
-
},
|
|
343
|
-
],
|
|
344
|
-
},
|
|
345
|
-
"location": {
|
|
346
|
-
"hash": "",
|
|
347
|
-
"pathname": "/activity/tasks/1234",
|
|
348
|
-
},
|
|
349
|
-
"push": [MockFunction],
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
intl={
|
|
353
|
-
{
|
|
354
|
-
"formatMessage": [MockFunction],
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
onNavigateLeft={[Function]}
|
|
358
|
-
onNavigateRight={[Function]}
|
|
359
|
-
/>
|
|
360
|
-
</Router>
|
|
361
|
-
`;
|