box-ui-elements 15.0.0-beta.7 → 15.0.0
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/CONTRIBUTING.md +3 -1
- package/dist/explorer.css +1 -1
- package/dist/explorer.js +58 -26
- package/dist/openwith.css +1 -1
- package/dist/openwith.js +10 -17
- package/dist/picker.css +1 -1
- package/dist/picker.js +12 -19
- package/dist/preview.css +1 -1
- package/dist/preview.js +56 -24
- package/dist/sharing.css +1 -1
- package/dist/sharing.js +54 -22
- package/dist/sidebar.css +1 -1
- package/dist/sidebar.js +56 -24
- package/dist/uploader.css +1 -1
- package/dist/uploader.js +12 -19
- package/es/api/uploads/UploadsReachability.js.flow +2 -2
- package/es/api/uploads/UploadsReachability.js.map +1 -1
- package/es/common/messages.js +4 -0
- package/es/common/messages.js.flow +5 -0
- package/es/common/messages.js.map +1 -1
- package/es/common/types/core.js.flow +2 -0
- package/es/common/types/core.js.map +1 -1
- package/es/components/avatar/UnknownUserAvatar.js +6 -9
- package/es/components/avatar/UnknownUserAvatar.js.map +1 -1
- package/es/components/close-button/CloseButton.js +24 -0
- package/es/components/close-button/CloseButton.js.flow +26 -0
- package/es/components/close-button/CloseButton.js.map +1 -0
- package/es/components/close-button/CloseButton.scss +10 -0
- package/es/components/close-button/CloseButton.stories.js +14 -0
- package/es/components/close-button/CloseButton.stories.js.map +1 -0
- package/es/components/close-button/index.js +2 -0
- package/es/components/close-button/index.js.flow +2 -0
- package/es/components/close-button/index.js.map +1 -0
- package/es/components/date-picker/AccessiblePikaday.js +113 -0
- package/es/components/date-picker/AccessiblePikaday.js.map +1 -0
- package/es/components/date-picker/DatePicker.js +426 -106
- package/es/components/date-picker/DatePicker.js.map +1 -1
- package/es/components/date-picker/DatePicker.scss +32 -22
- package/es/components/date-picker/DatePicker.stories.js +10 -0
- package/es/components/date-picker/DatePicker.stories.js.map +1 -1
- package/es/components/date-picker/_pikaday.scss +8 -2
- package/es/components/flyout/Flyout.js +13 -3
- package/es/components/flyout/Flyout.js.flow +14 -3
- package/es/components/flyout/Flyout.js.map +1 -1
- package/es/components/flyout/Flyout.scss +40 -0
- package/es/components/flyout/FlyoutContext.js +6 -0
- package/es/components/flyout/FlyoutContext.js.flow +9 -0
- package/es/components/flyout/FlyoutContext.js.map +1 -0
- package/es/components/flyout/OverlayHeader.js +33 -0
- package/es/components/flyout/OverlayHeader.js.map +1 -0
- package/es/components/flyout/OverlayHeader.scss +9 -0
- package/es/components/flyout/_variables.scss +1 -0
- package/es/components/flyout/index.js +2 -0
- package/es/components/flyout/index.js.flow +2 -0
- package/es/components/flyout/index.js.map +1 -1
- package/es/components/image-tooltip/ImageTooltip.js +1 -2
- package/es/components/image-tooltip/ImageTooltip.js.map +1 -1
- package/es/components/media-query/constants.js +26 -0
- package/es/components/media-query/constants.js.flow +32 -0
- package/es/components/media-query/constants.js.map +1 -0
- package/es/components/media-query/index.js +3 -0
- package/es/components/media-query/index.js.flow +4 -0
- package/es/components/media-query/index.js.map +1 -0
- package/es/components/media-query/stories/MediaQuery.stories.js +37 -0
- package/es/components/media-query/stories/MediaQuery.stories.js.flow +80 -0
- package/es/components/media-query/stories/MediaQuery.stories.js.map +1 -0
- package/es/components/media-query/types.js +2 -0
- package/es/components/media-query/types.js.flow +29 -0
- package/es/components/media-query/types.js.map +1 -0
- package/es/components/media-query/useMediaQuery.js +91 -0
- package/es/components/media-query/useMediaQuery.js.flow +97 -0
- package/es/components/media-query/useMediaQuery.js.map +1 -0
- package/es/components/media-query/withMediaQuery.js +21 -0
- package/es/components/media-query/withMediaQuery.js.flow +23 -0
- package/es/components/media-query/withMediaQuery.js.map +1 -0
- package/es/components/modal/Modal.scss +27 -0
- package/es/components/preview/previewIcons.js +4 -0
- package/es/components/preview/previewIcons.js.map +1 -1
- package/es/components/search-form/SearchForm.scss +0 -5
- package/es/components/selector-dropdown/SelectorDropdown.js +5 -3
- package/es/components/selector-dropdown/SelectorDropdown.js.flow +3 -3
- package/es/components/selector-dropdown/SelectorDropdown.js.map +1 -1
- package/es/components/tab-view/Tabs.scss +0 -4
- package/es/components/tooltip/Tooltip.js +21 -4
- package/es/components/tooltip/Tooltip.js.map +1 -1
- package/es/constants.js +1 -0
- package/es/constants.js.flow +1 -0
- package/es/constants.js.map +1 -1
- package/es/elements/content-open-with/IconFileMap.js +0 -2
- package/es/elements/content-open-with/IconFileMap.js.flow +0 -2
- package/es/elements/content-open-with/IconFileMap.js.map +1 -1
- package/es/elements/content-sidebar/Sidebar.js +2 -1
- package/es/elements/content-sidebar/Sidebar.js.flow +1 -1
- package/es/elements/content-sidebar/Sidebar.js.map +1 -1
- package/es/elements/content-sidebar/activity-feed/common/delete-confirmation/DeleteConfirmation.scss +3 -3
- package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js +14 -4
- package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.flow +18 -5
- package/es/elements/content-sidebar/activity-feed/task-form/TaskForm.js.map +1 -1
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js +78 -0
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.flow +97 -0
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.map +1 -0
- package/es/elements/content-sidebar/versions/StaticVersionsSidebar.scss +67 -0
- package/es/elements/content-sidebar/versions/VersionsSidebar.js +12 -4
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.flow +16 -3
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsSidebar.scss +5 -0
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js +42 -10
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.flow +42 -7
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.map +1 -1
- package/es/elements/content-sidebar/versions/flowTypes.js.flow +1 -0
- package/es/elements/content-sidebar/versions/messages.js +20 -0
- package/es/elements/content-sidebar/versions/messages.js.flow +28 -0
- package/es/elements/content-sidebar/versions/messages.js.map +1 -1
- package/es/features/classification/constants.js +2 -1
- package/es/features/classification/constants.js.flow +2 -0
- package/es/features/classification/constants.js.map +1 -1
- package/es/features/classification/flowTypes.js +1 -0
- package/es/features/classification/flowTypes.js.flow +7 -1
- package/es/features/classification/flowTypes.js.map +1 -1
- package/es/features/classification/security-controls/SecurityControls.js +3 -4
- package/es/features/classification/security-controls/SecurityControls.js.flow +3 -4
- package/es/features/classification/security-controls/SecurityControls.js.map +1 -1
- package/es/features/classification/security-controls/SecurityControlsItem.js +1 -1
- package/es/features/classification/security-controls/SecurityControlsItem.js.flow +20 -17
- package/es/features/classification/security-controls/SecurityControlsItem.js.map +1 -1
- package/es/features/classification/security-controls/SecurityControlsItem.scss +4 -0
- package/es/features/classification/security-controls/SecurityControlsModal.js +2 -2
- package/es/features/classification/security-controls/SecurityControlsModal.js.flow +2 -2
- package/es/features/classification/security-controls/SecurityControlsModal.js.map +1 -1
- package/es/features/classification/security-controls/messages.js +4 -0
- package/es/features/classification/security-controls/messages.js.flow +5 -0
- package/es/features/classification/security-controls/messages.js.map +1 -1
- package/es/features/classification/security-controls/utils.js +56 -35
- package/es/features/classification/security-controls/utils.js.flow +51 -27
- package/es/features/classification/security-controls/utils.js.map +1 -1
- package/es/features/collapsible-sidebar/CollapsibleSidebar.js +9 -3
- package/es/features/collapsible-sidebar/CollapsibleSidebar.js.flow +13 -5
- package/es/features/collapsible-sidebar/CollapsibleSidebar.js.map +1 -1
- package/es/features/collapsible-sidebar/CollapsibleSidebar.scss +35 -3
- package/es/features/content-explorer/content-explorer/ContentExplorer.scss +1 -1
- package/es/features/content-explorer/item-list/ItemList.js +1 -0
- package/es/features/content-explorer/item-list/ItemList.js.flow +1 -0
- package/es/features/content-explorer/item-list/ItemList.js.map +1 -1
- package/es/features/content-explorer/item-list/ItemListName.js +13 -2
- package/es/features/content-explorer/item-list/ItemListName.js.flow +3 -2
- package/es/features/content-explorer/item-list/ItemListName.js.map +1 -1
- package/es/features/header-flyout/HeaderFlyout.js +8 -10
- package/es/features/header-flyout/HeaderFlyout.js.flow +4 -8
- package/es/features/header-flyout/HeaderFlyout.js.map +1 -1
- package/es/features/header-flyout/styles/HeaderFlyout.scss +54 -15
- package/es/features/header-flyout/styles/_variables.scss +4 -0
- package/es/features/message-center/components/message-center-modal/MessageCenterModal.js +1 -0
- package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.flow +1 -0
- package/es/features/message-center/components/message-center-modal/MessageCenterModal.js.map +1 -1
- package/es/features/presence/PresenceCollaborator.js +90 -0
- package/es/features/presence/PresenceCollaborator.js.flow +81 -0
- package/es/features/presence/PresenceCollaborator.js.map +1 -0
- package/es/features/presence/PresenceCollaborator.scss +28 -0
- package/es/features/presence/PresenceCollaboratorsList.js +9 -57
- package/es/features/presence/PresenceCollaboratorsList.js.flow +7 -58
- package/es/features/presence/PresenceCollaboratorsList.js.map +1 -1
- package/es/features/presence/PresenceCollaboratorsList.scss +8 -35
- package/es/features/quick-search/QuickSearch.js +4 -2
- package/es/features/quick-search/QuickSearch.js.flow +13 -1
- package/es/features/quick-search/QuickSearch.js.map +1 -1
- package/es/features/unified-share-modal/SharedLinkSection.js +9 -20
- package/es/features/unified-share-modal/SharedLinkSection.js.flow +6 -27
- package/es/features/unified-share-modal/SharedLinkSection.js.map +1 -1
- package/es/features/unified-share-modal/UnifiedShareForm.js +95 -53
- package/es/features/unified-share-modal/UnifiedShareForm.js.flow +70 -14
- package/es/features/unified-share-modal/UnifiedShareForm.js.map +1 -1
- package/es/features/unified-share-modal/UnifiedShareModal.scss +3 -0
- package/es/features/unified-share-modal/flowTypes.js.flow +6 -0
- package/es/features/unified-share-modal/flowTypes.js.map +1 -1
- package/es/features/unified-share-modal/messages.js +8 -0
- package/es/features/unified-share-modal/messages.js.flow +10 -0
- package/es/features/unified-share-modal/messages.js.map +1 -1
- package/es/features/unified-share-modal/utils/mergeContacts.js +13 -10
- package/es/features/unified-share-modal/utils/mergeContacts.js.flow +4 -2
- package/es/features/unified-share-modal/utils/mergeContacts.js.map +1 -1
- package/es/icon/content/FileXbd32.js +39 -0
- package/es/icon/content/FileXbd32.js.flow +38 -0
- package/es/icon/content/FileXbd32.js.map +1 -0
- package/es/icon/content/FileXbd32.stories.js +13 -0
- package/es/icon/content/FileXbd32.stories.js.map +1 -0
- package/es/icon/content/FileXdw32.js +39 -0
- package/es/icon/content/FileXdw32.js.flow +38 -0
- package/es/icon/content/FileXdw32.js.map +1 -0
- package/es/icon/content/FileXdw32.stories.js +13 -0
- package/es/icon/content/FileXdw32.stories.js.map +1 -0
- package/es/icon/content/RetentionPolicyModifiable32.js +36 -0
- package/es/icon/content/RetentionPolicyModifiable32.js.flow +31 -0
- package/es/icon/content/RetentionPolicyModifiable32.js.map +1 -0
- package/es/icon/content/RetentionPolicyModifiable32.stories.js +13 -0
- package/es/icon/content/RetentionPolicyModifiable32.stories.js.map +1 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.js +36 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.js.flow +31 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.js.map +1 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.stories.js +13 -0
- package/es/icon/content/RetentionPolicyNonModifiable32.stories.js.map +1 -0
- package/es/icons/avatars/UnknownUserAvatar.js +10 -34
- package/es/icons/avatars/UnknownUserAvatar.js.map +1 -1
- package/es/icons/file-icon/FileIcon.js +8 -2
- package/es/icons/file-icon/FileIcon.js.flow +2 -2
- package/es/icons/file-icon/FileIcon.js.map +1 -1
- package/es/icons/general/IconSearch.js +1 -1
- package/es/icons/general/IconSearch.js.flow +1 -1
- package/es/icons/general/IconSearch.js.map +1 -1
- package/es/icons/general/IconSearchJuicy.js +30 -0
- package/es/icons/general/IconSearchJuicy.js.flow +26 -0
- package/es/icons/general/IconSearchJuicy.js.map +1 -0
- package/es/icons/google-docs/IconGoogle.js +89 -0
- package/es/icons/google-docs/IconGoogle.js.flow +57 -0
- package/es/icons/google-docs/IconGoogle.js.map +1 -0
- package/es/icons/item-icon/ItemIcon.js +4 -0
- package/es/icons/item-icon/ItemIcon.js.map +1 -1
- package/es/icons/microsoft-office/IconOffice.js +80 -0
- package/es/icons/microsoft-office/IconOffice.js.flow +45 -0
- package/es/icons/microsoft-office/IconOffice.js.map +1 -0
- package/es/illustration/EmailVerification140.js +111 -0
- package/es/illustration/EmailVerification140.js.flow +102 -0
- package/es/illustration/EmailVerification140.js.map +1 -0
- package/es/illustration/EmailVerification140.stories.js +13 -0
- package/es/illustration/EmailVerification140.stories.js.map +1 -0
- package/es/src/components/close-button/CloseButton.d.ts +9 -0
- package/es/src/components/close-button/CloseButton.stories.d.ts +9 -0
- package/es/src/components/close-button/__tests__/CloseButton.stories.test.d.ts +0 -0
- package/es/src/components/close-button/__tests__/CloseButton.test.d.ts +1 -0
- package/es/src/components/close-button/index.d.ts +1 -0
- package/es/src/components/date-picker/AccessiblePikaday.d.ts +16 -0
- package/es/src/components/date-picker/DatePicker.d.ts +33 -6
- package/es/src/components/date-picker/DatePicker.stories.d.ts +2 -1
- package/es/src/components/flyout/OverlayHeader.d.ts +10 -0
- package/es/src/components/tooltip/Tooltip.d.ts +4 -3
- package/es/src/icon/content/FileXbd32.d.ts +13 -0
- package/es/src/icon/content/FileXbd32.stories.d.ts +9 -0
- package/es/src/icon/content/FileXdw32.d.ts +13 -0
- package/es/src/icon/content/FileXdw32.stories.d.ts +9 -0
- package/es/src/icon/content/RetentionPolicyModifiable32.d.ts +13 -0
- package/es/src/icon/content/RetentionPolicyModifiable32.stories.d.ts +9 -0
- package/es/src/icon/content/RetentionPolicyNonModifiable32.d.ts +13 -0
- package/es/src/icon/content/RetentionPolicyNonModifiable32.stories.d.ts +9 -0
- package/es/src/icons/avatars/UnknownUserAvatar.d.ts +0 -1
- package/es/src/icons/general/IconSearchJuicy.d.ts +3 -0
- package/es/src/icons/general/__tests__/IconSearchJuicy.test.d.ts +1 -0
- package/es/src/icons/google-docs/IconGoogle.d.ts +12 -0
- package/es/src/icons/google-docs/__tests__/IconGoogle.test.d.ts +1 -0
- package/es/src/icons/item-icon/ItemIcon.d.ts +2 -0
- package/es/src/icons/microsoft-office/IconOffice.d.ts +12 -0
- package/es/src/icons/microsoft-office/__tests__/IconOffice.test.d.ts +1 -0
- package/es/src/illustration/EmailVerification140.d.ts +13 -0
- package/es/src/illustration/EmailVerification140.stories.d.ts +9 -0
- package/es/src/styles/variables.d.ts +9 -0
- package/es/styles/_variables.scss +1 -0
- package/es/styles/common/_forms.scss +6 -0
- package/es/styles/constants/_layout.scss +3 -0
- package/es/styles/constants/_media-queries.scss +15 -0
- package/es/styles/variables.js +18 -0
- package/es/styles/variables.js.flow +10 -1
- package/es/styles/variables.js.map +1 -1
- package/es/utils/Browser.js +12 -0
- package/es/utils/Browser.js.flow +10 -0
- package/es/utils/Browser.js.map +1 -1
- package/es/utils/validators.js +26 -4
- package/es/utils/validators.js.flow +25 -3
- package/es/utils/validators.js.map +1 -1
- package/i18n/bn-IN.js +12 -0
- package/i18n/bn-IN.properties +24 -0
- package/i18n/da-DK.js +12 -0
- package/i18n/da-DK.properties +24 -0
- package/i18n/de-DE.js +12 -0
- package/i18n/de-DE.properties +24 -0
- package/i18n/en-AU.js +12 -0
- package/i18n/en-AU.properties +24 -0
- package/i18n/en-CA.js +12 -0
- package/i18n/en-CA.properties +24 -0
- package/i18n/en-GB.js +12 -0
- package/i18n/en-GB.properties +24 -0
- package/i18n/en-US.js +12 -0
- package/i18n/en-US.properties +24 -0
- package/i18n/en-x-pseudo.js +12 -0
- package/i18n/es-419.js +12 -0
- package/i18n/es-419.properties +24 -0
- package/i18n/es-ES.js +12 -0
- package/i18n/es-ES.properties +24 -0
- package/i18n/fi-FI.js +12 -0
- package/i18n/fi-FI.properties +24 -0
- package/i18n/fr-CA.js +12 -0
- package/i18n/fr-CA.properties +24 -0
- package/i18n/fr-FR.js +12 -0
- package/i18n/fr-FR.properties +24 -0
- package/i18n/hi-IN.js +12 -0
- package/i18n/hi-IN.properties +24 -0
- package/i18n/it-IT.js +12 -0
- package/i18n/it-IT.properties +24 -0
- package/i18n/ja-JP.js +25 -13
- package/i18n/ja-JP.properties +37 -13
- package/i18n/ko-KR.js +12 -0
- package/i18n/ko-KR.properties +24 -0
- package/i18n/nb-NO.js +12 -0
- package/i18n/nb-NO.properties +24 -0
- package/i18n/nl-NL.js +12 -0
- package/i18n/nl-NL.properties +24 -0
- package/i18n/pl-PL.js +12 -0
- package/i18n/pl-PL.properties +24 -0
- package/i18n/pt-BR.js +12 -0
- package/i18n/pt-BR.properties +24 -0
- package/i18n/ru-RU.js +12 -0
- package/i18n/ru-RU.properties +24 -0
- package/i18n/sv-SE.js +12 -0
- package/i18n/sv-SE.properties +24 -0
- package/i18n/tr-TR.js +12 -0
- package/i18n/tr-TR.properties +24 -0
- package/i18n/zh-CN.js +12 -0
- package/i18n/zh-CN.properties +24 -0
- package/i18n/zh-TW.js +12 -0
- package/i18n/zh-TW.properties +24 -0
- package/package.json +8 -5
- package/src/__mocks__/pikaday.js +1 -0
- package/src/api/__tests__/MockOpenWithData.json +2 -25
- package/src/api/uploads/UploadsReachability.js +2 -2
- package/src/common/messages.js +5 -0
- package/src/common/types/core.js +2 -0
- package/src/components/avatar/UnknownUserAvatar.tsx +5 -4
- package/src/components/close-button/CloseButton.js.flow +26 -0
- package/src/components/close-button/CloseButton.scss +10 -0
- package/src/components/close-button/CloseButton.stories.md +1 -0
- package/src/components/close-button/CloseButton.stories.tsx +14 -0
- package/src/components/close-button/CloseButton.tsx +30 -0
- package/src/components/close-button/__tests__/CloseButton.stories.test.tsx +6 -0
- package/src/components/close-button/__tests__/CloseButton.test.tsx +40 -0
- package/src/components/close-button/__tests__/__image_snapshots__/close-button-stories-test-tsx-components-close-button-close-button-looks-visually-correct-when-using-story-components-buttons-closebutton-regular-1-snap.png +0 -0
- package/src/components/close-button/index.js.flow +2 -0
- package/src/components/close-button/index.ts +1 -0
- package/src/components/date-picker/AccessiblePikaday.ts +79 -0
- package/src/components/date-picker/DatePicker.scss +32 -22
- package/src/components/date-picker/DatePicker.stories.tsx +6 -0
- package/src/components/date-picker/DatePicker.tsx +350 -64
- package/src/components/date-picker/__tests__/DatePicker.test.tsx +44 -2
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-allows-editing-in-story-components-datepicker-manually-editable-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-allows-keyboard-selection-in-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-closes-calendar-and-clears-date-for-components-datepicker-basic-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-basic-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-custom-error-tooltip-position-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-disabled-with-error-message-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-manually-editable-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-description-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-limited-date-range-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-looks-visually-correct-when-using-story-components-datepicker-with-range-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-reflects-changes-in-components-datepicker-always-visible-with-custom-input-field-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-shows-calendar-and-date-for-components-datepicker-basic-1-snap.png +0 -0
- package/src/components/date-picker/__tests__/__image_snapshots__/date-picker-stories-test-tsx-components-date-picker-date-picker-shows-limited-range-in-components-datepicker-with-limited-date-range-1-snap.png +0 -0
- package/src/components/date-picker/_pikaday.scss +8 -2
- package/src/components/flyout/Flyout.js +14 -3
- package/src/components/flyout/Flyout.scss +40 -0
- package/src/components/flyout/FlyoutContext.js +9 -0
- package/src/components/flyout/OverlayHeader.scss +9 -0
- package/src/components/flyout/OverlayHeader.tsx +38 -0
- package/src/components/flyout/__tests__/Flyout.test.js +15 -0
- package/src/components/flyout/__tests__/OverlayHeader.test.js +56 -0
- package/src/components/flyout/_variables.scss +1 -0
- package/src/components/flyout/index.js +2 -0
- package/src/components/image-tooltip/ImageTooltip.tsx +1 -2
- package/src/components/media-query/__tests__/useMediaQuery.test.js +48 -0
- package/src/components/media-query/__tests__/withMediaQuery.test.js +29 -0
- package/src/components/media-query/constants.js +32 -0
- package/src/components/media-query/index.js +4 -0
- package/src/components/media-query/stories/MediaQuery.stories.js +80 -0
- package/src/components/media-query/stories/MediaQuery.stories.md +29 -0
- package/src/components/media-query/types.js +29 -0
- package/src/components/media-query/useMediaQuery.js +97 -0
- package/src/components/media-query/withMediaQuery.js +23 -0
- package/src/components/modal/Modal.scss +27 -0
- package/src/components/modal/__tests__/Modal.stories.test.js +10 -0
- package/src/components/modal/__tests__/__image_snapshots__/modal-stories-test-js-components-modal-modal-looks-visually-correct-for-small-screens-when-button-is-clicked-in-story-components-modal-basic-1-snap.png +0 -0
- package/src/components/modal/__tests__/__image_snapshots__/modal-stories-test-js-components-modal-modal-looks-visually-correct-for-small-screens-when-button-is-clicked-in-story-components-modal-with-custom-backdrop-click-handler-1-snap.png +0 -0
- package/src/components/preview/previewIcons.ts +4 -0
- package/src/components/search-form/SearchForm.scss +0 -5
- package/src/components/selector-dropdown/SelectorDropdown.js +3 -3
- package/src/components/selector-dropdown/__tests__/SelectorDropdown.test.js +5 -1
- package/src/components/sidebar-toggle-button/__tests__/__snapshots__/SidebarToggleButton.test.js.snap +0 -8
- package/src/components/tab-view/Tabs.scss +0 -4
- package/src/components/tooltip/Tooltip.tsx +20 -5
- package/src/components/tooltip/__tests__/Tooltip.test.tsx +17 -4
- package/src/components/tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -2
- package/src/constants.js +1 -0
- package/src/elements/content-open-with/IconFileMap.js +0 -2
- package/src/elements/content-open-with/__tests__/ContentOpenWith.test.js +13 -13
- package/src/elements/content-open-with/__tests__/OpenWithButton.test.js +1 -1
- package/src/elements/content-open-with/__tests__/OpenWithDropdownMenu.test.js +1 -5
- package/src/elements/content-open-with/__tests__/OpenWithDropdownMenuItem.test.js +2 -2
- package/src/elements/content-open-with/__tests__/__snapshots__/ContentOpenWith.test.js.snap +5 -5
- package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithButton.test.js.snap +1 -1
- package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenu.test.js.snap +1 -11
- package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenuItem.test.js.snap +4 -3
- package/src/elements/content-sidebar/Sidebar.js +1 -1
- package/src/elements/content-sidebar/__tests__/AddTaskButton.test.js +15 -0
- package/src/elements/content-sidebar/activity-feed/common/delete-confirmation/DeleteConfirmation.scss +3 -3
- package/src/elements/content-sidebar/activity-feed/task-form/TaskForm.js +18 -5
- package/src/elements/content-sidebar/versions/StaticVersionSidebar.js +97 -0
- package/src/elements/content-sidebar/versions/StaticVersionsSidebar.scss +67 -0
- package/src/elements/content-sidebar/versions/VersionsSidebar.js +16 -3
- package/src/elements/content-sidebar/versions/VersionsSidebar.scss +5 -0
- package/src/elements/content-sidebar/versions/VersionsSidebarContainer.js +42 -7
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebar.test.js +18 -1
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebarContainer.test.js +51 -2
- package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebarContainer.test.js.snap +75 -0
- package/src/elements/content-sidebar/versions/flowTypes.js +1 -0
- package/src/elements/content-sidebar/versions/messages.js +28 -0
- package/src/features/classification/constants.js +2 -0
- package/src/features/classification/flowTypes.js +7 -1
- package/src/features/classification/security-controls/SecurityControls.js +3 -4
- package/src/features/classification/security-controls/SecurityControlsItem.js +20 -17
- package/src/features/classification/security-controls/SecurityControlsItem.scss +4 -0
- package/src/features/classification/security-controls/SecurityControlsModal.js +2 -2
- package/src/features/classification/security-controls/__tests__/SecurityControlsItem.test.js +10 -0
- package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControls.test.js.snap +6 -6
- package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControlsItem.test.js.snap +35 -0
- package/src/features/classification/security-controls/__tests__/__snapshots__/SecurityControlsModal.test.js.snap +2 -2
- package/src/features/classification/security-controls/__tests__/__snapshots__/utils.test.js.snap +20 -0
- package/src/features/classification/security-controls/__tests__/utils.test.js +38 -18
- package/src/features/classification/security-controls/messages.js +5 -0
- package/src/features/classification/security-controls/utils.js +51 -27
- package/src/features/collapsible-sidebar/CollapsibleSidebar.js +13 -5
- package/src/features/collapsible-sidebar/CollapsibleSidebar.scss +35 -3
- package/src/features/collapsible-sidebar/__tests__/CollapsibleSidebar.test.js +35 -0
- package/src/features/collapsible-sidebar/__tests__/__snapshots__/CollapsibleSidebar.test.js.snap +1 -0
- package/src/features/content-explorer/content-explorer/ContentExplorer.scss +1 -1
- package/src/features/content-explorer/item-list/ItemList.js +1 -0
- package/src/features/content-explorer/item-list/ItemListName.js +3 -2
- package/src/features/content-explorer/item-list/__tests__/ItemListName.test.js +16 -2
- package/src/features/header-flyout/HeaderFlyout.js +4 -8
- package/src/features/header-flyout/__tests__/__snapshots__/HeaderFlyout.test.js.snap +14 -11
- package/src/features/header-flyout/styles/HeaderFlyout.scss +54 -15
- package/src/features/header-flyout/styles/_variables.scss +4 -0
- package/src/features/message-center/components/message-center-modal/MessageCenterModal.js +1 -0
- package/src/features/metadata-instance-editor/__tests__/__snapshots__/TemplateDropdown.test.js.snap +7 -0
- package/src/features/pagination/__tests__/__snapshots__/MarkerBasedPagination.test.js.snap +0 -8
- package/src/features/pagination/__tests__/__snapshots__/OffsetBasedPagination.test.js.snap +0 -16
- package/src/features/presence/PresenceCollaborator.js +81 -0
- package/src/features/presence/PresenceCollaborator.scss +28 -0
- package/src/features/presence/PresenceCollaboratorsList.js +7 -58
- package/src/features/presence/PresenceCollaboratorsList.scss +8 -35
- package/src/features/presence/__tests__/PresenceCollaborator.test.js +36 -0
- package/src/features/presence/__tests__/PresenceCollaboratorsList.test.js +13 -57
- package/src/features/presence/__tests__/__snapshots__/Presence.test.js.snap +5 -0
- package/src/features/presence/__tests__/__snapshots__/PresenceLink.test.js.snap +3 -0
- package/src/features/query-bar/__tests__/__snapshots__/ColumnButton.test.js.snap +3 -0
- package/src/features/quick-search/QuickSearch.js +13 -1
- package/src/features/quick-search/__tests__/QuickSearch.test.js +17 -0
- package/src/features/unified-share-modal/SharedLinkSection.js +6 -27
- package/src/features/unified-share-modal/UnifiedShareForm.js +70 -14
- package/src/features/unified-share-modal/UnifiedShareModal.scss +3 -0
- package/src/features/unified-share-modal/__tests__/EmailForm.test.js +9 -0
- package/src/features/unified-share-modal/__tests__/SharedLinkSection.test.js +14 -4
- package/src/features/unified-share-modal/__tests__/UnifiedShareForm.test.js +53 -4
- package/src/features/unified-share-modal/__tests__/__snapshots__/SharedLinkSection.test.js.snap +9 -0
- package/src/features/unified-share-modal/__tests__/__snapshots__/UnifiedShareForm.test.js.snap +0 -159
- package/src/features/unified-share-modal/flowTypes.js +6 -0
- package/src/features/unified-share-modal/messages.js +10 -0
- package/src/features/unified-share-modal/utils/__tests__/mergeContacts.test.js +23 -0
- package/src/features/unified-share-modal/utils/mergeContacts.js +4 -2
- package/src/icon/content/FileXbd32.js.flow +38 -0
- package/src/icon/content/FileXbd32.stories.tsx +13 -0
- package/src/icon/content/FileXbd32.tsx +37 -0
- package/src/icon/content/FileXdw32.js.flow +38 -0
- package/src/icon/content/FileXdw32.stories.tsx +13 -0
- package/src/icon/content/FileXdw32.tsx +37 -0
- package/src/icon/content/RetentionPolicyModifiable32.js.flow +31 -0
- package/src/icon/content/RetentionPolicyModifiable32.stories.tsx +14 -0
- package/src/icon/content/RetentionPolicyModifiable32.tsx +29 -0
- package/src/icon/content/RetentionPolicyNonModifiable32.js.flow +31 -0
- package/src/icon/content/RetentionPolicyNonModifiable32.stories.tsx +14 -0
- package/src/icon/content/RetentionPolicyNonModifiable32.tsx +29 -0
- package/src/icons/adobe-sign/README.md +1 -1
- package/src/icons/avatars/UnknownUserAvatar.tsx +7 -15
- package/src/icons/file-icon/FileIcon.js.flow +2 -2
- package/src/icons/file-icon/FileIcon.tsx +8 -2
- package/src/icons/file-icon/__tests__/FileIcon.test.tsx +28 -69
- package/src/icons/file-icon/__tests__/__snapshots__/FileIcon.test.tsx.snap +48 -34
- package/src/icons/general/IconSearch.js.flow +1 -1
- package/src/icons/general/IconSearch.tsx +1 -1
- package/src/icons/general/IconSearchJuicy.js.flow +26 -0
- package/src/icons/general/IconSearchJuicy.tsx +25 -0
- package/src/icons/general/README.md +5 -0
- package/src/icons/general/__tests__/IconSearchJuicy.test.tsx +38 -0
- package/src/icons/google-docs/IconGoogle.js.flow +57 -0
- package/src/icons/google-docs/IconGoogle.tsx +50 -0
- package/src/icons/google-docs/__tests__/IconGoogle.test.tsx +44 -0
- package/src/icons/item-icon/ItemIcon.tsx +4 -0
- package/src/icons/item-icon/__tests__/ItemIcon.test.tsx +47 -115
- package/src/icons/item-icon/__tests__/__snapshots__/ItemIcon.test.tsx.snap +229 -229
- package/src/icons/microsoft-office/IconOffice.js.flow +45 -0
- package/src/icons/microsoft-office/IconOffice.tsx +38 -0
- package/src/icons/microsoft-office/__tests__/IconOffice.test.tsx +44 -0
- package/src/illustration/EmailVerification140.js.flow +102 -0
- package/src/illustration/EmailVerification140.stories.tsx +13 -0
- package/src/illustration/EmailVerification140.tsx +100 -0
- package/src/styles/_variables.scss +1 -0
- package/src/styles/common/_forms.scss +6 -0
- package/src/styles/constants/_layout.scss +3 -0
- package/src/styles/constants/_media-queries.scss +15 -0
- package/src/styles/variables.js +10 -1
- package/src/styles/variables.json +10 -1
- package/src/styles/variables.ts +9 -0
- package/src/utils/Browser.js +10 -0
- package/src/utils/validators.js +25 -3
|
@@ -8,7 +8,7 @@ exports[`elements/content-open-with/ContentOpenWith render() should render the E
|
|
|
8
8
|
id="uniqueId"
|
|
9
9
|
>
|
|
10
10
|
<OpenWithButton
|
|
11
|
-
displayIntegration="
|
|
11
|
+
displayIntegration="ABCD"
|
|
12
12
|
error={null}
|
|
13
13
|
isLoading={true}
|
|
14
14
|
onClick={[Function]}
|
|
@@ -39,7 +39,7 @@ exports[`elements/content-open-with/ContentOpenWith render() should render the O
|
|
|
39
39
|
id="uniqueId"
|
|
40
40
|
>
|
|
41
41
|
<OpenWithButton
|
|
42
|
-
displayIntegration="
|
|
42
|
+
displayIntegration="ABCD"
|
|
43
43
|
error={null}
|
|
44
44
|
isLoading={false}
|
|
45
45
|
onClick={[Function]}
|
|
@@ -75,7 +75,7 @@ exports[`elements/content-open-with/ContentOpenWith render() should render the O
|
|
|
75
75
|
<OpenWithDropdownMenu
|
|
76
76
|
integrations={
|
|
77
77
|
Array [
|
|
78
|
-
"
|
|
78
|
+
"ABCD",
|
|
79
79
|
"Google Suite",
|
|
80
80
|
]
|
|
81
81
|
}
|
|
@@ -95,7 +95,7 @@ exports[`elements/content-open-with/ContentOpenWith render() should render the P
|
|
|
95
95
|
<OpenWithDropdownMenu
|
|
96
96
|
integrations={
|
|
97
97
|
Array [
|
|
98
|
-
"
|
|
98
|
+
"ABCD",
|
|
99
99
|
"Google Suite",
|
|
100
100
|
]
|
|
101
101
|
}
|
|
@@ -118,7 +118,7 @@ exports[`elements/content-open-with/ContentOpenWith render() should render the P
|
|
|
118
118
|
<OpenWithDropdownMenu
|
|
119
119
|
integrations={
|
|
120
120
|
Array [
|
|
121
|
-
"
|
|
121
|
+
"ABCD",
|
|
122
122
|
"Google Suite",
|
|
123
123
|
]
|
|
124
124
|
}
|
package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenu.test.js.snap
CHANGED
|
@@ -16,20 +16,10 @@ exports[`elements/content-open-with/OpenWithDropdownMenu should render a button
|
|
|
16
16
|
integration={
|
|
17
17
|
Object {
|
|
18
18
|
"appIntegrationId": 1,
|
|
19
|
-
"displayName": "Adobe Sign",
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
key="1"
|
|
23
|
-
onClick={[Function]}
|
|
24
|
-
/>
|
|
25
|
-
<OpenWithDropdownMenuItem
|
|
26
|
-
integration={
|
|
27
|
-
Object {
|
|
28
|
-
"appIntegrationId": 2,
|
|
29
19
|
"displayName": "Google Docs",
|
|
30
20
|
}
|
|
31
21
|
}
|
|
32
|
-
key="
|
|
22
|
+
key="1"
|
|
33
23
|
onClick={[Function]}
|
|
34
24
|
/>
|
|
35
25
|
</Menu>
|
package/src/elements/content-open-with/__tests__/__snapshots__/OpenWithDropdownMenuItem.test.js.snap
CHANGED
|
@@ -118,7 +118,8 @@ exports[`elements/content-open-with/OpenWithDropdownMenuItem should render the d
|
|
|
118
118
|
className=""
|
|
119
119
|
onClick={[Function]}
|
|
120
120
|
>
|
|
121
|
-
<
|
|
121
|
+
<IconGoogleDocs
|
|
122
|
+
className=""
|
|
122
123
|
dimension={30}
|
|
123
124
|
height={30}
|
|
124
125
|
width={30}
|
|
@@ -127,12 +128,12 @@ exports[`elements/content-open-with/OpenWithDropdownMenuItem should render the d
|
|
|
127
128
|
<p
|
|
128
129
|
className="bcow-menu-item-title"
|
|
129
130
|
>
|
|
130
|
-
|
|
131
|
+
Google Docs
|
|
131
132
|
</p>
|
|
132
133
|
<p
|
|
133
134
|
className="bcow-menu-item-description"
|
|
134
135
|
>
|
|
135
|
-
Open With
|
|
136
|
+
Open With Google Docs
|
|
136
137
|
</p>
|
|
137
138
|
</span>
|
|
138
139
|
</MenuItem>
|
|
@@ -235,7 +235,7 @@ class Sidebar extends React.Component<Props, State> {
|
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
return (
|
|
238
|
-
<aside id={this.id} className={styleClassName}>
|
|
238
|
+
<aside id={this.id} className={styleClassName} data-testid="preview-sidebar">
|
|
239
239
|
{isLoading ? (
|
|
240
240
|
<div className="bcs-loading">
|
|
241
241
|
<LoadingIndicator />
|
|
@@ -2,6 +2,21 @@ import React from 'react';
|
|
|
2
2
|
import { mount } from 'enzyme';
|
|
3
3
|
import { AddTaskButtonComponent as AddTaskButton } from '../AddTaskButton';
|
|
4
4
|
|
|
5
|
+
jest.mock('../../../components/date-picker/DatePicker', () => props => {
|
|
6
|
+
// only spread `input` attritutes to the input field
|
|
7
|
+
const { name, value = '', className, onChange, placeholder } = props;
|
|
8
|
+
const localInputProps = {
|
|
9
|
+
name,
|
|
10
|
+
value,
|
|
11
|
+
className,
|
|
12
|
+
onChange,
|
|
13
|
+
placeholder,
|
|
14
|
+
};
|
|
15
|
+
return (
|
|
16
|
+
<input type="date" {...localInputProps} {...props.inputProps} /> // eslint-disable-line react/prop-types
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
|
|
5
20
|
describe('elements/content-sidebar/AddTaskButton', () => {
|
|
6
21
|
/*
|
|
7
22
|
1. Pushing the open state into history keeps the sidebar open upon resize and refresh
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
// overrides for confirm/cancel button spacing
|
|
19
|
-
.bcs-DeleteConfirmation-delete,
|
|
20
|
-
.bcs-DeleteConfirmation-cancel {
|
|
19
|
+
.btn.bcs-DeleteConfirmation-delete,
|
|
20
|
+
.btn.bcs-DeleteConfirmation-cancel {
|
|
21
21
|
margin-left: 0;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.bcs-DeleteConfirmation-cancel {
|
|
24
|
+
.btn.bcs-DeleteConfirmation-cancel {
|
|
25
25
|
margin-right: 10px;
|
|
26
26
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import noop from 'lodash/noop';
|
|
8
8
|
import getProp from 'lodash/get';
|
|
9
|
+
import isEmpty from 'lodash/isEmpty';
|
|
9
10
|
import classNames from 'classnames';
|
|
10
11
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
11
12
|
import type { InjectIntlProvidedProps } from 'react-intl';
|
|
@@ -83,6 +84,8 @@ type Props = TaskFormProps & TaskFormConsumerProps & InjectIntlProvidedProps;
|
|
|
83
84
|
|
|
84
85
|
type TaskFormFieldName = 'taskName' | 'taskAssignees' | 'taskDueDate';
|
|
85
86
|
|
|
87
|
+
type TaskFormInvalidSubmitState = { [key: TaskFormFieldName]: ?{ validityState: ?{ patternMismatch: boolean } } };
|
|
88
|
+
|
|
86
89
|
type State = {|
|
|
87
90
|
approverTextInput: string, // partial text input value for approver field before autocomplete/select
|
|
88
91
|
approvers: Array<TaskCollabAssignee>,
|
|
@@ -135,7 +138,7 @@ class TaskForm extends React.Component<Props, State> {
|
|
|
135
138
|
};
|
|
136
139
|
}
|
|
137
140
|
|
|
138
|
-
validateForm = (only?: TaskFormFieldName) => {
|
|
141
|
+
validateForm = (only?: TaskFormFieldName, invalidSubmitValidityState?: ?TaskFormInvalidSubmitState) => {
|
|
139
142
|
this.setState(state => {
|
|
140
143
|
const { intl } = this.props;
|
|
141
144
|
const { approvers, message, approverTextInput } = state;
|
|
@@ -151,12 +154,18 @@ class TaskForm extends React.Component<Props, State> {
|
|
|
151
154
|
code: 'required',
|
|
152
155
|
message: intl.formatMessage(commonMessages.requiredFieldError),
|
|
153
156
|
};
|
|
157
|
+
const taskDueDateError = {
|
|
158
|
+
code: 'invalid',
|
|
159
|
+
message: intl.formatMessage(commonMessages.invalidDateError),
|
|
160
|
+
};
|
|
154
161
|
const formValidityState = {
|
|
155
162
|
taskAssignees:
|
|
156
163
|
(approverTextInput.length ? assigneeFieldInvalidError : null) ||
|
|
157
164
|
(approvers.length ? null : assigneeFieldMissingError),
|
|
158
165
|
taskName: message ? null : messageFieldError,
|
|
159
|
-
taskDueDate:
|
|
166
|
+
taskDueDate: getProp(invalidSubmitValidityState, 'taskDueDate.validityState.patternMismatch')
|
|
167
|
+
? taskDueDateError
|
|
168
|
+
: null,
|
|
160
169
|
};
|
|
161
170
|
const isValid = Object.values(formValidityState).every(val => val == null);
|
|
162
171
|
return {
|
|
@@ -175,8 +184,12 @@ class TaskForm extends React.Component<Props, State> {
|
|
|
175
184
|
|
|
176
185
|
clearForm = () => this.setState(this.getInitialFormState());
|
|
177
186
|
|
|
178
|
-
handleInvalidSubmit = () => {
|
|
179
|
-
|
|
187
|
+
handleInvalidSubmit = (invalidSubmitValidityState?: ?TaskFormInvalidSubmitState) => {
|
|
188
|
+
if (!isEmpty(invalidSubmitValidityState)) {
|
|
189
|
+
this.validateForm(undefined, invalidSubmitValidityState);
|
|
190
|
+
} else {
|
|
191
|
+
this.validateForm();
|
|
192
|
+
}
|
|
180
193
|
};
|
|
181
194
|
|
|
182
195
|
handleSubmitSuccess = () => {
|
|
@@ -273,7 +286,6 @@ class TaskForm extends React.Component<Props, State> {
|
|
|
273
286
|
// Modify date to be the end of day (minus 1 millisecond) for the given due date
|
|
274
287
|
dateValue.setHours(23, 59, 59, 999);
|
|
275
288
|
}
|
|
276
|
-
|
|
277
289
|
this.setState({ dueDate: dateValue });
|
|
278
290
|
this.validateForm('taskDueDate');
|
|
279
291
|
};
|
|
@@ -448,6 +460,7 @@ class TaskForm extends React.Component<Props, State> {
|
|
|
448
460
|
[INTERACTION_TARGET]: ACTIVITY_TARGETS.TASK_DATE_PICKER,
|
|
449
461
|
'data-testid': 'task-form-date-input',
|
|
450
462
|
}}
|
|
463
|
+
isAccessible
|
|
451
464
|
isDisabled={isForbiddenErrorOnEdit}
|
|
452
465
|
isKeyboardInputAllowed
|
|
453
466
|
isRequired={false}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @flow
|
|
3
|
+
* @file Static Versions Sidebar component
|
|
4
|
+
* @author Box
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { FormattedMessage } from 'react-intl';
|
|
9
|
+
|
|
10
|
+
import BoxDrive140 from '../../../illustration/BoxDrive140';
|
|
11
|
+
|
|
12
|
+
import { BackButton } from '../../common/nav-button';
|
|
13
|
+
import PrimaryButton from '../../../components/primary-button';
|
|
14
|
+
import { LoadingIndicatorWrapper } from '../../../components/loading-indicator';
|
|
15
|
+
import VersionsMenu from './VersionsMenu';
|
|
16
|
+
|
|
17
|
+
import messages from './messages';
|
|
18
|
+
|
|
19
|
+
import './StaticVersionsSidebar.scss';
|
|
20
|
+
|
|
21
|
+
type Props = {
|
|
22
|
+
isLoading: boolean,
|
|
23
|
+
onUpgradeClick: () => void,
|
|
24
|
+
parentName: string,
|
|
25
|
+
showUpsellWithPicture: boolean,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const StaticVersionsSidebar = ({ isLoading, onUpgradeClick, parentName, showUpsellWithPicture }: Props): React.Node => {
|
|
29
|
+
const versionTimestamp = new Date();
|
|
30
|
+
versionTimestamp.setDate(versionTimestamp.getDate() - 1);
|
|
31
|
+
|
|
32
|
+
const versions = ['1', '2', '3'].map(versionNumber => {
|
|
33
|
+
return {
|
|
34
|
+
id: versionNumber,
|
|
35
|
+
version_number: versionNumber,
|
|
36
|
+
type: 'file_version',
|
|
37
|
+
permissions: {
|
|
38
|
+
can_preview: true,
|
|
39
|
+
},
|
|
40
|
+
created_at: versionTimestamp.toUTCString(),
|
|
41
|
+
modified_by: null,
|
|
42
|
+
size: 1875887,
|
|
43
|
+
trashed_at: null,
|
|
44
|
+
uploader_display_name: 'John Doe',
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
className="bcs-StaticVersionSidebar"
|
|
51
|
+
role="tabpanel"
|
|
52
|
+
data-resin-component="preview"
|
|
53
|
+
data-resin-feature="versions"
|
|
54
|
+
>
|
|
55
|
+
<div className="bcs-StaticVersionSidebar-header">
|
|
56
|
+
<h3 className="bcs-StaticVersionSidebar-title">
|
|
57
|
+
<>
|
|
58
|
+
<BackButton data-resin-target="back" to={`/${parentName}`} />
|
|
59
|
+
<FormattedMessage {...messages.versionsTitle} />
|
|
60
|
+
</>
|
|
61
|
+
</h3>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div className="bcs-StaticVersionSidebar-content-wrapper">
|
|
65
|
+
<LoadingIndicatorWrapper
|
|
66
|
+
className="bcs-StaticVersionSidebar-content"
|
|
67
|
+
crawlerPosition="top"
|
|
68
|
+
isLoading={isLoading}
|
|
69
|
+
>
|
|
70
|
+
<VersionsMenu versions={versions} fileId="1" versionCount={3} versionLimit={3} />
|
|
71
|
+
</LoadingIndicatorWrapper>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div className="bcs-StaticVersionSidebar-upsell-wrapper">
|
|
75
|
+
<div className="bcs-StaticVersionSidebar-upsell">
|
|
76
|
+
{showUpsellWithPicture && <BoxDrive140 className="bcs-StaticVersionSidebar-upsell-icon" />}
|
|
77
|
+
<p className="bcs-StaticVersionSidebar-upsell-header">
|
|
78
|
+
<FormattedMessage {...messages.versionUpgradeLink} />
|
|
79
|
+
</p>
|
|
80
|
+
<p>
|
|
81
|
+
<FormattedMessage {...messages.versionUpsell} />
|
|
82
|
+
</p>
|
|
83
|
+
<PrimaryButton
|
|
84
|
+
className="bcs-StaticVersionSidebar-upsell-button"
|
|
85
|
+
data-resin-target="versioning_error_upgrade_cta"
|
|
86
|
+
onClick={onUpgradeClick}
|
|
87
|
+
type="button"
|
|
88
|
+
>
|
|
89
|
+
<FormattedMessage {...messages.upgradeButton} />
|
|
90
|
+
</PrimaryButton>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default StaticVersionsSidebar;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@import '../../../styles/variables';
|
|
2
|
+
@import '../../common/variables';
|
|
3
|
+
|
|
4
|
+
.bcs-StaticVersionSidebar {
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 341px; // 1px extra to account for the margin left
|
|
7
|
+
margin-left: -1px; // -1px to make nav button hover not have blank space
|
|
8
|
+
border-left: 1px solid $bdl-gray-10;
|
|
9
|
+
|
|
10
|
+
.bcs-StaticVersionSidebar-header {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
height: 60px;
|
|
14
|
+
margin: 0 25px;
|
|
15
|
+
border-bottom: 1px solid $bdl-gray-10;
|
|
16
|
+
|
|
17
|
+
.bcs-StaticVersionSidebar-title {
|
|
18
|
+
display: flex;
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.bcs-StaticVersionSidebar-content-wrapper {
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: calc(100% - 20px);
|
|
26
|
+
|
|
27
|
+
.bcs-StaticVersionSidebar-content {
|
|
28
|
+
padding-left: 25px;
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
|
|
31
|
+
button[data-resin-iscurrent='true'].bcs-VersionsItemButton {
|
|
32
|
+
width: 100%;
|
|
33
|
+
background-color: $hover-blue-background;
|
|
34
|
+
border: 1px solid $bdl-box-blue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.bcs-StaticVersionSidebar-upsell-wrapper {
|
|
41
|
+
position: relative;
|
|
42
|
+
height: 100%;
|
|
43
|
+
text-align: center;
|
|
44
|
+
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 30%);
|
|
45
|
+
|
|
46
|
+
.bcs-StaticVersionSidebar-upsell {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 30%;
|
|
49
|
+
padding: 48px;
|
|
50
|
+
|
|
51
|
+
.bcs-StaticVersionSidebar-upsell-icon {
|
|
52
|
+
width: 80px;
|
|
53
|
+
height: 80px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.bcs-StaticVersionSidebar-upsell-header {
|
|
57
|
+
margin: 0 0 10px;
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.bcs-StaticVersionSidebar-upsell-button {
|
|
62
|
+
margin-top: -8px;
|
|
63
|
+
padding: 10px 15px;
|
|
64
|
+
border-radius: 5px;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -12,6 +12,7 @@ import messages from './messages';
|
|
|
12
12
|
import SidebarContent from '../SidebarContent';
|
|
13
13
|
import VersionsMenu from './VersionsMenu';
|
|
14
14
|
import { BackButton } from '../../common/nav-button';
|
|
15
|
+
import PlainButton from '../../../components/plain-button/PlainButton';
|
|
15
16
|
import { DEFAULT_FETCH_END } from '../../../constants';
|
|
16
17
|
import { LoadingIndicatorWrapper } from '../../../components/loading-indicator';
|
|
17
18
|
import type { BoxItemVersion } from '../../../common/types/core';
|
|
@@ -21,18 +22,20 @@ const MAX_VERSIONS = DEFAULT_FETCH_END;
|
|
|
21
22
|
|
|
22
23
|
type Props = {
|
|
23
24
|
error?: MessageDescriptor,
|
|
25
|
+
errorTitle?: MessageDescriptor,
|
|
24
26
|
fileId: string,
|
|
25
27
|
isLoading: boolean,
|
|
28
|
+
onUpgradeClick?: () => void,
|
|
26
29
|
parentName: string,
|
|
27
30
|
versionCount: number,
|
|
28
31
|
versionLimit: number,
|
|
29
32
|
versions: Array<BoxItemVersion>,
|
|
30
33
|
};
|
|
31
34
|
|
|
32
|
-
const VersionsSidebar = ({ error, isLoading, parentName, versions, ...rest }: Props) => {
|
|
35
|
+
const VersionsSidebar = ({ error, errorTitle, onUpgradeClick, isLoading, parentName, versions, ...rest }: Props) => {
|
|
33
36
|
const showLimit = versions.length >= MAX_VERSIONS;
|
|
34
37
|
const showVersions = !!versions.length;
|
|
35
|
-
const showEmpty = !isLoading && !showVersions;
|
|
38
|
+
const showEmpty = !isLoading && !showVersions && !onUpgradeClick;
|
|
36
39
|
const showError = !!error;
|
|
37
40
|
|
|
38
41
|
return (
|
|
@@ -49,8 +52,18 @@ const VersionsSidebar = ({ error, isLoading, parentName, versions, ...rest }: Pr
|
|
|
49
52
|
>
|
|
50
53
|
<LoadingIndicatorWrapper className="bcs-Versions-content" crawlerPosition="top" isLoading={isLoading}>
|
|
51
54
|
{showError && (
|
|
52
|
-
<InlineError title={<FormattedMessage {...
|
|
55
|
+
<InlineError title={<FormattedMessage {...errorTitle} />}>
|
|
53
56
|
<FormattedMessage {...error} />
|
|
57
|
+
{onUpgradeClick && (
|
|
58
|
+
<PlainButton
|
|
59
|
+
onClick={onUpgradeClick}
|
|
60
|
+
data-resin-target="versioning_error_error_message_upgrade_cta"
|
|
61
|
+
type="button"
|
|
62
|
+
className="bcs-Versions-upgrade"
|
|
63
|
+
>
|
|
64
|
+
<FormattedMessage {...messages.versionUpgradeLink} />
|
|
65
|
+
</PlainButton>
|
|
66
|
+
)}
|
|
54
67
|
</InlineError>
|
|
55
68
|
)}
|
|
56
69
|
|
|
@@ -15,10 +15,11 @@ import type { MessageDescriptor } from 'react-intl';
|
|
|
15
15
|
import API from '../../../api';
|
|
16
16
|
import messages from './messages';
|
|
17
17
|
import openUrlInsideIframe from '../../../utils/iframe';
|
|
18
|
+
import StaticVersionsSidebar from './StaticVersionSidebar';
|
|
18
19
|
import VersionsSidebar from './VersionsSidebar';
|
|
19
20
|
import VersionsSidebarAPI from './VersionsSidebarAPI';
|
|
20
21
|
import { withAPIContext } from '../../common/api-context';
|
|
21
|
-
import type { VersionActionCallback, VersionChangeCallback } from './flowTypes';
|
|
22
|
+
import type { VersionActionCallback, VersionChangeCallback, SidebarLoadCallback } from './flowTypes';
|
|
22
23
|
import type { BoxItemVersion, BoxItem, FileVersions } from '../../../common/types/core';
|
|
23
24
|
|
|
24
25
|
type Props = {
|
|
@@ -27,6 +28,8 @@ type Props = {
|
|
|
27
28
|
hasSidebarInitialized?: boolean,
|
|
28
29
|
history: RouterHistory,
|
|
29
30
|
match: Match,
|
|
31
|
+
onLoad: SidebarLoadCallback,
|
|
32
|
+
onUpgradeClick?: () => void,
|
|
30
33
|
onVersionChange: VersionChangeCallback,
|
|
31
34
|
onVersionDelete: VersionActionCallback,
|
|
32
35
|
onVersionDownload: VersionActionCallback,
|
|
@@ -35,10 +38,18 @@ type Props = {
|
|
|
35
38
|
onVersionRestore: VersionActionCallback,
|
|
36
39
|
parentName: string,
|
|
37
40
|
versionId?: string,
|
|
41
|
+
versionUpsellExperience: ?string,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const UPSELL_TYPE = {
|
|
45
|
+
STATIC_VERSION_HISTORY: 'STATIC_VERSION_HISTORY',
|
|
46
|
+
STATIC_VERSION_HISTORY_WITH_PICTURE: 'STATIC_VERSION_HISTORY_WITH_PICTURE',
|
|
47
|
+
ERROR_MESSAGE: 'ERROR_MESSAGE',
|
|
38
48
|
};
|
|
39
49
|
|
|
40
50
|
type State = {
|
|
41
51
|
error?: MessageDescriptor,
|
|
52
|
+
errorTitle?: MessageDescriptor,
|
|
42
53
|
isLoading: boolean,
|
|
43
54
|
isWatermarked: boolean,
|
|
44
55
|
versionCount: number,
|
|
@@ -48,6 +59,7 @@ type State = {
|
|
|
48
59
|
|
|
49
60
|
class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
50
61
|
static defaultProps = {
|
|
62
|
+
onLoad: noop,
|
|
51
63
|
onVersionChange: noop,
|
|
52
64
|
onVersionDelete: noop,
|
|
53
65
|
onVersionDownload: noop,
|
|
@@ -72,8 +84,11 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
72
84
|
window: any = window;
|
|
73
85
|
|
|
74
86
|
componentDidMount() {
|
|
87
|
+
const { onLoad, versionUpsellExperience } = this.props;
|
|
75
88
|
this.initialize();
|
|
76
|
-
this.fetchData()
|
|
89
|
+
this.fetchData().then(() => {
|
|
90
|
+
onLoad({ component: 'preview', feature: 'versions', versionUpsellExperience });
|
|
91
|
+
});
|
|
77
92
|
}
|
|
78
93
|
|
|
79
94
|
componentDidUpdate({ fileId: prevFileId, versionId: prevVersionId }: Props) {
|
|
@@ -163,9 +178,13 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
163
178
|
this.mergeResponse(data);
|
|
164
179
|
};
|
|
165
180
|
|
|
166
|
-
handleFetchError = (): void => {
|
|
181
|
+
handleFetchError = (error: Object): void => {
|
|
182
|
+
const { onUpgradeClick } = this.props;
|
|
183
|
+
const shouldShowVersionErrorWithUpsell = !!onUpgradeClick && error.status === 403;
|
|
184
|
+
|
|
167
185
|
this.setState({
|
|
168
|
-
error: messages.versionFetchError,
|
|
186
|
+
error: shouldShowVersionErrorWithUpsell ? messages.versionNotAvailable : messages.versionFetchError,
|
|
187
|
+
errorTitle: shouldShowVersionErrorWithUpsell ? messages.versionAccessError : messages.versionServerError,
|
|
169
188
|
isLoading: false,
|
|
170
189
|
isWatermarked: false,
|
|
171
190
|
versionCount: 0,
|
|
@@ -208,8 +227,8 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
208
227
|
this.api = new VersionsSidebarAPI(this.props);
|
|
209
228
|
};
|
|
210
229
|
|
|
211
|
-
fetchData = ():
|
|
212
|
-
this.api
|
|
230
|
+
fetchData = (): Promise<?[BoxItem, FileVersions]> => {
|
|
231
|
+
return this.api
|
|
213
232
|
.fetchData()
|
|
214
233
|
.then(this.handleFetchSuccess)
|
|
215
234
|
.catch(this.handleFetchError);
|
|
@@ -275,7 +294,22 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
275
294
|
};
|
|
276
295
|
|
|
277
296
|
render() {
|
|
278
|
-
const { fileId, parentName } = this.props;
|
|
297
|
+
const { fileId, parentName, onUpgradeClick, versionUpsellExperience } = this.props;
|
|
298
|
+
|
|
299
|
+
if (
|
|
300
|
+
onUpgradeClick &&
|
|
301
|
+
(versionUpsellExperience === UPSELL_TYPE.STATIC_VERSION_HISTORY ||
|
|
302
|
+
versionUpsellExperience === UPSELL_TYPE.STATIC_VERSION_HISTORY_WITH_PICTURE)
|
|
303
|
+
) {
|
|
304
|
+
return (
|
|
305
|
+
<StaticVersionsSidebar
|
|
306
|
+
onUpgradeClick={onUpgradeClick}
|
|
307
|
+
parentName={parentName}
|
|
308
|
+
showUpsellWithPicture={versionUpsellExperience === UPSELL_TYPE.STATIC_VERSION_HISTORY_WITH_PICTURE}
|
|
309
|
+
{...this.state}
|
|
310
|
+
/>
|
|
311
|
+
);
|
|
312
|
+
}
|
|
279
313
|
|
|
280
314
|
return (
|
|
281
315
|
<VersionsSidebar
|
|
@@ -285,6 +319,7 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
285
319
|
onPreview={this.handleActionPreview}
|
|
286
320
|
onPromote={this.handleActionPromote}
|
|
287
321
|
onRestore={this.handleActionRestore}
|
|
322
|
+
onUpgradeClick={onUpgradeClick}
|
|
288
323
|
parentName={parentName}
|
|
289
324
|
{...this.state}
|
|
290
325
|
/>
|
|
@@ -4,6 +4,7 @@ import InlineError from '../../../../components/inline-error';
|
|
|
4
4
|
import messages from '../messages';
|
|
5
5
|
import VersionsMenu from '../VersionsMenu';
|
|
6
6
|
import VersionsSidebar from '../VersionsSidebar';
|
|
7
|
+
import PlainButton from '../../../../components/plain-button/PlainButton';
|
|
7
8
|
|
|
8
9
|
jest.mock('../../../common/nav-button', () => ({
|
|
9
10
|
BackButton: () => <button type="button">Back</button>,
|
|
@@ -22,12 +23,28 @@ describe('elements/content-sidebar/versions/VersionsSidebar', () => {
|
|
|
22
23
|
});
|
|
23
24
|
|
|
24
25
|
test('should show an inline error if the prop is provided', () => {
|
|
25
|
-
const wrapper = getWrapper({
|
|
26
|
+
const wrapper = getWrapper({
|
|
27
|
+
error: messages.versionFetchError,
|
|
28
|
+
errorTitle: messages.versionServerError,
|
|
29
|
+
versions: [],
|
|
30
|
+
});
|
|
26
31
|
|
|
27
32
|
expect(wrapper.exists(InlineError)).toBe(true);
|
|
28
33
|
expect(wrapper).toMatchSnapshot();
|
|
29
34
|
});
|
|
30
35
|
|
|
36
|
+
test('should show an upsell inline error if the errorUpsell prop is provided', () => {
|
|
37
|
+
const wrapper = getWrapper({
|
|
38
|
+
error: messages.versionNotAvailable,
|
|
39
|
+
errorTitle: messages.versionAccessError,
|
|
40
|
+
onUpgradeClick: () => {},
|
|
41
|
+
versions: [],
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
expect(wrapper.exists(InlineError)).toBe(true);
|
|
45
|
+
expect(wrapper.exists(PlainButton)).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
|
|
31
48
|
test('should show max versions text if max versions provided', () => {
|
|
32
49
|
const versions = Array.from({ length: 1000 }).map((item, index) => ({ id: index }));
|
|
33
50
|
const wrapper = getWrapper({ versions });
|