Skip to content

Commit f7f5909

Browse files
authored
Merge pull request #398 from hackforla/0.2.9
Release 0.2.9
2 parents 4228451 + 70d9398 commit f7f5909

17 files changed

+2870
-4880
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55

66
# Custom ignores
7-
/screenshots
7+
cypress/screenshots
8+
cypress/videos
89

910
### Linux ###
1011
*~
@@ -241,5 +242,5 @@ node_modules
241242
# End of project-specific exclusions
242243
.eslintcache
243244

244-
# Yarn lockfile
245-
yarn.lock
245+
# Yarn lockfile
246+
yarn.lock

client/package-lock.json

Lines changed: 2331 additions & 4757 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "client",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"private": true,
55
"proxy": "http://localhost:5000",
66
"dependencies": {
@@ -13,13 +13,13 @@
1313
"eslint-plugin-prettier": "^3.1.3",
1414
"formik": "^2.1.4",
1515
"moment": "^2.24.0",
16-
"node-sass": "^4.13.1",
16+
"node-sass": "^4.14.1",
1717
"react": "^16.13.0",
1818
"react-dom": "^16.13.0",
1919
"react-jss": "^10.1.0",
2020
"react-loader": "^2.4.7",
2121
"react-router-dom": "^5.1.2",
22-
"react-scripts": "^3.4.0",
22+
"react-scripts": "^3.4.1",
2323
"react-string-replace": "^0.4.4",
2424
"react-tooltip": "^4.2.2",
2525
"yup": "^0.28.3"
@@ -51,11 +51,11 @@
5151
]
5252
},
5353
"devDependencies": {
54-
"@storybook/addon-actions": "^5.3.17",
54+
"@storybook/addon-actions": "^5.3.18",
5555
"@storybook/addon-links": "^5.3.17",
56-
"@storybook/addon-storyshots": "^5.3.17",
56+
"@storybook/addon-storyshots": "^5.3.18",
5757
"@storybook/addons": "^5.3.17",
58-
"@storybook/react": "^5.3.17",
58+
"@storybook/react": "^5.3.18",
5959
"eslint": "^6.8.0",
6060
"eslint-plugin-jest": "^23.8.2",
6161
"eslint-plugin-react": "^7.20.0",
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import { createUseStyles } from "react-jss";
4+
import clsx from "clsx";
5+
6+
const useStyles = createUseStyles({
7+
container: {
8+
display: "flex",
9+
flexDirection: "column",
10+
backgroundColor: "#F7F9FA",
11+
marginBottom: "1em",
12+
marginRight: "auto",
13+
marginLeft: "auto",
14+
width: "50vw",
15+
minWidth: 550,
16+
maxWidth: 700
17+
},
18+
closeButton: {
19+
alignSelf: "flex-end",
20+
backgroundColor: "#F7F9FA",
21+
color: "#B2C0D3",
22+
borderStyle: "none",
23+
display: "flex",
24+
justifyContent: "center",
25+
margin: 0,
26+
padding: 0,
27+
width: "2em",
28+
"&:hover": {
29+
cursor: "pointer",
30+
color: "#8E99A8"
31+
}
32+
},
33+
bigX: {
34+
fontSize: "25px"
35+
},
36+
content: {
37+
margin: "0 1em",
38+
paddingBottom: "2em",
39+
alignSelf: "center"
40+
},
41+
open: {
42+
display: "flex"
43+
},
44+
closed: {
45+
display: "none"
46+
}
47+
});
48+
49+
const InfoBox = ({ children, displayStatus, handleClick }) => {
50+
const classes = useStyles();
51+
52+
return (
53+
<div
54+
className={clsx(
55+
classes.container,
56+
displayStatus ? classes.open : classes.closed
57+
)}
58+
>
59+
<button onClick={handleClick} className={classes.closeButton}>
60+
<span className={classes.bigX}>{"\u00d7"}</span>
61+
</button>
62+
<div className={classes.content}>{children}</div>
63+
</div>
64+
);
65+
};
66+
67+
InfoBox.propTypes = {
68+
children: PropTypes.any,
69+
displayStatus: PropTypes.bool,
70+
handleClick: PropTypes.func
71+
};
72+
73+
export default InfoBox;

client/src/components/ProjectWizard/RuleStrategy/RuleStrategy.js

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,29 @@ const useStyles = createUseStyles({
6464
marginTop: "4px"
6565
},
6666
tooltip: {
67-
padding: "10px",
67+
padding: "15px",
6868
minWidth: "200px",
69-
maxWidth: "400px"
69+
maxWidth: "400px",
70+
fontFamily: "Arial",
71+
fontSize: 12,
72+
lineHeight: "16px",
73+
fontWeight: "bold",
74+
"-webkit-box-shadow": "0px 0px 8px rgba(0, 46, 109, 0.2)",
75+
"-moz-box-shadow": "0px 0px 8px rgba(0, 46, 109, 0.2)",
76+
boxShadow: "0px 0px 8px rgba(0, 46, 109, 0.2)",
77+
"-webkit-border-radius": 2,
78+
"-moz-border-radius": 2,
79+
borderRadius: 2,
80+
"&.show": {
81+
visibility: "visible !important",
82+
opacity: "1 !important"
83+
}
7084
}
7185
});
7286

7387
const RuleStrategy = ({
7488
rule: {
89+
id,
7590
code,
7691
name,
7792
dataType,
@@ -91,10 +106,8 @@ const RuleStrategy = ({
91106
onCommentChange
92107
}) => {
93108
const classes = useStyles();
94-
95109
const possibleAndEarnedPointsContainers = () => {
96110
const calculationUnits = calcUnits ? calcUnits : "";
97-
98111
return (
99112
<React.Fragment>
100113
<div className={classes.points}>
@@ -122,7 +135,7 @@ const RuleStrategy = ({
122135
<label
123136
htmlFor={code}
124137
className={classes.strategyName}
125-
data-for="main"
138+
data-for={"main" + id}
126139
data-tip={description}
127140
data-iscapture="true"
128141
data-html="true"
@@ -151,7 +164,7 @@ const RuleStrategy = ({
151164
<label
152165
htmlFor={code}
153166
className={classes.strategyName}
154-
data-for="main"
167+
data-for={"main" + id}
155168
data-tip={description}
156169
data-iscapture="true"
157170
data-html="true"
@@ -177,7 +190,7 @@ const RuleStrategy = ({
177190
<label
178191
htmlFor={code}
179192
className={classes.strategyName}
180-
data-for="main"
193+
data-for={"main" + id}
181194
data-tip={description}
182195
data-iscapture="true"
183196
data-html="true"
@@ -208,7 +221,7 @@ const RuleStrategy = ({
208221
<label
209222
htmlFor={code}
210223
className={classes.strategyName}
211-
data-for="main"
224+
data-for={"main" + id}
212225
data-tip={description}
213226
data-iscapture="true"
214227
data-html="true"
@@ -230,7 +243,7 @@ const RuleStrategy = ({
230243
) : (
231244
<div
232245
className={classes.strategyContainer}
233-
data-for="main"
246+
data-for={"main" + id}
234247
data-tip={description}
235248
data-iscapture="true"
236249
data-html="true"
@@ -261,12 +274,19 @@ const RuleStrategy = ({
261274
</div>
262275
) : null}
263276
<ReactTooltip
264-
id="main"
265-
place="top"
277+
id={"main" + id}
278+
place="right"
266279
type="info"
267280
effect="float"
268281
multiline={true}
269-
style={{ width: "25vw" }}
282+
style={{
283+
width: "25vw"
284+
}}
285+
textColor="#32578A"
286+
backgroundColor="#F7F9FA"
287+
border={true}
288+
borderColor="#B2C0D3"
289+
offset={{ right: 20 }}
270290
/>
271291
</React.Fragment>
272292
);

client/src/components/ProjectWizard/RuleStrategy/RuleStrategyList.stories.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { tdmRules } from "../../../test-data/tdm-calc-rules";
77
const rules = tdmRules.filter(rule => rule.calculationPanelId === 22);
88

99
export const actions = {
10-
onInputChange: action("onInputChange")
10+
onInputChange: action("onInputChange"),
11+
onCommentChange: action("onCommentChange")
1112
};
1213

1314
storiesOf("RuleStrategyList", module).add("default", () => (

client/src/components/ProjectWizard/RuleStrategy/RuleStrategyPanels.stories.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const rules = tdmRules.filter(
99
);
1010

1111
export const actions = {
12-
onInputChange: action("onInputChange")
12+
onInputChange: action("onInputChange"),
13+
onCommentChange: action("onCommentChange")
1314
};
1415

1516
storiesOf("RuleStrategyPanels", module).add("default", () => (

client/src/components/ProjectWizard/SidebarPoints/ToolTip.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState } from "react";
22
import PropTypes from "prop-types";
33
import { createUseStyles } from "react-jss";
44
import clsx from "clsx";
5+
import ToolTipIcon from "./ToolTipIcon";
56

67
const useStyles = createUseStyles({
78
tipIcon: {
@@ -42,17 +43,20 @@ const useStyles = createUseStyles({
4243
});
4344

4445
const ToolTip = ({ tipText }) => {
45-
const [tipVisibility, setTipVisibility] = useState(false);
46+
const [tipVisibility] = useState(false);
4647
const classes = useStyles();
47-
const handleClick = () => {
48-
//setTipVisibility(!tipVisibility);
49-
};
48+
49+
// will need to be changed to onHover
5050
const showTip = tipVisibility ? "showTip" : "";
5151
return (
5252
<React.Fragment>
53-
<button className={classes.tipIcon} onClick={handleClick}>
54-
?
55-
</button>
53+
<ToolTipIcon
54+
containerStyle={{
55+
fontSize: 16,
56+
verticalAlign: "top",
57+
"&:hover": { cursor: "pointer" }
58+
}}
59+
/>
5660
<span className={clsx(classes.tipText, showTip)}>{tipText}</span>
5761
</React.Fragment>
5862
);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
4+
import { faCircle, faQuestion } from "@fortawesome/free-solid-svg-icons";
5+
import { createUseStyles } from "react-jss";
6+
import clsx from "clsx";
7+
8+
const useStyles = createUseStyles({
9+
questionStyle: styles => ({
10+
...styles.questionStyle
11+
}),
12+
circleStyle: styles => ({
13+
...styles.circleStyle
14+
}),
15+
containerStyle: styles => ({
16+
fontSize: 25,
17+
verticalAlign: "-.25em",
18+
...styles.containerStyle
19+
})
20+
});
21+
22+
const ToolTipIcon = ({ containerStyle, circleStyle, questionStyle }) => {
23+
const classes = useStyles({ containerStyle, circleStyle, questionStyle });
24+
return (
25+
<span className={clsx("fa-layers", "fa-fw", classes.containerStyle)}>
26+
<FontAwesomeIcon
27+
icon={faCircle}
28+
color="#a7c539"
29+
className={classes.circleStyle}
30+
/>
31+
<FontAwesomeIcon
32+
icon={faQuestion}
33+
color="white"
34+
className={classes.questionStyle}
35+
transform="shrink-5"
36+
/>
37+
</span>
38+
);
39+
};
40+
41+
ToolTipIcon.propTypes = {
42+
circleStyle: PropTypes.object,
43+
containerStyle: PropTypes.object,
44+
questionStyle: PropTypes.object
45+
};
46+
47+
export default ToolTipIcon;

client/src/components/ProjectWizard/TdmCalculationWizard.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,25 @@ const useStyles = createUseStyles({
5757
marginTop: "2em"
5858
},
5959
unSelectContainer: {
60-
display: "flex",
61-
flexDirection: "row",
60+
display: "grid",
61+
gridTemplateColumns: "[h-start] 20% [h-mid] auto [h-end] 20%",
6262
alignItems: "center",
63-
justifyContent: "center",
64-
position: "relative",
65-
height: "32px"
63+
justifyContent: "space-between",
64+
position: "relative"
6665
},
6766
unSelectButton: {
68-
position: "absolute",
69-
right: "24px",
67+
marginLeft: "auto",
68+
marginRight: "1em",
69+
gridColumn: "h-end",
7070
backgroundColor: "transparent",
7171
border: "0",
7272
cursor: "pointer",
7373
textDecoration: "underline"
74+
},
75+
alignMid: {
76+
gridColumn: "h-mid",
77+
display: "flex",
78+
justifyContent: "center"
7479
}
7580
});
7681

0 commit comments

Comments
 (0)