This repository has been archived by the owner on Apr 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-31) Add report using DevExtreme DataGrid
- Loading branch information
1 parent
8423385
commit 03b52c4
Showing
5 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
src/Cake.Issues.Reporting.Generic/Templates/DxDataGrid.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
@model IEnumerable<Cake.Issues.IIssue> | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Issues Report</title> | ||
|
||
@* DevExtreme dependencies *@ | ||
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.1.0.min.js"></script> | ||
@* DevExtreme themes *@ | ||
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/18.1.3/css/dx.common.css" /> | ||
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/18.1.3/css/dx.light.css" /> | ||
@* DevExtreme library *@ | ||
<script type="text/javascript" src="https://cdn3.devexpress.com/jslib/18.1.3/js/dx.all.js"></script> | ||
</head> | ||
<body class="dx-viewport"> | ||
<h1>Issues Report</h1> | ||
|
||
<div class="container"> | ||
<div id="gridContainer"></div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
var issues = []; | ||
@foreach (var issue in Model) | ||
{ | ||
@:issues.push({ProviderName: "@issue.ProviderName", ProviderType: "@issue.ProviderType", Priority: "@issue.Priority", PriorityName: "@issue.PriorityName", Project: "@issue.Project", Path: "@if (issue.AffectedFileRelativePath != null) { @issue.AffectedFileRelativePath.GetDirectory() }", File: "@if (issue.AffectedFileRelativePath != null) { @issue.AffectedFileRelativePath.GetFilename() }", Line: "@issue.Line", Rule: "@issue.Rule", RuleUrl: "@issue.RuleUrl", Message: "@issue.Message"}); | ||
} | ||
</script> | ||
<script type="text/javascript"> | ||
$(function(){ | ||
$("#gridContainer").dxDataGrid({ | ||
dataSource: issues, | ||
loadPanel: { | ||
enabled: true | ||
}, | ||
searchPanel: { | ||
visible: true | ||
}, | ||
groupPanel: { | ||
visible: true | ||
}, | ||
headerFilter: { | ||
visible: true | ||
}, | ||
rowAlternationEnabled: true, | ||
allowColumnResizing: true, | ||
columns: [ | ||
{ | ||
dataField: "ProviderName", | ||
groupIndex: 0 | ||
}, | ||
{ | ||
caption: "Severity", | ||
dataField: "PriorityName", | ||
calculateSortValue: "Priority", | ||
width: "90px" | ||
}, | ||
"Project", | ||
"Path", | ||
"File", | ||
{ | ||
dataField: "Line", | ||
allowFiltering: false, | ||
allowGrouping: false, | ||
width: "70px" | ||
}, | ||
"Rule", | ||
"Message" | ||
], | ||
summary: { | ||
groupItems: [{ | ||
column: "ProviderType", | ||
summaryType: "count", | ||
displayFormat: "{0} issues", | ||
}], | ||
totalItems: [{ | ||
column: "Severity", | ||
summaryType: "count", | ||
displayFormat: "{0} issues" | ||
}] | ||
} | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |