@@ -10,6 +10,7 @@ import { ResultResolutionService } from 'src/app/services/result-resolution/resu
10
10
import { TFColumn , TFSorting , TFOrder , TFColumnType } from 'src/app/elements/table-filter/tfColumn' ;
11
11
import { ResultResolution } from 'src/app/shared/models/result-resolution' ;
12
12
import { LocalPermissions } from 'src/app/shared/models/local-permissions' ;
13
+ import { ProjectService } from '../../../../services/project/project.service' ;
13
14
14
15
@Component ( {
15
16
templateUrl : './issue-list.component.html' ,
@@ -23,7 +24,8 @@ export class IssueListComponent implements OnInit {
23
24
private route : ActivatedRoute ,
24
25
private issueService : IssueService ,
25
26
private permissions : PermissionsService ,
26
- private resolutionService : ResultResolutionService
27
+ private resolutionService : ResultResolutionService ,
28
+ private projectService : ProjectService
27
29
) { }
28
30
29
31
projectId : number ;
@@ -37,16 +39,18 @@ export class IssueListComponent implements OnInit {
37
39
statuses : Label [ ] ;
38
40
defSort : TFSorting = { property : 'created' , order : TFOrder . asc } ;
39
41
hideCreateModal = true ;
42
+ isAiOn : boolean ;
40
43
41
44
async ngOnInit ( ) {
42
45
this . projectId = this . route . snapshot . params . projectId ;
43
- [ this . issues , this . resolutions , this . canEdit , this . projectUsers , this . statuses ] = await Promise . all ( [
46
+ [ this . issues , this . resolutions , this . canEdit , this . projectUsers , this . statuses , this . isAiOn ] = await Promise . all ( [
44
47
this . issueService . getIssues ( { project_id : this . projectId } ) ,
45
48
this . resolutionService . getResolution ( this . projectId ) ,
46
49
this . permissions . hasProjectPermissions ( this . projectId ,
47
50
[ EGlobalPermissions . manager ] , [ ELocalPermissions . manager , ELocalPermissions . engineer ] ) ,
48
51
this . userService . getProjectUsers ( this . projectId ) ,
49
- this . issueService . getIssueStatuses ( )
52
+ this . issueService . getIssueStatuses ( ) ,
53
+ ( ( await this . projectService . getProject ( this . projectId ) ) . ai_resolutions === 1 )
50
54
] ) ;
51
55
this . projectUsers = this . projectUsers . filter ( user => user . admin === 1 || user . manager === 1 || user . engineer === 1 ) ;
52
56
this . users = this . projectUsers . map ( x => x . user ) ;
@@ -79,6 +83,9 @@ export class IssueListComponent implements OnInit {
79
83
showCreate ( ) {
80
84
this . hideCreateModal = false ;
81
85
}
86
+ generateAiIssues ( ) {
87
+ this . issueService . getAiIssues ( this . projectId ) ;
88
+ }
82
89
83
90
async execute ( result : { executed : boolean , result ?: Issue } ) {
84
91
this . hideCreateModal = true ;
0 commit comments