orc-shared 5.8.0-dev.3 → 5.8.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppFrame/About.js +4 -3
- package/dist/utils/filterHelper.js +4 -2
- package/package.json +1 -1
- package/src/components/AppFrame/About.js +4 -3
- package/src/components/AppFrame/About.test.js +61 -0
- package/src/utils/filterHelper.js +4 -2
- package/src/utils/filterHelper.test.js +6 -6
|
@@ -17,6 +17,7 @@ var _close = _interopRequireDefault(require("../../content/close.png"));
|
|
|
17
17
|
var _versionInfo = require("../../selectors/versionInfo");
|
|
18
18
|
var _locale = require("../../selectors/locale");
|
|
19
19
|
var _sharedMessages = _interopRequireDefault(require("./../../sharedMessages"));
|
|
20
|
+
var _lodash = require("lodash");
|
|
20
21
|
var _templateObject;
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -116,7 +117,7 @@ var About = exports.About = function About(_ref2) {
|
|
|
116
117
|
key: "orc-shared-version",
|
|
117
118
|
message: _objectSpread(_objectSpread({}, _sharedMessages.default.orcSharedVersion), {}, {
|
|
118
119
|
values: {
|
|
119
|
-
version: DEPENDENCIES["orc-shared"]
|
|
120
|
+
version: (0, _lodash.trimStart)(DEPENDENCIES["orc-shared"], "^")
|
|
120
121
|
}
|
|
121
122
|
})
|
|
122
123
|
})] : null, DEPENDENCIES && DEPENDENCIES["orc-scripts"] ? [/*#__PURE__*/_react.default.createElement("br", {
|
|
@@ -125,7 +126,7 @@ var About = exports.About = function About(_ref2) {
|
|
|
125
126
|
key: "orc-scripts-version",
|
|
126
127
|
message: _objectSpread(_objectSpread({}, _sharedMessages.default.orcScriptsVersion), {}, {
|
|
127
128
|
values: {
|
|
128
|
-
version: DEPENDENCIES["orc-scripts"]
|
|
129
|
+
version: (0, _lodash.trimStart)(DEPENDENCIES["orc-scripts"], "^")
|
|
129
130
|
}
|
|
130
131
|
})
|
|
131
132
|
})] : null, DEPENDENCIES && DEPENDENCIES["orc-secret"] ? [/*#__PURE__*/_react.default.createElement("br", {
|
|
@@ -134,7 +135,7 @@ var About = exports.About = function About(_ref2) {
|
|
|
134
135
|
key: "orc-secret-version",
|
|
135
136
|
message: _objectSpread(_objectSpread({}, _sharedMessages.default.orcSecretVersion), {}, {
|
|
136
137
|
values: {
|
|
137
|
-
version: DEPENDENCIES["orc-secret"]
|
|
138
|
+
version: (0, _lodash.trimStart)(DEPENDENCIES["orc-secret"], "^")
|
|
138
139
|
}
|
|
139
140
|
})
|
|
140
141
|
})] : null), /*#__PURE__*/_react.default.createElement(AboutParagraph, {
|
|
@@ -4,6 +4,7 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.substituteAllForNull = exports.getValueWithAll = exports.extractDropboxOptionsMemo = exports.extractDropboxOptions = void 0;
|
|
5
5
|
var _constants = require("../constants");
|
|
6
6
|
var _index = require("./index");
|
|
7
|
+
var _localizationHelper = require("./localizationHelper");
|
|
7
8
|
(function () {
|
|
8
9
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
9
10
|
enterModule && enterModule(module);
|
|
@@ -45,9 +46,10 @@ var extractDropboxOptionsMemo = exports.extractDropboxOptionsMemo = function ext
|
|
|
45
46
|
var options = [];
|
|
46
47
|
items.forEach(function (v) {
|
|
47
48
|
if (!activeKey || v.get(activeKey)) {
|
|
49
|
+
var value = v.get(valueKey);
|
|
48
50
|
options.push({
|
|
49
|
-
value:
|
|
50
|
-
label: v.get(labelKey) || fallbackLabelKey && v.get(fallbackLabelKey),
|
|
51
|
+
value: value,
|
|
52
|
+
label: v.get(labelKey) || fallbackLabelKey && v.get(fallbackLabelKey) || (0, _localizationHelper.getNotLocalizedString)(value),
|
|
51
53
|
sortOrder: v.get(sortOrderKey)
|
|
52
54
|
});
|
|
53
55
|
}
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ import close from "../../content/close.png";
|
|
|
13
13
|
import { getVersionSelector } from "../../selectors/versionInfo";
|
|
14
14
|
import { currentLocaleOrDefault } from "../../selectors/locale";
|
|
15
15
|
import sharedMessages from "./../../sharedMessages";
|
|
16
|
+
import { trimStart } from "lodash";
|
|
16
17
|
|
|
17
18
|
export const ABOUT_NAME = "__aboutBox";
|
|
18
19
|
|
|
@@ -125,7 +126,7 @@ export const About = ({ currentApplication }) => {
|
|
|
125
126
|
key="orc-shared-version"
|
|
126
127
|
message={{
|
|
127
128
|
...sharedMessages.orcSharedVersion,
|
|
128
|
-
values: { version: DEPENDENCIES["orc-shared"] },
|
|
129
|
+
values: { version: trimStart(DEPENDENCIES["orc-shared"], "^") },
|
|
129
130
|
}}
|
|
130
131
|
/>,
|
|
131
132
|
]
|
|
@@ -137,7 +138,7 @@ export const About = ({ currentApplication }) => {
|
|
|
137
138
|
key="orc-scripts-version"
|
|
138
139
|
message={{
|
|
139
140
|
...sharedMessages.orcScriptsVersion,
|
|
140
|
-
values: { version: DEPENDENCIES["orc-scripts"] },
|
|
141
|
+
values: { version: trimStart(DEPENDENCIES["orc-scripts"], "^") },
|
|
141
142
|
}}
|
|
142
143
|
/>,
|
|
143
144
|
]
|
|
@@ -149,7 +150,7 @@ export const About = ({ currentApplication }) => {
|
|
|
149
150
|
key="orc-secret-version"
|
|
150
151
|
message={{
|
|
151
152
|
...sharedMessages.orcSecretVersion,
|
|
152
|
-
values: { version: DEPENDENCIES["orc-secret"] },
|
|
153
|
+
values: { version: trimStart(DEPENDENCIES["orc-secret"], "^") },
|
|
153
154
|
}}
|
|
154
155
|
/>,
|
|
155
156
|
]
|
|
@@ -88,6 +88,67 @@ describe("About", () => {
|
|
|
88
88
|
);
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
it("renders an about box with normalized JS version", () => {
|
|
92
|
+
const orcSharedVersion = "^2.9.0";
|
|
93
|
+
const orcScriptsVersion = "^1.2.3";
|
|
94
|
+
const orcSecretVersion = "^5.1.7";
|
|
95
|
+
|
|
96
|
+
global.DEPENDENCIES = {
|
|
97
|
+
"orc-scripts": orcScriptsVersion,
|
|
98
|
+
"orc-secret": orcSecretVersion,
|
|
99
|
+
"orc-shared": orcSharedVersion,
|
|
100
|
+
};
|
|
101
|
+
global.BUILD_NUMBER = "2.3.2";
|
|
102
|
+
expect(
|
|
103
|
+
<Provider store={store}>
|
|
104
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
105
|
+
<About viewState={{ show: true }} currentApplication={{ displayName: "An application" }} />
|
|
106
|
+
</IntlProvider>
|
|
107
|
+
</Provider>,
|
|
108
|
+
"when mounted",
|
|
109
|
+
"to satisfy",
|
|
110
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
111
|
+
<AboutBox in>
|
|
112
|
+
<CloseButton>
|
|
113
|
+
<img src={close} alt="X" />
|
|
114
|
+
</CloseButton>
|
|
115
|
+
<img src={logoImage} alt="Orckestra" />
|
|
116
|
+
<AboutParagraph>
|
|
117
|
+
{stringifyWithoutQuotes(messages["orc-shared.ccVersion"]).replace("{version}", ccVersion)}
|
|
118
|
+
<br />
|
|
119
|
+
An application 2.3.2
|
|
120
|
+
<br />
|
|
121
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcSharedVersion"]).replace(
|
|
122
|
+
"{version}",
|
|
123
|
+
orcSharedVersion.replace("^", ""),
|
|
124
|
+
)}
|
|
125
|
+
<br />
|
|
126
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcScriptsVersion"]).replace(
|
|
127
|
+
"{version}",
|
|
128
|
+
orcScriptsVersion.replace("^", ""),
|
|
129
|
+
)}
|
|
130
|
+
<br />
|
|
131
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcSecretVersion"]).replace(
|
|
132
|
+
"{version}",
|
|
133
|
+
orcSecretVersion.replace("^", ""),
|
|
134
|
+
)}
|
|
135
|
+
</AboutParagraph>
|
|
136
|
+
<AboutParagraph long>{stringifyWithoutQuotes(messages["orc-shared.copyrightTermsNotice"])}</AboutParagraph>
|
|
137
|
+
<AboutParagraph>
|
|
138
|
+
<AboutLink href="https://www.orckestra.com">
|
|
139
|
+
{stringifyWithoutQuotes(messages["orc-shared.ccName"])}
|
|
140
|
+
</AboutLink>
|
|
141
|
+
</AboutParagraph>
|
|
142
|
+
<AboutParagraph>
|
|
143
|
+
{stringifyWithoutQuotes(messages["orc-shared.copyright"]).replace("{year}", new Date().getFullYear())}
|
|
144
|
+
<br />
|
|
145
|
+
{stringifyWithoutQuotes(messages["orc-shared.allRightsReserved"])}
|
|
146
|
+
</AboutParagraph>
|
|
147
|
+
</AboutBox>
|
|
148
|
+
</IntlProvider>,
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
|
|
91
152
|
it("view state handler update show value when clicking on close button", () =>
|
|
92
153
|
expect(
|
|
93
154
|
<Provider store={store}>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { allValue } from "../constants";
|
|
2
2
|
import { memoize } from "./index";
|
|
3
|
+
import { getNotLocalizedString } from "./localizationHelper";
|
|
3
4
|
|
|
4
5
|
export const getValueWithAll = value => {
|
|
5
6
|
if (!value) return allValue;
|
|
@@ -20,9 +21,10 @@ export const extractDropboxOptionsMemo = (data, config = undefined) => {
|
|
|
20
21
|
let options = [];
|
|
21
22
|
items.forEach(v => {
|
|
22
23
|
if (!activeKey || v.get(activeKey)) {
|
|
24
|
+
const value = v.get(valueKey);
|
|
23
25
|
options.push({
|
|
24
|
-
value:
|
|
25
|
-
label: v.get(labelKey) || (fallbackLabelKey && v.get(fallbackLabelKey)),
|
|
26
|
+
value: value,
|
|
27
|
+
label: v.get(labelKey) || (fallbackLabelKey && v.get(fallbackLabelKey)) || getNotLocalizedString(value),
|
|
26
28
|
sortOrder: v.get(sortOrderKey),
|
|
27
29
|
});
|
|
28
30
|
}
|
|
@@ -43,8 +43,8 @@ describe("extractDropboxOptions", () => {
|
|
|
43
43
|
const result = extractDropboxOptions(lookup);
|
|
44
44
|
|
|
45
45
|
expect(result, "to equal", [
|
|
46
|
-
{ value: "value1", label:
|
|
47
|
-
{ value: "value3", label:
|
|
46
|
+
{ value: "value1", label: "[value1]", sortOrder: 0 },
|
|
47
|
+
{ value: "value3", label: "[value3]", sortOrder: 3 },
|
|
48
48
|
]);
|
|
49
49
|
});
|
|
50
50
|
|
|
@@ -60,8 +60,8 @@ describe("extractDropboxOptions", () => {
|
|
|
60
60
|
const result = extractDropboxOptions(lookups);
|
|
61
61
|
|
|
62
62
|
expect(result, "to equal", [
|
|
63
|
-
{ value: "value4", label:
|
|
64
|
-
{ value: "value6", label:
|
|
63
|
+
{ value: "value4", label: "[value4]", sortOrder: 0 },
|
|
64
|
+
{ value: "value6", label: "[value6]", sortOrder: 3 },
|
|
65
65
|
]);
|
|
66
66
|
});
|
|
67
67
|
|
|
@@ -77,8 +77,8 @@ describe("extractDropboxOptions", () => {
|
|
|
77
77
|
const result = extractDropboxOptions(lookup);
|
|
78
78
|
|
|
79
79
|
expect(result, "to equal", [
|
|
80
|
-
{ value: "value1", label:
|
|
81
|
-
{ value: "value3", label:
|
|
80
|
+
{ value: "value1", label: "[value1]", sortOrder: 0 },
|
|
81
|
+
{ value: "value3", label: "[value3]", sortOrder: 3 },
|
|
82
82
|
]);
|
|
83
83
|
});
|
|
84
84
|
|