File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Coderr.Server.Abstractions/Security
Coderr.Server.Web/ClientApp/components/discover/incidents Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,15 @@ public static int GetAccountId(this ClaimsPrincipal principal)
37
37
throw new InvalidOperationException (
38
38
"Failed to find ClaimTypes.NameIdentifier, user is probably not logged in." ) ;
39
39
40
- if ( ! int . TryParse ( claim . Value , out var userId ) )
41
- throw new FormatException (
42
- $ "UserId { claim . Value } is not a number. All claims: { principal . ToFriendlyString ( ) } ") ;
40
+ if ( int . TryParse ( claim . Value , out var userId ) ) return userId ;
41
+
42
+ var ex = new FormatException ( $ "UserId { claim . Value } is not a number.") ;
43
+ foreach ( var c in principal . Claims )
44
+ {
45
+ ex . Data [ $ "Claim.{ c . Type } "] = c . Value ;
46
+ }
43
47
44
- return userId ;
48
+ throw ex ;
45
49
}
46
50
47
51
/// <summary>
Original file line number Diff line number Diff line change @@ -107,6 +107,12 @@ export default class IncidentComponent extends Vue {
107
107
} ) ;
108
108
}
109
109
110
+ delete ( ) {
111
+ AppRoot . Instance . incidentService . delete ( this . incidentId , "yes" ) ;
112
+ AppRoot . notify ( "Incident have been removed" , 'fa-info' , 'success' ) ;
113
+ this . $router . push ( { name : 'suggest' } ) ;
114
+ }
115
+
110
116
private displayChart ( days : ReportDay [ ] ) {
111
117
var labels : Date [ ] = [ ] ;
112
118
var series : number [ ] = [ ] ;
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ <h3>{{incident.Description}} <small class="text-muted">[{{incident.FullName}}]</
10
10
< div class ="btn-group " role ="group ">
11
11
< a class ="btn btn-primary " href ="# " v-if ="incident.IncidentState == 0 " v-on:click.prevent ="assignToMe "> Assign to me</ a >
12
12
< div class ="dropdown " style ="display: inline-block ">
13
- < button class ="btn btn-outline-primary dropdown-toggle " type ="button " id ="dropdownMenuButton " data-toggle ="dropdown " aria-haspopup ="true " aria-expanded ="false "> </ button >
13
+ < button class ="btn btn-outline-dark dropdown-toggle " type ="button " id ="dropdownMenuButton " data-toggle ="dropdown " aria-haspopup ="true " aria-expanded ="false "> </ button >
14
14
< div class ="dropdown-menu dropdown-menu-right " aria-labelledby ="dropdownMenuButton ">
15
15
< a class ="dropdown-item " href ="# " v-if ="incident.IncidentState == 0 " v-on:click.prevent ="assignToSomeoneElse "> Assign to ..</ a >
16
16
< a class ="dropdown-item " href ="# " v-if ="!isClosed && !isIgnored " v-on:click.prevent ="ignore "> Ignore</ a >
17
17
< a class ="dropdown-item " href ="# " v-if ="!isClosed " v-on:click.prevent ="close "> Close</ a >
18
+ < a class ="dropdown-item " href ="# " v-on:click.prevent ="delete "> Delete</ a >
18
19
</ div >
19
20
</ div >
20
21
</ div >
You can’t perform that action at this time.
0 commit comments