box-ui-elements 15.1.0-beta.10 → 15.1.0-beta.13
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/DEVELOPING.md +1 -1
- package/dist/explorer.css +1 -1
- package/dist/explorer.js +13 -13
- package/dist/openwith.js +3 -3
- package/dist/picker.js +6 -6
- package/dist/preview.css +1 -1
- package/dist/preview.js +15 -15
- package/dist/sharing.js +5 -5
- package/dist/sidebar.css +1 -1
- package/dist/sidebar.js +16 -16
- package/dist/uploader.js +4 -4
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js +2 -3
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.flow +2 -3
- package/es/elements/content-sidebar/versions/StaticVersionSidebar.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsSidebar.js +4 -12
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.flow +3 -16
- package/es/elements/content-sidebar/versions/VersionsSidebar.js.map +1 -1
- package/es/elements/content-sidebar/versions/VersionsSidebar.scss +0 -5
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js +13 -28
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.flow +8 -32
- package/es/elements/content-sidebar/versions/VersionsSidebarContainer.js.map +1 -1
- package/es/elements/content-sidebar/versions/messages.js +0 -4
- package/es/elements/content-sidebar/versions/messages.js.flow +0 -5
- package/es/elements/content-sidebar/versions/messages.js.map +1 -1
- package/es/features/unified-share-modal/UnifiedShareForm.js +1 -3
- package/es/features/unified-share-modal/UnifiedShareForm.js.flow +16 -20
- package/es/features/unified-share-modal/UnifiedShareForm.js.map +1 -1
- package/es/features/unified-share-modal/flowTypes.js.flow +0 -2
- package/es/features/unified-share-modal/flowTypes.js.map +1 -1
- package/i18n/bn-IN.js +0 -1
- package/i18n/bn-IN.properties +0 -2
- package/i18n/da-DK.js +0 -1
- package/i18n/da-DK.properties +0 -2
- package/i18n/de-DE.js +0 -1
- package/i18n/de-DE.properties +0 -2
- package/i18n/en-AU.js +0 -1
- package/i18n/en-AU.properties +0 -2
- package/i18n/en-CA.js +0 -1
- package/i18n/en-CA.properties +0 -2
- package/i18n/en-GB.js +0 -1
- package/i18n/en-GB.properties +0 -2
- package/i18n/en-US.js +0 -1
- package/i18n/en-US.properties +0 -2
- package/i18n/en-x-pseudo.js +842 -843
- package/i18n/en-x-pseudo.properties +853 -831
- package/i18n/es-419.js +0 -1
- package/i18n/es-419.properties +0 -2
- package/i18n/es-ES.js +0 -1
- package/i18n/es-ES.properties +0 -2
- package/i18n/fi-FI.js +0 -1
- package/i18n/fi-FI.properties +0 -2
- package/i18n/fr-CA.js +0 -1
- package/i18n/fr-CA.properties +0 -2
- package/i18n/fr-FR.js +0 -1
- package/i18n/fr-FR.properties +0 -2
- package/i18n/hi-IN.js +0 -1
- package/i18n/hi-IN.properties +0 -2
- package/i18n/it-IT.js +0 -1
- package/i18n/it-IT.properties +0 -2
- package/i18n/ja-JP.js +0 -1
- package/i18n/ja-JP.properties +0 -2
- package/i18n/ko-KR.js +0 -1
- package/i18n/ko-KR.properties +0 -2
- package/i18n/nb-NO.js +0 -1
- package/i18n/nb-NO.properties +0 -2
- package/i18n/nl-NL.js +0 -1
- package/i18n/nl-NL.properties +0 -2
- package/i18n/pl-PL.js +0 -1
- package/i18n/pl-PL.properties +0 -2
- package/i18n/pt-BR.js +0 -1
- package/i18n/pt-BR.properties +0 -2
- package/i18n/ru-RU.js +0 -1
- package/i18n/ru-RU.properties +0 -2
- package/i18n/sv-SE.js +0 -1
- package/i18n/sv-SE.properties +0 -2
- package/i18n/tr-TR.js +0 -1
- package/i18n/tr-TR.properties +0 -2
- package/i18n/zh-CN.js +0 -1
- package/i18n/zh-CN.properties +0 -2
- package/i18n/zh-TW.js +0 -1
- package/i18n/zh-TW.properties +0 -2
- package/package.json +2 -2
- package/src/elements/content-sidebar/versions/StaticVersionSidebar.js +2 -3
- package/src/elements/content-sidebar/versions/VersionsSidebar.js +3 -16
- package/src/elements/content-sidebar/versions/VersionsSidebar.scss +0 -5
- package/src/elements/content-sidebar/versions/VersionsSidebarContainer.js +8 -32
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebar.test.js +1 -18
- package/src/elements/content-sidebar/versions/__tests__/VersionsSidebarContainer.test.js +1 -26
- package/src/elements/content-sidebar/versions/__tests__/__snapshots__/VersionsSidebarContainer.test.js.snap +13 -47
- package/src/elements/content-sidebar/versions/messages.js +0 -5
- package/src/features/unified-share-modal/UnifiedShareForm.js +16 -20
- package/src/features/unified-share-modal/__tests__/UnifiedShareForm.test.js +0 -12
- package/src/features/unified-share-modal/flowTypes.js +0 -2
|
@@ -16,8 +16,7 @@ import './StaticVersionsSidebar.scss';
|
|
|
16
16
|
var StaticVersionsSidebar = function StaticVersionsSidebar(_ref) {
|
|
17
17
|
var isLoading = _ref.isLoading,
|
|
18
18
|
onUpgradeClick = _ref.onUpgradeClick,
|
|
19
|
-
parentName = _ref.parentName
|
|
20
|
-
showUpsellWithPicture = _ref.showUpsellWithPicture;
|
|
19
|
+
parentName = _ref.parentName;
|
|
21
20
|
var versionTimestamp = new Date();
|
|
22
21
|
versionTimestamp.setDate(versionTimestamp.getDate() - 1);
|
|
23
22
|
var versions = ['1', '2', '3'].map(function (versionNumber) {
|
|
@@ -62,7 +61,7 @@ var StaticVersionsSidebar = function StaticVersionsSidebar(_ref) {
|
|
|
62
61
|
className: "bcs-StaticVersionSidebar-upsell-wrapper"
|
|
63
62
|
}, React.createElement("div", {
|
|
64
63
|
className: "bcs-StaticVersionSidebar-upsell"
|
|
65
|
-
},
|
|
64
|
+
}, React.createElement(BoxDrive140, {
|
|
66
65
|
className: "bcs-StaticVersionSidebar-upsell-icon"
|
|
67
66
|
}), React.createElement("p", {
|
|
68
67
|
className: "bcs-StaticVersionSidebar-upsell-header"
|
|
@@ -22,10 +22,9 @@ type Props = {
|
|
|
22
22
|
isLoading: boolean,
|
|
23
23
|
onUpgradeClick: () => void,
|
|
24
24
|
parentName: string,
|
|
25
|
-
showUpsellWithPicture: boolean,
|
|
26
25
|
};
|
|
27
26
|
|
|
28
|
-
const StaticVersionsSidebar = ({ isLoading, onUpgradeClick, parentName
|
|
27
|
+
const StaticVersionsSidebar = ({ isLoading, onUpgradeClick, parentName }: Props): React.Node => {
|
|
29
28
|
const versionTimestamp = new Date();
|
|
30
29
|
versionTimestamp.setDate(versionTimestamp.getDate() - 1);
|
|
31
30
|
|
|
@@ -73,7 +72,7 @@ const StaticVersionsSidebar = ({ isLoading, onUpgradeClick, parentName, showUpse
|
|
|
73
72
|
|
|
74
73
|
<div className="bcs-StaticVersionSidebar-upsell-wrapper">
|
|
75
74
|
<div className="bcs-StaticVersionSidebar-upsell">
|
|
76
|
-
|
|
75
|
+
<BoxDrive140 className="bcs-StaticVersionSidebar-upsell-icon" />
|
|
77
76
|
<p className="bcs-StaticVersionSidebar-upsell-header">
|
|
78
77
|
<FormattedMessage {...messages.versionUpgradeLink} />
|
|
79
78
|
</p>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/StaticVersionSidebar.js"],"names":["React","FormattedMessage","BoxDrive140","BackButton","PrimaryButton","LoadingIndicatorWrapper","VersionsMenu","messages","StaticVersionsSidebar","isLoading","onUpgradeClick","parentName","
|
|
1
|
+
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/StaticVersionSidebar.js"],"names":["React","FormattedMessage","BoxDrive140","BackButton","PrimaryButton","LoadingIndicatorWrapper","VersionsMenu","messages","StaticVersionsSidebar","isLoading","onUpgradeClick","parentName","versionTimestamp","Date","setDate","getDate","versions","map","versionNumber","id","version_number","type","permissions","can_preview","created_at","toUTCString","modified_by","size","trashed_at","uploader_display_name","versionsTitle","versionUpgradeLink","versionUpsell","upgradeButton"],"mappings":"AAAA;;;;;AAMA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAEA,OAAOC,WAAP,MAAwB,mCAAxB;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AvC,IADJ,EAEI,oBAAC,gBAAD,EAAsBJ,QAAQ,CAACuB,aAA/B,CAFJ,CADJ,CADJ,CANJ,EAeI;AAAK,IAAA,SAAS,EAAC;AAAf,KACI,oBAAC,uBAAD;AACI,IAAA,SAAS,EAAC,kCADd;AAEI,IAAA,eAAe,EAAC,KAFpB;AAGI,IAAA,SAAS,EAAErB;AAHf,KAKI,oBAAC,YAAD;AAAc,IAAA,QAAQ,EAAEO,QAAxB;AAAkC,IAAA,MAAM,EAAC,GAAzC;AAA6C,IAAA,YAAY,EAAE,CAA3D;AAA8D,IAAA,YAAY,EAAE;AAA5E,IALJ,CADJ,CAfJ,EAyBI;AAAK,IAAA,SAAS,EAAC;AAAf,KACI;AAAK,IAAA,SAAS,EAAC;AAAf,KACI,oBAAC,WAAD;AAAa,IAAA,SAAS,EAAC;AAAvB,IADJ,EAEI;AAAG,IAAA,SAAS,EAAC;AAAb,KACI,oBAAC,gBAAD,EAAsBT,QAAQ,CAACwB,kBAA/B,CADJ,CAFJ,EAKI,+BACI,oBAAC,gBAAD,EAAsBxB,QAAQ,CAACyB,aAA/B,CADJ,CALJ,EAQI,oBAAC,aAAD;AACI,IAAA,SAAS,EAAC,wCADd;AAEI,yBAAkB,8BAFtB;AAGI,IAAA,OAAO,EAAEtB,cAHb;AAII,IAAA,IAAI,EAAC;AAJT,KAMI,oBAAC,gBAAD,EAAsBH,QAAQ,CAAC0B,aAA/B,CANJ,CARJ,CADJ,CAzBJ,CADJ;AA+CH,CAnED;;AAqEA,eAAezB,qBAAf","sourcesContent":["/**\n * @flow\n * @file Static Versions Sidebar component\n * @author Box\n */\n\nimport * as React from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nimport BoxDrive140 from '../../../illustration/BoxDrive140';\n\nimport { BackButton } from '../../common/nav-button';\nimport PrimaryButton from '../../../components/primary-button';\nimport { LoadingIndicatorWrapper } from '../../../components/loading-indicator';\nimport VersionsMenu from './VersionsMenu';\n\nimport messages from './messages';\n\nimport './StaticVersionsSidebar.scss';\n\ntype Props = {\n isLoading: boolean,\n onUpgradeClick: () => void,\n parentName: string,\n};\n\nconst StaticVersionsSidebar = ({ isLoading, onUpgradeClick, parentName }: Props): React.Node => {\n const versionTimestamp = new Date();\n versionTimestamp.setDate(versionTimestamp.getDate() - 1);\n\n const versions = ['1', '2', '3'].map(versionNumber => {\n return {\n id: versionNumber,\n version_number: versionNumber,\n type: 'file_version',\n permissions: {\n can_preview: true,\n },\n created_at: versionTimestamp.toUTCString(),\n modified_by: null,\n size: 1875887,\n trashed_at: null,\n uploader_display_name: 'John Doe',\n };\n });\n\n return (\n <div\n className=\"bcs-StaticVersionSidebar\"\n role=\"tabpanel\"\n data-resin-component=\"preview\"\n data-resin-feature=\"versions\"\n >\n <div className=\"bcs-StaticVersionSidebar-header\">\n <h3 className=\"bcs-StaticVersionSidebar-title\">\n <>\n <BackButton data-resin-target=\"back\" to={`/${parentName}`} />\n <FormattedMessage {...messages.versionsTitle} />\n </>\n </h3>\n </div>\n\n <div className=\"bcs-StaticVersionSidebar-content-wrapper\">\n <LoadingIndicatorWrapper\n className=\"bcs-StaticVersionSidebar-content\"\n crawlerPosition=\"top\"\n isLoading={isLoading}\n >\n <VersionsMenu versions={versions} fileId=\"1\" versionCount={3} versionLimit={3} />\n </LoadingIndicatorWrapper>\n </div>\n\n <div className=\"bcs-StaticVersionSidebar-upsell-wrapper\">\n <div className=\"bcs-StaticVersionSidebar-upsell\">\n <BoxDrive140 className=\"bcs-StaticVersionSidebar-upsell-icon\" />\n <p className=\"bcs-StaticVersionSidebar-upsell-header\">\n <FormattedMessage {...messages.versionUpgradeLink} />\n </p>\n <p>\n <FormattedMessage {...messages.versionUpsell} />\n </p>\n <PrimaryButton\n className=\"bcs-StaticVersionSidebar-upsell-button\"\n data-resin-target=\"versioning_error_upgrade_cta\"\n onClick={onUpgradeClick}\n type=\"button\"\n >\n <FormattedMessage {...messages.upgradeButton} />\n </PrimaryButton>\n </div>\n </div>\n </div>\n );\n};\n\nexport default StaticVersionsSidebar;\n"],"file":"StaticVersionSidebar.js"}
|
|
@@ -16,7 +16,6 @@ import messages from './messages';
|
|
|
16
16
|
import SidebarContent from '../SidebarContent';
|
|
17
17
|
import VersionsMenu from './VersionsMenu';
|
|
18
18
|
import { BackButton } from '../../common/nav-button';
|
|
19
|
-
import PlainButton from '../../../components/plain-button/PlainButton';
|
|
20
19
|
import { DEFAULT_FETCH_END } from '../../../constants';
|
|
21
20
|
import { LoadingIndicatorWrapper } from '../../../components/loading-indicator';
|
|
22
21
|
import './VersionsSidebar.scss';
|
|
@@ -24,16 +23,14 @@ var MAX_VERSIONS = DEFAULT_FETCH_END;
|
|
|
24
23
|
|
|
25
24
|
var VersionsSidebar = function VersionsSidebar(_ref) {
|
|
26
25
|
var error = _ref.error,
|
|
27
|
-
errorTitle = _ref.errorTitle,
|
|
28
|
-
onUpgradeClick = _ref.onUpgradeClick,
|
|
29
26
|
isLoading = _ref.isLoading,
|
|
30
27
|
parentName = _ref.parentName,
|
|
31
28
|
versions = _ref.versions,
|
|
32
|
-
rest = _objectWithoutProperties(_ref, ["error", "
|
|
29
|
+
rest = _objectWithoutProperties(_ref, ["error", "isLoading", "parentName", "versions"]);
|
|
33
30
|
|
|
34
31
|
var showLimit = versions.length >= MAX_VERSIONS;
|
|
35
32
|
var showVersions = !!versions.length;
|
|
36
|
-
var showEmpty = !isLoading && !showVersions
|
|
33
|
+
var showEmpty = !isLoading && !showVersions;
|
|
37
34
|
var showError = !!error;
|
|
38
35
|
return React.createElement(SidebarContent, {
|
|
39
36
|
className: "bcs-Versions",
|
|
@@ -48,13 +45,8 @@ var VersionsSidebar = function VersionsSidebar(_ref) {
|
|
|
48
45
|
crawlerPosition: "top",
|
|
49
46
|
isLoading: isLoading
|
|
50
47
|
}, showError && React.createElement(InlineError, {
|
|
51
|
-
title: React.createElement(FormattedMessage,
|
|
52
|
-
}, React.createElement(FormattedMessage, error),
|
|
53
|
-
onClick: onUpgradeClick,
|
|
54
|
-
"data-resin-target": "versioning_error_error_message_upgrade_cta",
|
|
55
|
-
type: "button",
|
|
56
|
-
className: "bcs-Versions-upgrade"
|
|
57
|
-
}, React.createElement(FormattedMessage, messages.versionUpgradeLink))), showEmpty && React.createElement("div", {
|
|
48
|
+
title: React.createElement(FormattedMessage, messages.versionServerError)
|
|
49
|
+
}, React.createElement(FormattedMessage, error)), showEmpty && React.createElement("div", {
|
|
58
50
|
className: "bcs-Versions-empty"
|
|
59
51
|
}, React.createElement(FormattedMessage, messages.versionsEmpty)), showVersions && React.createElement("div", {
|
|
60
52
|
className: "bcs-Versions-menu"
|
|
@@ -12,7 +12,6 @@ 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';
|
|
16
15
|
import { DEFAULT_FETCH_END } from '../../../constants';
|
|
17
16
|
import { LoadingIndicatorWrapper } from '../../../components/loading-indicator';
|
|
18
17
|
import type { BoxItemVersion } from '../../../common/types/core';
|
|
@@ -22,20 +21,18 @@ const MAX_VERSIONS = DEFAULT_FETCH_END;
|
|
|
22
21
|
|
|
23
22
|
type Props = {
|
|
24
23
|
error?: MessageDescriptor,
|
|
25
|
-
errorTitle?: MessageDescriptor,
|
|
26
24
|
fileId: string,
|
|
27
25
|
isLoading: boolean,
|
|
28
|
-
onUpgradeClick?: () => void,
|
|
29
26
|
parentName: string,
|
|
30
27
|
versionCount: number,
|
|
31
28
|
versionLimit: number,
|
|
32
29
|
versions: Array<BoxItemVersion>,
|
|
33
30
|
};
|
|
34
31
|
|
|
35
|
-
const VersionsSidebar = ({ error,
|
|
32
|
+
const VersionsSidebar = ({ error, isLoading, parentName, versions, ...rest }: Props) => {
|
|
36
33
|
const showLimit = versions.length >= MAX_VERSIONS;
|
|
37
34
|
const showVersions = !!versions.length;
|
|
38
|
-
const showEmpty = !isLoading && !showVersions
|
|
35
|
+
const showEmpty = !isLoading && !showVersions;
|
|
39
36
|
const showError = !!error;
|
|
40
37
|
|
|
41
38
|
return (
|
|
@@ -52,18 +49,8 @@ const VersionsSidebar = ({ error, errorTitle, onUpgradeClick, isLoading, parentN
|
|
|
52
49
|
>
|
|
53
50
|
<LoadingIndicatorWrapper className="bcs-Versions-content" crawlerPosition="top" isLoading={isLoading}>
|
|
54
51
|
{showError && (
|
|
55
|
-
<InlineError title={<FormattedMessage {...
|
|
52
|
+
<InlineError title={<FormattedMessage {...messages.versionServerError} />}>
|
|
56
53
|
<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
|
-
)}
|
|
67
54
|
</InlineError>
|
|
68
55
|
)}
|
|
69
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/VersionsSidebar.js"],"names":["React","FormattedMessage","InlineError","messages","SidebarContent","VersionsMenu","BackButton","
|
|
1
|
+
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/VersionsSidebar.js"],"names":["React","FormattedMessage","InlineError","messages","SidebarContent","VersionsMenu","BackButton","DEFAULT_FETCH_END","LoadingIndicatorWrapper","MAX_VERSIONS","VersionsSidebar","error","isLoading","parentName","versions","rest","showLimit","length","showVersions","showEmpty","showError","versionsTitle","versionServerError","versionsEmpty","versionMaxEntries","maxVersions"],"mappings":";;;;;;AAAA;;;;;AAMA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAEA,OAAOC,WAAP,MAAwB,kCAAxB;AACA,OAAOC,QAAP,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IAAA,SAAS,EAAC;AAAf,KACI,oBAAC,gBAAD,EAAsBhB,QAAQ,CAACoB,aAA/B,CADJ,CARR,EAaKL,YAAY,IACT;AAAK,IAAA,SAAS,EAAC;AAAf,KACI,oBAAC,YAAD;AAAc,IAAA,QAAQ,EAAEJ;AAAxB,KAAsCC,IAAtC,EADJ,CAdR,EAkBKC,SAAS,IACN;AAAK,IAAA,SAAS,EAAC,yBAAf;AAAyC,mBAAY;AAArD,KACI,oBAAC,gBAAD,eACQb,QAAQ,CAACqB,iBADjB;AAEI,IAAA,MAAM,EAAE;AACJC,MAAAA,WAAW,EAAEhB;AADT;AAFZ,KADJ,CAnBR,CAXJ,CADJ;AA2CH,CAjDD;;AAmDA,eAAeC,eAAf","sourcesContent":["/**\n * @flow\n * @file Versions Sidebar component\n * @author Box\n */\n\nimport * as React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport type { MessageDescriptor } from 'react-intl';\nimport InlineError from '../../../components/inline-error';\nimport messages from './messages';\nimport SidebarContent from '../SidebarContent';\nimport VersionsMenu from './VersionsMenu';\nimport { BackButton } from '../../common/nav-button';\nimport { DEFAULT_FETCH_END } from '../../../constants';\nimport { LoadingIndicatorWrapper } from '../../../components/loading-indicator';\nimport type { BoxItemVersion } from '../../../common/types/core';\nimport './VersionsSidebar.scss';\n\nconst MAX_VERSIONS = DEFAULT_FETCH_END;\n\ntype Props = {\n error?: MessageDescriptor,\n fileId: string,\n isLoading: boolean,\n parentName: string,\n versionCount: number,\n versionLimit: number,\n versions: Array<BoxItemVersion>,\n};\n\nconst VersionsSidebar = ({ error, isLoading, parentName, versions, ...rest }: Props) => {\n const showLimit = versions.length >= MAX_VERSIONS;\n const showVersions = !!versions.length;\n const showEmpty = !isLoading && !showVersions;\n const showError = !!error;\n\n return (\n <SidebarContent\n className=\"bcs-Versions\"\n data-resin-component=\"preview\"\n data-resin-feature=\"versions\"\n title={\n <>\n <BackButton data-resin-target=\"back\" to={`/${parentName}`} />\n <FormattedMessage {...messages.versionsTitle} />\n </>\n }\n >\n <LoadingIndicatorWrapper className=\"bcs-Versions-content\" crawlerPosition=\"top\" isLoading={isLoading}>\n {showError && (\n <InlineError title={<FormattedMessage {...messages.versionServerError} />}>\n <FormattedMessage {...error} />\n </InlineError>\n )}\n\n {showEmpty && (\n <div className=\"bcs-Versions-empty\">\n <FormattedMessage {...messages.versionsEmpty} />\n </div>\n )}\n\n {showVersions && (\n <div className=\"bcs-Versions-menu\">\n <VersionsMenu versions={versions} {...rest} />\n </div>\n )}\n {showLimit && (\n <div className=\"bcs-Versions-maxEntries\" data-testid=\"max-versions\">\n <FormattedMessage\n {...messages.versionMaxEntries}\n values={{\n maxVersions: MAX_VERSIONS,\n }}\n />\n </div>\n )}\n </LoadingIndicatorWrapper>\n </SidebarContent>\n );\n};\n\nexport default VersionsSidebar;\n"],"file":"VersionsSidebar.js"}
|
|
@@ -58,11 +58,6 @@ import StaticVersionsSidebar from './StaticVersionSidebar';
|
|
|
58
58
|
import VersionsSidebar from './VersionsSidebar';
|
|
59
59
|
import VersionsSidebarAPI from './VersionsSidebarAPI';
|
|
60
60
|
import { withAPIContext } from '../../common/api-context';
|
|
61
|
-
var UPSELL_TYPE = {
|
|
62
|
-
STATIC_VERSION_HISTORY: 'STATIC_VERSION_HISTORY',
|
|
63
|
-
STATIC_VERSION_HISTORY_WITH_PICTURE: 'STATIC_VERSION_HISTORY_WITH_PICTURE',
|
|
64
|
-
ERROR_MESSAGE: 'ERROR_MESSAGE'
|
|
65
|
-
};
|
|
66
61
|
|
|
67
62
|
var VersionsSidebarContainer =
|
|
68
63
|
/*#__PURE__*/
|
|
@@ -169,13 +164,9 @@ function (_React$Component) {
|
|
|
169
164
|
_this.mergeResponse(data);
|
|
170
165
|
});
|
|
171
166
|
|
|
172
|
-
_defineProperty(_assertThisInitialized(_this), "handleFetchError", function (
|
|
173
|
-
var onUpgradeClick = _this.props.onUpgradeClick;
|
|
174
|
-
var shouldShowVersionErrorWithUpsell = !!onUpgradeClick && error.status === 403;
|
|
175
|
-
|
|
167
|
+
_defineProperty(_assertThisInitialized(_this), "handleFetchError", function () {
|
|
176
168
|
_this.setState({
|
|
177
|
-
error:
|
|
178
|
-
errorTitle: shouldShowVersionErrorWithUpsell ? messages.versionAccessError : messages.versionServerError,
|
|
169
|
+
error: messages.versionFetchError,
|
|
179
170
|
isLoading: false,
|
|
180
171
|
isWatermarked: false,
|
|
181
172
|
versionCount: 0,
|
|
@@ -293,15 +284,12 @@ function (_React$Component) {
|
|
|
293
284
|
_createClass(VersionsSidebarContainer, [{
|
|
294
285
|
key: "componentDidMount",
|
|
295
286
|
value: function componentDidMount() {
|
|
296
|
-
var
|
|
297
|
-
onLoad = _this$props3.onLoad,
|
|
298
|
-
versionUpsellExperience = _this$props3.versionUpsellExperience;
|
|
287
|
+
var onLoad = this.props.onLoad;
|
|
299
288
|
this.initialize();
|
|
300
289
|
this.fetchData().then(function () {
|
|
301
290
|
onLoad({
|
|
302
291
|
component: 'preview',
|
|
303
|
-
feature: 'versions'
|
|
304
|
-
versionUpsellExperience: versionUpsellExperience
|
|
292
|
+
feature: 'versions'
|
|
305
293
|
});
|
|
306
294
|
});
|
|
307
295
|
}
|
|
@@ -310,9 +298,9 @@ function (_React$Component) {
|
|
|
310
298
|
value: function componentDidUpdate(_ref5) {
|
|
311
299
|
var prevFileId = _ref5.fileId,
|
|
312
300
|
prevVersionId = _ref5.versionId;
|
|
313
|
-
var _this$
|
|
314
|
-
fileId = _this$
|
|
315
|
-
versionId = _this$
|
|
301
|
+
var _this$props3 = this.props,
|
|
302
|
+
fileId = _this$props3.fileId,
|
|
303
|
+
versionId = _this$props3.versionId;
|
|
316
304
|
|
|
317
305
|
if (fileId !== prevFileId) {
|
|
318
306
|
this.refresh();
|
|
@@ -347,17 +335,15 @@ function (_React$Component) {
|
|
|
347
335
|
}, {
|
|
348
336
|
key: "render",
|
|
349
337
|
value: function render() {
|
|
350
|
-
var _this$
|
|
351
|
-
fileId = _this$
|
|
352
|
-
parentName = _this$
|
|
353
|
-
onUpgradeClick = _this$
|
|
354
|
-
versionUpsellExperience = _this$props5.versionUpsellExperience;
|
|
338
|
+
var _this$props4 = this.props,
|
|
339
|
+
fileId = _this$props4.fileId,
|
|
340
|
+
parentName = _this$props4.parentName,
|
|
341
|
+
onUpgradeClick = _this$props4.onUpgradeClick;
|
|
355
342
|
|
|
356
|
-
if (onUpgradeClick
|
|
343
|
+
if (onUpgradeClick) {
|
|
357
344
|
return React.createElement(StaticVersionsSidebar, _extends({
|
|
358
345
|
onUpgradeClick: onUpgradeClick,
|
|
359
|
-
parentName: parentName
|
|
360
|
-
showUpsellWithPicture: versionUpsellExperience === UPSELL_TYPE.STATIC_VERSION_HISTORY_WITH_PICTURE
|
|
346
|
+
parentName: parentName
|
|
361
347
|
}, this.state));
|
|
362
348
|
}
|
|
363
349
|
|
|
@@ -368,7 +354,6 @@ function (_React$Component) {
|
|
|
368
354
|
onPreview: this.handleActionPreview,
|
|
369
355
|
onPromote: this.handleActionPromote,
|
|
370
356
|
onRestore: this.handleActionRestore,
|
|
371
|
-
onUpgradeClick: onUpgradeClick,
|
|
372
357
|
parentName: parentName
|
|
373
358
|
}, this.state));
|
|
374
359
|
}
|
|
@@ -38,18 +38,10 @@ type Props = {
|
|
|
38
38
|
onVersionRestore: VersionActionCallback,
|
|
39
39
|
parentName: string,
|
|
40
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',
|
|
48
41
|
};
|
|
49
42
|
|
|
50
43
|
type State = {
|
|
51
44
|
error?: MessageDescriptor,
|
|
52
|
-
errorTitle?: MessageDescriptor,
|
|
53
45
|
isLoading: boolean,
|
|
54
46
|
isWatermarked: boolean,
|
|
55
47
|
versionCount: number,
|
|
@@ -84,10 +76,10 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
84
76
|
window: any = window;
|
|
85
77
|
|
|
86
78
|
componentDidMount() {
|
|
87
|
-
const { onLoad
|
|
79
|
+
const { onLoad } = this.props;
|
|
88
80
|
this.initialize();
|
|
89
81
|
this.fetchData().then(() => {
|
|
90
|
-
onLoad({ component: 'preview', feature: 'versions'
|
|
82
|
+
onLoad({ component: 'preview', feature: 'versions' });
|
|
91
83
|
});
|
|
92
84
|
}
|
|
93
85
|
|
|
@@ -178,13 +170,9 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
178
170
|
this.mergeResponse(data);
|
|
179
171
|
};
|
|
180
172
|
|
|
181
|
-
handleFetchError = (
|
|
182
|
-
const { onUpgradeClick } = this.props;
|
|
183
|
-
const shouldShowVersionErrorWithUpsell = !!onUpgradeClick && error.status === 403;
|
|
184
|
-
|
|
173
|
+
handleFetchError = (): void => {
|
|
185
174
|
this.setState({
|
|
186
|
-
error:
|
|
187
|
-
errorTitle: shouldShowVersionErrorWithUpsell ? messages.versionAccessError : messages.versionServerError,
|
|
175
|
+
error: messages.versionFetchError,
|
|
188
176
|
isLoading: false,
|
|
189
177
|
isWatermarked: false,
|
|
190
178
|
versionCount: 0,
|
|
@@ -294,21 +282,10 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
294
282
|
};
|
|
295
283
|
|
|
296
284
|
render() {
|
|
297
|
-
const { fileId, parentName, onUpgradeClick
|
|
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
|
-
);
|
|
285
|
+
const { fileId, parentName, onUpgradeClick } = this.props;
|
|
286
|
+
|
|
287
|
+
if (onUpgradeClick) {
|
|
288
|
+
return <StaticVersionsSidebar onUpgradeClick={onUpgradeClick} parentName={parentName} {...this.state} />;
|
|
312
289
|
}
|
|
313
290
|
|
|
314
291
|
return (
|
|
@@ -319,7 +296,6 @@ class VersionsSidebarContainer extends React.Component<Props, State> {
|
|
|
319
296
|
onPreview={this.handleActionPreview}
|
|
320
297
|
onPromote={this.handleActionPromote}
|
|
321
298
|
onRestore={this.handleActionRestore}
|
|
322
|
-
onUpgradeClick={onUpgradeClick}
|
|
323
299
|
parentName={parentName}
|
|
324
300
|
{...this.state}
|
|
325
301
|
/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/VersionsSidebarContainer.js"],"names":["React","flow","getProp","merge","noop","generatePath","withRouter","API","messages","openUrlInsideIframe","StaticVersionsSidebar","VersionsSidebar","VersionsSidebarAPI","withAPIContext","UPSELL_TYPE","STATIC_VERSION_HISTORY","STATIC_VERSION_HISTORY_WITH_PICTURE","ERROR_MESSAGE","VersionsSidebarContainer","isLoading","isWatermarked","versionCount","Infinity","versionLimit","versions","window","versionId","setState","api","deleteVersion","findVersion","then","fetchVersion","handleDeleteSuccess","props","onVersionDelete","catch","handleActionError","versionActionDeleteError","fetchDownloadUrl","onVersionDownload","versionActionDownloadError","updateVersion","onVersionPreview","promoteVersion","fetchData","handleFetchSuccess","handlePromoteSuccess","onVersionPromote","versionActionPromoteError","restoreVersion","handleRestoreSuccess","onVersionRestore","versionActionRestoreError","message","error","data","selectedVersionId","id","mergeResponse","updateVersionToCurrent","onUpgradeClick","shouldShowVersionErrorWithUpsell","status","versionNotAvailable","versionFetchError","errorTitle","versionAccessError","versionServerError","fileResponse","versionsResponse","version_limit","undefined","versionsWithPermissions","getVersionsAPI","addPermissions","entries","total_count","sortVersions","verifyVersion","file","fileVersion","file_version","handleFetchError","state","find","version","newVersion","newVersionId","map","newVersions","mergeVersions","history","match","push","path","params","getCurrentVersionId","onVersionChange","selectedVersion","currentVersionId","onLoad","versionUpsellExperience","initialize","component","feature","prevFileId","fileId","prevVersionId","refresh","sort","a","b","Date","parse","created_at","parentName","handleActionDelete","handleActionDownload","handleActionPreview","handleActionPromote","handleActionRestore","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAMA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,KAAP,MAAkB,cAAlB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,kBAAzC;AAGA,OAAOC,GAAP,MAAgB,cAAhB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,mBAAP,MAAgC,uBAAhC;AACA,OAAOC,qBAAP,MAAkC,wBAAlC;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,kBAAP,MAA+B,sBAA/B;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAuBA,IAAMC,WAAW,GAAG;AAChBC,EAAAA,sBAAsB,EAAE,wBADR;AAEhBC,EAAAA,mCAAmC,EAAE,qCAFrB;AAGhBC,EAAAA,aAAa,EAAE;AAHC,CAApB;;IAgBMC,wB;;;;;;;;;;;;;;;;;;4DAgBa;AACXC,MAAAA,SAAS,EAAE,IADA;AAEXC,MAAAA,aAAa,EAAE,KAFJ;AAGXC,MAAAA,YAAY,EAAEC,QAHH;AAIXC,MAAAA,YAAY,EAAED,QAJH;AAKXE,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yC,uBADvC,gBACuCA,uBADvC;;AAGL,UACIzC,cAAc,KACbyC,uBAAuB,KAAKxF,WAAW,CAACC,sBAAxC,IACGuF,uBAAuB,KAAKxF,WAAW,CAACE,mCAF9B,CADlB,EAIE;AACE,eACI,oBAAC,qBAAD;AACI,UAAA,cAAc,EAAE6C,cADpB;AAEI,UAAA,UAAU,EAAEuD,UAFhB;AAGI,UAAA,qBAAqB,EAAEd,uBAAuB,KAAKxF,WAAW,CAACE;AAHnE,WAIQ,KAAKoE,KAJb,EADJ;AAQH;;AAED,aACI,oBAAC,eAAD;AACI,QAAA,MAAM,EAAEuB,MADZ;AAEI,QAAA,QAAQ,EAAE,KAAKU,kBAFnB;AAGI,QAAA,UAAU,EAAE,KAAKC,oBAHrB;AAII,QAAA,SAAS,EAAE,KAAKC,mBAJpB;AAKI,QAAA,SAAS,EAAE,KAAKC,mBALpB;AAMI,QAAA,SAAS,EAAE,KAAKC,mBANpB;AAOI,QAAA,cAAc,EAAE5D,cAPpB;AAQI,QAAA,UAAU,EAAEuD;AARhB,SASQ,KAAKhC,KATb,EADJ;AAaH;;;;EA3QkCpF,KAAK,CAAC0H,S;;gBAAvCxG,wB,kBACoB;AAClBmF,EAAAA,MAAM,EAAEjG,IADU;AAElB8F,EAAAA,eAAe,EAAE9F,IAFC;AAGlB+B,EAAAA,eAAe,EAAE/B,IAHC;AAIlBoC,EAAAA,iBAAiB,EAAEpC,IAJD;AAKlBuC,EAAAA,gBAAgB,EAAEvC,IALA;AAMlB4C,EAAAA,gBAAgB,EAAE5C,IANA;AAOlBgD,EAAAA,gBAAgB,EAAEhD,IAPA;AAQlBgH,EAAAA,UAAU,EAAE;AARM,C;;AA8Q1B,eAAenH,IAAI,CAAC,CAACK,UAAD,EAAaO,cAAb,CAAD,CAAJ,CAAmCK,wBAAnC,CAAf","sourcesContent":["/**\n * @flow\n * @file Versions Sidebar container\n * @author Box\n */\n\nimport React from 'react';\nimport flow from 'lodash/flow';\nimport getProp from 'lodash/get';\nimport merge from 'lodash/merge';\nimport noop from 'lodash/noop';\nimport { generatePath, withRouter } from 'react-router-dom';\nimport type { Match, RouterHistory } from 'react-router-dom';\nimport type { MessageDescriptor } from 'react-intl';\nimport API from '../../../api';\nimport messages from './messages';\nimport openUrlInsideIframe from '../../../utils/iframe';\nimport StaticVersionsSidebar from './StaticVersionSidebar';\nimport VersionsSidebar from './VersionsSidebar';\nimport VersionsSidebarAPI from './VersionsSidebarAPI';\nimport { withAPIContext } from '../../common/api-context';\nimport type { VersionActionCallback, VersionChangeCallback, SidebarLoadCallback } from './flowTypes';\nimport type { BoxItemVersion, BoxItem, FileVersions } from '../../../common/types/core';\n\ntype Props = {\n api: API,\n fileId: string,\n hasSidebarInitialized?: boolean,\n history: RouterHistory,\n match: Match,\n onLoad: SidebarLoadCallback,\n onUpgradeClick?: () => void,\n onVersionChange: VersionChangeCallback,\n onVersionDelete: VersionActionCallback,\n onVersionDownload: VersionActionCallback,\n onVersionPreview: VersionActionCallback,\n onVersionPromote: VersionActionCallback,\n onVersionRestore: VersionActionCallback,\n parentName: string,\n versionId?: string,\n versionUpsellExperience: ?string,\n};\n\nconst UPSELL_TYPE = {\n STATIC_VERSION_HISTORY: 'STATIC_VERSION_HISTORY',\n STATIC_VERSION_HISTORY_WITH_PICTURE: 'STATIC_VERSION_HISTORY_WITH_PICTURE',\n ERROR_MESSAGE: 'ERROR_MESSAGE',\n};\n\ntype State = {\n error?: MessageDescriptor,\n errorTitle?: MessageDescriptor,\n isLoading: boolean,\n isWatermarked: boolean,\n versionCount: number,\n versionLimit: number,\n versions: Array<BoxItemVersion>,\n};\n\nclass VersionsSidebarContainer extends React.Component<Props, State> {\n static defaultProps = {\n onLoad: noop,\n onVersionChange: noop,\n onVersionDelete: noop,\n onVersionDownload: noop,\n onVersionPreview: noop,\n onVersionPromote: noop,\n onVersionRestore: noop,\n parentName: '',\n };\n\n api: VersionsSidebarAPI;\n\n props: Props;\n\n state: State = {\n isLoading: true,\n isWatermarked: false,\n versionCount: Infinity,\n versionLimit: Infinity,\n versions: [],\n };\n\n window: any = window;\n\n componentDidMount() {\n const { onLoad, versionUpsellExperience } = this.props;\n this.initialize();\n this.fetchData().then(() => {\n onLoad({ component: 'preview', feature: 'versions', versionUpsellExperience });\n });\n }\n\n componentDidUpdate({ fileId: prevFileId, versionId: prevVersionId }: Props) {\n const { fileId, versionId } = this.props;\n\n if (fileId !== prevFileId) {\n this.refresh();\n }\n\n if (versionId !== prevVersionId) {\n this.verifyVersion();\n }\n }\n\n componentWillUnmount() {\n // Reset the current version id since the wrapping route is no longer active\n this.props.onVersionChange(null);\n }\n\n handleActionDelete = (versionId: string): Promise<void> => {\n this.setState({ isLoading: true });\n\n return this.api\n .deleteVersion(this.findVersion(versionId))\n .then(() => this.api.fetchVersion(versionId))\n .then(this.handleDeleteSuccess)\n .then(() => this.props.onVersionDelete(versionId))\n .catch(() => this.handleActionError(messages.versionActionDeleteError));\n };\n\n handleActionDownload = (versionId: string): Promise<void> => {\n return this.api\n .fetchDownloadUrl(this.findVersion(versionId))\n .then(openUrlInsideIframe)\n .then(() => this.props.onVersionDownload(versionId))\n .catch(() => this.handleActionError(messages.versionActionDownloadError));\n };\n\n handleActionPreview = (versionId: string): void => {\n this.updateVersion(versionId);\n this.props.onVersionPreview(versionId);\n };\n\n handleActionPromote = (versionId: string): Promise<void> => {\n this.setState({ isLoading: true });\n\n return this.api\n .promoteVersion(this.findVersion(versionId))\n .then(this.api.fetchData)\n .then(this.handleFetchSuccess)\n .then(this.handlePromoteSuccess)\n .then(() => this.props.onVersionPromote(versionId))\n .catch(() => this.handleActionError(messages.versionActionPromoteError));\n };\n\n handleActionRestore = (versionId: string): Promise<void> => {\n this.setState({ isLoading: true });\n\n return this.api\n .restoreVersion(this.findVersion(versionId))\n .then(() => this.api.fetchVersion(versionId))\n .then(this.handleRestoreSuccess)\n .then(() => this.props.onVersionRestore(versionId))\n .catch(() => this.handleActionError(messages.versionActionRestoreError));\n };\n\n handleActionError = (message: MessageDescriptor): void => {\n this.setState({\n error: message,\n isLoading: false,\n });\n };\n\n handleDeleteSuccess = (data: BoxItemVersion): void => {\n const { versionId: selectedVersionId } = this.props;\n const { id: versionId } = data;\n\n this.mergeResponse(data);\n\n // Bump the user to the current version if they deleted their selected version\n if (versionId === selectedVersionId) {\n this.updateVersionToCurrent();\n }\n };\n\n handleRestoreSuccess = (data: BoxItemVersion): void => {\n this.mergeResponse(data);\n };\n\n handleFetchError = (error: Object): void => {\n const { onUpgradeClick } = this.props;\n const shouldShowVersionErrorWithUpsell = !!onUpgradeClick && error.status === 403;\n\n this.setState({\n error: shouldShowVersionErrorWithUpsell ? messages.versionNotAvailable : messages.versionFetchError,\n errorTitle: shouldShowVersionErrorWithUpsell ? messages.versionAccessError : messages.versionServerError,\n isLoading: false,\n isWatermarked: false,\n versionCount: 0,\n versions: [],\n });\n };\n\n handleFetchSuccess = ([fileResponse, versionsResponse]): [BoxItem, FileVersions] => {\n const { api } = this.props;\n const { version_limit } = fileResponse;\n const isWatermarked = getProp(fileResponse, 'watermark_info.is_watermarked', false);\n const versionLimit = version_limit !== null && version_limit !== undefined ? version_limit : Infinity;\n const versionsWithPermissions = api.getVersionsAPI(false).addPermissions(versionsResponse, fileResponse) || {};\n const { entries: versions, total_count: versionCount } = versionsWithPermissions;\n\n this.setState(\n {\n error: undefined,\n isLoading: false,\n isWatermarked,\n versionCount,\n versionLimit,\n versions: this.sortVersions(versions),\n },\n this.verifyVersion,\n );\n\n return [fileResponse, versionsResponse];\n };\n\n handlePromoteSuccess = ([file]: [BoxItem, FileVersions]): void => {\n const { file_version: fileVersion } = file;\n\n if (fileVersion) {\n this.updateVersion(fileVersion.id);\n }\n };\n\n initialize = (): void => {\n this.api = new VersionsSidebarAPI(this.props);\n };\n\n fetchData = (): Promise<?[BoxItem, FileVersions]> => {\n return this.api\n .fetchData()\n .then(this.handleFetchSuccess)\n .catch(this.handleFetchError);\n };\n\n findVersion = (versionId: ?string): ?BoxItemVersion => {\n const { versions } = this.state;\n\n return versions.find(version => version.id === versionId);\n };\n\n getCurrentVersionId = (): ?string => {\n const { versions } = this.state;\n return versions[0] ? versions[0].id : null;\n };\n\n mergeVersions = (newVersion: BoxItemVersion): Array<BoxItemVersion> => {\n const { versions } = this.state;\n const newVersionId = newVersion ? newVersion.id : '';\n return versions.map(version => (version.id === newVersionId ? merge({ ...version }, newVersion) : version));\n };\n\n mergeResponse = (data: BoxItemVersion): void => {\n const newVersions = this.mergeVersions(data);\n\n this.setState({\n error: undefined,\n isLoading: false,\n versions: newVersions,\n });\n };\n\n refresh(): void {\n this.initialize();\n this.setState({ isLoading: true }, this.fetchData);\n }\n\n sortVersions(versions?: Array<BoxItemVersion> = []): Array<BoxItemVersion> {\n return [...versions].sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at));\n }\n\n updateVersion = (versionId?: ?string): void => {\n const { history, match } = this.props;\n return history.push(generatePath(match.path, { ...match.params, versionId }));\n };\n\n updateVersionToCurrent = (): void => {\n this.updateVersion(this.getCurrentVersionId());\n };\n\n verifyVersion = () => {\n const { onVersionChange, versionId } = this.props;\n const selectedVersion = this.findVersion(versionId);\n\n if (selectedVersion) {\n onVersionChange(selectedVersion, {\n currentVersionId: this.getCurrentVersionId(),\n updateVersionToCurrent: this.updateVersionToCurrent,\n });\n } else {\n this.updateVersionToCurrent();\n }\n };\n\n render() {\n const { fileId, parentName, onUpgradeClick, versionUpsellExperience } = this.props;\n\n if (\n onUpgradeClick &&\n (versionUpsellExperience === UPSELL_TYPE.STATIC_VERSION_HISTORY ||\n versionUpsellExperience === UPSELL_TYPE.STATIC_VERSION_HISTORY_WITH_PICTURE)\n ) {\n return (\n <StaticVersionsSidebar\n onUpgradeClick={onUpgradeClick}\n parentName={parentName}\n showUpsellWithPicture={versionUpsellExperience === UPSELL_TYPE.STATIC_VERSION_HISTORY_WITH_PICTURE}\n {...this.state}\n />\n );\n }\n\n return (\n <VersionsSidebar\n fileId={fileId}\n onDelete={this.handleActionDelete}\n onDownload={this.handleActionDownload}\n onPreview={this.handleActionPreview}\n onPromote={this.handleActionPromote}\n onRestore={this.handleActionRestore}\n onUpgradeClick={onUpgradeClick}\n parentName={parentName}\n {...this.state}\n />\n );\n }\n}\n\nexport type VersionsSidebarProps = Props;\nexport default flow([withRouter, withAPIContext])(VersionsSidebarContainer);\n"],"file":"VersionsSidebarContainer.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/VersionsSidebarContainer.js"],"names":["React","flow","getProp","merge","noop","generatePath","withRouter","API","messages","openUrlInsideIframe","StaticVersionsSidebar","VersionsSidebar","VersionsSidebarAPI","withAPIContext","VersionsSidebarContainer","isLoading","isWatermarked","versionCount","Infinity","versionLimit","versions","window","versionId","setState","api","deleteVersion","findVersion","then","fetchVersion","handleDeleteSuccess","props","onVersionDelete","catch","handleActionError","versionActionDeleteError","fetchDownloadUrl","onVersionDownload","versionActionDownloadError","updateVersion","onVersionPreview","promoteVersion","fetchData","handleFetchSuccess","handlePromoteSuccess","onVersionPromote","versionActionPromoteError","restoreVersion","handleRestoreSuccess","onVersionRestore","versionActionRestoreError","message","error","data","selectedVersionId","id","mergeResponse","updateVersionToCurrent","versionFetchError","fileResponse","versionsResponse","version_limit","undefined","versionsWithPermissions","getVersionsAPI","addPermissions","entries","total_count","sortVersions","verifyVersion","file","fileVersion","file_version","handleFetchError","state","find","version","newVersion","newVersionId","map","newVersions","mergeVersions","history","match","push","path","params","getCurrentVersionId","onVersionChange","selectedVersion","currentVersionId","onLoad","initialize","component","feature","prevFileId","fileId","prevVersionId","refresh","sort","a","b","Date","parse","created_at","parentName","onUpgradeClick","handleActionDelete","handleActionDownload","handleActionPreview","handleActionPromote","handleActionRestore","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAMA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AACA,OAAOC,OAAP,MAAoB,YAApB;AAC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AAA,yBAC0C,KAAKzE,KAD/C;AAAA,UACGiE,MADH,gBACGA,MADH;AAAA,UACWS,UADX,gBACWA,UADX;AAAA,UACuBC,cADvB,gBACuBA,cADvB;;AAGL,UAAIA,cAAJ,EAAoB;AAChB,eAAO,oBAAC,qBAAD;AAAuB,UAAA,cAAc,EAAEA,cAAvC;AAAuD,UAAA,UAAU,EAAED;AAAnE,WAAmF,KAAK/B,KAAxF,EAAP;AACH;;AAED,aACI,oBAAC,eAAD;AACI,QAAA,MAAM,EAAEsB,MADZ;AAEI,QAAA,QAAQ,EAAE,KAAKW,kBAFnB;AAGI,QAAA,UAAU,EAAE,KAAKC,oBAHrB;AAII,QAAA,SAAS,EAAE,KAAKC,mBAJpB;AAKI,QAAA,SAAS,EAAE,KAAKC,mBALpB;AAMI,QAAA,SAAS,EAAE,KAAKC,mBANpB;AAOI,QAAA,UAAU,EAAEN;AAPhB,SAQQ,KAAK/B,KARb,EADJ;AAYH;;;;EA3PkCzE,KAAK,CAAC+G,S;;gBAAvCjG,wB,kBACoB;AAClB4E,EAAAA,MAAM,EAAEtF,IADU;AAElBmF,EAAAA,eAAe,EAAEnF,IAFC;AAGlB2B,EAAAA,eAAe,EAAE3B,IAHC;AAIlBgC,EAAAA,iBAAiB,EAAEhC,IAJD;AAKlBmC,EAAAA,gBAAgB,EAAEnC,IALA;AAMlBwC,EAAAA,gBAAgB,EAAExC,IANA;AAOlB4C,EAAAA,gBAAgB,EAAE5C,IAPA;AAQlBoG,EAAAA,UAAU,EAAE;AARM,C;;AA8P1B,eAAevG,IAAI,CAAC,CAACK,UAAD,EAAaO,cAAb,CAAD,CAAJ,CAAmCC,wBAAnC,CAAf","sourcesContent":["/**\n * @flow\n * @file Versions Sidebar container\n * @author Box\n */\n\nimport React from 'react';\nimport flow from 'lodash/flow';\nimport getProp from 'lodash/get';\nimport merge from 'lodash/merge';\nimport noop from 'lodash/noop';\nimport { generatePath, withRouter } from 'react-router-dom';\nimport type { Match, RouterHistory } from 'react-router-dom';\nimport type { MessageDescriptor } from 'react-intl';\nimport API from '../../../api';\nimport messages from './messages';\nimport openUrlInsideIframe from '../../../utils/iframe';\nimport StaticVersionsSidebar from './StaticVersionSidebar';\nimport VersionsSidebar from './VersionsSidebar';\nimport VersionsSidebarAPI from './VersionsSidebarAPI';\nimport { withAPIContext } from '../../common/api-context';\nimport type { VersionActionCallback, VersionChangeCallback, SidebarLoadCallback } from './flowTypes';\nimport type { BoxItemVersion, BoxItem, FileVersions } from '../../../common/types/core';\n\ntype Props = {\n api: API,\n fileId: string,\n hasSidebarInitialized?: boolean,\n history: RouterHistory,\n match: Match,\n onLoad: SidebarLoadCallback,\n onUpgradeClick?: () => void,\n onVersionChange: VersionChangeCallback,\n onVersionDelete: VersionActionCallback,\n onVersionDownload: VersionActionCallback,\n onVersionPreview: VersionActionCallback,\n onVersionPromote: VersionActionCallback,\n onVersionRestore: VersionActionCallback,\n parentName: string,\n versionId?: string,\n};\n\ntype State = {\n error?: MessageDescriptor,\n isLoading: boolean,\n isWatermarked: boolean,\n versionCount: number,\n versionLimit: number,\n versions: Array<BoxItemVersion>,\n};\n\nclass VersionsSidebarContainer extends React.Component<Props, State> {\n static defaultProps = {\n onLoad: noop,\n onVersionChange: noop,\n onVersionDelete: noop,\n onVersionDownload: noop,\n onVersionPreview: noop,\n onVersionPromote: noop,\n onVersionRestore: noop,\n parentName: '',\n };\n\n api: VersionsSidebarAPI;\n\n props: Props;\n\n state: State = {\n isLoading: true,\n isWatermarked: false,\n versionCount: Infinity,\n versionLimit: Infinity,\n versions: [],\n };\n\n window: any = window;\n\n componentDidMount() {\n const { onLoad } = this.props;\n this.initialize();\n this.fetchData().then(() => {\n onLoad({ component: 'preview', feature: 'versions' });\n });\n }\n\n componentDidUpdate({ fileId: prevFileId, versionId: prevVersionId }: Props) {\n const { fileId, versionId } = this.props;\n\n if (fileId !== prevFileId) {\n this.refresh();\n }\n\n if (versionId !== prevVersionId) {\n this.verifyVersion();\n }\n }\n\n componentWillUnmount() {\n // Reset the current version id since the wrapping route is no longer active\n this.props.onVersionChange(null);\n }\n\n handleActionDelete = (versionId: string): Promise<void> => {\n this.setState({ isLoading: true });\n\n return this.api\n .deleteVersion(this.findVersion(versionId))\n .then(() => this.api.fetchVersion(versionId))\n .then(this.handleDeleteSuccess)\n .then(() => this.props.onVersionDelete(versionId))\n .catch(() => this.handleActionError(messages.versionActionDeleteError));\n };\n\n handleActionDownload = (versionId: string): Promise<void> => {\n return this.api\n .fetchDownloadUrl(this.findVersion(versionId))\n .then(openUrlInsideIframe)\n .then(() => this.props.onVersionDownload(versionId))\n .catch(() => this.handleActionError(messages.versionActionDownloadError));\n };\n\n handleActionPreview = (versionId: string): void => {\n this.updateVersion(versionId);\n this.props.onVersionPreview(versionId);\n };\n\n handleActionPromote = (versionId: string): Promise<void> => {\n this.setState({ isLoading: true });\n\n return this.api\n .promoteVersion(this.findVersion(versionId))\n .then(this.api.fetchData)\n .then(this.handleFetchSuccess)\n .then(this.handlePromoteSuccess)\n .then(() => this.props.onVersionPromote(versionId))\n .catch(() => this.handleActionError(messages.versionActionPromoteError));\n };\n\n handleActionRestore = (versionId: string): Promise<void> => {\n this.setState({ isLoading: true });\n\n return this.api\n .restoreVersion(this.findVersion(versionId))\n .then(() => this.api.fetchVersion(versionId))\n .then(this.handleRestoreSuccess)\n .then(() => this.props.onVersionRestore(versionId))\n .catch(() => this.handleActionError(messages.versionActionRestoreError));\n };\n\n handleActionError = (message: MessageDescriptor): void => {\n this.setState({\n error: message,\n isLoading: false,\n });\n };\n\n handleDeleteSuccess = (data: BoxItemVersion): void => {\n const { versionId: selectedVersionId } = this.props;\n const { id: versionId } = data;\n\n this.mergeResponse(data);\n\n // Bump the user to the current version if they deleted their selected version\n if (versionId === selectedVersionId) {\n this.updateVersionToCurrent();\n }\n };\n\n handleRestoreSuccess = (data: BoxItemVersion): void => {\n this.mergeResponse(data);\n };\n\n handleFetchError = (): void => {\n this.setState({\n error: messages.versionFetchError,\n isLoading: false,\n isWatermarked: false,\n versionCount: 0,\n versions: [],\n });\n };\n\n handleFetchSuccess = ([fileResponse, versionsResponse]): [BoxItem, FileVersions] => {\n const { api } = this.props;\n const { version_limit } = fileResponse;\n const isWatermarked = getProp(fileResponse, 'watermark_info.is_watermarked', false);\n const versionLimit = version_limit !== null && version_limit !== undefined ? version_limit : Infinity;\n const versionsWithPermissions = api.getVersionsAPI(false).addPermissions(versionsResponse, fileResponse) || {};\n const { entries: versions, total_count: versionCount } = versionsWithPermissions;\n\n this.setState(\n {\n error: undefined,\n isLoading: false,\n isWatermarked,\n versionCount,\n versionLimit,\n versions: this.sortVersions(versions),\n },\n this.verifyVersion,\n );\n\n return [fileResponse, versionsResponse];\n };\n\n handlePromoteSuccess = ([file]: [BoxItem, FileVersions]): void => {\n const { file_version: fileVersion } = file;\n\n if (fileVersion) {\n this.updateVersion(fileVersion.id);\n }\n };\n\n initialize = (): void => {\n this.api = new VersionsSidebarAPI(this.props);\n };\n\n fetchData = (): Promise<?[BoxItem, FileVersions]> => {\n return this.api\n .fetchData()\n .then(this.handleFetchSuccess)\n .catch(this.handleFetchError);\n };\n\n findVersion = (versionId: ?string): ?BoxItemVersion => {\n const { versions } = this.state;\n\n return versions.find(version => version.id === versionId);\n };\n\n getCurrentVersionId = (): ?string => {\n const { versions } = this.state;\n return versions[0] ? versions[0].id : null;\n };\n\n mergeVersions = (newVersion: BoxItemVersion): Array<BoxItemVersion> => {\n const { versions } = this.state;\n const newVersionId = newVersion ? newVersion.id : '';\n return versions.map(version => (version.id === newVersionId ? merge({ ...version }, newVersion) : version));\n };\n\n mergeResponse = (data: BoxItemVersion): void => {\n const newVersions = this.mergeVersions(data);\n\n this.setState({\n error: undefined,\n isLoading: false,\n versions: newVersions,\n });\n };\n\n refresh(): void {\n this.initialize();\n this.setState({ isLoading: true }, this.fetchData);\n }\n\n sortVersions(versions?: Array<BoxItemVersion> = []): Array<BoxItemVersion> {\n return [...versions].sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at));\n }\n\n updateVersion = (versionId?: ?string): void => {\n const { history, match } = this.props;\n return history.push(generatePath(match.path, { ...match.params, versionId }));\n };\n\n updateVersionToCurrent = (): void => {\n this.updateVersion(this.getCurrentVersionId());\n };\n\n verifyVersion = () => {\n const { onVersionChange, versionId } = this.props;\n const selectedVersion = this.findVersion(versionId);\n\n if (selectedVersion) {\n onVersionChange(selectedVersion, {\n currentVersionId: this.getCurrentVersionId(),\n updateVersionToCurrent: this.updateVersionToCurrent,\n });\n } else {\n this.updateVersionToCurrent();\n }\n };\n\n render() {\n const { fileId, parentName, onUpgradeClick } = this.props;\n\n if (onUpgradeClick) {\n return <StaticVersionsSidebar onUpgradeClick={onUpgradeClick} parentName={parentName} {...this.state} />;\n }\n\n return (\n <VersionsSidebar\n fileId={fileId}\n onDelete={this.handleActionDelete}\n onDownload={this.handleActionDownload}\n onPreview={this.handleActionPreview}\n onPromote={this.handleActionPromote}\n onRestore={this.handleActionRestore}\n parentName={parentName}\n {...this.state}\n />\n );\n }\n}\n\nexport type VersionsSidebarProps = Props;\nexport default flow([withRouter, withAPIContext])(VersionsSidebarContainer);\n"],"file":"VersionsSidebarContainer.js"}
|
|
@@ -112,10 +112,6 @@ var messages = defineMessages({
|
|
|
112
112
|
"id": "be.sidebarVersions.serverError",
|
|
113
113
|
"defaultMessage": "Server Error"
|
|
114
114
|
},
|
|
115
|
-
versionAccessError: {
|
|
116
|
-
"id": "be.sidebarVersions.accessError",
|
|
117
|
-
"defaultMessage": "You don't have access to versioning"
|
|
118
|
-
},
|
|
119
115
|
versionUpgradeLink: {
|
|
120
116
|
"id": "be.sidebarVersions.upgradeLink",
|
|
121
117
|
"defaultMessage": "Upgrade Now"
|
|
@@ -147,11 +147,6 @@ const messages = defineMessages({
|
|
|
147
147
|
defaultMessage: 'Server Error',
|
|
148
148
|
description: 'Heading for inline error messages displayed due to a remote server issue.',
|
|
149
149
|
},
|
|
150
|
-
versionAccessError: {
|
|
151
|
-
id: 'be.sidebarVersions.accessError',
|
|
152
|
-
defaultMessage: "You don't have access to versioning",
|
|
153
|
-
description: 'Heading for inline error messages with upsell.',
|
|
154
|
-
},
|
|
155
150
|
versionUpgradeLink: {
|
|
156
151
|
id: 'be.sidebarVersions.upgradeLink',
|
|
157
152
|
defaultMessage: 'Upgrade Now',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/messages.js"],"names":["defineMessages","messages","fileRequestDisplayName","versionsEmpty","versionsPriorWeek","versionsThisMonth","versionsToday","versionsYesterday","versionsTitle","versionCurrent","versionActionDelete","versionActionDeleteError","versionActionDisabledRetention","versionActionDownload","versionActionDownloadError","versionActionPreview","versionActionPromote","versionActionPromoteError","versionActionRestore","versionActionRestoreError","versionActionToggle","versionDeletedBy","versionFetchError","versionNotAvailable","versionLimitExceeded","versionNumberBadge","versionNumberLabel","versionPromotedBy","versionRestoredBy","versionServerError","versionAccessError","versionUpgradeLink","versionUploadedBy","versionUserUnknown","versionMaxEntries","versionRetentionDelete","versionRetentionIndefinite","versionRetentionRemove","versionUpsell","upgradeButton"],"mappings":"AAEA,SAASA,cAAT,QAA+B,YAA/B;AAEA,IAAMC,QAAQ,GAAGD,cAAc,CAAC;AAC5BE,EAAAA,sBAAsB;AAAA;AAAA;AAAA,GADM;AAO5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GAPe;AAY5BC,EAAAA,iBAAiB;AAAA;AAAA;AAAA,GAZW;AAiB5BC,EAAAA,iBAAiB;AAAA;AAAA;AAAA,GAjBW;AAsB5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GAtBe;AA2B5BC,EAAAA,iBAAiB;AAAA;AAAA;AAAA,GA3BW;AAgC5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GAhCe;AAqC5BC,EAAAA,cAAc;AAAA;AAAA;AAAA,GArCc;AA0C5BC,EAAAA,mBAAmB;AAAA;AAAA;AAAA,GA1CS;AA+C5BC,EAAAA,wBAAwB;AAAA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A1KM;AA+K5BC,EAAAA,0BAA0B;AAAA;AAAA;AAAA,GA/KE;AAoL5BC,EAAAA,sBAAsB;AAAA;AAAA;AAAA,GApLM;AAyL5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GAzLe;AA+L5BC,EAAAA,aAAa;AAAA;AAAA;AAAA;AA/Le,CAAD,CAA/B;AAsMA,eAAetC,QAAf","sourcesContent":["// @flow strict\n\nimport { defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n fileRequestDisplayName: {\n defaultMessage: 'File Request',\n description:\n 'name of the File Request feature used to translate when a File Request is uploaded by the service',\n id: 'be.sidebarVersions.fileRequestDisplayName',\n },\n versionsEmpty: {\n id: 'be.sidebarVersions.empty',\n description: 'Message to display when no versions are available',\n defaultMessage: 'No prior versions are available for this file.',\n },\n versionsPriorWeek: {\n id: 'be.sidebarVersions.priorWeek',\n description: 'Header to display for group of versions created in the prior week',\n defaultMessage: 'Last Week',\n },\n versionsThisMonth: {\n id: 'be.sidebarVersions.thisMonth',\n description: 'Header to display for group of versions created in the current month',\n defaultMessage: 'This Month',\n },\n versionsToday: {\n id: 'be.sidebarVersions.today',\n description: 'Header to display for group of versions created yesterday',\n defaultMessage: 'Today',\n },\n versionsYesterday: {\n id: 'be.sidebarVersions.yesterday',\n description: 'Header to display for group of versions created today',\n defaultMessage: 'Yesterday',\n },\n versionsTitle: {\n id: 'be.sidebarVersions.title',\n description: 'Title for the preview versions sidebar',\n defaultMessage: 'Version History',\n },\n versionCurrent: {\n id: 'be.sidebarVersions.current',\n defaultMessage: 'Current Version',\n description: 'Label for the current version item in the version history list.',\n },\n versionActionDelete: {\n id: 'be.sidebarVersions.delete',\n defaultMessage: 'Delete',\n description: 'Label for the version delete action.',\n },\n versionActionDeleteError: {\n id: 'be.sidebarVersions.deleteError',\n defaultMessage: 'File version could not be deleted.',\n description: 'Error message for the version delete action.',\n },\n versionActionDisabledRetention: {\n id: 'be.sidebarVersions.disabledByRetention',\n defaultMessage: 'Disabled by retention policy',\n description: 'Tooltip message for actions disabled by retention policy.',\n },\n versionActionDownload: {\n id: 'be.sidebarVersions.download',\n defaultMessage: 'Download',\n description: 'Label for the version download action.',\n },\n versionActionDownloadError: {\n id: 'be.sidebarVersions.downloadError',\n defaultMessage: 'File version could not be downloaded.',\n description: 'Error message for the version download action.',\n },\n versionActionPreview: {\n id: 'be.sidebarVersions.preview',\n defaultMessage: 'Preview',\n description: 'Label for the version preview action.',\n },\n versionActionPromote: {\n id: 'be.sidebarVersions.promote',\n defaultMessage: 'Make Current',\n description: 'Label for the version promote action.',\n },\n versionActionPromoteError: {\n id: 'be.sidebarVersions.promoteError',\n defaultMessage: 'File version could not be made current.',\n description: 'Error message for the version promote action.',\n },\n versionActionRestore: {\n id: 'be.sidebarVersions.restore',\n defaultMessage: 'Restore',\n description: 'Label for the version restore action.',\n },\n versionActionRestoreError: {\n id: 'be.sidebarVersions.restoreError',\n defaultMessage: 'File version could not be restored.',\n description: 'Error message for the version restored action.',\n },\n versionActionToggle: {\n id: 'be.sidebarVersions.toggle',\n defaultMessage: 'Toggle Actions Menu',\n description: 'Label for the version actions dropdown menu toggle button.',\n },\n versionDeletedBy: {\n id: 'be.sidebarVersions.deletedBy',\n defaultMessage: 'Deleted by {name}',\n description: 'Message displayed for a deleted version. {name} is the user who performed the action.',\n },\n versionFetchError: {\n id: 'be.sidebarVersions.fetchError',\n defaultMessage: 'File versions could not be retrieved.',\n description: 'Error message for the versions fetch call.',\n },\n versionNotAvailable: {\n id: 'be.sidebarVersions.notAvailable',\n defaultMessage:\n 'Sorry, version history is not available with your current account plan. To access versioning, select from one of our paid plans.',\n description:\n 'Error message with upsell for the versions fetch call for users who dont have the version feature.',\n },\n versionLimitExceeded: {\n id: 'be.sidebarVersions.versionLimitExceeded',\n defaultMessage:\n 'You are limited to the last {versionLimit, number} {versionLimit, plural, one {version} other {versions}}.',\n description: \"Text displayed if a version exceeds the user's maximum allowed version count\",\n },\n versionNumberBadge: {\n id: 'be.sidebarVersions.versionNumberBadge',\n defaultMessage: 'V{versionNumber}',\n description: 'Text to display in the version badge.',\n },\n versionNumberLabel: {\n id: 'be.sidebarVersions.versionNumberLabel',\n defaultMessage: 'Version number {versionNumber}',\n description: 'Label given to the version badge for screen readers.',\n },\n versionPromotedBy: {\n id: 'be.sidebarVersions.promotedBy',\n defaultMessage: 'Promoted from v{versionPromoted} by {name}',\n description: 'Message displayed for a restored version. {name} is the user who performed the action.',\n },\n versionRestoredBy: {\n id: 'be.sidebarVersions.restoredBy',\n defaultMessage: 'Restored by {name}',\n description: 'Message displayed for a restored version. {name} is the user who performed the action.',\n },\n versionServerError: {\n id: 'be.sidebarVersions.serverError',\n defaultMessage: 'Server Error',\n description: 'Heading for inline error messages displayed due to a remote server issue.',\n },\n versionAccessError: {\n id: 'be.sidebarVersions.accessError',\n defaultMessage: \"You don't have access to versioning\",\n description: 'Heading for inline error messages with upsell.',\n },\n versionUpgradeLink: {\n id: 'be.sidebarVersions.upgradeLink',\n defaultMessage: 'Upgrade Now',\n description: 'Text on the upgrade button shown when user does not have access to Version History',\n },\n versionUploadedBy: {\n id: 'be.sidebarVersions.uploadedBy',\n defaultMessage: 'Uploaded by {name}',\n description: 'Message displayed for an uploaded version. {name} is the user who performed the action.',\n },\n versionUserUnknown: {\n id: 'be.sidebarVersions.versionUserUnknown',\n defaultMessage: 'Unknown',\n description: 'Name displayed for unknown or deleted users.',\n },\n versionMaxEntries: {\n id: 'be.sidebarVersions.versionMaxEntries',\n defaultMessage: 'Version history is limited to the last {maxVersions} entries.',\n description: 'Max supported entries for version history',\n },\n versionRetentionDelete: {\n id: 'be.sidebarVersions.versionRetentionDelete',\n defaultMessage: 'Will be deleted {time} by retention policy.',\n description: 'Message describing when the version will be deleted due to an applied retention policy.',\n },\n versionRetentionIndefinite: {\n id: 'be.sidebarVersions.versionRetentionIndefinite',\n defaultMessage: 'Retained indefinitely by retention policy.',\n description: 'Message describing that the version retention policy is indefinite and will not expire.',\n },\n versionRetentionRemove: {\n id: 'be.sidebarVersions.versionRetentionRemove',\n defaultMessage: 'Retention policy expires on {time}.',\n description: 'Message describing when the version retention policy will expire.',\n },\n versionUpsell: {\n defaultMessage:\n 'Sorry, version history is not available with your current account plan. To access versioning, select from one of our paid plans.',\n description: 'Upgrade message shown when user does not have access to Version History',\n id: 'be.sidebarVersions.versionUpsell',\n },\n upgradeButton: {\n defaultMessage: 'Upgrade',\n description: 'Text on the upgrade button shown when user does not have access to Version History',\n id: 'be.sidebarVersions.upgradeButton',\n },\n});\n\nexport default messages;\n"],"file":"messages.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/elements/content-sidebar/versions/messages.js"],"names":["defineMessages","messages","fileRequestDisplayName","versionsEmpty","versionsPriorWeek","versionsThisMonth","versionsToday","versionsYesterday","versionsTitle","versionCurrent","versionActionDelete","versionActionDeleteError","versionActionDisabledRetention","versionActionDownload","versionActionDownloadError","versionActionPreview","versionActionPromote","versionActionPromoteError","versionActionRestore","versionActionRestoreError","versionActionToggle","versionDeletedBy","versionFetchError","versionNotAvailable","versionLimitExceeded","versionNumberBadge","versionNumberLabel","versionPromotedBy","versionRestoredBy","versionServerError","versionUpgradeLink","versionUploadedBy","versionUserUnknown","versionMaxEntries","versionRetentionDelete","versionRetentionIndefinite","versionRetentionRemove","versionUpsell","upgradeButton"],"mappings":"AAEA,SAASA,cAAT,QAA+B,YAA/B;AAEA,IAAMC,QAAQ,GAAGD,cAAc,CAAC;AAC5BE,EAAAA,sBAAsB;AAAA;AAAA;AAAA,GADM;AAO5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GAPe;AAY5BC,EAAAA,iBAAiB;AAAA;AAAA;AAAA,GAZW;AAiB5BC,EAAAA,iBAAiB;AAAA;AAAA;AAAA,GAjBW;AAsB5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GAtBe;AA2B5BC,EAAAA,iBAAiB;AAAA;AAAA;AAAA,GA3BW;AAgC5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GAhCe;AA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AAiB;AAAA;AAAA;AAAA,GAhKW;AAqK5BC,EAAAA,sBAAsB;AAAA;AAAA;AAAA,GArKM;AA0K5BC,EAAAA,0BAA0B;AAAA;AAAA;AAAA,GA1KE;AA+K5BC,EAAAA,sBAAsB;AAAA;AAAA;AAAA,GA/KM;AAoL5BC,EAAAA,aAAa;AAAA;AAAA;AAAA,GApLe;AA0L5BC,EAAAA,aAAa;AAAA;AAAA;AAAA;AA1Le,CAAD,CAA/B;AAiMA,eAAerC,QAAf","sourcesContent":["// @flow strict\n\nimport { defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n fileRequestDisplayName: {\n defaultMessage: 'File Request',\n description:\n 'name of the File Request feature used to translate when a File Request is uploaded by the service',\n id: 'be.sidebarVersions.fileRequestDisplayName',\n },\n versionsEmpty: {\n id: 'be.sidebarVersions.empty',\n description: 'Message to display when no versions are available',\n defaultMessage: 'No prior versions are available for this file.',\n },\n versionsPriorWeek: {\n id: 'be.sidebarVersions.priorWeek',\n description: 'Header to display for group of versions created in the prior week',\n defaultMessage: 'Last Week',\n },\n versionsThisMonth: {\n id: 'be.sidebarVersions.thisMonth',\n description: 'Header to display for group of versions created in the current month',\n defaultMessage: 'This Month',\n },\n versionsToday: {\n id: 'be.sidebarVersions.today',\n description: 'Header to display for group of versions created yesterday',\n defaultMessage: 'Today',\n },\n versionsYesterday: {\n id: 'be.sidebarVersions.yesterday',\n description: 'Header to display for group of versions created today',\n defaultMessage: 'Yesterday',\n },\n versionsTitle: {\n id: 'be.sidebarVersions.title',\n description: 'Title for the preview versions sidebar',\n defaultMessage: 'Version History',\n },\n versionCurrent: {\n id: 'be.sidebarVersions.current',\n defaultMessage: 'Current Version',\n description: 'Label for the current version item in the version history list.',\n },\n versionActionDelete: {\n id: 'be.sidebarVersions.delete',\n defaultMessage: 'Delete',\n description: 'Label for the version delete action.',\n },\n versionActionDeleteError: {\n id: 'be.sidebarVersions.deleteError',\n defaultMessage: 'File version could not be deleted.',\n description: 'Error message for the version delete action.',\n },\n versionActionDisabledRetention: {\n id: 'be.sidebarVersions.disabledByRetention',\n defaultMessage: 'Disabled by retention policy',\n description: 'Tooltip message for actions disabled by retention policy.',\n },\n versionActionDownload: {\n id: 'be.sidebarVersions.download',\n defaultMessage: 'Download',\n description: 'Label for the version download action.',\n },\n versionActionDownloadError: {\n id: 'be.sidebarVersions.downloadError',\n defaultMessage: 'File version could not be downloaded.',\n description: 'Error message for the version download action.',\n },\n versionActionPreview: {\n id: 'be.sidebarVersions.preview',\n defaultMessage: 'Preview',\n description: 'Label for the version preview action.',\n },\n versionActionPromote: {\n id: 'be.sidebarVersions.promote',\n defaultMessage: 'Make Current',\n description: 'Label for the version promote action.',\n },\n versionActionPromoteError: {\n id: 'be.sidebarVersions.promoteError',\n defaultMessage: 'File version could not be made current.',\n description: 'Error message for the version promote action.',\n },\n versionActionRestore: {\n id: 'be.sidebarVersions.restore',\n defaultMessage: 'Restore',\n description: 'Label for the version restore action.',\n },\n versionActionRestoreError: {\n id: 'be.sidebarVersions.restoreError',\n defaultMessage: 'File version could not be restored.',\n description: 'Error message for the version restored action.',\n },\n versionActionToggle: {\n id: 'be.sidebarVersions.toggle',\n defaultMessage: 'Toggle Actions Menu',\n description: 'Label for the version actions dropdown menu toggle button.',\n },\n versionDeletedBy: {\n id: 'be.sidebarVersions.deletedBy',\n defaultMessage: 'Deleted by {name}',\n description: 'Message displayed for a deleted version. {name} is the user who performed the action.',\n },\n versionFetchError: {\n id: 'be.sidebarVersions.fetchError',\n defaultMessage: 'File versions could not be retrieved.',\n description: 'Error message for the versions fetch call.',\n },\n versionNotAvailable: {\n id: 'be.sidebarVersions.notAvailable',\n defaultMessage:\n 'Sorry, version history is not available with your current account plan. To access versioning, select from one of our paid plans.',\n description:\n 'Error message with upsell for the versions fetch call for users who dont have the version feature.',\n },\n versionLimitExceeded: {\n id: 'be.sidebarVersions.versionLimitExceeded',\n defaultMessage:\n 'You are limited to the last {versionLimit, number} {versionLimit, plural, one {version} other {versions}}.',\n description: \"Text displayed if a version exceeds the user's maximum allowed version count\",\n },\n versionNumberBadge: {\n id: 'be.sidebarVersions.versionNumberBadge',\n defaultMessage: 'V{versionNumber}',\n description: 'Text to display in the version badge.',\n },\n versionNumberLabel: {\n id: 'be.sidebarVersions.versionNumberLabel',\n defaultMessage: 'Version number {versionNumber}',\n description: 'Label given to the version badge for screen readers.',\n },\n versionPromotedBy: {\n id: 'be.sidebarVersions.promotedBy',\n defaultMessage: 'Promoted from v{versionPromoted} by {name}',\n description: 'Message displayed for a restored version. {name} is the user who performed the action.',\n },\n versionRestoredBy: {\n id: 'be.sidebarVersions.restoredBy',\n defaultMessage: 'Restored by {name}',\n description: 'Message displayed for a restored version. {name} is the user who performed the action.',\n },\n versionServerError: {\n id: 'be.sidebarVersions.serverError',\n defaultMessage: 'Server Error',\n description: 'Heading for inline error messages displayed due to a remote server issue.',\n },\n versionUpgradeLink: {\n id: 'be.sidebarVersions.upgradeLink',\n defaultMessage: 'Upgrade Now',\n description: 'Text on the upgrade button shown when user does not have access to Version History',\n },\n versionUploadedBy: {\n id: 'be.sidebarVersions.uploadedBy',\n defaultMessage: 'Uploaded by {name}',\n description: 'Message displayed for an uploaded version. {name} is the user who performed the action.',\n },\n versionUserUnknown: {\n id: 'be.sidebarVersions.versionUserUnknown',\n defaultMessage: 'Unknown',\n description: 'Name displayed for unknown or deleted users.',\n },\n versionMaxEntries: {\n id: 'be.sidebarVersions.versionMaxEntries',\n defaultMessage: 'Version history is limited to the last {maxVersions} entries.',\n description: 'Max supported entries for version history',\n },\n versionRetentionDelete: {\n id: 'be.sidebarVersions.versionRetentionDelete',\n defaultMessage: 'Will be deleted {time} by retention policy.',\n description: 'Message describing when the version will be deleted due to an applied retention policy.',\n },\n versionRetentionIndefinite: {\n id: 'be.sidebarVersions.versionRetentionIndefinite',\n defaultMessage: 'Retained indefinitely by retention policy.',\n description: 'Message describing that the version retention policy is indefinite and will not expire.',\n },\n versionRetentionRemove: {\n id: 'be.sidebarVersions.versionRetentionRemove',\n defaultMessage: 'Retention policy expires on {time}.',\n description: 'Message describing when the version retention policy will expire.',\n },\n versionUpsell: {\n defaultMessage:\n 'Sorry, version history is not available with your current account plan. To access versioning, select from one of our paid plans.',\n description: 'Upgrade message shown when user does not have access to Version History',\n id: 'be.sidebarVersions.versionUpsell',\n },\n upgradeButton: {\n defaultMessage: 'Upgrade',\n description: 'Text on the upgrade button shown when user does not have access to Version History',\n id: 'be.sidebarVersions.upgradeButton',\n },\n});\n\nexport default messages;\n"],"file":"messages.js"}
|
|
@@ -588,8 +588,6 @@ function (_React$Component) {
|
|
|
588
588
|
var _this$props10 = this.props,
|
|
589
589
|
_this$props10$openUpg = _this$props10.openUpgradePlanModal,
|
|
590
590
|
openUpgradePlanModal = _this$props10$openUpg === void 0 ? function () {} : _this$props10$openUpg,
|
|
591
|
-
_this$props10$showNew = _this$props10.showNewUpgradeText,
|
|
592
|
-
showNewUpgradeText = _this$props10$showNew === void 0 ? false : _this$props10$showNew,
|
|
593
591
|
_this$props10$trackin = _this$props10.trackingProps,
|
|
594
592
|
trackingProps = _this$props10$trackin === void 0 ? {} : _this$props10$trackin;
|
|
595
593
|
var _trackingProps$invite = trackingProps.inviteCollabsEmailTracking,
|
|
@@ -598,7 +596,7 @@ function (_React$Component) {
|
|
|
598
596
|
upgradeLinkProps = _inviteCollabsEmailTr === void 0 ? {} : _inviteCollabsEmailTr;
|
|
599
597
|
return React.createElement("div", {
|
|
600
598
|
className: "upgrade-description"
|
|
601
|
-
}, React.createElement(UpgradeBadge, null),
|
|
599
|
+
}, React.createElement(UpgradeBadge, null), React.createElement(FormattedMessage, _extends({
|
|
602
600
|
values: {
|
|
603
601
|
upgradeGetMoreAccessControlsLink: React.createElement(PlainButton, _extends({
|
|
604
602
|
className: "upgrade-link",
|