orc-shared 5.8.0-dev.2 → 5.8.0-dev.3
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/actions/makeApiAction.js +2 -2
- package/dist/actions/makeOrcApiAction.js +2 -2
- package/dist/actions/metadata.js +2 -2
- package/dist/actions/navigation.js +2 -2
- package/dist/buildStore.js +2 -2
- package/dist/components/AppFrame/About.js +2 -2
- package/dist/components/AppFrame/Preferences.js +2 -3
- package/dist/components/Form/FieldList.js +5 -6
- package/dist/components/Form/Inputs/Text.js +0 -1
- package/dist/components/Form/Inputs/Translation.js +2 -2
- package/dist/components/List/enhanceColumnDefs.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/Modal.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/Notification.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +12 -9
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +2 -2
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +2 -2
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/Checkbox.js +2 -2
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +2 -2
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/DatePicker.js +2 -2
- package/dist/components/MaterialUI/Inputs/InputBase.js +2 -2
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/RadioProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/Select.js +2 -2
- package/dist/components/MaterialUI/Inputs/SelectProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +2 -2
- package/dist/components/MaterialUI/Inputs/Switch.js +2 -2
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/createInput.js +2 -2
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +2 -2
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +2 -2
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +2 -3
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +2 -2
- package/dist/components/MaterialUI/Surfaces/paperProps.js +2 -2
- package/dist/components/MaterialUI/componentProps.js +2 -2
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +1 -0
- package/dist/components/MaterialUI/muiThemes.js +2 -2
- package/dist/components/MaterialUI/textProps.js +2 -2
- package/dist/components/Navigation/Bar.js +2 -2
- package/dist/components/Navigation/index.js +1 -0
- package/dist/components/Navigation/useNavigationState.js +2 -2
- package/dist/components/Routing/SegmentPage.js +1 -1
- package/dist/components/Routing/withWaypointing.js +2 -2
- package/dist/components/Scope/index.js +2 -2
- package/dist/components/Treeview/Node.js +2 -2
- package/dist/components/Treeview/index.js +2 -2
- package/dist/getThemeOverrides.js +2 -2
- package/dist/hocs/withToggle.js +2 -2
- package/dist/hocs/withUpdateHandler.js +2 -2
- package/dist/hooks/useEditState.js +2 -2
- package/dist/hooks/useEntityLoader.js +2 -2
- package/dist/hooks/useFullEntityEditState.js +2 -2
- package/dist/hooks/useLabelMessage.js +2 -2
- package/dist/hooks/useMultipleFieldEditState.js +2 -2
- package/dist/hooks/useNotificationRequestState.js +2 -2
- package/dist/selectors/metadata.js +2 -2
- package/dist/selectors/modules.js +2 -2
- package/dist/utils/flatten.js +2 -2
- package/dist/utils/modelValidationHelper.js +2 -2
- package/dist/utils/stripKey.js +2 -2
- package/package.json +2 -5
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +23 -7
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +18 -6
- package/src/components/Routing/SegmentPage.js +1 -0
package/dist/utils/flatten.js
CHANGED
|
@@ -13,8 +13,8 @@ exports.flattenObj = exports.flatten = void 0;
|
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
-
function _toPropertyKey(
|
|
17
|
-
function _toPrimitive(
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
17
|
+
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); }
|
|
18
18
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
19
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
20
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -14,8 +14,8 @@ var _lodash = require("lodash");
|
|
|
14
14
|
enterModule && enterModule(module);
|
|
15
15
|
})();
|
|
16
16
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(
|
|
18
|
-
function _toPrimitive(
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
18
|
+
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); }
|
|
19
19
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
20
20
|
return a;
|
|
21
21
|
};
|
package/dist/utils/stripKey.js
CHANGED
|
@@ -12,8 +12,8 @@ exports.default = void 0;
|
|
|
12
12
|
})();
|
|
13
13
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
16
|
+
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); }
|
|
17
17
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
18
18
|
return a;
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orc-shared",
|
|
3
|
-
"version": "5.8.0-dev.
|
|
3
|
+
"version": "5.8.0-dev.3",
|
|
4
4
|
"description": "Shared code for Orckestra applications",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -54,11 +54,8 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@testing-library/react": "^10.4.9"
|
|
56
56
|
},
|
|
57
|
-
"peerDependencies": {
|
|
58
|
-
"orc-scripts": "2.0.0-dev.4"
|
|
59
|
-
},
|
|
60
57
|
"dependencies": {
|
|
61
|
-
"orc-scripts": "2.0.0
|
|
58
|
+
"orc-scripts": "^2.0.0",
|
|
62
59
|
"react-number-format": "^5.3.0"
|
|
63
60
|
},
|
|
64
61
|
"sideEffects": false,
|
|
@@ -15,11 +15,10 @@ const useStyles = makeStyles(theme => ({
|
|
|
15
15
|
color: props => (!props.error ? theme.palette.text.hint : theme.palette.error.main),
|
|
16
16
|
fontFamily: theme.typography.fontFamily,
|
|
17
17
|
marginBottom: theme.spacing(1),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
18
|
+
},
|
|
19
|
+
titleRequired: {
|
|
20
|
+
paddingLeft: theme.spacing(0.5),
|
|
21
|
+
color: theme.palette.error.main,
|
|
23
22
|
},
|
|
24
23
|
value: {
|
|
25
24
|
fontSize: theme.typography.fontSize,
|
|
@@ -77,9 +76,25 @@ const InformationItemChildren = ({
|
|
|
77
76
|
return <MultipleLinesText textProps={multipleLinesTextProps} children={value} tooltipClasses={tooltipClasses} />;
|
|
78
77
|
};
|
|
79
78
|
|
|
80
|
-
const InformationItemHeader = ({ classes, label, headerIcon, headerIconClassName }) => {
|
|
79
|
+
const InformationItemHeader = ({ classes, label, headerIcon, headerIconClassName, required }) => {
|
|
81
80
|
const formattedLabel = typeof label === "object" ? <FormattedMessage {...label} /> : label;
|
|
82
|
-
const headerText =
|
|
81
|
+
const headerText =
|
|
82
|
+
(formattedLabel && (
|
|
83
|
+
<Typography
|
|
84
|
+
className={classes.title}
|
|
85
|
+
children={
|
|
86
|
+
<>
|
|
87
|
+
{formattedLabel}
|
|
88
|
+
{required && (
|
|
89
|
+
<span data-qa="required" className={classes.titleRequired}>
|
|
90
|
+
*
|
|
91
|
+
</span>
|
|
92
|
+
)}
|
|
93
|
+
</>
|
|
94
|
+
}
|
|
95
|
+
/>
|
|
96
|
+
)) ??
|
|
97
|
+
null;
|
|
83
98
|
|
|
84
99
|
if (headerIcon) {
|
|
85
100
|
return (
|
|
@@ -113,6 +128,7 @@ const InformationItem = ({
|
|
|
113
128
|
<InformationItemHeader
|
|
114
129
|
classes={classes}
|
|
115
130
|
label={label}
|
|
131
|
+
required={required}
|
|
116
132
|
headerIcon={headerIcon}
|
|
117
133
|
headerIconClassName={headerIconClassName}
|
|
118
134
|
/>
|
|
@@ -237,7 +237,7 @@ describe("Information Item", () => {
|
|
|
237
237
|
|
|
238
238
|
const component = (
|
|
239
239
|
<IntlProvider locale="en" messages={{ label }}>
|
|
240
|
-
<InformationItem label={label} required={
|
|
240
|
+
<InformationItem label={label} required={false}>
|
|
241
241
|
{value}
|
|
242
242
|
</InformationItem>
|
|
243
243
|
</IntlProvider>
|
|
@@ -272,19 +272,31 @@ describe("Information Item", () => {
|
|
|
272
272
|
|
|
273
273
|
it("Renders Information Item with required", () => {
|
|
274
274
|
const label = "label";
|
|
275
|
-
const value =
|
|
275
|
+
const value = <p>Value</p>;
|
|
276
276
|
|
|
277
|
-
const component =
|
|
277
|
+
const component = (
|
|
278
278
|
<IntlProvider locale="en-US">
|
|
279
279
|
<InformationItem label={label} required={true}>
|
|
280
280
|
{value}
|
|
281
281
|
</InformationItem>
|
|
282
|
-
</IntlProvider
|
|
282
|
+
</IntlProvider>
|
|
283
283
|
);
|
|
284
284
|
|
|
285
|
-
const
|
|
285
|
+
const expected = (
|
|
286
|
+
<div>
|
|
287
|
+
<Typography
|
|
288
|
+
children={
|
|
289
|
+
<>
|
|
290
|
+
{label}
|
|
291
|
+
<span data-qa="required">*</span>
|
|
292
|
+
</>
|
|
293
|
+
}
|
|
294
|
+
/>
|
|
295
|
+
{value}
|
|
296
|
+
</div>
|
|
297
|
+
);
|
|
286
298
|
|
|
287
|
-
expect(
|
|
299
|
+
expect(component, "when mounted", "to satisfy", expected);
|
|
288
300
|
});
|
|
289
301
|
|
|
290
302
|
it("Renders Information Item properly with a header icon", () => {
|
|
@@ -64,6 +64,7 @@ export const List = styled.div`
|
|
|
64
64
|
border-right: 1px solid ${getThemeProp(["colors", "borderLight"], "#cccccc")};
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: column;
|
|
67
|
+
overflow-y: auto;
|
|
67
68
|
`;
|
|
68
69
|
|
|
69
70
|
const FilteredLink = ({ active, ...props }) => (props.to ? <Link {...props} /> : <div {...props} />);
|