Skip to content

Commit 329d5a1

Browse files
committed
corrected bugs
1 parent 02b958f commit 329d5a1

File tree

7 files changed

+37
-18
lines changed

7 files changed

+37
-18
lines changed

src/Server/Coderr.Server.ReportAnalyzer/ApplicationVersions/Handlers/GetVersionFromReport.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ public async Task HandleAsync(IMessageContext context, ReportAddedToIncident e)
4545

4646
_repository.SaveIncidentVersion(e.Incident.Id, versionEntity.Id);
4747

48-
await IncreaseReportCounter(versionEntity.Id, isNewIncident);
48+
await IncreaseReportCounter(versionEntity.Id, isNewIncident, e.Report.CreatedAtUtc);
4949
}
5050

51-
private async Task IncreaseReportCounter(int versionId, bool isNewIncident)
51+
private async Task IncreaseReportCounter(int versionId, bool isNewIncident, DateTime reportedAtUtc)
5252
{
5353
var month =
54-
await _repository.FindMonthForApplicationAsync(versionId, DateTime.Today.Year, DateTime.Today.Month) ??
55-
new ApplicationVersionMonth(versionId, new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1));
54+
await _repository.FindMonthForApplicationAsync(versionId, reportedAtUtc.Year, reportedAtUtc.Month) ??
55+
new ApplicationVersionMonth(versionId, new DateTime(reportedAtUtc.Year, reportedAtUtc.Month, 1));
5656

5757
if (isNewIncident)
5858
month.IncreaseIncidentCount();

src/Server/Coderr.Server.Web/ClientApp/components/discover/incidents/Suggestions.vue.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{ suggestion.incidentName }} <span class="text-muted">[{{suggestion.exceptionType}}]</span>
77
</div>
88
<div class="card-body">
9-
<strong>Motivation: </strong>
9+
<strong>Criteria: </strong>
1010
{{suggestion.reason}}
1111
<div v-if="!applicationId">
1212
Reported for: <router-link :to="{name: 'discoverApplication', params: {applicationId: suggestion.applicationId}}">{{suggestion.applicationName}}</router-link>

src/Server/Coderr.Server.Web/ClientApp/components/discover/incidents/incident.vue.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@
55
<h3>{{incident.Description}} <small class="text-muted">[{{incident.FullName}}]</small></h3>
66
<div class="">
77
<a href="#" class="btn btn-light" v-on:click.prevent="$router.back()">&lt;&lt; Back ...</a>
8-
<button class="btn btn-outline-primary" v-if="incident.IncidentState == 0" v-on:click.prevent="assignToMe">Assign to me</button>
9-
<button class="btn btn-outline-primary" v-if="incident.IncidentState == 0" v-on:click.prevent="assignToSomeoneElse">Assign to ..</button>
10-
<button class="btn btn-outline-primary" v-if="!isClosed" v-on:click.prevent="close">Close</button>
11-
<button class="btn btn-outline-primary" v-if="!isClosed && !isIgnored" v-on:click.prevent="ignore">Ignore (hide) incident</button>
8+
<div class="dropdown float-right">
9+
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
10+
What do you want to do?
11+
</button>
12+
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
13+
<a class="dropdown-item" href="#" v-if="incident.IncidentState == 0" v-on:click.prevent="assignToMe">Assign to me</a>
14+
<a class="dropdown-item" href="#" v-if="incident.IncidentState == 0" v-on:click.prevent="assignToSomeoneElse">Assign to ..</a>
15+
<a class="dropdown-item" href="#" v-if="!isClosed" v-on:click.prevent="close">Close</a>
16+
<a class="dropdown-item" href="#" v-if="!isClosed && !isIgnored" v-on:click.prevent="ignore">Ignore (hide) incident</a>
17+
</div>
18+
</div>
1219
</div>
1320
</div>
1421
</div>

src/Server/Coderr.Server.Web/ClientApp/components/discover/incidents/search.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ export default class IncidentSearchComponent extends Vue {
104104
if (id > 0) {
105105
this.activeApplications.push(id);
106106
}
107+
} else {
108+
this.highlightActiveApps();
107109
}
108-
this.highlightActiveApps();
110+
109111
this.highlightActiveTags();
110112
this.highlightIncidentState(this.incidentState);
111113
this.search(true);

src/Server/Coderr.Server.Web/ClientApp/components/home/navmenu/navmenu.vue.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</router-link>
5959
</li>
6060
<li class="nav-item">
61-
<a href="#" class="nav-link" title="Log out">
61+
<a href="/account/logout" class="nav-link" title="Log out">
6262
<i class="fa fa-power-off"></i>
6363
</a>
6464
</li>

src/Server/Coderr.Server.Web/ClientApp/components/manage/application/security/security.vue.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h3>Admins</h3>
1212
{{admin.name}}
1313
</td>
1414
<td>
15-
<a href="#" @click.prevent="removeAdmin(admin.id)" title="Downgrade to regular member"><i class="fa fa-hand-point-down text-warning"></i></a>
15+
<a href="#" @click.prevent="removeAdmin(admin.id)" v-if="admins.length > 1" title="Downgrade to regular member"><i class="fa fa-hand-point-down text-warning"></i></a>
1616
</td>
1717
</tr>
1818
</table>

src/Server/Coderr.Server.Web/ClientApp/services/applications/ApplicationService.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export class ApplicationCreated {
3434
export class ApplicationSummary {
3535
readonly id: number;
3636
readonly name: string;
37-
readonly sharedSecret: string;
38-
readonly appKey: string;
37+
sharedSecret: string;
38+
appKey: string;
3939

4040
constructor(id: number, name: string, sharedSecret: string, appKey: string) {
4141
this.id = id;
@@ -114,9 +114,19 @@ export class ApplicationService {
114114

115115
async get(appId: number): Promise<ApplicationSummary> {
116116
for (var i = 0; i < this.applications.length; i++) {
117-
if (this.applications[i].id === appId)
118-
console.log('returning cahce', this.applications[i]);
119-
return this.applications[i];
117+
if (this.applications[i].id !== appId)
118+
continue;
119+
120+
if (this.applications[i].appKey === 'n/a') {
121+
const appQuery = new GetApplicationInfo();
122+
appQuery.ApplicationId = appId;
123+
const appInfo = await this.apiClient.query<GetApplicationInfoResult>(appQuery);
124+
this.applications[i].appKey = appInfo.AppKey;
125+
this.applications[i].sharedSecret = appInfo.SharedSecret;
126+
}
127+
128+
console.log('returning cahce', this.applications[i]);
129+
return this.applications[i];
120130
}
121131

122132
var q = new GetApplicationInfo();
@@ -151,7 +161,7 @@ export class ApplicationService {
151161
if (id === 0) {
152162
throw new Error("Expected an incidentId");
153163
}
154-
164+
155165
var q = new GetApplicationTeam();
156166
q.ApplicationId = id;
157167
var result = await this.apiClient.query<GetApplicationTeamResult>(q);

0 commit comments

Comments
 (0)