orc-shared 1.1.0-dev.9 → 1.2.0-dev.10
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/modules.js +63 -1
- 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 +59 -22
- 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 +6 -5
- package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +115 -62
- package/dist/components/AppFrame/ApplicationSelector/index.js +45 -47
- package/dist/components/AppFrame/MenuItem.js +6 -15
- package/dist/components/AppFrame/Preferences.js +3 -3
- package/dist/components/AppFrame/Sidebar.js +20 -9
- package/dist/components/AppFrame/Topbar.js +1 -1
- package/dist/components/ApplicationModuleLoader.js +143 -0
- package/dist/components/Authenticate.js +13 -13
- 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/ExternalLink.js +113 -0
- 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 +26 -6
- package/dist/components/MaterialUI/textProps.js +1 -1
- package/dist/components/Modules.js +132 -25
- 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 +5 -1
- package/dist/components/Routing/Page.js +5 -3
- package/dist/components/Routing/Segment.js +4 -3
- package/dist/components/Routing/SegmentPage.js +8 -6
- package/dist/components/Routing/withWaypointing.js +14 -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/useScopeConfirmationModalState.js +7 -16
- package/dist/components/Scope/useScopeData.js +4 -13
- 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 +44 -2
- package/dist/content/icons/html-templates.svg +3 -0
- package/dist/content/icons/lock.svg +3 -0
- package/dist/content/icons/orckestra-icon.svg +5 -0
- package/dist/content/icons/unlock.svg +3 -0
- package/dist/content/iconsSheet.svg +14 -0
- package/dist/content/orckestra-logo-white.png +0 -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/modules.js +39 -1
- package/dist/reducers/requestStates.js +181 -0
- package/dist/reducers/scopes.js +27 -0
- package/dist/reducers/settings.js +31 -2
- 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 +57 -19
- package/dist/selectors/countries.js +1 -1
- package/dist/selectors/locale.js +1 -1
- package/dist/selectors/metadata.js +104 -14
- package/dist/selectors/modules.js +15 -1
- 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 +7 -1
- package/dist/selectors/settings.js +13 -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/setTranslationWithFallback.js +3 -2
- 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 +6 -9
- 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/modules.js +30 -0
- package/src/actions/modules.test.js +50 -1
- package/src/actions/requestState.js +8 -0
- package/src/actions/requestState.test.js +14 -0
- package/src/actions/requestsApi.js +30 -0
- package/src/actions/scopes.js +33 -7
- package/src/actions/scopes.test.js +84 -14
- package/src/buildStore.js +2 -0
- package/src/components/AppFrame/About.js +2 -2
- package/src/components/AppFrame/AppFrame.test.js +15 -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/MenuItem.js +3 -5
- package/src/components/AppFrame/MenuItem.test.js +2 -24
- package/src/components/AppFrame/Sidebar.js +11 -12
- package/src/components/AppFrame/Sidebar.test.js +18 -0
- package/src/components/AppFrame/Topbar.test.js +2 -4
- package/src/components/ApplicationModuleLoader.js +52 -0
- package/src/components/ApplicationModuleLoader.test.js +149 -0
- package/src/components/Authenticate.js +5 -4
- package/src/components/Authenticate.test.js +23 -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/ExternalLink.js +25 -0
- package/src/components/MaterialUI/Navigation/ExternalLink.test.js +26 -0
- 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 +23 -3
- package/src/components/Modules.js +108 -13
- package/src/components/Modules.test.js +431 -12
- 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/Provision.test.js +34 -0
- package/src/components/Routing/FullPage.js +4 -2
- package/src/components/Routing/FullPage.test.js +75 -0
- package/src/components/Routing/Page.js +2 -2
- package/src/components/Routing/Page.test.js +20 -0
- package/src/components/Routing/Segment.js +5 -2
- package/src/components/Routing/Segment.test.js +22 -1
- package/src/components/Routing/SegmentPage.js +12 -4
- package/src/components/Routing/SubPage.test.js +1 -1
- package/src/components/Routing/withWaypointing.js +19 -17
- package/src/components/Routing/withWaypointing.test.js +81 -3
- package/src/components/Scope/Scope.test.js +117 -0
- package/src/components/Scope/index.js +6 -10
- package/src/components/Scope/useScopeConfirmationModalState.js +5 -16
- package/src/components/Scope/useScopeConfirmationModalState.test.js +39 -13
- package/src/components/Scope/useScopeData.js +0 -3
- package/src/components/Scope/useScopeData.test.js +0 -27
- package/src/components/Sidepanel.js +0 -1
- package/src/components/Sidepanel.test.js +0 -3
- package/src/constants.js +33 -0
- package/src/content/icons/html-templates.svg +3 -0
- package/src/content/icons/lock.svg +3 -0
- package/src/content/icons/orckestra-icon.svg +5 -0
- package/src/content/icons/unlock.svg +3 -0
- package/src/content/iconsSheet.svg +14 -0
- package/src/content/orckestra-logo-white.png +0 -0
- package/src/hocs/withScopeData.test.js +0 -31
- 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/modules.js +48 -2
- package/src/reducers/modules.test.js +117 -2
- package/src/reducers/requestStates.js +98 -0
- package/src/reducers/requestStates.test.js +399 -0
- package/src/reducers/scopes.js +30 -0
- package/src/reducers/scopes.test.js +45 -1
- package/src/reducers/settings.js +26 -2
- package/src/reducers/settings.test.js +74 -6
- package/src/selectors/authentication.js +53 -28
- package/src/selectors/authentication.test.js +600 -12
- package/src/selectors/locale.test.js +0 -2
- package/src/selectors/metadata.js +73 -13
- package/src/selectors/metadata.test.js +479 -8
- package/src/selectors/modules.js +7 -0
- package/src/selectors/modules.test.js +16 -1
- package/src/selectors/requestStates.js +12 -0
- package/src/selectors/requestStates.test.js +83 -0
- package/src/selectors/scope.js +2 -0
- package/src/selectors/scope.test.js +5 -0
- package/src/selectors/settings.js +6 -0
- 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/setTranslationWithFallback.js +1 -1
- package/src/utils/setTranslationWithFallback.test.js +4 -14
- 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
|
@@ -11,10 +11,13 @@ const useStyles = makeStyles(theme => ({
|
|
|
11
11
|
fontSize: theme.spacing(1.2),
|
|
12
12
|
marginBottom: theme.spacing(0.6),
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
listHeight: {
|
|
15
|
+
height: props => props.height && theme.spacing(props.height),
|
|
16
|
+
},
|
|
15
17
|
paper: {
|
|
18
|
+
flexGrow: 1,
|
|
19
|
+
height: "1px", // forces the container to takes 100%
|
|
16
20
|
overflow: "auto",
|
|
17
|
-
height: props => theme.spacing(props.height),
|
|
18
21
|
border: `1px solid ${theme.palette.primary.light}`,
|
|
19
22
|
borderRadius: theme.shape.borderRadius,
|
|
20
23
|
boxShadow: "none",
|
|
@@ -38,6 +41,11 @@ const useStyles = makeStyles(theme => ({
|
|
|
38
41
|
actionPanel: {
|
|
39
42
|
paddingTop: theme.spacing(2),
|
|
40
43
|
},
|
|
44
|
+
listContainer: {
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: "column",
|
|
47
|
+
height: "100%",
|
|
48
|
+
},
|
|
41
49
|
}));
|
|
42
50
|
|
|
43
51
|
const defaultInfoPanelXs = 6;
|
|
@@ -74,7 +82,7 @@ const SelectionList = ({
|
|
|
74
82
|
useEffect(() => {
|
|
75
83
|
const listDataIds = listData.data.map(d => d.id);
|
|
76
84
|
const checkedFromList = listDataIds.filter(l => checked.includes(l));
|
|
77
|
-
if (defaultSelection && checkedFromList.length === 0) {
|
|
85
|
+
if (defaultSelection && checkedFromList.length === 0 && checked[0] !== defaultSelection) {
|
|
78
86
|
setChecked([defaultSelection]);
|
|
79
87
|
}
|
|
80
88
|
}, [defaultSelection, checked, listData.data]);
|
|
@@ -101,7 +109,7 @@ const SelectionList = ({
|
|
|
101
109
|
const dividerDiff = showDivider ? 1 : 0;
|
|
102
110
|
|
|
103
111
|
const listComponent = (
|
|
104
|
-
|
|
112
|
+
<div className={classes.listContainer}>
|
|
105
113
|
<div className={classes.title}>{listData.title}</div>
|
|
106
114
|
<ScrollableCustomList
|
|
107
115
|
ref={refScrollableList}
|
|
@@ -118,7 +126,7 @@ const SelectionList = ({
|
|
|
118
126
|
onChange={onChangeEvent}
|
|
119
127
|
/>
|
|
120
128
|
{actionPanel ? <div className={classes.actionPanel}>{actionPanel}</div> : null}
|
|
121
|
-
|
|
129
|
+
</div>
|
|
122
130
|
);
|
|
123
131
|
|
|
124
132
|
const dividerComponent = showDivider && (
|
|
@@ -129,7 +137,7 @@ const SelectionList = ({
|
|
|
129
137
|
|
|
130
138
|
return (
|
|
131
139
|
<Grid container spacing={2}>
|
|
132
|
-
<Grid item xs={12 - infoPanelXs - dividerDiff}>
|
|
140
|
+
<Grid item xs={12 - infoPanelXs - dividerDiff} className={classes.listHeight}>
|
|
133
141
|
{listComponent}
|
|
134
142
|
</Grid>
|
|
135
143
|
{dividerComponent}
|
|
@@ -33,8 +33,10 @@ describe("SelectionList", () => {
|
|
|
33
33
|
<TestWrapper intlProvider={{ messages }}>
|
|
34
34
|
<Grid>
|
|
35
35
|
<Grid>
|
|
36
|
-
<div>
|
|
37
|
-
|
|
36
|
+
<div>
|
|
37
|
+
<div>{listTitle}</div>
|
|
38
|
+
<ScrollableCustomList checked={[]} items={list} classes={{}} />
|
|
39
|
+
</div>
|
|
38
40
|
</Grid>
|
|
39
41
|
<Grid>
|
|
40
42
|
<div></div>
|
|
@@ -60,8 +62,10 @@ describe("SelectionList", () => {
|
|
|
60
62
|
<TestWrapper intlProvider={{ messages }}>
|
|
61
63
|
<Grid>
|
|
62
64
|
<Grid>
|
|
63
|
-
<div>
|
|
64
|
-
|
|
65
|
+
<div>
|
|
66
|
+
<div>{listTitle}</div>
|
|
67
|
+
<ScrollableCustomList checked={[]} items={list} classes={{}} />
|
|
68
|
+
</div>
|
|
65
69
|
</Grid>
|
|
66
70
|
<Grid>
|
|
67
71
|
<div></div>
|
|
@@ -86,8 +90,10 @@ describe("SelectionList", () => {
|
|
|
86
90
|
const expected = (
|
|
87
91
|
<Grid>
|
|
88
92
|
<Grid>
|
|
89
|
-
<div>
|
|
90
|
-
|
|
93
|
+
<div>
|
|
94
|
+
<div>{listTitle}</div>
|
|
95
|
+
<ScrollableCustomList checked={[]} items={list} classes={{}} />
|
|
96
|
+
</div>
|
|
91
97
|
</Grid>
|
|
92
98
|
<Grid>
|
|
93
99
|
<hr />
|
|
@@ -117,9 +123,11 @@ describe("SelectionList", () => {
|
|
|
117
123
|
const expected = (
|
|
118
124
|
<Grid>
|
|
119
125
|
<Grid>
|
|
120
|
-
<div>
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
<div>
|
|
127
|
+
<div>{listTitle}</div>
|
|
128
|
+
<ScrollableCustomList checked={[]} items={list} classes={{}} />
|
|
129
|
+
<div>{actionPanel}</div>
|
|
130
|
+
</div>
|
|
123
131
|
</Grid>
|
|
124
132
|
<Grid>
|
|
125
133
|
<hr />
|
|
@@ -145,8 +153,10 @@ describe("SelectionList", () => {
|
|
|
145
153
|
const expected = (
|
|
146
154
|
<Grid>
|
|
147
155
|
<Grid>
|
|
148
|
-
<div>
|
|
149
|
-
|
|
156
|
+
<div>
|
|
157
|
+
<div>{listTitle}</div>
|
|
158
|
+
<ScrollableCustomList checked={[]} items={list} classes={{}} />
|
|
159
|
+
</div>
|
|
150
160
|
</Grid>
|
|
151
161
|
<Grid>
|
|
152
162
|
<div>Test</div>
|
|
@@ -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 (
|