X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=otf-frontend%2Fclient%2Fsrc%2Fapp%2Flayout%2Ftest-instance-expanded-details%2Ftest-instance-expanded-details.component.ts;fp=otf-frontend%2Fclient%2Fsrc%2Fapp%2Flayout%2Ftest-instance-expanded-details%2Ftest-instance-expanded-details.component.ts;h=baf9c40d9447f8f5fc66b4bfebd026be318765d8;hb=6f7e46b4562b31f748670be8947d315963240ddd;hp=0000000000000000000000000000000000000000;hpb=f49bd1efeaaddd4891c1f329b18d8cfb28b3e75b;p=it%2Fotf.git diff --git a/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.ts b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.ts new file mode 100644 index 0000000..baf9c40 --- /dev/null +++ b/otf-frontend/client/src/app/layout/test-instance-expanded-details/test-instance-expanded-details.component.ts @@ -0,0 +1,59 @@ +/* Copyright (c) 2019 AT&T Intellectual Property. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +##############################################################################*/ + + +import { Component, OnInit, Input } from '@angular/core'; +import { TestExecutionService } from 'app/shared/services/test-execution.service'; + +@Component({ + selector: 'app-test-instance-expanded-details', + templateUrl: './test-instance-expanded-details.component.pug', + styleUrls: ['./test-instance-expanded-details.component.scss'] +}) +export class TestInstanceExpandedDetailsComponent implements OnInit { + + @Input() public testInstanceId; + public executionList:any = []; + public isLoading = true; + + constructor(private testexecution: TestExecutionService) { } + + ngOnInit() { + this.testexecution.find({ + $limit: 100, + $sort: { + startTime: -1 + }, + $or: [ + { "historicTestInstance._id": this.testInstanceId}, + { testInstanceId: this.testInstanceId } + ], + $select: ['startTime', 'testResult'] + + }).subscribe( + result => { + for(let i = 0; i < result['data']['length']; i++){ + result['data'][i]['startTime'] = new Date(result['data'][i]['startTime']).toLocaleString(); + } + this.executionList = result['data']; + this.isLoading = false; + }, + err => { + this.isLoading = false; + } + ); + } + +}