box-ui-elements 19.0.0-beta.21 → 19.0.0-beta.23

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.
Files changed (94) hide show
  1. package/dist/explorer.js +15 -15
  2. package/dist/openwith.js +5 -5
  3. package/dist/picker.js +8 -8
  4. package/dist/preview.js +11 -11
  5. package/dist/sharing.js +5 -5
  6. package/dist/sidebar.js +13 -13
  7. package/dist/uploader.js +4 -4
  8. package/es/api/APIFactory.js +25 -0
  9. package/es/api/APIFactory.js.flow +25 -0
  10. package/es/api/APIFactory.js.map +1 -1
  11. package/es/api/Intelligence.js +60 -0
  12. package/es/api/Intelligence.js.flow +68 -0
  13. package/es/api/Intelligence.js.map +1 -0
  14. package/es/common/types/core.js.flow +1 -0
  15. package/es/common/types/core.js.map +1 -1
  16. package/es/constants.js +2 -0
  17. package/es/constants.js.flow +2 -0
  18. package/es/constants.js.map +1 -1
  19. package/es/elements/common/selectors/version.js +2 -1
  20. package/es/elements/common/selectors/version.js.flow +2 -1
  21. package/es/elements/common/selectors/version.js.map +1 -1
  22. package/es/features/content-answers/ContentAnswersModalError.js +23 -0
  23. package/es/features/content-answers/ContentAnswersModalError.js.map +1 -0
  24. package/es/features/content-answers/ContentAnswersModalError.scss +28 -0
  25. package/es/features/content-answers/messages.js +12 -0
  26. package/es/features/content-answers/messages.js.map +1 -1
  27. package/es/src/features/content-answers/ContentAnswersModalError.d.ts +3 -0
  28. package/es/src/features/content-answers/__tests__/ContentAnswersModalError.test.d.ts +1 -0
  29. package/es/src/features/content-answers/messages.d.ts +15 -0
  30. package/es/utils/fields.js +3 -3
  31. package/es/utils/fields.js.flow +3 -0
  32. package/es/utils/fields.js.map +1 -1
  33. package/i18n/bn-IN.js +5 -2
  34. package/i18n/bn-IN.properties +2 -2
  35. package/i18n/da-DK.js +5 -2
  36. package/i18n/da-DK.properties +2 -2
  37. package/i18n/de-DE.js +5 -2
  38. package/i18n/de-DE.properties +2 -2
  39. package/i18n/en-AU.js +3 -0
  40. package/i18n/en-CA.js +3 -0
  41. package/i18n/en-GB.js +3 -0
  42. package/i18n/en-US.js +3 -0
  43. package/i18n/en-US.properties +6 -0
  44. package/i18n/en-x-pseudo.js +3 -0
  45. package/i18n/es-419.js +5 -2
  46. package/i18n/es-419.properties +2 -2
  47. package/i18n/es-ES.js +5 -2
  48. package/i18n/es-ES.properties +2 -2
  49. package/i18n/fi-FI.js +5 -2
  50. package/i18n/fi-FI.properties +2 -2
  51. package/i18n/fr-CA.js +5 -2
  52. package/i18n/fr-CA.properties +2 -2
  53. package/i18n/fr-FR.js +5 -2
  54. package/i18n/fr-FR.properties +2 -2
  55. package/i18n/hi-IN.js +5 -2
  56. package/i18n/hi-IN.properties +2 -2
  57. package/i18n/it-IT.js +5 -2
  58. package/i18n/it-IT.properties +2 -2
  59. package/i18n/ja-JP.js +3 -0
  60. package/i18n/ko-KR.js +5 -2
  61. package/i18n/ko-KR.properties +2 -2
  62. package/i18n/nb-NO.js +5 -2
  63. package/i18n/nb-NO.properties +2 -2
  64. package/i18n/nl-NL.js +5 -2
  65. package/i18n/nl-NL.properties +2 -2
  66. package/i18n/pl-PL.js +5 -2
  67. package/i18n/pl-PL.properties +2 -2
  68. package/i18n/pt-BR.js +5 -2
  69. package/i18n/pt-BR.properties +2 -2
  70. package/i18n/ru-RU.js +5 -2
  71. package/i18n/ru-RU.properties +2 -2
  72. package/i18n/sv-SE.js +5 -2
  73. package/i18n/sv-SE.properties +2 -2
  74. package/i18n/tr-TR.js +5 -2
  75. package/i18n/tr-TR.properties +2 -2
  76. package/i18n/zh-CN.js +5 -2
  77. package/i18n/zh-CN.properties +2 -2
  78. package/i18n/zh-TW.js +5 -2
  79. package/i18n/zh-TW.properties +2 -2
  80. package/package.json +1 -1
  81. package/src/api/APIFactory.js +25 -0
  82. package/src/api/Intelligence.js +68 -0
  83. package/src/api/__tests__/Intelligence.test.js +67 -0
  84. package/src/common/types/core.js +1 -0
  85. package/src/constants.js +2 -0
  86. package/src/elements/common/selectors/__tests__/version.js +13 -11
  87. package/src/elements/common/selectors/version.js +2 -1
  88. package/src/elements/content-sidebar/versions/__tests__/VersionsItem.test.js +3 -0
  89. package/src/features/content-answers/ContentAnswersModalError.scss +28 -0
  90. package/src/features/content-answers/ContentAnswersModalError.tsx +32 -0
  91. package/src/features/content-answers/__tests__/ContentAnswersModalError.test.tsx +21 -0
  92. package/src/features/content-answers/messages.ts +15 -0
  93. package/src/utils/__tests__/fields.test.js +2 -0
  94. package/src/utils/fields.js +3 -0
@@ -18,6 +18,7 @@ jest.mock('../../../../utils/dom', () => ({
18
18
  describe('elements/content-sidebar/versions/VersionsItem', () => {
19
19
  const defaultDate = new Date('2019-03-01T00:00:00');
20
20
  const defaultUser = { name: 'Test User', id: 10 };
21
+ const promotedByUser = { name: 'Promote User', id: 13 };
21
22
  const restoreDate = new Date('2019-05-01T00:00:00');
22
23
  const restoreUser = { name: 'Restore User', id: 12 };
23
24
  const trashedDate = new Date('2019-04-01T00:00:00');
@@ -117,6 +118,7 @@ describe('elements/content-sidebar/versions/VersionsItem', () => {
117
118
  test.each`
118
119
  versionUser | expected
119
120
  ${defaultUser} | ${defaultUser.name}
121
+ ${promotedByUser} | ${promotedByUser.name}
120
122
  ${restoreUser} | ${restoreUser.name}
121
123
  ${trashedUser} | ${trashedUser.name}
122
124
  ${PLACEHOLDER_USER} | ${unknownUser}
@@ -131,6 +133,7 @@ describe('elements/content-sidebar/versions/VersionsItem', () => {
131
133
  test.each`
132
134
  versionUser | expected
133
135
  ${defaultUser} | ${defaultUser.name}
136
+ ${promotedByUser} | ${promotedByUser.name}
134
137
  ${restoreUser} | ${restoreUser.name}
135
138
  ${trashedUser} | ${trashedUser.name}
136
139
  ${{ ...PLACEHOLDER_USER, name: FILE_REQUEST_NAME }} | ${(<FormattedMessage {...messages.fileRequestDisplayName} />)}
@@ -0,0 +1,28 @@
1
+ @import '../../styles/variables';
2
+
3
+ .bdl-ContentAnswersModalError {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ justify-content: center;
8
+ height: 100%;
9
+ text-align: center;
10
+
11
+ &-illustration {
12
+ margin-block-end: 1.5rem;
13
+ }
14
+
15
+ h2 {
16
+ margin: 0;
17
+ font-weight: bold;
18
+ font-size: 1rem;
19
+ margin-block-end: .75rem;
20
+ }
21
+
22
+ p {
23
+ margin: 0;
24
+ font-weight: normal;
25
+ font-size: .875rem;
26
+ letter-spacing: .01875rem;
27
+ }
28
+ }
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
+ import Unplugged140 from '../../illustration/Unplugged140';
4
+
5
+ import messages from './messages';
6
+
7
+ import './ContentAnswersModalError.scss';
8
+
9
+ const ContentAnswersModalError = () => {
10
+ return (
11
+ <div className="bdl-ContentAnswersModalError">
12
+ <div
13
+ className="bdl-ContentAnswersModalError-illustration"
14
+ data-testid="content-answers-modal-error-illustration"
15
+ >
16
+ <Unplugged140 />
17
+ </div>
18
+
19
+ <h2 data-testid="content-answers-modal-error-heading">
20
+ <FormattedMessage {...messages.intelligenceUnavailableHeading} />
21
+ </h2>
22
+ <p data-testid="content-answers-modal-error-description">
23
+ <FormattedMessage {...messages.intelligenceUnavailableDescription} />
24
+ </p>
25
+ <p data-testid="content-answers-modal-error-tryagain">
26
+ <FormattedMessage {...messages.intelligenceUnavailableTryAgain} />
27
+ </p>
28
+ </div>
29
+ );
30
+ };
31
+
32
+ export default ContentAnswersModalError;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+
4
+ import ContentAnswersModalError from '../ContentAnswersModalError';
5
+
6
+ describe('features/content-answers/ContentAnswersModalError', () => {
7
+ const renderComponent = (props?: {}) => render(<ContentAnswersModalError {...props} />);
8
+
9
+ test('should render', () => {
10
+ renderComponent();
11
+
12
+ const illustration = screen.getByTestId('content-answers-modal-error-illustration');
13
+ expect(illustration).toBeInTheDocument();
14
+ const heading = screen.getByTestId('content-answers-modal-error-heading');
15
+ expect(heading).toBeInTheDocument();
16
+ const description = screen.getByTestId('content-answers-modal-error-description');
17
+ expect(description).toBeInTheDocument();
18
+ const tryagain = screen.getByTestId('content-answers-modal-error-tryagain');
19
+ expect(tryagain).toBeInTheDocument();
20
+ });
21
+ });
@@ -32,6 +32,21 @@ const messages = defineMessages({
32
32
  'Disabled tooltip message for Content Answers entry point button when the file type is not supported',
33
33
  id: 'boxui.contentAnswers.disabledTooltipFileNotCompatible',
34
34
  },
35
+ intelligenceUnavailableDescription: {
36
+ defaultMessage: 'The Box AI service is not responding.',
37
+ description: 'Box AI Q&A service unavailable error description',
38
+ id: 'boxui.contentAnswers.intelligenceUnavailableDescription',
39
+ },
40
+ intelligenceUnavailableHeading: {
41
+ defaultMessage: 'Box AI is unavailable',
42
+ description: 'Box AI Q&A service unavailable error title',
43
+ id: 'boxui.contentAnswers.intelligenceUnavailableHeading',
44
+ },
45
+ intelligenceUnavailableTryAgain: {
46
+ defaultMessage: 'Please try again later.',
47
+ description: 'Box AI Q&A service unavailable error try again later description',
48
+ id: 'boxui.contentAnswers.intelligenceUnavailableTryAgain',
49
+ },
35
50
  maxCharactersReachedError: {
36
51
  defaultMessage: 'Maximum of {characterLimit} characters reached',
37
52
  description: 'Error tooltip to show inside text area if the user reached the character limit',
@@ -19,6 +19,7 @@ import {
19
19
  FIELD_PARENT,
20
20
  FIELD_EXTENSION,
21
21
  FIELD_PERMISSIONS,
22
+ FIELD_PROMOTED_BY,
22
23
  FIELD_ITEM_COLLECTION,
23
24
  FIELD_ITEM_EXPIRATION,
24
25
  FIELD_PATH_COLLECTION,
@@ -169,6 +170,7 @@ describe('util/fields', () => {
169
170
  FIELD_MODIFIED_BY,
170
171
  FIELD_NAME,
171
172
  FIELD_PERMISSIONS,
173
+ FIELD_PROMOTED_BY,
172
174
  FIELD_RESTORED_AT,
173
175
  FIELD_RESTORED_BY,
174
176
  FIELD_RETENTION,
@@ -28,6 +28,7 @@ import {
28
28
  FIELD_CREATED_BY,
29
29
  FIELD_MODIFIED_BY,
30
30
  FIELD_OWNED_BY,
31
+ FIELD_PROMOTED_BY,
31
32
  FIELD_RESTORED_BY,
32
33
  FIELD_TRASHED_BY,
33
34
  FIELD_DESCRIPTION,
@@ -150,6 +151,7 @@ const FILE_VERSION_FIELDS_TO_FETCH = [
150
151
  FIELD_MODIFIED_BY,
151
152
  FIELD_RESTORED_FROM,
152
153
  FIELD_SIZE,
154
+ FIELD_PROMOTED_BY,
153
155
  FIELD_UPLOADER_DISPLAY_NAME,
154
156
  FIELD_VERSION_NUMBER,
155
157
  ];
@@ -164,6 +166,7 @@ const FILE_VERSIONS_FIELDS_TO_FETCH = [
164
166
  FIELD_MODIFIED_BY,
165
167
  FIELD_NAME,
166
168
  FIELD_PERMISSIONS, // Expensive field to fetch
169
+ FIELD_PROMOTED_BY,
167
170
  FIELD_RESTORED_AT,
168
171
  FIELD_RESTORED_BY,
169
172
  FIELD_RETENTION, // Expensive field to fetch