orc-shared 5.8.0-dev.4 → 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.
@@ -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, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orc-shared",
3
- "version": "5.8.0-dev.4",
3
+ "version": "5.8.0-dev.5",
4
4
  "description": "Shared code for Orckestra applications",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
@@ -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}>