Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Commit

Permalink
Fix: Border Background bars Gantt for a11y (fixes #123)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijit945 committed Dec 20, 2019
1 parent 5a39496 commit 0efdb12
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ Cerner Corporation
- Avinash Gupta [@avinashg1994]
- Ben Cai [@benbcai]


[@abhijit945]: https://github.com/abhijit945
[@dinesh94singh]: https://github.com/Dinesh94Singh
[@veronimazur]: https://github.com/veronimazur
[@swatikode]: https://github.com/swatikode
[@SharathAlur]: https://github.com/SharathAlur
[@sharathalur]: https://github.com/SharathAlur
[@pranav300]: https://github.com/pranav300
[@prashant-kamboj]: https://github.com/Prashant-Kamboj
[@avinashg1994]: https://github.com/avinashg1994
Expand Down
6 changes: 1 addition & 5 deletions src/main/js/controls/Gantt/helpers/activityHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@ const getActivityHashedBar = (
// Draw the background rect
getRect(path, x, y, width, height)
.classed(styles.activityBar, true)
.attr(
"style",
style ||
`fill: ${constants.DEFAULT_ACTIVITY_BAR_HASH_COLOR}; fill-opacity: ${constants.DEFAULT_GANTT_ACTIVITY_OPACITY};`
);
.attr("style", style);
// Opacity for bar with hashes
getRect(path, x, y, width, height)
.classed(styles.activityBar, true)
Expand Down
2 changes: 1 addition & 1 deletion src/main/js/controls/Gantt/helpers/durationHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const getTaskStyle = (data = {}) =>
*/
const getActivityStyle = (data = {}) => {
const color = data.color || COLORS.BLUE;
let currentStyle = `fill: ${color}; fill-opacity: ${constants.DEFAULT_GANTT_ACTIVITY_OPACITY};`;
let currentStyle = `fill: ${color}; fill-opacity: ${constants.DEFAULT_GANTT_ACTIVITY_OPACITY}; stroke-width: 1px; stroke: ${color}`;

// If style property is not provided then we use treat it as filled.
if (utils.isEmpty(data.style)) {
Expand Down
6 changes: 6 additions & 0 deletions src/test/unit/controls/Gantt/Activity-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ describe("Gantt -> Track -> Activity", () => {
expect(activityElement.getAttribute("style")).toContain(
"opacity: 0.5"
);
expect(activityElement.getAttribute("style")).toContain(
"stroke-width: 1px"
);
expect(activityElement.getAttribute("style")).toContain(
"stroke: #007cc3"
);
expect(toNumber(activityElement.getAttribute("x"))).toBeGreaterThan(
0
);
Expand Down

0 comments on commit 0efdb12

Please sign in to comment.