forked from cake-contrib/Cake.Issues.Reporting.Generic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-34) Add report using DevExtreme PivotGrid
- Loading branch information
1 parent
c45ecf4
commit b23c3ae
Showing
9 changed files
with
825 additions
and
0 deletions.
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
27 changes: 27 additions & 0 deletions
27
src/Cake.Issues.Reporting.Generic.Tests/HtmlDxPivotGridAreaExtensionsTests.cs
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,27 @@ | ||
namespace Cake.Issues.Reporting.Generic.Tests | ||
{ | ||
using Shouldly; | ||
using Xunit; | ||
|
||
public sealed class HtmlDxPivotGridAreaExtensionsTests | ||
{ | ||
public sealed class TheToJavaScriptIdentifierMethod | ||
{ | ||
[Theory] | ||
[InlineData(HtmlDxPivotGridArea.Column)] | ||
[InlineData(HtmlDxPivotGridArea.Row)] | ||
[InlineData(HtmlDxPivotGridArea.Filter)] | ||
[InlineData(HtmlDxPivotGridArea.Data)] | ||
public void Should_Return_Identifier(HtmlDxPivotGridArea area) | ||
{ | ||
// Given | ||
|
||
// When | ||
var result = area.ToJavaScriptIdentifier(); | ||
|
||
// Then | ||
result.ShouldNotBeNullOrWhiteSpace(); | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Cake.Issues.Reporting.Generic | ||
{ | ||
/// <summary> | ||
/// Possible areas for fields. | ||
/// </summary> | ||
public enum HtmlDxPivotGridArea | ||
{ | ||
/// <summary> | ||
/// Field will be shown as row. | ||
/// </summary> | ||
Row, | ||
|
||
/// <summary> | ||
/// Field will be shown as column. | ||
/// </summary> | ||
Column, | ||
|
||
/// <summary> | ||
/// Field will be shown as data. | ||
/// </summary> | ||
Data, | ||
|
||
/// <summary> | ||
/// Field will be available to filter. | ||
/// </summary> | ||
Filter | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/Cake.Issues.Reporting.Generic/HtmlDxPivotGridAreaExtensions.cs
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,32 @@ | ||
namespace Cake.Issues.Reporting.Generic | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// Extension methods for the <see cref="HtmlDxPivotGridArea"/> enumeration. | ||
/// </summary> | ||
public static class HtmlDxPivotGridAreaExtensions | ||
{ | ||
/// <summary> | ||
/// Returns the short identifier of the pivot grid area. | ||
/// </summary> | ||
/// <param name="area">Area for which the identifier should be returned.</param> | ||
/// <returns>Short identifier of the area.</returns> | ||
public static string ToJavaScriptIdentifier(this HtmlDxPivotGridArea area) | ||
{ | ||
switch (area) | ||
{ | ||
case HtmlDxPivotGridArea.Row: | ||
return "row"; | ||
case HtmlDxPivotGridArea.Column: | ||
return "column"; | ||
case HtmlDxPivotGridArea.Data: | ||
return "data"; | ||
case HtmlDxPivotGridArea.Filter: | ||
return "filter"; | ||
default: | ||
throw new ArgumentException("Unknown enumeration value", nameof(area)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.