Skip to content

Commit

Permalink
Fixed: Tasks selection doesn't work in Chrome (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
uve committed Aug 30, 2018
1 parent b15ab74 commit ff940ba
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 29 deletions.
30 changes: 8 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-gantt",
"version": "1.14.2",
"version": "1.14.3",
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions pbiviz.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"visual": {
"name": "Gantt",
"displayName": "Gantt 1.14.2",
"displayName": "Gantt 1.14.3",
"guid": "Gantt1448688115699",
"visualClassName": "Gantt",
"version": "1.14.2",
"version": "1.14.3",
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
"supportUrl": "https://community.powerbi.com",
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-gantt"
Expand Down
1 change: 0 additions & 1 deletion src/behavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ module powerbi.extensibility.visual.behavior {

options.taskSelection.on("click", (dataPoint: Task) => {
const event: MouseEvent = d3.event as MouseEvent;

selectionHandler.handleSelection(dataPoint, event.ctrlKey);

event.stopPropagation();
Expand Down
4 changes: 4 additions & 0 deletions src/gantt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ module powerbi.extensibility.visual {
export const TaskResource: ClassAndSelector = createClassAndSelector("task-resource");
export const TaskLabels: ClassAndSelector = createClassAndSelector("task-labels");
export const TaskLines: ClassAndSelector = createClassAndSelector("task-lines");
export const TaskLinesRect: ClassAndSelector = createClassAndSelector("task-lines-rect");
export const CollapseAll: ClassAndSelector = createClassAndSelector("collapse-all");
export const CollapseAllArrow: ClassAndSelector = createClassAndSelector("collapse-all-arrow");
export const Label: ClassAndSelector = createClassAndSelector("label");
Expand Down Expand Up @@ -363,7 +364,9 @@ module powerbi.extensibility.visual {

this.lineGroupWrapper = this.lineGroup
.append("rect")
.classed(Selectors.TaskLinesRect.className, true)
.attr("height", "100%")
.attr("width", "0")
.attr("fill", axisBackgroundColor)
.attr("y", this.margin.top);

Expand Down Expand Up @@ -1611,6 +1614,7 @@ module powerbi.extensibility.visual {

} else {
this.lineGroupWrapper
.attr("width", 0)
.attr("fill", "transparent");

this.collapseAllGroup
Expand Down
6 changes: 6 additions & 0 deletions test/visualBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ module powerbi.extensibility.visual.test {
.children("rect.task-lines");
}

public get taskLineRect() {
return this.mainElement
.children("g.task-lines")
.children("rect.task-lines-rect");
}

public get taskLineBackgroundRect() {
return this.taskLine
.children("rect");
Expand Down
7 changes: 4 additions & 3 deletions test/visualTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ module powerbi.extensibility.visual.test {
VisualData.ColumnType,
VisualData.ColumnStartDate,
VisualData.ColumnDuration,
VisualData.ColumnCompletePercentage
VisualData.ColumnCompletePercentage,
VisualData.ColumnResource]);


Expand Down Expand Up @@ -1562,6 +1562,7 @@ module powerbi.extensibility.visual.test {
show: true
}
};

});

it("show", (done) => {
Expand All @@ -1573,7 +1574,7 @@ module powerbi.extensibility.visual.test {

visualBuilder.updateRenderTimeout(dataView, () => {
expect(visualBuilder.taskLabels).toBeInDOM();

expect(visualBuilder.taskLineRect.attr("width")).toEqual("110");
done();
});
});
Expand All @@ -1587,7 +1588,7 @@ module powerbi.extensibility.visual.test {

visualBuilder.updateRenderTimeout(dataView, () => {
expect(visualBuilder.taskLabels).not.toBeInDOM();

expect(visualBuilder.taskLineRect.attr("width")).toEqual("0");
done();
});
});
Expand Down

0 comments on commit ff940ba

Please sign in to comment.