orc-shared 5.10.0-dev.2 → 5.10.0-dev.21
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/metadata.js +30 -11
- package/dist/actions/requestsApi.js +10 -1
- package/dist/components/AppFrame/About.js +136 -100
- package/dist/components/AppFrame/Anchor.js +45 -21
- package/dist/components/AppFrame/AppFrame.js +53 -31
- package/dist/components/AppFrame/Help.js +35 -15
- package/dist/components/AppFrame/MenuItem.js +148 -114
- package/dist/components/AppFrame/Preferences.js +136 -97
- package/dist/components/AppFrame/Sidebar.js +51 -28
- package/dist/components/AppFrame/Topbar.js +61 -36
- package/dist/components/ColumnWrapper.js +28 -5
- package/dist/components/Culture.js +33 -14
- package/dist/components/DropMenu/Menu.js +79 -45
- package/dist/components/DropMenu/index.js +34 -29
- package/dist/components/Form/Combination.js +45 -16
- package/dist/components/Form/Field.js +57 -38
- package/dist/components/Form/FieldElements.js +0 -11
- package/dist/components/Form/Fieldset.js +47 -19
- package/dist/components/Form/Form.js +22 -9
- package/dist/components/Form/FormElement.js +40 -7
- package/dist/components/Form/Inputs/Button.js +63 -18
- package/dist/components/Form/Inputs/ReadOnly.js +50 -27
- package/dist/components/{AppFrame/ApplicationSelector/Header.js → Form/Inputs/Selector.js} +30 -31
- package/dist/components/Form/Inputs/Text.js +20 -37
- package/dist/components/Form/Inputs/Toggles.js +39 -40
- package/dist/components/Form/Inputs/index.js +2 -13
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +31 -11
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/SectionToolbar.js +89 -0
- package/dist/components/MaterialUI/DataDisplay/Table.js +109 -18
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +5 -1
- package/dist/components/MaterialUI/DataDisplay/TableWithInMemoryPaging.js +198 -0
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +4 -1
- package/dist/components/MaterialUI/Inputs/DatePicker.js +14 -14
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -0
- package/dist/components/MaterialUI/Inputs/Select.js +2 -0
- package/dist/components/MaterialUI/Inputs/SelectProps.js +2 -0
- package/dist/components/MaterialUI/Inputs/Switch.js +17 -1
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +2 -0
- package/dist/components/MaterialUI/Inputs/TimePicker.js +14 -21
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +3 -1
- package/dist/components/MaterialUI/muiThemes.js +2 -1
- package/dist/components/Provision.js +1 -1
- package/dist/constants.js +2 -1
- package/dist/content/iconsSheet.svg +740 -116
- package/dist/hocs/withScrollBox.js +27 -12
- package/dist/hooks/useDaysAndMonthsLocalization.js +77 -0
- package/dist/hooks/useInMemoryPaging.js +135 -0
- package/dist/hooks/useMultipleFieldEditState.js +12 -3
- package/dist/reducers/metadata.js +6 -0
- package/dist/schemas/metadata.js +9 -1
- package/dist/selectors/locale.js +1 -0
- package/dist/selectors/metadata.js +14 -11
- package/dist/sharedMessages.js +184 -0
- package/dist/utils/ListHelper.js +271 -0
- package/dist/utils/comparisonHelper.js +185 -0
- package/dist/utils/propertyBagHelper.js +3 -1
- package/dist/utils/timezoneHelper.js +18 -31
- package/package.json +4 -3
- package/src/actions/metadata.js +11 -0
- package/src/actions/metadata.test.js +27 -0
- package/src/actions/requestsApi.js +6 -0
- package/src/components/AppFrame/About.js +97 -117
- package/src/components/AppFrame/About.test.js +128 -90
- package/src/components/AppFrame/Anchor.js +34 -36
- package/src/components/AppFrame/Anchor.test.js +5 -68
- package/src/components/AppFrame/AppFrame.js +31 -40
- package/src/components/AppFrame/AppFrame.test.js +424 -445
- package/src/components/AppFrame/Help.js +23 -20
- package/src/components/AppFrame/Help.test.js +3 -3
- package/src/components/AppFrame/MenuItem.js +106 -126
- package/src/components/AppFrame/MenuItem.test.js +78 -169
- package/src/components/AppFrame/Preferences.js +110 -98
- package/src/components/AppFrame/Preferences.test.js +115 -219
- package/src/components/AppFrame/Sidebar.js +39 -41
- package/src/components/AppFrame/Sidebar.test.js +88 -168
- package/src/components/AppFrame/Topbar.js +59 -52
- package/src/components/AppFrame/Topbar.test.js +31 -39
- package/src/components/ColumnWrapper.js +18 -9
- package/src/components/Culture.js +20 -10
- package/src/components/Culture.test.js +27 -16
- package/src/components/DropMenu/DropMenu.test.js +185 -224
- package/src/components/DropMenu/Menu.js +73 -80
- package/src/components/DropMenu/Menu.test.js +35 -86
- package/src/components/DropMenu/index.js +19 -15
- package/src/components/Form/Combination.js +35 -28
- package/src/components/Form/Combination.test.js +6 -19
- package/src/components/Form/Field.js +53 -66
- package/src/components/Form/Field.test.js +29 -51
- package/src/components/Form/FieldElements.js +0 -14
- package/src/components/Form/FieldElements.test.js +104 -111
- package/src/components/Form/Fieldset.js +42 -37
- package/src/components/Form/Fieldset.test.js +14 -7
- package/src/components/Form/Form.js +11 -7
- package/src/components/Form/Form.test.js +75 -56
- package/src/components/Form/FormElement.js +24 -16
- package/src/components/Form/InputField.test.js +24 -30
- package/src/components/Form/Inputs/Button.js +58 -14
- package/src/components/Form/Inputs/Button.test.js +32 -7
- package/src/components/Form/Inputs/Inputs.test.js +0 -7
- package/src/components/Form/Inputs/ReadOnly.js +34 -28
- package/src/components/Form/Inputs/ReadOnly.test.js +45 -7
- package/src/components/Form/Inputs/Selector.js +22 -0
- package/src/components/Form/Inputs/Selector.test.js +105 -0
- package/src/components/Form/Inputs/Text.js +15 -44
- package/src/components/Form/Inputs/Text.test.js +20 -29
- package/src/components/Form/Inputs/Toggles.js +27 -26
- package/src/components/Form/Inputs/Toggles.test.js +22 -28
- package/src/components/Form/Inputs/index.js +4 -15
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +1 -4
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +32 -6
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.test.js +3 -1
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/SectionToolbar.js +39 -0
- package/src/components/MaterialUI/DataDisplay/Table.js +190 -114
- package/src/components/MaterialUI/DataDisplay/Table.test.js +246 -1
- package/src/components/MaterialUI/DataDisplay/TableProps.js +4 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableWithInMemoryPaging.js +145 -0
- package/src/components/MaterialUI/DataDisplay/TableWithInMemoryPaging.test.js +457 -0
- package/src/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +5 -1
- package/src/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.test.js +7 -1
- package/src/components/MaterialUI/Inputs/DatePicker.js +19 -20
- package/src/components/MaterialUI/Inputs/DatePicker.test.js +11 -6
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -0
- package/src/components/MaterialUI/Inputs/Select.js +2 -0
- package/src/components/MaterialUI/Inputs/SelectProps.js +2 -0
- package/src/components/MaterialUI/Inputs/SelectProps.test.js +2 -0
- package/src/components/MaterialUI/Inputs/Switch.js +22 -1
- package/src/components/MaterialUI/Inputs/Switch.test.js +23 -0
- package/src/components/MaterialUI/Inputs/SwitchProps.js +2 -0
- package/src/components/MaterialUI/Inputs/SwitchProps.test.js +2 -0
- package/src/components/MaterialUI/Inputs/TimePicker.js +10 -19
- package/src/components/MaterialUI/Inputs/TimePicker.test.js +278 -117
- package/src/components/MaterialUI/hocs/withDeferredTooltip.js +4 -1
- package/src/components/MaterialUI/hocs/withDeferredTooltip.test.js +27 -0
- package/src/components/MaterialUI/muiThemes.js +1 -0
- package/src/components/Navigation/Bar.test.js +92 -87
- package/src/components/Provision.js +1 -1
- package/src/components/TaskDetailsModal.test.js +1 -3
- package/src/constants.js +1 -0
- package/src/content/iconsSheet.svg +740 -116
- package/src/hocs/withScrollBox.js +32 -19
- package/src/hocs/withScrollBox.test.js +15 -3
- package/src/hooks/useDaysAndMonthsLocalization.js +79 -0
- package/src/hooks/useDaysAndMonthsLocalization.test.js +107 -0
- package/src/hooks/useInMemoryPaging.js +78 -0
- package/src/hooks/useInMemoryPaging.test.js +515 -0
- package/src/hooks/useMultipleFieldEditState.js +11 -4
- package/src/hooks/useMultipleFieldEditState.test.js +49 -1
- package/src/reducers/metadata.js +6 -1
- package/src/reducers/metadata.test.js +31 -0
- package/src/requests +1 -0
- package/src/schemas/metadata.js +3 -0
- package/src/selectors/locale.js +1 -1
- package/src/selectors/metadata.js +12 -9
- package/src/selectors/metadata.test.js +92 -11
- package/src/sharedMessages.js +184 -0
- package/src/timezones.json +883 -0
- package/src/translations/en-US.json +46 -0
- package/src/translations/fr-CA.json +46 -0
- package/src/utils/ListHelper.js +203 -0
- package/src/utils/ListHelper.test.js +710 -0
- package/src/utils/comparisonHelper.js +135 -0
- package/src/utils/comparisonHelper.test.js +334 -0
- package/src/utils/propertyBagHelper.js +2 -0
- package/src/utils/propertyBagHelper.test.js +6 -0
- package/src/utils/timezoneHelper.js +10 -135
- package/src/utils/timezoneHelper.test.js +7 -7
- package/dist/components/Form/FieldList.js +0 -270
- package/dist/components/Form/Inputs/FieldButtons.js +0 -66
- package/dist/components/Form/Inputs/Number.js +0 -117
- package/dist/components/Form/Inputs/SmallButton.js +0 -91
- package/dist/components/Form/Inputs/Time.js +0 -86
- package/dist/components/Form/Inputs/Translation.js +0 -169
- package/src/components/AppFrame/ApplicationSelector/Header.js +0 -34
- package/src/components/AppFrame/ApplicationSelector/Header.test.js +0 -23
- package/src/components/Form/FieldList.js +0 -210
- package/src/components/Form/FieldList.test.js +0 -558
- package/src/components/Form/Inputs/FieldButtons.js +0 -90
- package/src/components/Form/Inputs/Number.js +0 -60
- package/src/components/Form/Inputs/Number.test.js +0 -435
- package/src/components/Form/Inputs/SmallButton.js +0 -37
- package/src/components/Form/Inputs/SmallButton.test.js +0 -65
- package/src/components/Form/Inputs/Time.js +0 -32
- package/src/components/Form/Inputs/Time.test.js +0 -41
- package/src/components/Form/Inputs/Translation.js +0 -93
- package/src/components/Form/Inputs/Translation.test.js +0 -204
|
@@ -66,6 +66,10 @@ import {
|
|
|
66
66
|
GET_CUSTOMER_LOOKUP_SUCCESS,
|
|
67
67
|
GET_CUSTOMER_LOOKUP_FAILURE,
|
|
68
68
|
GET_CUSTOMER_LOOKUP_REQUEST,
|
|
69
|
+
GET_ORDER_ATTRIBUTE_GROUPS_SUCCESS,
|
|
70
|
+
getOrderAttributeGroups,
|
|
71
|
+
GET_ORDER_ATTRIBUTE_GROUPS_REQUEST,
|
|
72
|
+
GET_ORDER_ATTRIBUTE_GROUPS_FAILURE,
|
|
69
73
|
} from "./metadata";
|
|
70
74
|
|
|
71
75
|
jest.mock("../utils/buildUrl", () => {
|
|
@@ -600,3 +604,26 @@ describe("getProfileAttributeGroups", () => {
|
|
|
600
604
|
},
|
|
601
605
|
}));
|
|
602
606
|
});
|
|
607
|
+
|
|
608
|
+
describe("getOrderAttributeGroups", () => {
|
|
609
|
+
it("creates a RSAA to get order definitions", () =>
|
|
610
|
+
expect(getOrderAttributeGroups, "when called", "to exhaustively satisfy", {
|
|
611
|
+
[RSAA]: {
|
|
612
|
+
types: [
|
|
613
|
+
GET_ORDER_ATTRIBUTE_GROUPS_REQUEST,
|
|
614
|
+
GET_ORDER_ATTRIBUTE_GROUPS_SUCCESS,
|
|
615
|
+
GET_ORDER_ATTRIBUTE_GROUPS_FAILURE,
|
|
616
|
+
],
|
|
617
|
+
endpoint: 'URL: metadata/attributegroups/order ""',
|
|
618
|
+
method: "GET",
|
|
619
|
+
body: undefined,
|
|
620
|
+
credentials: "include",
|
|
621
|
+
bailout: expect.it("to be a function"),
|
|
622
|
+
headers: {
|
|
623
|
+
Accept: "application/json; charset=utf-8",
|
|
624
|
+
"Content-Type": "application/json",
|
|
625
|
+
},
|
|
626
|
+
options: { redirect: "follow" },
|
|
627
|
+
},
|
|
628
|
+
}));
|
|
629
|
+
});
|
|
@@ -62,6 +62,12 @@ export const getCustomerLookupsRequest = {
|
|
|
62
62
|
verb: "GET",
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
export const getOrderAttributeGroupsRequest = {
|
|
66
|
+
name: "getOrderAttributeGroupsRequest",
|
|
67
|
+
buildUrl: () => buildUrl(["metadata", "attributegroups", "order"]),
|
|
68
|
+
verb: "GET",
|
|
69
|
+
};
|
|
70
|
+
|
|
65
71
|
export const getOrderDefinitionRequest = {
|
|
66
72
|
name: "getOrderDefinitionRequest",
|
|
67
73
|
buildUrl: (name, queryParams) => buildUrl(["metadata", "definitions", "order", name], queryParams),
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ReactDOM from "react-dom";
|
|
3
3
|
import { useSelector } from "react-redux";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { ifFlag } from "../../utils";
|
|
7
|
-
import Text from "../Text";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
5
|
+
import { makeStyles } from "@material-ui/core/styles";
|
|
8
6
|
import withClickOutside from "../../hocs/withClickOutside";
|
|
9
7
|
import useViewState from "../../hooks/useViewState";
|
|
10
8
|
import bgImage from "../../content/aboutBackground.png";
|
|
@@ -19,78 +17,84 @@ export const ABOUT_NAME = "__aboutBox";
|
|
|
19
17
|
|
|
20
18
|
const getModalRoot = () => document.getElementById("modal");
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
const useStyles = makeStyles(() => ({
|
|
21
|
+
aboutBox: props => ({
|
|
22
|
+
boxSizing: "border-box",
|
|
23
|
+
zIndex: 9999,
|
|
24
|
+
position: "absolute",
|
|
25
|
+
top: "calc(50% - 210px)",
|
|
26
|
+
left: "calc(50% - 210px)",
|
|
27
|
+
height: "420px",
|
|
28
|
+
width: "420px",
|
|
29
|
+
padding: "15px 20px",
|
|
30
|
+
color: "#ffffff",
|
|
31
|
+
fontSize: "13px",
|
|
32
|
+
lineHeight: "16px",
|
|
33
|
+
background: `#0a0a07 url(${props.bgImage})`,
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
"&.enter-active": {
|
|
36
|
+
opacity: 1,
|
|
37
|
+
transition: "none",
|
|
38
|
+
visibility: "visible",
|
|
39
|
+
},
|
|
40
|
+
"&.exit-active": {
|
|
41
|
+
opacity: 0,
|
|
42
|
+
transition: "opacity 800ms ease-out, visibility 800ms linear 800ms;",
|
|
43
|
+
visibility: "hidden",
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
closeButton: {
|
|
47
|
+
zIndex: 9999,
|
|
48
|
+
position: "absolute",
|
|
49
|
+
color: "#ffffff",
|
|
50
|
+
top: "15px",
|
|
51
|
+
right: "20px",
|
|
52
|
+
margin: "0",
|
|
53
|
+
cursor: "pointer",
|
|
54
|
+
opacity: "1",
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
"&:hover": {
|
|
57
|
+
opacity: 0.75,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
aboutLink: {
|
|
61
|
+
color: "#337ab7",
|
|
62
|
+
textDecoration: "none",
|
|
63
|
+
},
|
|
64
|
+
aboutParagraph: {
|
|
65
|
+
marginTop: "20px",
|
|
66
|
+
},
|
|
67
|
+
longAboutParagraph: props => ({
|
|
68
|
+
marginTop: "20px",
|
|
69
|
+
fontSize: props.lang?.toLowerCase().startsWith("fr") ? "10px" : undefined,
|
|
70
|
+
}),
|
|
71
|
+
}));
|
|
61
72
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`;
|
|
73
|
+
export const AboutBox = withClickOutside(
|
|
74
|
+
React.forwardRef(({ children, className }, ref) => {
|
|
75
|
+
const classes = useStyles({ bgImage });
|
|
66
76
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
`,
|
|
76
|
-
)}
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
export const AboutLink = styled.a`
|
|
80
|
-
color: #23527c;
|
|
81
|
-
text-decoration: none;
|
|
82
|
-
`;
|
|
77
|
+
return (
|
|
78
|
+
<div ref={ref} className={`${classes.aboutBox} ${className ? className : ""}`}>
|
|
79
|
+
{children}
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}),
|
|
83
|
+
);
|
|
83
84
|
|
|
84
85
|
export const getClickOutsideHandler = ({ show }, updateViewState) => {
|
|
85
86
|
return show
|
|
86
87
|
? event => {
|
|
87
88
|
event.stopPropagation();
|
|
88
89
|
updateViewState("show", false);
|
|
89
|
-
|
|
90
|
+
}
|
|
90
91
|
: () => {};
|
|
91
92
|
};
|
|
92
93
|
|
|
93
94
|
export const About = ({ currentApplication }) => {
|
|
95
|
+
const lang = document.documentElement.lang;
|
|
96
|
+
const classes = useStyles({ lang });
|
|
97
|
+
|
|
94
98
|
const [viewState, updateViewState] = useViewState(ABOUT_NAME);
|
|
95
99
|
const version = useSelector(getVersionSelector);
|
|
96
100
|
const locale = useSelector(currentLocaleOrDefault);
|
|
@@ -98,84 +102,60 @@ export const About = ({ currentApplication }) => {
|
|
|
98
102
|
const aboutLinkUrl = "https://www.orckestra.com".concat(locale.substr(0, 2).toLowerCase() === "fr" ? "/fr" : "");
|
|
99
103
|
|
|
100
104
|
return (
|
|
101
|
-
<AboutBox
|
|
102
|
-
<
|
|
105
|
+
<AboutBox className={`${viewState.show ? "enter-active" : "exit-active"}`} onClickOutside={closeAboutBox}>
|
|
106
|
+
<p className={classes.closeButton} onClick={closeAboutBox}>
|
|
103
107
|
<img src={close} alt="X" />
|
|
104
|
-
</
|
|
108
|
+
</p>
|
|
105
109
|
<img src={logoImage} width="250" alt="Orckestra" />
|
|
106
|
-
<
|
|
107
|
-
<
|
|
108
|
-
message={{
|
|
109
|
-
...sharedMessages.ccVersion,
|
|
110
|
-
values: { version: version },
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
110
|
+
<p className={classes.aboutParagraph}>
|
|
111
|
+
<FormattedMessage {...sharedMessages.ccVersion} values={{ version: version }} />
|
|
113
112
|
{currentApplication && currentApplication.displayName
|
|
114
|
-
? [
|
|
115
|
-
<br key="application-br" />,
|
|
116
|
-
<Text
|
|
117
|
-
key="application-version"
|
|
118
|
-
message={currentApplication.displayName.concat(" ", window.BUILD_NUMBER)}
|
|
119
|
-
/>,
|
|
120
|
-
]
|
|
113
|
+
? [<br key="application-br" />, currentApplication.displayName.concat(" ", window.BUILD_NUMBER)]
|
|
121
114
|
: null}
|
|
122
115
|
{DEPENDENCIES && DEPENDENCIES["orc-shared"]
|
|
123
116
|
? [
|
|
124
117
|
<br key="orc-shared-br" />,
|
|
125
|
-
<
|
|
118
|
+
<FormattedMessage
|
|
126
119
|
key="orc-shared-version"
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
values: { version: trimStart(DEPENDENCIES["orc-shared"], "^") },
|
|
130
|
-
}}
|
|
120
|
+
{...sharedMessages.orcSharedVersion}
|
|
121
|
+
values={{ version: trimStart(DEPENDENCIES["orc-shared"], "^") }}
|
|
131
122
|
/>,
|
|
132
|
-
|
|
123
|
+
]
|
|
133
124
|
: null}
|
|
134
125
|
{DEPENDENCIES && DEPENDENCIES["orc-scripts"]
|
|
135
126
|
? [
|
|
136
127
|
<br key="orc-scripts-br" />,
|
|
137
|
-
<
|
|
128
|
+
<FormattedMessage
|
|
138
129
|
key="orc-scripts-version"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
values: { version: trimStart(DEPENDENCIES["orc-scripts"], "^") },
|
|
142
|
-
}}
|
|
130
|
+
{...sharedMessages.orcScriptsVersion}
|
|
131
|
+
values={{ version: trimStart(DEPENDENCIES["orc-scripts"], "^") }}
|
|
143
132
|
/>,
|
|
144
|
-
|
|
133
|
+
]
|
|
145
134
|
: null}
|
|
146
135
|
{DEPENDENCIES && DEPENDENCIES["orc-secret"]
|
|
147
136
|
? [
|
|
148
137
|
<br key="orc-secret-br" />,
|
|
149
|
-
<
|
|
138
|
+
<FormattedMessage
|
|
150
139
|
key="orc-secret-version"
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
values: { version: trimStart(DEPENDENCIES["orc-secret"], "^") },
|
|
154
|
-
}}
|
|
140
|
+
{...sharedMessages.orcSecretVersion}
|
|
141
|
+
values={{ version: trimStart(DEPENDENCIES["orc-secret"], "^") }}
|
|
155
142
|
/>,
|
|
156
|
-
|
|
143
|
+
]
|
|
157
144
|
: null}
|
|
158
|
-
</
|
|
159
|
-
<
|
|
160
|
-
<
|
|
161
|
-
</
|
|
162
|
-
<
|
|
163
|
-
<
|
|
164
|
-
<
|
|
165
|
-
</
|
|
166
|
-
</
|
|
167
|
-
<
|
|
168
|
-
<
|
|
169
|
-
message={{
|
|
170
|
-
...sharedMessages.copyright,
|
|
171
|
-
values: {
|
|
172
|
-
year: new Date().getFullYear(),
|
|
173
|
-
},
|
|
174
|
-
}}
|
|
175
|
-
/>
|
|
145
|
+
</p>
|
|
146
|
+
<p className={classes.longAboutParagraph}>
|
|
147
|
+
<FormattedMessage {...sharedMessages.copyrightTermsNotice} />
|
|
148
|
+
</p>
|
|
149
|
+
<p className={classes.aboutParagraph}>
|
|
150
|
+
<a className={classes.aboutLink} href={aboutLinkUrl} target="_blank" rel="noreferrer">
|
|
151
|
+
<FormattedMessage {...sharedMessages.ccName} />
|
|
152
|
+
</a>
|
|
153
|
+
</p>
|
|
154
|
+
<p className={classes.aboutParagraph}>
|
|
155
|
+
<FormattedMessage {...sharedMessages.copyright} values={{ year: new Date().getFullYear() }} />
|
|
176
156
|
<br />
|
|
177
|
-
<
|
|
178
|
-
</
|
|
157
|
+
<FormattedMessage {...sharedMessages.allRightsReserved} />
|
|
158
|
+
</p>
|
|
179
159
|
</AboutBox>
|
|
180
160
|
);
|
|
181
161
|
};
|
|
@@ -6,13 +6,14 @@ import sinon from "sinon";
|
|
|
6
6
|
import bgImage from "../../content/aboutBackground.png";
|
|
7
7
|
import logoImage from "../../content/aboutLogo.png";
|
|
8
8
|
import close from "../../content/close.png";
|
|
9
|
-
import { ABOUT_NAME, AboutBox,
|
|
9
|
+
import { ABOUT_NAME, AboutBox, About, getClickOutsideHandler } from "./About";
|
|
10
10
|
import { setStateField } from "../../actions/view";
|
|
11
|
-
import { extractMessages } from "./../../utils/testUtils";
|
|
11
|
+
import { extractMessages, TestWrapper } from "./../../utils/testUtils";
|
|
12
12
|
import sharedMessages from "./../../sharedMessages";
|
|
13
13
|
import { stringifyWithoutQuotes } from "./../../utils/parseHelper";
|
|
14
14
|
|
|
15
15
|
const messages = extractMessages(sharedMessages);
|
|
16
|
+
|
|
16
17
|
describe("About", () => {
|
|
17
18
|
let state, store;
|
|
18
19
|
const ccVersion = "5.1.9.5";
|
|
@@ -48,20 +49,68 @@ describe("About", () => {
|
|
|
48
49
|
};
|
|
49
50
|
global.BUILD_NUMBER = "2.3.2";
|
|
50
51
|
expect(
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
53
|
+
<About currentApplication={{ displayName: "An application" }} />
|
|
54
|
+
</TestWrapper>,
|
|
55
|
+
"when mounted",
|
|
56
|
+
"to satisfy",
|
|
57
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider>
|
|
58
|
+
<AboutBox className="enter-active">
|
|
59
|
+
<p>
|
|
60
|
+
<img src={close} alt="X" />
|
|
61
|
+
</p>
|
|
62
|
+
<img src={logoImage} alt="Orckestra" />
|
|
63
|
+
<p>
|
|
64
|
+
{stringifyWithoutQuotes(messages["orc-shared.ccVersion"]).replace("{version}", ccVersion)}
|
|
65
|
+
<br />
|
|
66
|
+
An application 2.3.2
|
|
67
|
+
<br />
|
|
68
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcSharedVersion"]).replace("{version}", orcSharedVersion)}
|
|
69
|
+
<br />
|
|
70
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcScriptsVersion"]).replace("{version}", orcScriptsVersion)}
|
|
71
|
+
<br />
|
|
72
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcSecretVersion"]).replace("{version}", orcSecretVersion)}
|
|
73
|
+
</p>
|
|
74
|
+
<p>{stringifyWithoutQuotes(messages["orc-shared.copyrightTermsNotice"])}</p>
|
|
75
|
+
<p>
|
|
76
|
+
<a href="https://www.orckestra.com">{stringifyWithoutQuotes(messages["orc-shared.ccName"])}</a>
|
|
77
|
+
</p>
|
|
78
|
+
<p>
|
|
79
|
+
{stringifyWithoutQuotes(messages["orc-shared.copyright"]).replace("{year}", new Date().getFullYear())}
|
|
80
|
+
<br />
|
|
81
|
+
{stringifyWithoutQuotes(messages["orc-shared.allRightsReserved"])}
|
|
82
|
+
</p>
|
|
83
|
+
</AboutBox>
|
|
84
|
+
</TestWrapper>,
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("renders a closed about box", () => {
|
|
89
|
+
const orcSharedVersion = "2.9.0";
|
|
90
|
+
const orcScriptsVersion = "1.2.3";
|
|
91
|
+
const orcSecretVersion = "5.1.7";
|
|
92
|
+
|
|
93
|
+
global.DEPENDENCIES = {
|
|
94
|
+
"orc-scripts": orcScriptsVersion,
|
|
95
|
+
"orc-secret": orcSecretVersion,
|
|
96
|
+
"orc-shared": orcSharedVersion,
|
|
97
|
+
};
|
|
98
|
+
global.BUILD_NUMBER = "2.3.2";
|
|
99
|
+
state = state.setIn(["view", ABOUT_NAME, "show"], false);
|
|
100
|
+
|
|
101
|
+
expect(
|
|
102
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
103
|
+
<About currentApplication={{ displayName: "An application" }} />
|
|
104
|
+
</TestWrapper>,
|
|
56
105
|
"when mounted",
|
|
57
106
|
"to satisfy",
|
|
58
|
-
<
|
|
59
|
-
<AboutBox
|
|
60
|
-
<
|
|
107
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider>
|
|
108
|
+
<AboutBox className="exit-active">
|
|
109
|
+
<p>
|
|
61
110
|
<img src={close} alt="X" />
|
|
62
|
-
</
|
|
111
|
+
</p>
|
|
63
112
|
<img src={logoImage} alt="Orckestra" />
|
|
64
|
-
<
|
|
113
|
+
<p>
|
|
65
114
|
{stringifyWithoutQuotes(messages["orc-shared.ccVersion"]).replace("{version}", ccVersion)}
|
|
66
115
|
<br />
|
|
67
116
|
An application 2.3.2
|
|
@@ -71,20 +120,18 @@ describe("About", () => {
|
|
|
71
120
|
{stringifyWithoutQuotes(messages["orc-shared.orcScriptsVersion"]).replace("{version}", orcScriptsVersion)}
|
|
72
121
|
<br />
|
|
73
122
|
{stringifyWithoutQuotes(messages["orc-shared.orcSecretVersion"]).replace("{version}", orcSecretVersion)}
|
|
74
|
-
</
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</AboutParagraph>
|
|
81
|
-
<AboutParagraph>
|
|
123
|
+
</p>
|
|
124
|
+
<p>{stringifyWithoutQuotes(messages["orc-shared.copyrightTermsNotice"])}</p>
|
|
125
|
+
<p>
|
|
126
|
+
<a href="https://www.orckestra.com">{stringifyWithoutQuotes(messages["orc-shared.ccName"])}</a>
|
|
127
|
+
</p>
|
|
128
|
+
<p>
|
|
82
129
|
{stringifyWithoutQuotes(messages["orc-shared.copyright"]).replace("{year}", new Date().getFullYear())}
|
|
83
130
|
<br />
|
|
84
131
|
{stringifyWithoutQuotes(messages["orc-shared.allRightsReserved"])}
|
|
85
|
-
</
|
|
132
|
+
</p>
|
|
86
133
|
</AboutBox>
|
|
87
|
-
</
|
|
134
|
+
</TestWrapper>,
|
|
88
135
|
);
|
|
89
136
|
});
|
|
90
137
|
|
|
@@ -100,20 +147,18 @@ describe("About", () => {
|
|
|
100
147
|
};
|
|
101
148
|
global.BUILD_NUMBER = "2.3.2";
|
|
102
149
|
expect(
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
</IntlProvider>
|
|
107
|
-
</Provider>,
|
|
150
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
151
|
+
<About currentApplication={{ displayName: "An application" }} />
|
|
152
|
+
</TestWrapper>,
|
|
108
153
|
"when mounted",
|
|
109
154
|
"to satisfy",
|
|
110
|
-
<
|
|
111
|
-
<AboutBox
|
|
112
|
-
<
|
|
155
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider>
|
|
156
|
+
<AboutBox className="enter-active">
|
|
157
|
+
<p>
|
|
113
158
|
<img src={close} alt="X" />
|
|
114
|
-
</
|
|
159
|
+
</p>
|
|
115
160
|
<img src={logoImage} alt="Orckestra" />
|
|
116
|
-
<
|
|
161
|
+
<p>
|
|
117
162
|
{stringifyWithoutQuotes(messages["orc-shared.ccVersion"]).replace("{version}", ccVersion)}
|
|
118
163
|
<br />
|
|
119
164
|
An application 2.3.2
|
|
@@ -132,20 +177,18 @@ describe("About", () => {
|
|
|
132
177
|
"{version}",
|
|
133
178
|
orcSecretVersion.replace("^", ""),
|
|
134
179
|
)}
|
|
135
|
-
</
|
|
136
|
-
<
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
</AboutParagraph>
|
|
142
|
-
<AboutParagraph>
|
|
180
|
+
</p>
|
|
181
|
+
<p>{stringifyWithoutQuotes(messages["orc-shared.copyrightTermsNotice"])}</p>
|
|
182
|
+
<p>
|
|
183
|
+
<a href="https://www.orckestra.com">{stringifyWithoutQuotes(messages["orc-shared.ccName"])}</a>
|
|
184
|
+
</p>
|
|
185
|
+
<p>
|
|
143
186
|
{stringifyWithoutQuotes(messages["orc-shared.copyright"]).replace("{year}", new Date().getFullYear())}
|
|
144
187
|
<br />
|
|
145
188
|
{stringifyWithoutQuotes(messages["orc-shared.allRightsReserved"])}
|
|
146
|
-
</
|
|
189
|
+
</p>
|
|
147
190
|
</AboutBox>
|
|
148
|
-
</
|
|
191
|
+
</TestWrapper>,
|
|
149
192
|
);
|
|
150
193
|
});
|
|
151
194
|
|
|
@@ -153,99 +196,94 @@ describe("About", () => {
|
|
|
153
196
|
expect(
|
|
154
197
|
<Provider store={store}>
|
|
155
198
|
<IntlProvider locale="en-US" messages={messages}>
|
|
156
|
-
<About
|
|
199
|
+
<About />
|
|
157
200
|
</IntlProvider>
|
|
158
201
|
</Provider>,
|
|
159
202
|
"when mounted",
|
|
160
203
|
"with event",
|
|
161
204
|
{ type: "click", target: '[alt="X"]' },
|
|
162
|
-
).then(
|
|
163
|
-
expect(store.dispatch, "to have calls satisfying", [{ args: [setStateField(ABOUT_NAME, "show", false)] }]),
|
|
205
|
+
).then(
|
|
206
|
+
() => expect(store.dispatch, "to have calls satisfying", [{ args: [setStateField(ABOUT_NAME, "show", false)] }]),
|
|
207
|
+
expect.it("to have class", "exit-active"),
|
|
164
208
|
));
|
|
165
209
|
|
|
166
210
|
it("renders an about box with messages and background images but without versions", () => {
|
|
167
211
|
global.DEPENDENCIES = {};
|
|
168
212
|
global.BUILD_NUMBER = null;
|
|
169
213
|
expect(
|
|
170
|
-
<
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
</IntlProvider>
|
|
174
|
-
</Provider>,
|
|
214
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
215
|
+
<About />
|
|
216
|
+
</TestWrapper>,
|
|
175
217
|
"when mounted",
|
|
176
218
|
"to satisfy",
|
|
177
219
|
|
|
178
|
-
<
|
|
179
|
-
<AboutBox
|
|
180
|
-
<
|
|
220
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider>
|
|
221
|
+
<AboutBox className="enter-active">
|
|
222
|
+
<p>
|
|
181
223
|
<img src={close} alt="X" />
|
|
182
|
-
</
|
|
224
|
+
</p>
|
|
183
225
|
<img src={logoImage} alt="Orckestra" />
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
{stringifyWithoutQuotes(messages["orc-shared.ccName"])}
|
|
191
|
-
</AboutLink>
|
|
192
|
-
</AboutParagraph>
|
|
193
|
-
<AboutParagraph>
|
|
226
|
+
<p>{stringifyWithoutQuotes(messages["orc-shared.ccVersion"]).replace("{version}", ccVersion)}</p>
|
|
227
|
+
<p>{stringifyWithoutQuotes(messages["orc-shared.copyrightTermsNotice"])}</p>
|
|
228
|
+
<p>
|
|
229
|
+
<a href="https://www.orckestra.com">{stringifyWithoutQuotes(messages["orc-shared.ccName"])}</a>
|
|
230
|
+
</p>
|
|
231
|
+
<p>
|
|
194
232
|
{stringifyWithoutQuotes(messages["orc-shared.copyright"]).replace("{year}", new Date().getFullYear())}
|
|
195
233
|
<br />
|
|
196
234
|
{stringifyWithoutQuotes(messages["orc-shared.allRightsReserved"])}
|
|
197
|
-
</
|
|
235
|
+
</p>
|
|
198
236
|
</AboutBox>
|
|
199
|
-
</
|
|
237
|
+
</TestWrapper>,
|
|
200
238
|
);
|
|
201
239
|
});
|
|
202
240
|
|
|
203
241
|
it("renders an about box with about ling to the french version of the web site.", () => {
|
|
204
242
|
state = state.setIn(["locale", "locale"], "FR-FR");
|
|
243
|
+
|
|
244
|
+
Object.defineProperty(document.documentElement, "lang", {
|
|
245
|
+
value: "FR-FR",
|
|
246
|
+
configurable: true,
|
|
247
|
+
});
|
|
248
|
+
|
|
205
249
|
expect(
|
|
206
|
-
<
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
</IntlProvider>
|
|
210
|
-
</Provider>,
|
|
250
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
251
|
+
<About />
|
|
252
|
+
</TestWrapper>,
|
|
211
253
|
"when mounted",
|
|
212
254
|
"to satisfy",
|
|
213
|
-
<
|
|
214
|
-
<AboutBox
|
|
215
|
-
<
|
|
255
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider>
|
|
256
|
+
<AboutBox className="enter-active">
|
|
257
|
+
<p>
|
|
216
258
|
<img src={close} alt="X" />
|
|
217
|
-
</
|
|
259
|
+
</p>
|
|
218
260
|
<img src={logoImage} alt="Orckestra" />
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
{stringifyWithoutQuotes(messages["orc-shared.ccName"])}
|
|
226
|
-
</AboutLink>
|
|
227
|
-
</AboutParagraph>
|
|
228
|
-
<AboutParagraph>
|
|
261
|
+
<p>{stringifyWithoutQuotes(messages["orc-shared.ccVersion"]).replace("{version}", ccVersion)}</p>
|
|
262
|
+
<p>{stringifyWithoutQuotes(messages["orc-shared.copyrightTermsNotice"])}</p>
|
|
263
|
+
<p>
|
|
264
|
+
<a href="https://www.orckestra.com/fr">{stringifyWithoutQuotes(messages["orc-shared.ccName"])}</a>
|
|
265
|
+
</p>
|
|
266
|
+
<p>
|
|
229
267
|
{stringifyWithoutQuotes(messages["orc-shared.copyright"]).replace("{year}", new Date().getFullYear())}
|
|
230
268
|
<br />
|
|
231
269
|
{stringifyWithoutQuotes(messages["orc-shared.allRightsReserved"])}
|
|
232
|
-
</
|
|
270
|
+
</p>
|
|
233
271
|
</AboutBox>
|
|
234
|
-
</
|
|
272
|
+
</TestWrapper>,
|
|
235
273
|
);
|
|
236
274
|
});
|
|
237
275
|
|
|
238
276
|
describe("AboutBox", () => {
|
|
239
277
|
it("has a background image", () =>
|
|
240
|
-
expect(<AboutBox
|
|
278
|
+
expect(<AboutBox />, "when mounted", "to have style rules satisfying", "to contain", bgImage));
|
|
241
279
|
|
|
242
280
|
it("renders an opacity-transitioning box", () =>
|
|
243
281
|
expect(
|
|
244
|
-
<AboutBox
|
|
282
|
+
<AboutBox />,
|
|
245
283
|
"when mounted",
|
|
246
284
|
"to have style rules satisfying",
|
|
247
285
|
"to contain",
|
|
248
|
-
"transition: opacity 800ms ease-out;",
|
|
286
|
+
"transition: opacity 800ms ease-out, visibility 800ms linear 800ms;",
|
|
249
287
|
));
|
|
250
288
|
});
|
|
251
289
|
|