orc-shared 1.1.0-dev.8 → 1.1.1
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/applications.js +1 -1
- package/dist/actions/authentication.js +1 -1
- package/dist/actions/countries.js +1 -1
- package/dist/actions/locale.js +1 -1
- package/dist/actions/makeApiAction.js +73 -3
- package/dist/actions/makeOrcApiAction.js +2 -2
- package/dist/actions/metadata.js +295 -31
- package/dist/actions/navigation.js +3 -3
- package/dist/actions/requestState.js +78 -0
- package/dist/actions/requestsApi.js +58 -7
- package/dist/actions/scopes.js +1 -1
- package/dist/actions/timezones.js +1 -1
- package/dist/actions/toasts.js +1 -1
- package/dist/actions/versionInfo.js +1 -1
- package/dist/actions/view.js +1 -1
- package/dist/buildStore.js +7 -4
- package/dist/components/AppFrame/About.js +3 -3
- package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +115 -62
- package/dist/components/AppFrame/ApplicationSelector/index.js +45 -47
- package/dist/components/AppFrame/MenuItem.js +1 -1
- package/dist/components/AppFrame/Preferences.js +3 -3
- package/dist/components/AppFrame/Sidebar.js +1 -1
- package/dist/components/AppFrame/Topbar.js +1 -1
- package/dist/components/Authenticate.js +1 -1
- package/dist/components/CategoryList.js +1 -1
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/DropMenu/Menu.js +1 -1
- package/dist/components/DropMenu/index.js +1 -1
- package/dist/components/Form/FieldList.js +3 -3
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Form/Inputs/Button.js +1 -1
- package/dist/components/Form/Inputs/FieldButtons.js +1 -1
- package/dist/components/Form/Inputs/Number.js +1 -1
- package/dist/components/Form/Inputs/ReadOnly.js +1 -1
- package/dist/components/Form/Inputs/SmallButton.js +1 -1
- package/dist/components/Form/Inputs/Text.js +1 -1
- package/dist/components/Form/Inputs/Time.js +1 -1
- package/dist/components/Form/Inputs/Toggles.js +1 -1
- package/dist/components/Form/Inputs/Translation.js +3 -3
- package/dist/components/List/HeadCell.js +1 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/Row.js +1 -1
- package/dist/components/List/enhanceColumnDefs.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/List.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/Notification.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +3 -3
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +19 -6
- package/dist/components/MaterialUI/DataDisplay/Table.js +28 -10
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +5 -2
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +5 -2
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/index.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +3 -3
- package/dist/components/MaterialUI/Feedback/useNotification.js +1 -1
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +2 -2
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/DatePicker.js +11 -0
- package/dist/components/MaterialUI/Inputs/InputBase.js +3 -2
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/dist/components/MaterialUI/Inputs/RadioProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/Select.js +2 -2
- package/dist/components/MaterialUI/Inputs/SelectProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/Switch.js +3 -3
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +1 -1
- package/dist/components/MaterialUI/Inputs/TimePicker.js +19 -8
- package/dist/components/MaterialUI/Inputs/createInput.js +3 -3
- package/dist/components/MaterialUI/Inputs/index.js +1 -1
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +1 -1
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +1 -1
- package/dist/components/MaterialUI/Navigation/TabBar.js +38 -33
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +6 -4
- package/dist/components/MaterialUI/ScopeSelector/ScopeTreeView.js +8 -4
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +9 -6
- package/dist/components/MaterialUI/Surfaces/ExpansionPanel.js +11 -2
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +10 -2
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +5 -2
- package/dist/components/MaterialUI/Surfaces/paperProps.js +1 -1
- package/dist/components/MaterialUI/muiThemes.js +21 -6
- package/dist/components/MaterialUI/textProps.js +1 -1
- package/dist/components/Modules.js +24 -2
- package/dist/components/MultiSelector.js +1 -1
- package/dist/components/Navigation/Bar.js +3 -3
- package/dist/components/Navigation/Tab.js +1 -1
- package/dist/components/Navigation/useNavigationState.js +30 -4
- package/dist/components/Placeholder.js +1 -1
- package/dist/components/Routing/FullPage.js +2 -0
- package/dist/components/Routing/Segment.js +4 -3
- package/dist/components/Routing/SegmentPage.js +24 -11
- package/dist/components/Routing/withWaypointing.js +10 -4
- package/dist/components/Scope/ScopeNode.js +1 -1
- package/dist/components/Scope/Selector.js +1 -1
- package/dist/components/Scope/index.js +11 -3
- package/dist/components/Scope/useScopeSelect.js +1 -1
- package/dist/components/Selector.js +1 -1
- package/dist/components/Sidepanel.js +1 -2
- package/dist/components/Spritesheet.js +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/ToastList.js +1 -1
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/Treeview/Label.js +1 -1
- package/dist/components/Treeview/Leaf.js +1 -1
- package/dist/components/Treeview/Node.js +3 -3
- package/dist/components/Treeview/index.js +2 -2
- package/dist/components/Treeview/settings.js +1 -1
- package/dist/constants.js +26 -1
- package/dist/content/icons/html-templates.svg +3 -0
- package/dist/content/iconsSheet.svg +3 -0
- package/dist/getThemeOverrides.js +2 -2
- package/dist/hocs/withInfiniteScroll.js +1 -1
- package/dist/hocs/withUpdateHandler.js +2 -2
- package/dist/hooks/useDispatchWithModulesData.js +1 -1
- package/dist/hooks/useEditState.js +3 -3
- package/dist/hooks/useEntityLoader.js +182 -0
- package/dist/hooks/useFullEntityEditState.js +3 -3
- package/dist/hooks/useInfiniteScroll.js +104 -0
- package/dist/hooks/useLabelMessage.js +3 -3
- package/dist/hooks/useLoader.js +1 -0
- package/dist/hooks/useMultipleFieldEditState.js +2 -2
- package/dist/hooks/useNavigationHandler.js +1 -1
- package/dist/hooks/useNotificationRequestState.js +159 -0
- package/dist/hooks/useRequestState.js +146 -0
- package/dist/hooks/useSelectorAndUnwrap.js +1 -1
- package/dist/reducers/metadata.js +52 -26
- package/dist/reducers/requestStates.js +181 -0
- package/dist/schemas/countries.js +1 -1
- package/dist/schemas/definitions.js +1 -1
- package/dist/schemas/metadata.js +1 -1
- package/dist/schemas/productDefinitions.js +1 -1
- package/dist/schemas/timezones.js +1 -1
- package/dist/selectors/applications.js +1 -1
- package/dist/selectors/authentication.js +1 -2
- package/dist/selectors/countries.js +1 -1
- package/dist/selectors/locale.js +1 -1
- package/dist/selectors/metadata.js +117 -17
- package/dist/selectors/navigation.js +1 -1
- package/dist/selectors/requestStates.js +82 -0
- package/dist/selectors/requests.js +1 -1
- package/dist/selectors/scope.js +2 -1
- package/dist/selectors/versionInfo.js +1 -1
- package/dist/selectors/view.js +1 -1
- package/dist/sharedMessages.js +44 -0
- package/dist/spawnerMiddleware.js +1 -1
- package/dist/utils/displayModeHelper.js +1 -1
- package/dist/utils/flatten.js +2 -2
- package/dist/utils/localizationHelper.js +1 -1
- package/dist/utils/mapHelper.js +1 -1
- package/dist/utils/modelValidationHelper.js +2 -2
- package/dist/utils/parseHelper.js +1 -1
- package/dist/utils/propertyHelper.js +2 -2
- package/dist/utils/propertyValidator.js +1 -1
- package/dist/utils/setTranslation.js +27 -1
- package/dist/utils/setTranslationWithFallback.js +33 -3
- package/dist/utils/testUtils.js +6 -2
- package/dist/utils/timezoneHelper.js +111 -0
- package/dist/utils/unwrapImmutable.js +1 -1
- package/dist/utils/urlHelper.js +11 -1
- package/package.json +3 -7
- package/src/actions/makeApiAction.js +24 -1
- package/src/actions/makeApiAction.test.js +76 -3
- package/src/actions/metadata.js +130 -0
- package/src/actions/metadata.test.js +337 -5
- package/src/actions/requestState.js +8 -0
- package/src/actions/requestState.test.js +14 -0
- package/src/actions/requestsApi.js +30 -0
- package/src/buildStore.js +2 -0
- package/src/components/AppFrame/AppFrame.test.js +6 -16
- package/src/components/AppFrame/ApplicationSelector/ApplicationDialog.js +105 -82
- package/src/components/AppFrame/ApplicationSelector/ApplicationDialog.test.js +60 -23
- package/src/components/AppFrame/ApplicationSelector/ApplicationSelector.test.js +22 -89
- package/src/components/AppFrame/ApplicationSelector/index.js +34 -15
- package/src/components/AppFrame/Topbar.test.js +2 -4
- package/src/components/MaterialUI/DataDisplay/SelectionList.js +14 -6
- package/src/components/MaterialUI/DataDisplay/SelectionList.test.js +21 -11
- package/src/components/MaterialUI/DataDisplay/Table.js +29 -5
- package/src/components/MaterialUI/DataDisplay/Table.test.js +23 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TransferList.js +3 -0
- package/src/components/MaterialUI/Inputs/DatePicker.js +11 -0
- package/src/components/MaterialUI/Inputs/InputBase.js +3 -1
- package/src/components/MaterialUI/Inputs/InputBase.test.js +38 -0
- package/src/components/MaterialUI/Inputs/TimePicker.js +9 -3
- package/src/components/MaterialUI/Inputs/TimePicker.test.js +263 -118
- package/src/components/MaterialUI/Navigation/TabBar.js +82 -78
- package/src/components/MaterialUI/Navigation/TabBar.test.js +129 -3
- package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +4 -2
- package/src/components/MaterialUI/ScopeSelector/ScopeSelector.test.js +29 -0
- package/src/components/MaterialUI/ScopeSelector/ScopeTreeView.js +4 -1
- package/src/components/MaterialUI/ScopeSelector/ScopeTreeView.test.js +52 -0
- package/src/components/MaterialUI/ScopeSelector/TreeItem.js +9 -6
- package/src/components/MaterialUI/ScopeSelector/TreeItem.test.js +63 -2
- package/src/components/MaterialUI/Surfaces/ExpansionPanel.js +14 -1
- package/src/components/MaterialUI/Surfaces/ExpansionPanel.test.js +16 -0
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +11 -2
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.test.js +36 -0
- package/src/components/MaterialUI/Surfaces/expansionPanelProps.js +2 -0
- package/src/components/MaterialUI/Surfaces/expansionPanelProps.test.js +2 -2
- package/src/components/MaterialUI/muiThemes.js +18 -3
- package/src/components/Modules.js +13 -1
- package/src/components/Modules.test.js +133 -1
- package/src/components/Navigation/Navigation.test.js +2 -0
- package/src/components/Navigation/useNavigationState.js +21 -1
- package/src/components/Navigation/useNavigationState.test.js +10 -0
- package/src/components/Routing/FullPage.js +2 -1
- package/src/components/Routing/FullPage.test.js +149 -79
- package/src/components/Routing/Segment.js +5 -2
- package/src/components/Routing/Segment.test.js +22 -1
- package/src/components/Routing/SegmentPage.js +19 -9
- package/src/components/Routing/SubPage.test.js +1 -1
- package/src/components/Routing/withWaypointing.js +19 -17
- package/src/components/Routing/withWaypointing.test.js +50 -0
- package/src/components/Scope/Scope.test.js +117 -0
- package/src/components/Scope/index.js +6 -10
- package/src/components/Sidepanel.js +0 -1
- package/src/components/Sidepanel.test.js +0 -3
- package/src/constants.js +18 -0
- package/src/content/icons/html-templates.svg +3 -0
- package/src/content/iconsSheet.svg +3 -0
- package/src/hooks/useEntityLoader.js +68 -0
- package/src/hooks/useEntityLoader.test.js +266 -0
- package/src/hooks/useInfiniteScroll.js +25 -0
- package/src/hooks/useInfiniteScroll.test.js +87 -0
- package/src/hooks/useLoader.js +1 -0
- package/src/hooks/useNotificationRequestState.js +78 -0
- package/src/hooks/useNotificationRequestState.test.js +264 -0
- package/src/hooks/useRequestState.js +57 -0
- package/src/hooks/useRequestState.test.js +217 -0
- package/src/reducers/metadata.js +76 -16
- package/src/reducers/metadata.test.js +458 -4
- package/src/reducers/requestStates.js +98 -0
- package/src/reducers/requestStates.test.js +399 -0
- package/src/selectors/authentication.js +0 -1
- package/src/selectors/locale.test.js +0 -2
- package/src/selectors/metadata.js +90 -19
- package/src/selectors/metadata.test.js +532 -123
- package/src/selectors/requestStates.js +12 -0
- package/src/selectors/requestStates.test.js +83 -0
- package/src/selectors/scope.js +1 -1
- package/src/sharedMessages.js +44 -0
- package/src/translations/en-US.json +12 -1
- package/src/translations/fr-CA.json +13 -2
- package/src/utils/modelValidationHelper.js +1 -1
- package/src/utils/setTranslation.js +16 -1
- package/src/utils/setTranslation.test.js +24 -0
- package/src/utils/setTranslationWithFallback.js +19 -2
- package/src/utils/setTranslationWithFallback.test.js +104 -6
- package/src/utils/testUtils.js +3 -1
- package/src/utils/timezoneHelper.js +140 -0
- package/src/utils/timezoneHelper.test.js +33 -0
- package/src/utils/urlHelper.js +6 -0
- package/src/translations/it-IT.json +0 -54
|
@@ -24,6 +24,10 @@ export const useStyles = makeStyles(theme => ({
|
|
|
24
24
|
},
|
|
25
25
|
table: {
|
|
26
26
|
tableLayout: "fixed",
|
|
27
|
+
minWidth: "auto",
|
|
28
|
+
},
|
|
29
|
+
tableConstrained: {
|
|
30
|
+
minWidth: theme.spacing(83),
|
|
27
31
|
},
|
|
28
32
|
stickyHeaderHead: {
|
|
29
33
|
borderTop: props => (props.withoutTopBorder ? "none" : "1px solid " + theme.palette.grey.borders),
|
|
@@ -62,22 +66,34 @@ export const useStyles = makeStyles(theme => ({
|
|
|
62
66
|
},
|
|
63
67
|
},
|
|
64
68
|
tableCell: {
|
|
65
|
-
padding: theme.spacing(2),
|
|
69
|
+
padding: theme.spacing(2, 0.5),
|
|
70
|
+
"&:first-child": {
|
|
71
|
+
padding: theme.spacing(2, 0.5, 2, 2),
|
|
72
|
+
},
|
|
66
73
|
},
|
|
67
74
|
tableCellSelect: {
|
|
68
|
-
padding: theme.spacing(2),
|
|
75
|
+
padding: theme.spacing(2, 0.5),
|
|
69
76
|
width: theme.spacing(3),
|
|
77
|
+
"&:first-child": {
|
|
78
|
+
padding: theme.spacing(2, 0.5, 2, 2),
|
|
79
|
+
},
|
|
70
80
|
},
|
|
71
81
|
headerCell: {
|
|
72
|
-
padding: theme.spacing(1,
|
|
82
|
+
padding: theme.spacing(1, 0.5),
|
|
73
83
|
textAlign: "left",
|
|
74
84
|
fontWeight: theme.typography.fontWeightSemiBold,
|
|
85
|
+
"&:first-child": {
|
|
86
|
+
padding: theme.spacing(2, 0.5, 2, 2),
|
|
87
|
+
},
|
|
75
88
|
},
|
|
76
89
|
headerCellSelect: {
|
|
77
|
-
padding: theme.spacing(1,
|
|
90
|
+
padding: theme.spacing(1, 0.5),
|
|
78
91
|
width: theme.spacing(3),
|
|
79
92
|
textAlign: "left",
|
|
80
93
|
fontWeight: theme.typography.fontWeightSemiBold,
|
|
94
|
+
"&:first-child": {
|
|
95
|
+
padding: theme.spacing(2, 0.5, 2, 2),
|
|
96
|
+
},
|
|
81
97
|
},
|
|
82
98
|
rowSelectCheckbox: {
|
|
83
99
|
padding: 0,
|
|
@@ -304,7 +320,13 @@ const FullTable = React.forwardRef((props, ref) => {
|
|
|
304
320
|
onScroll={scrollEvent}
|
|
305
321
|
>
|
|
306
322
|
<ResizeDetector onResize={props.onResize} />
|
|
307
|
-
<TableMui
|
|
323
|
+
<TableMui
|
|
324
|
+
className={classNames(
|
|
325
|
+
props.classes.table,
|
|
326
|
+
props.customClasses.table,
|
|
327
|
+
props.constrained ? props.classes.tableConstrained : "",
|
|
328
|
+
)}
|
|
329
|
+
>
|
|
308
330
|
<TableHead className={classNames(props.classes.tableHeader, props.customClasses.tableHeader)}>
|
|
309
331
|
<TableRow>{props.tableHeaders}</TableRow>
|
|
310
332
|
</TableHead>
|
|
@@ -347,6 +369,7 @@ const Table = ({
|
|
|
347
369
|
const isEditingMode = tableProps?.get(TableProps.propNames.isEditingMode) || false;
|
|
348
370
|
const selectedRows = tableProps?.get(TableProps.propNames.selectedRows) || null;
|
|
349
371
|
const selectedRowsChanged = tableProps?.get(TableProps.propNames.selectedRowsChanged) || null;
|
|
372
|
+
const constrained = tableProps?.get(TableProps.propNames.constrained) || false;
|
|
350
373
|
|
|
351
374
|
customClasses["tableHeader"] = tableProps?.getStyle(TableProps.ruleNames.tableHeader) || null;
|
|
352
375
|
customClasses["tableRow"] = tableProps?.getStyle(TableProps.ruleNames.tableRow) || null;
|
|
@@ -430,6 +453,7 @@ const Table = ({
|
|
|
430
453
|
ref={refScrolled}
|
|
431
454
|
classes={classes}
|
|
432
455
|
customClasses={customClasses}
|
|
456
|
+
constrained={constrained}
|
|
433
457
|
onResize={onResize}
|
|
434
458
|
selectedNumber={selectedNumber}
|
|
435
459
|
scrollLoader={scrollLoader}
|
|
@@ -136,6 +136,15 @@ describe("useStyles", () => {
|
|
|
136
136
|
expect.it("to contain", "cursor: pointer").and("to contain", ":hover {background-color: #F7F7F7;}"),
|
|
137
137
|
);
|
|
138
138
|
});
|
|
139
|
+
|
|
140
|
+
it("build constrained styles as expected", () => {
|
|
141
|
+
expect(
|
|
142
|
+
<MuiThemeContainer classToTest="tableConstrained" styleProps={{ constrained: true }} />,
|
|
143
|
+
"when mounted",
|
|
144
|
+
"to have style rules satisfying",
|
|
145
|
+
expect.it("to contain", "min-width: 51.875rem"),
|
|
146
|
+
);
|
|
147
|
+
});
|
|
139
148
|
});
|
|
140
149
|
|
|
141
150
|
describe("Memoize components", () => {
|
|
@@ -641,6 +650,20 @@ describe("Table", () => {
|
|
|
641
650
|
expect(component, "when mounted", "to satisfy", expected);
|
|
642
651
|
});
|
|
643
652
|
|
|
653
|
+
it("Renders Table with constrained property set to true", () => {
|
|
654
|
+
const { headers, rows } = buildHeaderAndRowFromConfig(config, elements);
|
|
655
|
+
|
|
656
|
+
const tableProps = new TableProps();
|
|
657
|
+
|
|
658
|
+
tableProps.set(TableProps.propNames.constrained, true);
|
|
659
|
+
|
|
660
|
+
const component = <Table rows={rows} headers={headers} tableProps={tableProps} />;
|
|
661
|
+
|
|
662
|
+
const mountedComponent = mount(component);
|
|
663
|
+
|
|
664
|
+
expect(mountedComponent.exists(".makeStyles-tableConstrained-277"), "to be truthy");
|
|
665
|
+
});
|
|
666
|
+
|
|
644
667
|
it("Renders Table with enabled sticky header and select mode", () => {
|
|
645
668
|
const { headers, rows } = buildHeaderAndRowFromConfig(config, elements);
|
|
646
669
|
|
|
@@ -11,6 +11,7 @@ class TableProps extends ComponentProps {
|
|
|
11
11
|
isEditingMode: "isEditingMode",
|
|
12
12
|
selectedRows: "selectedRows",
|
|
13
13
|
selectedRowsChanged: "selectedRowsChanged",
|
|
14
|
+
constrained: "constrained",
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
static ruleNames = {
|
|
@@ -35,6 +36,7 @@ class TableProps extends ComponentProps {
|
|
|
35
36
|
this.componentProps.set(this.constructor.propNames.isEditingMode, null);
|
|
36
37
|
this.componentProps.set(this.constructor.propNames.selectedRows, null);
|
|
37
38
|
this.componentProps.set(this.constructor.propNames.selectedRowsChanged, null);
|
|
39
|
+
this.componentProps.set(this.constructor.propNames.constrained, false);
|
|
38
40
|
|
|
39
41
|
this.componentClasses.set(this.constructor.ruleNames.tableHeader, null);
|
|
40
42
|
this.componentClasses.set(this.constructor.ruleNames.tableRow, null);
|
|
@@ -9,6 +9,7 @@ describe("TableProps Props", () => {
|
|
|
9
9
|
"onRowClick",
|
|
10
10
|
"classes",
|
|
11
11
|
"deepPropsComparation",
|
|
12
|
+
"constrained",
|
|
12
13
|
];
|
|
13
14
|
|
|
14
15
|
const ruleNames = ["tableHeader", "tableRow", "tableCell", "headerCell", "tableContainer", "container", "table"];
|
|
@@ -28,6 +29,7 @@ describe("TableProps Props", () => {
|
|
|
28
29
|
"isEditingMode",
|
|
29
30
|
"selectedRows",
|
|
30
31
|
"selectedRowsChanged",
|
|
32
|
+
"constrained",
|
|
31
33
|
];
|
|
32
34
|
|
|
33
35
|
const ruleNames = ["tableHeader", "tableRow", "tableCell", "headerCell", "tableContainer", "container", "table"];
|
|
@@ -41,6 +41,9 @@ const useStyles = makeStyles(theme => ({
|
|
|
41
41
|
|
|
42
42
|
customContainer: {
|
|
43
43
|
margin: theme.spacing(1.5, 1),
|
|
44
|
+
"& .MuiTreeView-root li:last-child:before, & .MuiTreeItem-iconontainer:before": {
|
|
45
|
+
backgroundColor: theme.palette.background.paper,
|
|
46
|
+
},
|
|
44
47
|
},
|
|
45
48
|
|
|
46
49
|
button: {
|
|
@@ -69,6 +69,17 @@ const useStyles = makeStyles(theme => ({
|
|
|
69
69
|
"& .react-datepicker__input-time-container .react-datepicker-time__input-container": {
|
|
70
70
|
display: "block",
|
|
71
71
|
},
|
|
72
|
+
"& .react-datepicker__day.disabledDay": {
|
|
73
|
+
color: theme.palette.grey.borders,
|
|
74
|
+
pointerEvents: "none",
|
|
75
|
+
},
|
|
76
|
+
"& .react-datepicker__day.alreadySelectedDay": {
|
|
77
|
+
backgroundColor: theme.palette.background.selectedDate,
|
|
78
|
+
color: theme.palette.primary.contrastText,
|
|
79
|
+
borderRadius: "0.3rem",
|
|
80
|
+
pointerEvents: "none",
|
|
81
|
+
opacity: 0.4,
|
|
82
|
+
},
|
|
72
83
|
},
|
|
73
84
|
disabled: {
|
|
74
85
|
border: `1px solid ${theme.palette.grey.light} !important`,
|
|
@@ -100,6 +100,8 @@ const InputBase = ({ inputProps }) => {
|
|
|
100
100
|
const metadata = inputProps?.get(InputBaseProps.propNames.metadata);
|
|
101
101
|
const autoComplete = inputProps?.get(InputBaseProps.propNames.autoComplete);
|
|
102
102
|
|
|
103
|
+
const tooltipText = type === "text" ? value : "";
|
|
104
|
+
|
|
103
105
|
const onClick = item => {
|
|
104
106
|
// Fixes FireFox issue, where the input number buttons do not focus on input control,
|
|
105
107
|
// causing onBlur to never fire
|
|
@@ -141,7 +143,7 @@ const InputBase = ({ inputProps }) => {
|
|
|
141
143
|
startAdornment={startAdornment}
|
|
142
144
|
endAdornment={endAdornment}
|
|
143
145
|
rows={4}
|
|
144
|
-
title={
|
|
146
|
+
title={tooltipText}
|
|
145
147
|
autoComplete={autoComplete}
|
|
146
148
|
/>
|
|
147
149
|
</div>
|
|
@@ -53,6 +53,44 @@ describe("InputBase Component", () => {
|
|
|
53
53
|
expect(mountedComponent.prop("inputProps").get(InputBaseProps.propNames.value), "to equal", aValue + aValue);
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
+
it("Renders InputBase component with title attribute for input of type text", () => {
|
|
57
|
+
const inputProps = new InputBaseProps();
|
|
58
|
+
const aLabel = "aLabel";
|
|
59
|
+
const aValue = "value";
|
|
60
|
+
|
|
61
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
62
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
63
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
64
|
+
inputProps.set(InputBaseProps.propNames.type, "text");
|
|
65
|
+
inputProps.set(InputBaseProps.propNames.disabled, true);
|
|
66
|
+
|
|
67
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
68
|
+
|
|
69
|
+
const mountedComponent = mount(component);
|
|
70
|
+
const expected = <InputBaseMUI value={aValue} title={aValue} />;
|
|
71
|
+
|
|
72
|
+
expect(mountedComponent.containsMatchingElement(expected), "to be truthy");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("Renders InputBase component with title attribute for input types other than text", () => {
|
|
76
|
+
const inputProps = new InputBaseProps();
|
|
77
|
+
const aLabel = "aLabel";
|
|
78
|
+
const aValue = "value";
|
|
79
|
+
|
|
80
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
81
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
82
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
83
|
+
inputProps.set(InputBaseProps.propNames.type, "number");
|
|
84
|
+
inputProps.set(InputBaseProps.propNames.disabled, true);
|
|
85
|
+
|
|
86
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
87
|
+
|
|
88
|
+
const mountedComponent = mount(component);
|
|
89
|
+
const expected = <InputBaseMUI value={aValue} title="" />;
|
|
90
|
+
|
|
91
|
+
expect(mountedComponent.containsMatchingElement(expected), "to be truthy");
|
|
92
|
+
});
|
|
93
|
+
|
|
56
94
|
it("Renders InputBase component without labels", () => {
|
|
57
95
|
const inputProps = new InputBaseProps();
|
|
58
96
|
const aValue = "value";
|
|
@@ -2,6 +2,9 @@ import React, { useState } from "react";
|
|
|
2
2
|
import { makeStyles } from "@material-ui/core/styles";
|
|
3
3
|
import Select from "./Select";
|
|
4
4
|
import SelectProps from "./SelectProps";
|
|
5
|
+
import { getTimeZoneName } from "../../../utils/timezoneHelper";
|
|
6
|
+
import { namedLookupLocalizedSelector } from "../../../selectors/metadata";
|
|
7
|
+
import { useSelector } from "react-redux";
|
|
5
8
|
|
|
6
9
|
const useStyles = makeStyles(theme => ({
|
|
7
10
|
timeWrapper: {
|
|
@@ -177,6 +180,9 @@ const TimePicker = ({ value, onChange, showTimeZone, showAMPM, requestedTimeZone
|
|
|
177
180
|
showAMPM = showAMPM ?? isBrowserUsingAMPM();
|
|
178
181
|
const [time, setTime] = useState(parseTime(value || "00:00"));
|
|
179
182
|
|
|
183
|
+
const userTimeZone = getTimeZoneName();
|
|
184
|
+
const localizedTimeZoneName = useSelector(namedLookupLocalizedSelector("customer", "TimeZone", userTimeZone, null));
|
|
185
|
+
|
|
180
186
|
const onTimeChange = datetime => {
|
|
181
187
|
if (onChange) {
|
|
182
188
|
// DatePicker expects 24 hour time format, or else things go wonky!
|
|
@@ -209,12 +215,12 @@ const TimePicker = ({ value, onChange, showTimeZone, showAMPM, requestedTimeZone
|
|
|
209
215
|
};
|
|
210
216
|
|
|
211
217
|
const getTimeZone = requestedTimeZone => {
|
|
212
|
-
if (requestedTimeZone)
|
|
213
|
-
|
|
214
|
-
} else {
|
|
218
|
+
if (requestedTimeZone) return requestedTimeZone;
|
|
219
|
+
if (!localizedTimeZoneName) {
|
|
215
220
|
var timezone = new Date().toString().match(/GMT(\S+) \(([^)]+)\)/i);
|
|
216
221
|
return `${timezone[2]} (GMT${timezone[1]})`;
|
|
217
222
|
}
|
|
223
|
+
return localizedTimeZoneName;
|
|
218
224
|
};
|
|
219
225
|
|
|
220
226
|
return (
|