Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
limit: 15,
mode: "stack_frequent",
},
showProjectName: !$stateParams.projectId,
source: vm._source + ".Events",
};
vm.stats = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
limit: 15,
mode: "stack_new",
},
showProjectName: !$stateParams.projectId,
source: vm._source + ".Events",
};
vm.stats = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
limit: 15,
mode: "stack_users",
},
showProjectName: !$stateParams.projectId,
source: vm._source + ".Events",
};
vm.stats = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</label>
</th>
<th>{{::'Summary' | translate}}</th>
<th class="hidden-xs" ng-if="vm.settings.showProjectName">{{::'Project' | translate}}</th>
<th class="percentage">{{::'UserRatio' | translate}}</th>
<th class="number">{{::'Events' | translate}}</th>
<th class="date hidden-xs">{{::'First' | translate}}</th>
Expand All @@ -35,6 +36,9 @@
<td ng-click="vm.open(stack.id, $event)">
<summary source="stack" show-type="vm.showType" show-status="vm.showStatus"></summary>
</td>
<td class="hidden-xs" ng-click="vm.open(stack.id, $event)" ng-if="vm.settings.showProjectName">
{{::stack.project_name}}
</td>
<td ng-click="vm.open(stack.id, $event)" class="number">
<abbr title="{{stack.users | number:0}} of {{stack.total_users | number:0}} users"
>{{(stack.total_users > 0 ? stack.users / stack.total_users * 100.0 : 0) |
Expand All @@ -57,7 +61,7 @@
<td class="hidden-xs">
<label class="checks m-b-none"><input type="checkbox" disabled /><i></i></label>
</td>
<td colspan="5" class="hidden-xs">
<td colspan="{{vm.settings.showProjectName ? 6 : 5}}" class="hidden-xs">
<strong ng-if="vm.loading">{{::'Loading...' | translate}}</strong>
<strong ng-if="!vm.loading"
>{{vm.hasFilter() ? 'No stacks were found with the current filter.': 'No stacks were found.' |
Expand Down
31 changes: 31 additions & 0 deletions tests/Exceptionless.Tests/Controllers/EventControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,37 @@ public async Task GetEvents_StackFrequentMode_DeserializesStackSummaryModelWithR
});
}

[Fact]
public async Task GetEvents_StackFrequentMode_IncludesProjectNameFields()
{
// Arrange
await CreateStacksAndEventsAsync();

// Act
var response = await SendRequestAsync(r => r
.AsGlobalAdminUser()
.AppendPath("events")
.QueryString("filter", "status:open")
.QueryString("mode", "stack_frequent")
.StatusCodeShouldBeOk()
);

string json = await response.Content.ReadAsStringAsync(TestCancellationToken);
using var document = JsonDocument.Parse(json);

// Assert
Assert.Equal(JsonValueKind.Array, document.RootElement.ValueKind);
Assert.NotEqual(0, document.RootElement.GetArrayLength());

foreach (var item in document.RootElement.EnumerateArray())
{
Assert.True(item.TryGetProperty("project_id", out var projectId), "Expected project_id field in stack summary payload.");
Assert.True(item.TryGetProperty("project_name", out var projectName), "Expected project_name field in stack summary payload.");
Assert.False(string.IsNullOrWhiteSpace(projectId.GetString()));
Assert.False(string.IsNullOrWhiteSpace(projectName.GetString()));
}
}

[InlineData(null)]
[InlineData("")]
[InlineData("@!")]
Expand Down