orc-shared 5.10.1-dev.2 → 5.10.1-dev.4

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.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.useMenuProps = exports.default = exports.Menu = exports.CurrentApp = void 0;
5
- var _react = _interopRequireDefault(require("react"));
4
+ exports.useMenuProps = exports.sanitizeEnvironmentCode = exports.getAppEnvironmentInfo = exports.default = exports.Menu = exports.CurrentApp = void 0;
5
+ var _react = _interopRequireWildcard(require("react"));
6
6
  var _reactRedux = require("react-redux");
7
7
  var _reactIntl = require("react-intl");
8
8
  var _styles = require("@material-ui/core/styles");
@@ -16,9 +16,13 @@ var _DropMenu = _interopRequireDefault(require("../DropMenu"));
16
16
  var _Anchor = _interopRequireDefault(require("./Anchor"));
17
17
  var _Help = _interopRequireDefault(require("./Help"));
18
18
  var _sharedMessages = _interopRequireDefault(require("./../../sharedMessages"));
19
+ var _classnames = _interopRequireDefault(require("classnames"));
20
+ var _comparisonHelper = require("../../utils/comparisonHelper");
19
21
  var _excluded = ["menuLabel"],
20
22
  _excluded2 = ["applications", "applicationId", "currentApplication", "onClick", "helpUrl"];
21
23
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
24
+ 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); }
25
+ 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 && {}.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; }
22
26
  (function () {
23
27
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
24
28
  enterModule && enterModule(module);
@@ -27,6 +31,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
27
31
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
28
32
  enterModule && enterModule(module);
29
33
  })();
34
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
35
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
36
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
37
+ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
38
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
39
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
30
40
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
31
41
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
32
42
  var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
@@ -63,6 +73,22 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
63
73
  appLogo: {
64
74
  height: "30px",
65
75
  marginRight: "10px"
76
+ },
77
+ qaContainerColor: {
78
+ backgroundColor: "#9F0F18",
79
+ color: "#FFFFFF"
80
+ },
81
+ intContainerColor: {
82
+ backgroundColor: "#FCA311",
83
+ color: "#000000"
84
+ },
85
+ stgContainerColor: {
86
+ backgroundColor: "#19B9E6",
87
+ color: "#000000"
88
+ },
89
+ localdevContainerColor: {
90
+ backgroundColor: "#87E911",
91
+ color: "#000000"
66
92
  }
67
93
  };
68
94
  });
@@ -116,21 +142,126 @@ __signature__(Menu, "useMenuProps{{ menuLabel, ...menuProps }}", function () {
116
142
  __signature__(Menu, "useMenuProps{{ menuLabel, ...menuProps }}", function () {
117
143
  return [useMenuProps];
118
144
  });
145
+ var sanitizeEnvironmentCode = exports.sanitizeEnvironmentCode = function sanitizeEnvironmentCode(envCode) {
146
+ if (!envCode) {
147
+ return envCode;
148
+ }
149
+ envCode = envCode.toLowerCase();
150
+ var partialEnvCodes = ["prd",
151
+ // to support the old prdhi / prdlow used by SBD
152
+ "int",
153
+ // to support int, int2, etc
154
+ "qa",
155
+ // to support qa, qa2, etc
156
+ "stg",
157
+ // to support stg, stg2, etc
158
+ "localdev" // local development of the platform by product or service teams
159
+ ];
160
+ for (var _i = 0, _partialEnvCodes = partialEnvCodes; _i < _partialEnvCodes.length; _i++) {
161
+ var partialEnvCode = _partialEnvCodes[_i];
162
+ if (envCode.startsWith(partialEnvCode)) {
163
+ return partialEnvCode;
164
+ }
165
+ }
166
+ return envCode; // other names will be used as-is
167
+ };
168
+ var getAppEnvironmentInfo = exports.getAppEnvironmentInfo = function getAppEnvironmentInfo(currentLocation, uiContainerName) {
169
+ var environmentCode = null;
170
+ var sanitizedEnvironmentCode = null;
171
+ var isDeployedLocalDevEnv = false;
172
+ var domainMatch = currentLocation == null ? void 0 : currentLocation.match(/*#__PURE__*/_wrapRegExp(/^([^.]+)\.([^.]+)\.([^.]+)\.orckestra\.(cloud|org)$/, {
173
+ appName: 1,
174
+ envCode: 2,
175
+ clientCode: 3
176
+ }));
177
+ if (domainMatch) {
178
+ environmentCode = domainMatch.groups.envCode;
179
+ } else if (currentLocation != null && currentLocation.toLowerCase().endsWith("local.develop.orckestra.cloud") || (currentLocation == null ? void 0 : currentLocation.toLowerCase()) === "localhost") {
180
+ environmentCode = "localdev";
181
+ } else if (currentLocation != null && currentLocation.toLowerCase().endsWith("develop.orckestra.cloud")) {
182
+ environmentCode = "localdev";
183
+ isDeployedLocalDevEnv = true;
184
+ }
185
+
186
+ // uncomment if you want to force a specific environment / color
187
+ // environmentCode = "prd";
188
+
189
+ sanitizedEnvironmentCode = sanitizeEnvironmentCode(environmentCode);
190
+ if (!sanitizedEnvironmentCode || sanitizedEnvironmentCode === "rel") {
191
+ // we never want a different color / text for our rel environment
192
+ return {
193
+ name: "",
194
+ cssClassCategory: null
195
+ };
196
+ }
197
+ if (!uiContainerName) {
198
+ uiContainerName = "prd"; // fallback in case the container is not defined in a meta tag
199
+ }
200
+ var needCustomCssClass = !!sanitizedEnvironmentCode && !(0, _comparisonHelper.areEqualCaseInsensitive)(sanitizedEnvironmentCode, "prd") || !(0, _comparisonHelper.areEqualCaseInsensitive)(uiContainerName, "prd");
201
+ var cssClassCategory = null;
202
+ var nameParts = [];
203
+ if (!(0, _comparisonHelper.areEqualCaseInsensitive)(sanitizedEnvironmentCode, "prd")) {
204
+ nameParts.push(environmentCode);
205
+ }
206
+ if (needCustomCssClass) {
207
+ var needBuildNumber = false;
208
+ var isPrdUiContainer = (0, _comparisonHelper.areEqualCaseInsensitive)(uiContainerName, "prd");
209
+ if ((0, _comparisonHelper.areEqualCaseInsensitive)(sanitizedEnvironmentCode, "prd")) {
210
+ cssClassCategory = "qa"; // if we end up here, it means that our prd environment is using a different UI container
211
+ needBuildNumber = !isPrdUiContainer;
212
+ } else if ((0, _comparisonHelper.areEqualCaseInsensitive)(sanitizedEnvironmentCode, "localdev")) {
213
+ cssClassCategory = "localdev";
214
+ needBuildNumber = !isPrdUiContainer && isDeployedLocalDevEnv;
215
+ } else if ((0, _comparisonHelper.areEqualCaseInsensitive)(sanitizedEnvironmentCode, "qa")) {
216
+ cssClassCategory = "qa";
217
+ needBuildNumber = !isPrdUiContainer;
218
+ } else if ((0, _comparisonHelper.areEqualCaseInsensitive)(sanitizedEnvironmentCode, "stg")) {
219
+ cssClassCategory = "stg";
220
+ needBuildNumber = !isPrdUiContainer;
221
+ } else {
222
+ // any other container have the int look
223
+ cssClassCategory = "int";
224
+ needBuildNumber = !isPrdUiContainer;
225
+ }
226
+ if (needBuildNumber) {
227
+ nameParts.push("".concat(window.BUILD_NUMBER, "/").concat(uiContainerName));
228
+ }
229
+ }
230
+ return {
231
+ name: nameParts.join(" — "),
232
+ cssClassCategory: cssClassCategory
233
+ };
234
+ };
119
235
  var CurrentApp = exports.CurrentApp = function CurrentApp(_ref) {
120
236
  var displayName = _ref.displayName,
121
237
  iconUri = _ref.iconUri;
122
238
  var classes = useStyles();
239
+ var containerInfo = (0, _react.useMemo)(function () {
240
+ var _document$querySelect;
241
+ return getAppEnvironmentInfo(window.location.hostname, (_document$querySelect = document.querySelector('meta[name="cdn-container-name"]')) == null ? void 0 : _document$querySelect.getAttribute("content"));
242
+ }, []);
243
+ var name;
244
+ if (containerInfo.name) {
245
+ if (displayName) {
246
+ // to avoid issues with tests where "undefined" ends up in the name
247
+ name = "".concat(displayName, " \u2014 ").concat(containerInfo.name);
248
+ } else {
249
+ name = " \u2014 ".concat(containerInfo.name);
250
+ }
251
+ } else {
252
+ name = displayName;
253
+ }
123
254
  return /*#__PURE__*/_react.default.createElement("div", {
124
- className: classes.appLabel
255
+ className: (0, _classnames.default)(classes.appLabel, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.qaContainerColor, containerInfo.cssClassCategory === "qa"), classes.intContainerColor, containerInfo.cssClassCategory === "int"), classes.stgContainerColor, containerInfo.cssClassCategory === "stg"), classes.localdevContainerColor, containerInfo.cssClassCategory === "localdev"))
125
256
  }, /*#__PURE__*/_react.default.createElement("img", {
126
257
  src: iconUri,
127
258
  className: classes.appLogo
128
- }), displayName);
259
+ }), name);
129
260
  };
130
- __signature__(CurrentApp, "useStyles{classes}", function () {
261
+ __signature__(CurrentApp, "useStyles{classes}\nuseMemo{containerInfo}", function () {
131
262
  return [useStyles];
132
263
  });
133
- __signature__(CurrentApp, "useStyles{classes}", function () {
264
+ __signature__(CurrentApp, "useStyles{classes}\nuseMemo{containerInfo}", function () {
134
265
  return [useStyles];
135
266
  });
136
267
  CurrentApp.displayName = "CurrentApp";
@@ -173,6 +304,8 @@ var _default3 = exports.default = _default2;
173
304
  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
174
305
  reactHotLoader.register(useMenuProps, "useMenuProps", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
175
306
  reactHotLoader.register(Menu, "Menu", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
307
+ reactHotLoader.register(sanitizeEnvironmentCode, "sanitizeEnvironmentCode", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
308
+ reactHotLoader.register(getAppEnvironmentInfo, "getAppEnvironmentInfo", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
176
309
  reactHotLoader.register(CurrentApp, "CurrentApp", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
177
310
  reactHotLoader.register(Topbar, "Topbar", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
178
311
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
@@ -191,6 +324,8 @@ var _default3 = exports.default = _default2;
191
324
  reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
192
325
  reactHotLoader.register(useMenuProps, "useMenuProps", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
193
326
  reactHotLoader.register(Menu, "Menu", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
327
+ reactHotLoader.register(sanitizeEnvironmentCode, "sanitizeEnvironmentCode", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
328
+ reactHotLoader.register(getAppEnvironmentInfo, "getAppEnvironmentInfo", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
194
329
  reactHotLoader.register(CurrentApp, "CurrentApp", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
195
330
  reactHotLoader.register(Topbar, "Topbar", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
196
331
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/AppFrame/Topbar.js");
@@ -6,7 +6,7 @@ var _immutable = _interopRequireDefault(require("immutable"));
6
6
  var _lodash = require("lodash");
7
7
  var _ListHelper;
8
8
  var _excluded = ["resetList", "scope", "filters", "sorting"],
9
- _excluded2 = ["sorting", "filters", "scope", "page", "nextPageToLoad", "index", "list", "totalCount"];
9
+ _excluded2 = ["sorting", "filters", "scope", "page", "nextPageToLoad", "index", "list", "totalCount", "searchRequested"];
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  (function () {
12
12
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
@@ -30,13 +30,16 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
30
30
  return a;
31
31
  };
32
32
  var ListInfoPropertyName = exports.ListInfoPropertyName = "listInfo";
33
- var standardInfoKeys = ["scope", "page", "filters", "sorting", "totalCount", "nextPageToLoad", "index", "list"];
33
+ var standardInfoKeys = ["scope", "page", "filters", "sorting", "totalCount", "nextPageToLoad", "index", "list", "searchRequested"];
34
34
  var ListReducerHelper = /*#__PURE__*/function () {
35
35
  function ListReducerHelper(groupPropertyName) {
36
36
  var _this = this;
37
37
  _defineProperty(this, "setNextPageToLoad", function (state, nextPageToLoad) {
38
38
  return state.setIn([_this.groupPropertyName, "nextPageToLoad"], nextPageToLoad);
39
39
  });
40
+ _defineProperty(this, "setSearchRequested", function (state, searchRequested) {
41
+ return state.setIn([_this.groupPropertyName, "searchRequested"], searchRequested);
42
+ });
40
43
  _defineProperty(this, "setResults", function (state, listInfo, forceReset) {
41
44
  if (forceReset === void 0) {
42
45
  forceReset = false;
@@ -79,6 +82,7 @@ var ListReducerHelper = /*#__PURE__*/function () {
79
82
  s.setIn([_this.groupPropertyName, "scope"], scope != null ? scope : null);
80
83
  s.setIn([_this.groupPropertyName, "filters"], _immutable.default.fromJS(filters != null ? filters : null));
81
84
  s.setIn([_this.groupPropertyName, "sorting"], _immutable.default.fromJS(sorting != null ? sorting : null));
85
+ s.setIn([_this.groupPropertyName, "searchRequested"], false);
82
86
  var otherKeys = Object.keys(others);
83
87
  s.get(_this.groupPropertyName).keySeq().forEach(function (key) {
84
88
  if (!standardInfoKeys.includes(key) && !otherKeys.includes(key)) {
@@ -109,7 +113,7 @@ var ListReducerHelper = /*#__PURE__*/function () {
109
113
  if (propertiesToKeep === void 0) {
110
114
  propertiesToKeep = {};
111
115
  }
112
- var updatedState = state.setIn([_this.groupPropertyName, "nextPageToLoad"], 1).setIn([_this.groupPropertyName, "index"], _immutable.default.fromJS({})).setIn([_this.groupPropertyName, "list"], _immutable.default.fromJS([])).setIn([_this.groupPropertyName, "totalCount"], 0);
116
+ var updatedState = state.setIn([_this.groupPropertyName, "nextPageToLoad"], 1).setIn([_this.groupPropertyName, "searchRequested"], false).setIn([_this.groupPropertyName, "index"], _immutable.default.fromJS({})).setIn([_this.groupPropertyName, "list"], _immutable.default.fromJS([])).setIn([_this.groupPropertyName, "totalCount"], 0);
113
117
  if (!propertiesToKeep.filters) {
114
118
  updatedState = updatedState.setIn([_this.groupPropertyName, "filters"], null);
115
119
  }
@@ -145,7 +149,8 @@ var ListSelectorHelper = /*#__PURE__*/function () {
145
149
  currentPage: listInfo.get("page"),
146
150
  currentFilters: (_listInfo$get = listInfo.get("filters")) == null ? void 0 : _listInfo$get.toJS(),
147
151
  currentSorting: (_listInfo$get2 = listInfo.get("sorting")) == null ? void 0 : _listInfo$get2.toJS(),
148
- totalCount: listInfo.get("totalCount")
152
+ totalCount: listInfo.get("totalCount"),
153
+ searchRequested: listInfo.get("searchRequested")
149
154
  };
150
155
  listInfo.mapKeys(function (key, value) {
151
156
  if (standardInfoKeys.includes(key)) {
@@ -165,6 +170,9 @@ var ListSelectorHelper = /*#__PURE__*/function () {
165
170
  _defineProperty(this, "getNextPageToLoad", function (state) {
166
171
  return state.getIn([_this2.groupPropertyName, "nextPageToLoad"]);
167
172
  });
173
+ _defineProperty(this, "getSearchRequested", function (state) {
174
+ return state.getIn([_this2.groupPropertyName, "searchRequested"]);
175
+ });
168
176
  this.groupPropertyName = groupPropertyName;
169
177
  }
170
178
  var _proto2 = ListSelectorHelper.prototype;
@@ -200,6 +208,7 @@ var ListHelper = /*#__PURE__*/function () {
200
208
  index = _ref4.index,
201
209
  list = _ref4.list,
202
210
  totalCount = _ref4.totalCount,
211
+ searchRequested = _ref4.searchRequested,
203
212
  additionalValues = _objectWithoutProperties(_ref4, _excluded2);
204
213
  return _defineProperty({}, _this3.groupPropertyName, _objectSpread({
205
214
  sorting: sorting != null ? sorting : null,
@@ -209,7 +218,8 @@ var ListHelper = /*#__PURE__*/function () {
209
218
  nextPageToLoad: nextPageToLoad != null ? nextPageToLoad : 1,
210
219
  index: index != null ? index : {},
211
220
  list: list != null ? list : [],
212
- totalCount: totalCount != null ? totalCount : 0
221
+ totalCount: totalCount != null ? totalCount : 0,
222
+ searchRequested: searchRequested != null ? searchRequested : false
213
223
  }, additionalValues));
214
224
  });
215
225
  this.groupPropertyName = groupPropertyName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orc-shared",
3
- "version": "5.10.1-dev.2",
3
+ "version": "5.10.1-dev.4",
4
4
  "description": "Shared code for Orckestra applications",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useMemo } from "react";
2
2
  import { useDispatch, useSelector } from "react-redux";
3
3
  import { useIntl } from "react-intl";
4
4
  import { makeStyles } from "@material-ui/core/styles";
@@ -12,6 +12,8 @@ import DropMenu from "../DropMenu";
12
12
  import Anchor from "./Anchor";
13
13
  import Help from "./Help";
14
14
  import sharedMessages from "./../../sharedMessages";
15
+ import classNames from "classnames";
16
+ import { areEqualCaseInsensitive } from "../../utils/comparisonHelper";
15
17
 
16
18
  const useStyles = makeStyles(theme => ({
17
19
  wrapper: {
@@ -41,6 +43,22 @@ const useStyles = makeStyles(theme => ({
41
43
  height: "30px",
42
44
  marginRight: "10px",
43
45
  },
46
+ qaContainerColor: {
47
+ backgroundColor: "#9F0F18",
48
+ color: "#FFFFFF",
49
+ },
50
+ intContainerColor: {
51
+ backgroundColor: "#FCA311",
52
+ color: "#000000",
53
+ },
54
+ stgContainerColor: {
55
+ backgroundColor: "#19B9E6",
56
+ color: "#000000",
57
+ },
58
+ localdevContainerColor: {
59
+ backgroundColor: "#87E911",
60
+ color: "#000000",
61
+ },
44
62
  }));
45
63
 
46
64
  export const useMenuProps = () => {
@@ -81,13 +99,146 @@ export const Menu = () => {
81
99
  );
82
100
  };
83
101
 
102
+ export const sanitizeEnvironmentCode = envCode => {
103
+ if (!envCode) {
104
+ return envCode;
105
+ }
106
+
107
+ envCode = envCode.toLowerCase();
108
+
109
+ const partialEnvCodes = [
110
+ "prd", // to support the old prdhi / prdlow used by SBD
111
+ "int", // to support int, int2, etc
112
+ "qa", // to support qa, qa2, etc
113
+ "stg", // to support stg, stg2, etc
114
+ "localdev", // local development of the platform by product or service teams
115
+ ];
116
+
117
+ for (const partialEnvCode of partialEnvCodes) {
118
+ if (envCode.startsWith(partialEnvCode)) {
119
+ return partialEnvCode;
120
+ }
121
+ }
122
+
123
+ return envCode; // other names will be used as-is
124
+ };
125
+
126
+ export const getAppEnvironmentInfo = (currentLocation, uiContainerName) => {
127
+ let environmentCode = null;
128
+ let sanitizedEnvironmentCode = null;
129
+ let isDeployedLocalDevEnv = false;
130
+
131
+ const domainMatch = currentLocation?.match(
132
+ /^(?<appName>[^.]+)\.(?<envCode>[^.]+)\.(?<clientCode>[^.]+)\.orckestra\.(cloud|org)$/,
133
+ );
134
+
135
+ if (domainMatch) {
136
+ environmentCode = domainMatch.groups.envCode;
137
+ } else if (
138
+ currentLocation?.toLowerCase().endsWith("local.develop.orckestra.cloud") ||
139
+ currentLocation?.toLowerCase() === "localhost"
140
+ ) {
141
+ environmentCode = "localdev";
142
+ } else if (currentLocation?.toLowerCase().endsWith("develop.orckestra.cloud")) {
143
+ environmentCode = "localdev";
144
+ isDeployedLocalDevEnv = true;
145
+ }
146
+
147
+ // uncomment if you want to force a specific environment / color
148
+ // environmentCode = "prd";
149
+
150
+ sanitizedEnvironmentCode = sanitizeEnvironmentCode(environmentCode);
151
+
152
+ if (!sanitizedEnvironmentCode || sanitizedEnvironmentCode === "rel") {
153
+ // we never want a different color / text for our rel environment
154
+ return {
155
+ name: "",
156
+ cssClassCategory: null,
157
+ };
158
+ }
159
+
160
+ if (!uiContainerName) {
161
+ uiContainerName = "prd"; // fallback in case the container is not defined in a meta tag
162
+ }
163
+
164
+ const needCustomCssClass =
165
+ (!!sanitizedEnvironmentCode && !areEqualCaseInsensitive(sanitizedEnvironmentCode, "prd")) ||
166
+ !areEqualCaseInsensitive(uiContainerName, "prd");
167
+
168
+ let cssClassCategory = null;
169
+
170
+ const nameParts = [];
171
+
172
+ if (!areEqualCaseInsensitive(sanitizedEnvironmentCode, "prd")) {
173
+ nameParts.push(environmentCode);
174
+ }
175
+
176
+ if (needCustomCssClass) {
177
+ let needBuildNumber = false;
178
+ const isPrdUiContainer = areEqualCaseInsensitive(uiContainerName, "prd");
179
+
180
+ if (areEqualCaseInsensitive(sanitizedEnvironmentCode, "prd")) {
181
+ cssClassCategory = "qa"; // if we end up here, it means that our prd environment is using a different UI container
182
+ needBuildNumber = !isPrdUiContainer;
183
+ } else if (areEqualCaseInsensitive(sanitizedEnvironmentCode, "localdev")) {
184
+ cssClassCategory = "localdev";
185
+ needBuildNumber = !isPrdUiContainer && isDeployedLocalDevEnv;
186
+ } else if (areEqualCaseInsensitive(sanitizedEnvironmentCode, "qa")) {
187
+ cssClassCategory = "qa";
188
+ needBuildNumber = !isPrdUiContainer;
189
+ } else if (areEqualCaseInsensitive(sanitizedEnvironmentCode, "stg")) {
190
+ cssClassCategory = "stg";
191
+ needBuildNumber = !isPrdUiContainer;
192
+ } else {
193
+ // any other container have the int look
194
+ cssClassCategory = "int";
195
+ needBuildNumber = !isPrdUiContainer;
196
+ }
197
+
198
+ if (needBuildNumber) {
199
+ nameParts.push(`${window.BUILD_NUMBER}/${uiContainerName}`);
200
+ }
201
+ }
202
+
203
+ return {
204
+ name: nameParts.join(" — "),
205
+ cssClassCategory: cssClassCategory,
206
+ };
207
+ };
208
+
84
209
  export const CurrentApp = ({ displayName, iconUri }) => {
85
210
  const classes = useStyles();
211
+ const containerInfo = useMemo(() => {
212
+ return getAppEnvironmentInfo(
213
+ window.location.hostname,
214
+ document.querySelector('meta[name="cdn-container-name"]')?.getAttribute("content"),
215
+ );
216
+ }, []);
217
+
218
+ let name;
219
+
220
+ if (containerInfo.name) {
221
+ if (displayName) {
222
+ // to avoid issues with tests where "undefined" ends up in the name
223
+ name = `${displayName} — ${containerInfo.name}`;
224
+ } else {
225
+ name = ` — ${containerInfo.name}`;
226
+ }
227
+ } else {
228
+ name = displayName;
229
+ }
86
230
 
87
231
  return (
88
- <div className={classes.appLabel}>
232
+ <div
233
+ className={classNames(classes.appLabel, {
234
+ [classes.qaContainerColor]: containerInfo.cssClassCategory === "qa",
235
+ [classes.intContainerColor]: containerInfo.cssClassCategory === "int",
236
+ [classes.stgContainerColor]: containerInfo.cssClassCategory === "stg",
237
+ [classes.localdevContainerColor]: containerInfo.cssClassCategory === "localdev",
238
+ })}
239
+ >
89
240
  <img src={iconUri} className={classes.appLogo} />
90
- {displayName}
241
+ {name}
91
242
  </div>
92
243
  );
93
244
  };
@@ -10,7 +10,7 @@ import { SIGN_OUT_REQUEST, SIGN_OUT_SUCCESS, SIGN_OUT_FAILURE } from "../../acti
10
10
  import { PREFS_NAME } from "./Preferences";
11
11
  import { ABOUT_NAME } from "./About";
12
12
  import ApplicationSelector from "./ApplicationSelector";
13
- import Topbar, { CurrentApp, useMenuProps } from "./Topbar";
13
+ import Topbar, { CurrentApp, getAppEnvironmentInfo, sanitizeEnvironmentCode, useMenuProps } from "./Topbar";
14
14
 
15
15
  jest.mock("../../utils/buildUrl", () => {
16
16
  const modExport = {};
@@ -80,7 +80,7 @@ describe("Topbar", () => {
80
80
  <ApplicationSelector {...props} />
81
81
  <div>
82
82
  <img src="/test/url" />
83
- Test label
83
+ Test label — localdev
84
84
  </div>
85
85
  </div>
86
86
  <Ignore />
@@ -102,6 +102,7 @@ describe("Topbar", () => {
102
102
  <Ignore />
103
103
  <div>
104
104
  <img />
105
+ {" — localdev"}
105
106
  </div>
106
107
  </div>
107
108
  <Ignore />
@@ -123,6 +124,7 @@ describe("Topbar", () => {
123
124
  <Ignore />
124
125
  <div>
125
126
  <img />
127
+ {" — localdev"}
126
128
  </div>
127
129
  </div>
128
130
  <Ignore />
@@ -232,7 +234,20 @@ describe("useMenuProps", () => {
232
234
  ));
233
235
  });
234
236
 
235
- describe("CurrentApp", () => {
237
+ describe("CurrentApp for production site", () => {
238
+ const { location } = window;
239
+
240
+ beforeAll(() => {
241
+ delete window.location;
242
+
243
+ window.location = {
244
+ hostname: "oco.prd.platform.orckestra.cloud",
245
+ };
246
+ });
247
+ afterAll(() => {
248
+ window.location = location;
249
+ });
250
+
236
251
  it("renders the app logo and name", () =>
237
252
  expect(
238
253
  <CurrentApp displayName="Test label" iconUri="/test/url" />,
@@ -244,3 +259,143 @@ describe("CurrentApp", () => {
244
259
  </div>,
245
260
  ));
246
261
  });
262
+
263
+ describe("CurrentApp for localhost", () => {
264
+ it("renders the app logo and name and with build info", () => {
265
+ expect(
266
+ <CurrentApp displayName="Test label" iconUri="/test/url" />,
267
+ "when mounted",
268
+ "to satisfy",
269
+ <div>
270
+ <img src="/test/url" />
271
+ Test label — localdev
272
+ </div>,
273
+ );
274
+ });
275
+ });
276
+
277
+ describe("sanitizeEnvironmentCode", () => {
278
+ it.each([
279
+ [null, null],
280
+ [undefined, undefined],
281
+ ["demo1", "demo1"],
282
+ ["prd", "prd"],
283
+ ["prdhi", "prd"],
284
+ ["prd2", "prd"],
285
+ ["qa", "qa"],
286
+ ["qahi", "qa"],
287
+ ["qa2", "qa"],
288
+ ["int", "int"],
289
+ ["inthi", "int"],
290
+ ["int2", "int"],
291
+ ["stg", "stg"],
292
+ ["stghi", "stg"],
293
+ ["stg2", "stg"],
294
+ ["localdev", "localdev"],
295
+ ["localdevhi", "localdev"],
296
+ ["localdev2", "localdev"],
297
+ ])("Should sanitize %s as %s", (code, expectedSanitizedVersion) => {
298
+ const sanitizedVersion = sanitizeEnvironmentCode(code);
299
+
300
+ expect(sanitizedVersion, "to equal", expectedSanitizedVersion);
301
+ });
302
+ });
303
+
304
+ describe("getAppEnvironmentInfo", () => {
305
+ let originalBuildNumber;
306
+
307
+ beforeEach(() => {
308
+ originalBuildNumber = window.BUILD_NUMBER;
309
+ window.BUILD_NUMBER = "1.2-alpha888";
310
+ });
311
+
312
+ afterEach(() => {
313
+ window.BUILD_NUMBER = originalBuildNumber;
314
+ });
315
+
316
+ it.each([
317
+ [null, "prd", "", null],
318
+ ["", "prd", "", null],
319
+ ["prd", null, "", null],
320
+ ["prd", "", "", null],
321
+ ["prd", "prd", "", null],
322
+ ["prd", "qa", "1.2-alpha888/qa", "qa"],
323
+ ["prd", "int", "1.2-alpha888/int", "qa"],
324
+ ["qa", "prd", "qa", "qa"],
325
+ ["qa", "qa", "qa — 1.2-alpha888/qa", "qa"],
326
+ ["qa", "int", "qa — 1.2-alpha888/int", "qa"],
327
+ ["int", "prd", "int", "int"],
328
+ ["int", "qa", "int — 1.2-alpha888/qa", "int"],
329
+ ["int", "int", "int — 1.2-alpha888/int", "int"],
330
+ ["stg", "prd", "stg", "stg"],
331
+ ["stg", "stg", "stg — 1.2-alpha888/stg", "stg"],
332
+ ["stg", "int", "stg — 1.2-alpha888/int", "stg"],
333
+ ["demo1", "prd", "demo1", "int"],
334
+ ["demo1", "stg", "demo1 — 1.2-alpha888/stg", "int"],
335
+ ["demo1", "int", "demo1 — 1.2-alpha888/int", "int"],
336
+ ["rel", "prd", "", null],
337
+ ["rel", "stg", "", null],
338
+ ["rel", "int", "", null],
339
+ ["localdev", "prd", "localdev", "localdev"],
340
+ ["localdev", "qa", "localdev", "localdev"],
341
+ ])(
342
+ "getAppEnvironmentInfo for %s url and %s UI container",
343
+ (envCode, uiContainerName, expectedName, expectedCssClassCategory) => {
344
+ const info = getAppEnvironmentInfo(
345
+ envCode ? `oco.${envCode}.platform.orckestra.cloud` : envCode,
346
+ uiContainerName,
347
+ );
348
+
349
+ const expected = {
350
+ name: expectedName,
351
+ cssClassCategory: expectedCssClassCategory,
352
+ };
353
+
354
+ expect(info, "to equal", expected);
355
+ },
356
+ );
357
+
358
+ it("getAppEnvironmentInfo for localdev (occ-dev-oco.develop.orckestra.cloud) and prd UI container", () => {
359
+ const info = getAppEnvironmentInfo("occ-dev-oco.develop.orckestra.cloud", "prd");
360
+
361
+ const expected = {
362
+ name: "localdev",
363
+ cssClassCategory: "localdev",
364
+ };
365
+
366
+ expect(info, "to equal", expected);
367
+ });
368
+
369
+ it("getAppEnvironmentInfo for localdev (occ-dev-oco.develop.orckestra.cloud) and qa UI container", () => {
370
+ const info = getAppEnvironmentInfo("occ-dev-oco.develop.orckestra.cloud", "qa");
371
+
372
+ const expected = {
373
+ name: "localdev — 1.2-alpha888/qa",
374
+ cssClassCategory: "localdev",
375
+ };
376
+
377
+ expect(info, "to equal", expected);
378
+ });
379
+
380
+ it("getAppEnvironmentInfo for localdev (local.develop.orckestra.cloud) and prd UI container", () => {
381
+ const info = getAppEnvironmentInfo("local.develop.orckestra.cloud", "prd");
382
+
383
+ const expected = {
384
+ name: "localdev",
385
+ cssClassCategory: "localdev",
386
+ };
387
+
388
+ expect(info, "to equal", expected);
389
+ });
390
+
391
+ it("getAppEnvironmentInfo for localdev (localhost) and prd UI container", () => {
392
+ const info = getAppEnvironmentInfo("localhost", "prd");
393
+
394
+ const expected = {
395
+ name: "localdev",
396
+ cssClassCategory: "localdev",
397
+ };
398
+
399
+ expect(info, "to equal", expected);
400
+ });
401
+ });
@@ -3,7 +3,17 @@ import { isObject } from "lodash";
3
3
 
4
4
  export const ListInfoPropertyName = "listInfo";
5
5
 
6
- const standardInfoKeys = ["scope", "page", "filters", "sorting", "totalCount", "nextPageToLoad", "index", "list"];
6
+ const standardInfoKeys = [
7
+ "scope",
8
+ "page",
9
+ "filters",
10
+ "sorting",
11
+ "totalCount",
12
+ "nextPageToLoad",
13
+ "index",
14
+ "list",
15
+ "searchRequested",
16
+ ];
7
17
 
8
18
  class ListReducerHelper {
9
19
  constructor(groupPropertyName) {
@@ -14,6 +24,10 @@ class ListReducerHelper {
14
24
  return state.setIn([this.groupPropertyName, "nextPageToLoad"], nextPageToLoad);
15
25
  };
16
26
 
27
+ setSearchRequested = (state, searchRequested) => {
28
+ return state.setIn([this.groupPropertyName, "searchRequested"], searchRequested);
29
+ };
30
+
17
31
  setResults = (state, listInfo, forceReset = false) => {
18
32
  return state.withMutations(s => {
19
33
  const page = s.getIn([this.groupPropertyName, "nextPageToLoad"]);
@@ -51,6 +65,7 @@ class ListReducerHelper {
51
65
  s.setIn([this.groupPropertyName, "scope"], scope ?? null);
52
66
  s.setIn([this.groupPropertyName, "filters"], Immutable.fromJS(filters ?? null));
53
67
  s.setIn([this.groupPropertyName, "sorting"], Immutable.fromJS(sorting ?? null));
68
+ s.setIn([this.groupPropertyName, "searchRequested"], false);
54
69
 
55
70
  const otherKeys = Object.keys(others);
56
71
 
@@ -90,6 +105,7 @@ class ListReducerHelper {
90
105
  resetListInfo = (state, propertiesToKeep = {}) => {
91
106
  let updatedState = state
92
107
  .setIn([this.groupPropertyName, "nextPageToLoad"], 1)
108
+ .setIn([this.groupPropertyName, "searchRequested"], false)
93
109
  .setIn([this.groupPropertyName, "index"], Immutable.fromJS({}))
94
110
  .setIn([this.groupPropertyName, "list"], Immutable.fromJS([]))
95
111
  .setIn([this.groupPropertyName, "totalCount"], 0);
@@ -128,6 +144,7 @@ class ListSelectorHelper {
128
144
  currentFilters: listInfo.get("filters")?.toJS(),
129
145
  currentSorting: listInfo.get("sorting")?.toJS(),
130
146
  totalCount: listInfo.get("totalCount"),
147
+ searchRequested: listInfo.get("searchRequested"),
131
148
  };
132
149
 
133
150
  listInfo.mapKeys((key, value) => {
@@ -152,6 +169,10 @@ class ListSelectorHelper {
152
169
  getNextPageToLoad = state => {
153
170
  return state.getIn([this.groupPropertyName, "nextPageToLoad"]);
154
171
  };
172
+
173
+ getSearchRequested = state => {
174
+ return state.getIn([this.groupPropertyName, "searchRequested"]);
175
+ };
155
176
  }
156
177
 
157
178
  class ListHelper {
@@ -182,6 +203,7 @@ class ListHelper {
182
203
  index,
183
204
  list,
184
205
  totalCount,
206
+ searchRequested,
185
207
  ...additionalValues
186
208
  } = {}) => {
187
209
  return {
@@ -194,6 +216,7 @@ class ListHelper {
194
216
  index: index ?? {},
195
217
  list: list ?? [],
196
218
  totalCount: totalCount ?? 0,
219
+ searchRequested: searchRequested ?? false,
197
220
  ...additionalValues,
198
221
  },
199
222
  };
@@ -14,6 +14,7 @@ describe("createInitialListInfo", () => {
14
14
  index: {},
15
15
  list: [],
16
16
  totalCount: 0,
17
+ searchRequested: false,
17
18
  },
18
19
  });
19
20
  });
@@ -33,6 +34,7 @@ describe("createInitialListInfo", () => {
33
34
  index: {},
34
35
  list: [],
35
36
  totalCount: 0,
37
+ searchRequested: false,
36
38
  prop1: 123,
37
39
  prop2: { subprop: "a" },
38
40
  },
@@ -49,6 +51,7 @@ describe("createInitialListInfo", () => {
49
51
  index: { c: 1 },
50
52
  list: [1, 2, 3],
51
53
  totalCount: 10,
54
+ searchRequested: false,
52
55
  prop1: 123,
53
56
  prop2: { subprop: "a" },
54
57
  });
@@ -62,6 +65,7 @@ describe("createInitialListInfo", () => {
62
65
  index: { c: 1 },
63
66
  list: [1, 2, 3],
64
67
  totalCount: 10,
68
+ searchRequested: false,
65
69
  prop1: 123,
66
70
  prop2: { subprop: "a" },
67
71
  },
@@ -82,6 +86,7 @@ describe("createListInfoFrom", () => {
82
86
  index: {},
83
87
  list: [],
84
88
  totalCount: 0,
89
+ searchRequested: false,
85
90
  },
86
91
  });
87
92
  });
@@ -101,6 +106,7 @@ describe("createListInfoFrom", () => {
101
106
  index: {},
102
107
  list: [],
103
108
  totalCount: 0,
109
+ searchRequested: false,
104
110
  prop1: 123,
105
111
  prop2: { subprop: "a" },
106
112
  },
@@ -117,6 +123,7 @@ describe("createListInfoFrom", () => {
117
123
  index: { c: 1 },
118
124
  list: [1, 2, 3],
119
125
  totalCount: 10,
126
+ searchRequested: false,
120
127
  prop1: 123,
121
128
  prop2: { subprop: "a" },
122
129
  });
@@ -130,6 +137,7 @@ describe("createListInfoFrom", () => {
130
137
  index: { c: 1 },
131
138
  list: [1, 2, 3],
132
139
  totalCount: 10,
140
+ searchRequested: false,
133
141
  prop1: 123,
134
142
  prop2: { subprop: "a" },
135
143
  },
@@ -148,6 +156,7 @@ describe("ListSelectorHelper", () => {
148
156
  index: { c: 1 },
149
157
  list: [1, 2, 3],
150
158
  totalCount: 10,
159
+ searchRequested: true,
151
160
  prop1: 123,
152
161
  prop2: { subprop: "a" },
153
162
  }),
@@ -168,6 +177,11 @@ describe("ListSelectorHelper", () => {
168
177
  expect(value, "to equal", Immutable.fromJS({ c: 1 }));
169
178
  });
170
179
 
180
+ it("getSearchRequested", () => {
181
+ const value = ListHelper.selector.getSearchRequested(initialState);
182
+ expect(value, "to equal", true);
183
+ });
184
+
171
185
  it("getCurrentInfo", () => {
172
186
  const value = ListHelper.selector.getCurrentInfo(initialState);
173
187
  expect(value, "to equal", {
@@ -176,6 +190,7 @@ describe("ListSelectorHelper", () => {
176
190
  currentScope: "canada",
177
191
  currentPage: 1,
178
192
  totalCount: 10,
193
+ searchRequested: true,
179
194
  prop1: 123,
180
195
  prop2: { subprop: "a" },
181
196
  });
@@ -191,6 +206,7 @@ describe("ListSelectorHelper", () => {
191
206
  currentScope: "canada",
192
207
  currentPage: 1,
193
208
  totalCount: 10,
209
+ searchRequested: true,
194
210
  prop1: 123,
195
211
  prop2: { subprop: "a" },
196
212
  });
@@ -204,6 +220,7 @@ describe("ListSelectorHelper", () => {
204
220
  currentScope: undefined,
205
221
  currentPage: undefined,
206
222
  totalCount: undefined,
223
+ searchRequested: undefined,
207
224
  });
208
225
  });
209
226
  });
@@ -219,6 +236,7 @@ describe("ListReducerHelper", () => {
219
236
  index: { c: 1 },
220
237
  list: [1, 2, 3],
221
238
  totalCount: 10,
239
+ searchRequested: false,
222
240
  prop1: 123,
223
241
  prop2: { subprop: "a" },
224
242
  }),
@@ -239,6 +257,30 @@ describe("ListReducerHelper", () => {
239
257
  index: { c: 1 },
240
258
  list: [1, 2, 3],
241
259
  totalCount: 10,
260
+ searchRequested: false,
261
+ prop1: 123,
262
+ prop2: { subprop: "a" },
263
+ }),
264
+ ),
265
+ );
266
+ });
267
+
268
+ it("setSearchRequested", () => {
269
+ const newState = ListHelper.reducer.setSearchRequested(initialState, true);
270
+ expect(
271
+ newState,
272
+ "to equal",
273
+ Immutable.fromJS(
274
+ ListHelper.createListInfoFrom({
275
+ sorting: { a: 1 },
276
+ filters: { b: 1 },
277
+ scope: "canada",
278
+ page: 1,
279
+ nextPageToLoad: 2,
280
+ index: { c: 1 },
281
+ list: [1, 2, 3],
282
+ totalCount: 10,
283
+ searchRequested: true,
242
284
  prop1: 123,
243
285
  prop2: { subprop: "a" },
244
286
  }),
@@ -269,6 +311,7 @@ describe("ListReducerHelper", () => {
269
311
  index: { d: 1 },
270
312
  list: [4, 5, 6],
271
313
  totalCount: 222,
314
+ searchRequested: undefined,
272
315
  prop1: 123,
273
316
  prop2: { subprop: "a" },
274
317
  }),
@@ -300,6 +343,7 @@ describe("ListReducerHelper", () => {
300
343
  index: {},
301
344
  list: [4, 5, 6],
302
345
  totalCount: 222,
346
+ searchRequested: undefined,
303
347
  prop1: 123,
304
348
  prop2: { subprop: "a" },
305
349
  }),
@@ -327,6 +371,7 @@ describe("ListReducerHelper", () => {
327
371
  index: { c: 1, d: 1 },
328
372
  list: [1, 2, 3, 4, 5, 6],
329
373
  totalCount: 222,
374
+ searchRequested: undefined,
330
375
  prop1: 123,
331
376
  prop2: { subprop: "a" },
332
377
  }),
@@ -354,6 +399,7 @@ describe("ListReducerHelper", () => {
354
399
  index: { d: 1 },
355
400
  list: [4, 5, 6],
356
401
  totalCount: 222,
402
+ searchRequested: undefined,
357
403
  prop1: 123,
358
404
  prop2: { subprop: "a" },
359
405
  }),
@@ -384,6 +430,7 @@ describe("ListReducerHelper", () => {
384
430
  index: {},
385
431
  list: [],
386
432
  totalCount: 0,
433
+ searchRequested: false,
387
434
  prop1: 456,
388
435
  prop2: { subprop: "b" },
389
436
  }),
@@ -414,6 +461,7 @@ describe("ListReducerHelper", () => {
414
461
  index: { c: 1 },
415
462
  list: [1, 2, 3],
416
463
  totalCount: 10,
464
+ searchRequested: false,
417
465
  prop1: 456,
418
466
  prop2: { subprop: "b" },
419
467
  }),
@@ -444,6 +492,7 @@ describe("ListReducerHelper", () => {
444
492
  index: { c: 1 },
445
493
  list: [1, 2, 3],
446
494
  totalCount: 10,
495
+ searchRequested: false,
447
496
  prop1: 456,
448
497
  prop3: 789,
449
498
  }),
@@ -472,6 +521,7 @@ describe("ListReducerHelper", () => {
472
521
  index: { c: 1 },
473
522
  list: [1, 2, 3],
474
523
  totalCount: 10,
524
+ searchRequested: false,
475
525
  }),
476
526
  ),
477
527
  );
@@ -500,6 +550,7 @@ describe("ListReducerHelper", () => {
500
550
  index: { c: 1 },
501
551
  list: [1, 2, 3],
502
552
  totalCount: 10,
553
+ searchRequested: false,
503
554
  prop1: 456,
504
555
  prop2: { subprop: "b" },
505
556
  }),
@@ -522,6 +573,7 @@ describe("ListReducerHelper", () => {
522
573
  index: { c: 1 },
523
574
  list: [1, 2, 3],
524
575
  totalCount: 10,
576
+ searchRequested: false,
525
577
  }),
526
578
  ),
527
579
  );
@@ -542,6 +594,7 @@ describe("ListReducerHelper", () => {
542
594
  index: { c: 1, d: 888 },
543
595
  list: [1, 2, 3],
544
596
  totalCount: 10,
597
+ searchRequested: false,
545
598
  prop1: 123,
546
599
  prop2: { subprop: "a" },
547
600
  }),
@@ -564,6 +617,7 @@ describe("ListReducerHelper", () => {
564
617
  index: { c: 1 },
565
618
  list: [1, 2, 3, 888],
566
619
  totalCount: 10,
620
+ searchRequested: false,
567
621
  prop1: 123,
568
622
  prop2: { subprop: "a" },
569
623
  }),
@@ -586,6 +640,7 @@ describe("ListReducerHelper", () => {
586
640
  index: { c: 888 },
587
641
  list: [1, 2, 3],
588
642
  totalCount: 10,
643
+ searchRequested: false,
589
644
  prop1: 123,
590
645
  prop2: { subprop: "a" },
591
646
  }),
@@ -608,6 +663,7 @@ describe("ListReducerHelper", () => {
608
663
  index: { c: 1 },
609
664
  list: [1, 2, 3],
610
665
  totalCount: 10,
666
+ searchRequested: false,
611
667
  prop1: 123,
612
668
  prop2: { subprop: "a" },
613
669
  }),
@@ -630,6 +686,7 @@ describe("ListReducerHelper", () => {
630
686
  index: {},
631
687
  list: [1, 2, 3],
632
688
  totalCount: 10,
689
+ searchRequested: false,
633
690
  prop1: 123,
634
691
  prop2: { subprop: "a" },
635
692
  }),
@@ -652,6 +709,7 @@ describe("ListReducerHelper", () => {
652
709
  index: { c: 1 },
653
710
  list: [1, 2, 3],
654
711
  totalCount: 10,
712
+ searchRequested: false,
655
713
  prop1: 123,
656
714
  prop2: { subprop: "a" },
657
715
  }),
@@ -674,6 +732,7 @@ describe("ListReducerHelper", () => {
674
732
  index: {},
675
733
  list: [],
676
734
  totalCount: 0,
735
+ searchRequested: false,
677
736
  prop1: 123,
678
737
  prop2: { subprop: "a" },
679
738
  }),
@@ -701,6 +760,7 @@ describe("ListReducerHelper", () => {
701
760
  index: {},
702
761
  list: [],
703
762
  totalCount: 0,
763
+ searchRequested: false,
704
764
  prop1: 123,
705
765
  prop2: { subprop: "a" },
706
766
  }),