box-ui-elements 24.0.0-beta.7 → 24.0.0-beta.9
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/openwith.js +1 -1
- package/dist/picker.js +1 -1
- package/dist/preview.js +1 -1
- package/dist/sharing.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/uploader.js +1 -1
- package/es/constants.js +3 -1
- package/es/constants.js.flow +5 -0
- package/es/constants.js.map +1 -1
- package/es/elements/content-explorer/ContentExplorer.js +3 -2
- package/es/elements/content-explorer/ContentExplorer.js.map +1 -1
- package/es/elements/content-explorer/MetadataQueryAPIHelper.js +3 -11
- package/es/elements/content-explorer/MetadataQueryAPIHelper.js.map +1 -1
- package/es/elements/content-explorer/MetadataQueryBuilder.js +13 -23
- package/es/elements/content-explorer/MetadataQueryBuilder.js.map +1 -1
- package/es/elements/content-explorer/constants.js +0 -1
- package/es/elements/content-explorer/constants.js.map +1 -1
- package/es/elements/content-explorer/utils.js +5 -10
- package/es/elements/content-explorer/utils.js.map +1 -1
- package/es/elements/content-open-with/ContentOpenWith.js +3 -2
- package/es/elements/content-open-with/ContentOpenWith.js.flow +2 -0
- package/es/elements/content-open-with/ContentOpenWith.js.map +1 -1
- package/es/elements/content-picker/ContentPicker.js +3 -2
- package/es/elements/content-picker/ContentPicker.js.flow +2 -0
- package/es/elements/content-picker/ContentPicker.js.map +1 -1
- package/es/elements/content-preview/ContentPreview.js +3 -2
- package/es/elements/content-preview/ContentPreview.js.flow +2 -0
- package/es/elements/content-preview/ContentPreview.js.map +1 -1
- package/es/elements/content-sharing/ContentSharing.js +3 -2
- package/es/elements/content-sharing/ContentSharing.js.flow +2 -1
- package/es/elements/content-sharing/ContentSharing.js.map +1 -1
- package/es/elements/content-sidebar/ContentSidebar.js +3 -2
- package/es/elements/content-sidebar/ContentSidebar.js.flow +7 -1
- package/es/elements/content-sidebar/ContentSidebar.js.map +1 -1
- package/es/elements/content-uploader/ContentUploader.js +3 -2
- package/es/elements/content-uploader/ContentUploader.js.map +1 -1
- package/es/elements/wrappers/ES6Wrapper.js +0 -1
- package/es/elements/wrappers/ES6Wrapper.js.flow +0 -3
- package/es/elements/wrappers/ES6Wrapper.js.map +1 -1
- package/es/src/elements/content-explorer/constants.d.ts +0 -1
- package/es/src/elements/content-explorer/utils.d.ts +1 -2
- package/i18n/bn-IN.js +5 -5
- package/i18n/bn-IN.properties +5 -5
- package/i18n/da-DK.js +5 -5
- package/i18n/da-DK.properties +5 -5
- package/i18n/de-DE.js +6 -6
- package/i18n/de-DE.properties +6 -6
- package/i18n/en-AU.js +1 -1
- package/i18n/en-AU.properties +1 -1
- package/i18n/en-GB.js +1 -1
- package/i18n/en-GB.properties +1 -1
- package/i18n/es-419.js +6 -6
- package/i18n/es-419.properties +6 -6
- package/i18n/es-ES.js +6 -6
- package/i18n/es-ES.properties +6 -6
- package/i18n/fi-FI.js +5 -5
- package/i18n/fi-FI.properties +5 -5
- package/i18n/fr-CA.js +5 -5
- package/i18n/fr-CA.properties +5 -5
- package/i18n/fr-FR.js +5 -5
- package/i18n/fr-FR.properties +5 -5
- package/i18n/hi-IN.js +5 -5
- package/i18n/hi-IN.properties +5 -5
- package/i18n/it-IT.js +5 -5
- package/i18n/it-IT.properties +5 -5
- package/i18n/ko-KR.js +5 -5
- package/i18n/ko-KR.properties +5 -5
- package/i18n/nb-NO.js +5 -5
- package/i18n/nb-NO.properties +5 -5
- package/i18n/nl-NL.js +5 -5
- package/i18n/nl-NL.properties +5 -5
- package/i18n/pl-PL.js +5 -5
- package/i18n/pl-PL.properties +5 -5
- package/i18n/pt-BR.js +5 -5
- package/i18n/pt-BR.properties +5 -5
- package/i18n/ru-RU.js +6 -6
- package/i18n/ru-RU.properties +6 -6
- package/i18n/sv-SE.js +5 -5
- package/i18n/sv-SE.properties +5 -5
- package/i18n/tr-TR.js +6 -6
- package/i18n/tr-TR.properties +6 -6
- package/i18n/zh-CN.js +5 -5
- package/i18n/zh-CN.properties +5 -5
- package/i18n/zh-TW.js +5 -5
- package/i18n/zh-TW.properties +5 -5
- package/package.json +3 -3
- package/src/constants.js +5 -0
- package/src/elements/content-explorer/ContentExplorer.tsx +2 -0
- package/src/elements/content-explorer/MetadataQueryAPIHelper.ts +3 -9
- package/src/elements/content-explorer/MetadataQueryBuilder.ts +14 -26
- package/src/elements/content-explorer/__tests__/MetadataQueryAPIHelper.test.ts +41 -14
- package/src/elements/content-explorer/__tests__/MetadataQueryBuilder.test.ts +13 -0
- package/src/elements/content-explorer/constants.ts +0 -2
- package/src/elements/content-explorer/utils.ts +5 -14
- package/src/elements/content-open-with/ContentOpenWith.js +2 -0
- package/src/elements/content-picker/ContentPicker.js +2 -0
- package/src/elements/content-preview/ContentPreview.js +2 -0
- package/src/elements/content-sharing/ContentSharing.js +2 -1
- package/src/elements/content-sidebar/ContentSidebar.js +7 -1
- package/src/elements/content-uploader/ContentUploader.tsx +2 -0
- package/src/elements/wrappers/ES6Wrapper.js +0 -3
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
getSelectFilter,
|
|
7
7
|
getMimeTypeFilter,
|
|
8
8
|
} from '../MetadataQueryBuilder';
|
|
9
|
+
import { getFileExtensions } from '../utils';
|
|
9
10
|
|
|
10
11
|
describe('elements/content-explorer/MetadataQueryBuilder', () => {
|
|
11
12
|
describe('mergeQueryParams', () => {
|
|
@@ -532,4 +533,16 @@ describe('elements/content-explorer/MetadataQueryBuilder', () => {
|
|
|
532
533
|
});
|
|
533
534
|
});
|
|
534
535
|
});
|
|
536
|
+
|
|
537
|
+
describe('getFileExtensions', () => {
|
|
538
|
+
test('should return actual file extensions for single file type', () => {
|
|
539
|
+
const result = getFileExtensions('documentType');
|
|
540
|
+
expect(result).toEqual(['doc', 'docx', 'gdoc', 'rtf', 'txt']);
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
test('should handle empty array input', () => {
|
|
544
|
+
const result = getFileExtensions('');
|
|
545
|
+
expect(result).toEqual([]);
|
|
546
|
+
});
|
|
547
|
+
});
|
|
535
548
|
});
|
|
@@ -45,6 +45,4 @@ export const NON_FOLDER_FILE_TYPES_MAP = new Map([
|
|
|
45
45
|
['threedType', ['obj', 'fbx', 'stl', 'amf', 'iges']],
|
|
46
46
|
]);
|
|
47
47
|
|
|
48
|
-
export const FILE_FOLDER_TYPES_MAP = new Map(NON_FOLDER_FILE_TYPES_MAP).set('folderType', ['folder']);
|
|
49
|
-
|
|
50
48
|
export const NON_FOLDER_FILE_TYPES = Array.from(NON_FOLDER_FILE_TYPES_MAP.keys());
|
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
} from '@box/metadata-editor';
|
|
12
12
|
import type { MetadataFieldType } from '@box/metadata-view';
|
|
13
13
|
import type { Selection } from 'react-aria-components';
|
|
14
|
-
import { BoxItemSelection } from '@box/box-item-type-selector';
|
|
15
14
|
import type { BoxItem, Collection } from '../../common/types/core';
|
|
16
15
|
|
|
17
16
|
import messages from '../common/messages';
|
|
18
|
-
import {
|
|
17
|
+
import { NON_FOLDER_FILE_TYPES_MAP } from './constants';
|
|
19
18
|
|
|
20
19
|
// Specific type for metadata field value in the item
|
|
21
20
|
// Note: Item doesn't have field value in metadata object if that field is not set, so the value will be undefined in this case
|
|
@@ -196,17 +195,9 @@ export function useTemplateInstance(metadataTemplate: MetadataTemplate, selected
|
|
|
196
195
|
};
|
|
197
196
|
}
|
|
198
197
|
|
|
199
|
-
export const
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const areAllNonFolderFileTypesSelected = NON_FOLDER_FILE_TYPES.every(key => selectedFileTypesSet.has(key));
|
|
203
|
-
|
|
204
|
-
if (areAllNonFolderFileTypesSelected) {
|
|
205
|
-
if (selectedFileTypes.includes('folderType')) {
|
|
206
|
-
return [];
|
|
207
|
-
}
|
|
208
|
-
return ['file'];
|
|
198
|
+
export const getFileExtensions = (selectedFileType: string) => {
|
|
199
|
+
if (NON_FOLDER_FILE_TYPES_MAP.has(selectedFileType)) {
|
|
200
|
+
return NON_FOLDER_FILE_TYPES_MAP.get(selectedFileType).flat();
|
|
209
201
|
}
|
|
210
|
-
|
|
211
|
-
return selectedFileTypes.map(fileType => FILE_FOLDER_TYPES_MAP.get(fileType as string) || []).flat();
|
|
202
|
+
return [];
|
|
212
203
|
};
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
BOX_EDIT_INTEGRATION_ID,
|
|
27
27
|
BOX_EDIT_SFC_INTEGRATION_ID,
|
|
28
28
|
CLIENT_NAME_OPEN_WITH,
|
|
29
|
+
CLIENT_VERSION,
|
|
29
30
|
DEFAULT_HOSTNAME_API,
|
|
30
31
|
ERROR_CODE_EXECUTE_INTEGRATION,
|
|
31
32
|
HTTP_GET,
|
|
@@ -138,6 +139,7 @@ class ContentOpenWith extends PureComponent<Props, State> {
|
|
|
138
139
|
requestInterceptor,
|
|
139
140
|
responseInterceptor,
|
|
140
141
|
token,
|
|
142
|
+
version: CLIENT_VERSION,
|
|
141
143
|
});
|
|
142
144
|
|
|
143
145
|
// Clone initial state to allow for state reset on new files
|
|
@@ -30,6 +30,7 @@ import Content from './Content';
|
|
|
30
30
|
import Footer from './Footer';
|
|
31
31
|
import {
|
|
32
32
|
CLIENT_NAME_CONTENT_PICKER,
|
|
33
|
+
CLIENT_VERSION,
|
|
33
34
|
DEFAULT_HOSTNAME_API,
|
|
34
35
|
DEFAULT_HOSTNAME_UPLOAD,
|
|
35
36
|
DEFAULT_PAGE_NUMBER,
|
|
@@ -231,6 +232,7 @@ class ContentPicker extends Component<Props, State> {
|
|
|
231
232
|
sharedLinkPassword,
|
|
232
233
|
token,
|
|
233
234
|
uploadHost,
|
|
235
|
+
version: CLIENT_VERSION,
|
|
234
236
|
});
|
|
235
237
|
|
|
236
238
|
this.id = uniqueid('bcp_');
|
|
@@ -53,6 +53,7 @@ import {
|
|
|
53
53
|
DEFAULT_LOCALE,
|
|
54
54
|
DEFAULT_PATH_STATIC_PREVIEW,
|
|
55
55
|
CLIENT_NAME_CONTENT_PREVIEW,
|
|
56
|
+
CLIENT_VERSION,
|
|
56
57
|
ORIGIN_PREVIEW,
|
|
57
58
|
ORIGIN_CONTENT_PREVIEW,
|
|
58
59
|
ERROR_CODE_UNKNOWN,
|
|
@@ -298,6 +299,7 @@ class ContentPreview extends React.PureComponent<Props, State> {
|
|
|
298
299
|
sharedLink,
|
|
299
300
|
sharedLinkPassword,
|
|
300
301
|
token,
|
|
302
|
+
version: CLIENT_VERSION,
|
|
301
303
|
});
|
|
302
304
|
this.state = {
|
|
303
305
|
...this.initialState,
|
|
@@ -12,7 +12,7 @@ import API from '../../api';
|
|
|
12
12
|
// $FlowFixMe
|
|
13
13
|
import { withBlueprintModernization } from '../common/withBlueprintModernization';
|
|
14
14
|
import SharingModal from './SharingModal';
|
|
15
|
-
import { CLIENT_NAME_CONTENT_SHARING, DEFAULT_HOSTNAME_API } from '../../constants';
|
|
15
|
+
import { CLIENT_NAME_CONTENT_SHARING, CLIENT_VERSION, DEFAULT_HOSTNAME_API } from '../../constants';
|
|
16
16
|
import type { ItemType, StringMap } from '../../common/types/core';
|
|
17
17
|
import type { USMConfig } from '../../features/unified-share-modal/flowTypes';
|
|
18
18
|
|
|
@@ -57,6 +57,7 @@ const createAPI = (apiHost, itemID, itemType, token) =>
|
|
|
57
57
|
clientName: CLIENT_NAME_CONTENT_SHARING,
|
|
58
58
|
id: `${itemType}_${itemID}`,
|
|
59
59
|
token,
|
|
60
|
+
version: CLIENT_VERSION,
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
function ContentSharing({
|
|
@@ -16,7 +16,12 @@ import Internationalize from '../common/Internationalize';
|
|
|
16
16
|
import Sidebar from './Sidebar';
|
|
17
17
|
import NavRouter from '../common/nav-router';
|
|
18
18
|
import SidebarUtils from './SidebarUtils';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
CLIENT_NAME_CONTENT_SIDEBAR,
|
|
21
|
+
CLIENT_VERSION,
|
|
22
|
+
DEFAULT_HOSTNAME_API,
|
|
23
|
+
ORIGIN_CONTENT_SIDEBAR,
|
|
24
|
+
} from '../../constants';
|
|
20
25
|
import { EVENT_JS_READY } from '../common/logger/constants';
|
|
21
26
|
import { mark } from '../../utils/performance';
|
|
22
27
|
import { SIDEBAR_FIELDS_TO_FETCH, SIDEBAR_FIELDS_TO_FETCH_ARCHIVE } from '../../utils/fields';
|
|
@@ -165,6 +170,7 @@ class ContentSidebar extends React.Component<Props, State> {
|
|
|
165
170
|
sharedLink,
|
|
166
171
|
sharedLinkPassword,
|
|
167
172
|
token,
|
|
173
|
+
version: CLIENT_VERSION,
|
|
168
174
|
});
|
|
169
175
|
|
|
170
176
|
/* eslint-disable react/prop-types */
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
DEFAULT_ROOT,
|
|
36
36
|
CLIENT_NAME_CONTENT_UPLOADER,
|
|
37
|
+
CLIENT_VERSION,
|
|
37
38
|
DEFAULT_HOSTNAME_API,
|
|
38
39
|
DEFAULT_HOSTNAME_UPLOAD,
|
|
39
40
|
ERROR_CODE_ITEM_NAME_IN_USE,
|
|
@@ -290,6 +291,7 @@ class ContentUploader extends Component<ContentUploaderProps, State> {
|
|
|
290
291
|
sharedLinkPassword,
|
|
291
292
|
token,
|
|
292
293
|
uploadHost,
|
|
294
|
+
version: CLIENT_VERSION,
|
|
293
295
|
};
|
|
294
296
|
};
|
|
295
297
|
|
|
@@ -10,8 +10,6 @@ import i18n from '../common/i18n';
|
|
|
10
10
|
import { DEFAULT_CONTAINER } from '../../constants';
|
|
11
11
|
import type { Token, StringMap } from '../../common/types/core';
|
|
12
12
|
|
|
13
|
-
declare var __VERSION__: string;
|
|
14
|
-
|
|
15
13
|
class ES6Wrapper extends EventEmitter {
|
|
16
14
|
/**
|
|
17
15
|
* @property {Function}
|
|
@@ -66,7 +64,6 @@ class ES6Wrapper extends EventEmitter {
|
|
|
66
64
|
this.id = id;
|
|
67
65
|
this.token = token;
|
|
68
66
|
this.options = options;
|
|
69
|
-
this.options.version = __VERSION__;
|
|
70
67
|
this.emit = this.emit.bind(this);
|
|
71
68
|
const container = options.container || DEFAULT_CONTAINER;
|
|
72
69
|
this.container =
|