-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TOS-992 / 989] fix: Do not Allow deletion of uploads when used in Test Plans and add Test Plan Name to popup. #289
base: dev
Are you sure you want to change the base?
Changes from all commits
5baa4cb
b06e464
81f412b
f4b3cc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ import {Component, Inject} from '@angular/core'; | |
import {MAT_DIALOG_DATA} from '@angular/material/dialog'; | ||
import {LinkedEntitiesModalComponent} from "./linked-entities-modal.component"; | ||
import {TestDevice} from "../../../models/test-device.model"; | ||
import {TestPlanService} from "../../../services/test-plan.service"; | ||
import {TestPlan} from "../../../models/test-plan.model"; | ||
|
||
@Component({ | ||
selector: 'app-uploads-entities-modal', | ||
|
@@ -10,17 +12,43 @@ import {TestDevice} from "../../../models/test-device.model"; | |
export class UploadEntitiesModalComponent extends LinkedEntitiesModalComponent { | ||
|
||
constructor( | ||
public testPlanService : TestPlanService, | ||
@Inject(MAT_DIALOG_DATA) public modalData: any) { | ||
super(modalData); | ||
} | ||
|
||
|
||
ngOnInit(): void { | ||
this.setTestPlans(this.modalData?.linkedEntityList.cachedItems) | ||
} | ||
|
||
setTestPlans(testdevices){ | ||
let testPlanIds = []; | ||
testdevices.forEach((data: TestDevice) => { | ||
testPlanIds.push(data.testPlanId); | ||
}) | ||
this.testPlanService.findAll("id@"+ testPlanIds.join("#")).subscribe( | ||
res=> { | ||
this.setTestPlanNames(res.content) | ||
}, | ||
error=>{ | ||
console.log(error) | ||
} | ||
) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Raksha-testsigma Just correct the indentation of the brackets There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
openLinkedEntity(id) { | ||
let entityUrl; | ||
if(this.modalData.linkedEntityList['cachedItems'][0] instanceof TestDevice) | ||
entityUrl = "/ui/td/plans/"+ id +"/details"; | ||
window.open(window.location.origin + entityUrl, "_blank"); | ||
} | ||
|
||
private setTestPlanNames(content: TestPlan[]) { | ||
function findAssociatedTestPlan(d) { | ||
return content.find((t)=> d.testPlanId==t.id) | ||
} | ||
this.modalData.linkedEntityList.cachedItems.forEach( | ||
(d,i)=> this.modalData.linkedEntityList.cachedItems[i].name = findAssociatedTestPlan(d).name) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,30 @@ | |
class="list-container virtual-scroll-viewport" | ||
itemSize="27" | ||
style="max-height:261px;height:261px"> | ||
<div class="ts-col-100 pointer d-flex"> | ||
<div class="text-truncate w-235"> | ||
<span | ||
[textContent]="'Test Plans'"> | ||
</span> | ||
</div> | ||
<div> | ||
<span | ||
[textContent]="'Test Machines'"> | ||
</span> | ||
</div></div> | ||
<div | ||
*cdkVirtualFor="let linkedEntity of modalData.linkedEntityList ; let index=index; let first=first" | ||
[class.border-separator-t-1]="first" | ||
class="list-view md-pm green-highlight"> | ||
<div (click)="openLinkedEntity(linkedEntity.testPlanId)" class="ts-col-100 pointer d-flex" target="_blank"> | ||
<div class="text-truncate"> | ||
|
||
<div class="text-truncate w-235"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Raksha-testsigma Same as in previous comment. Why the extra line gap here? |
||
<span | ||
[textContent]="linkedEntity.name" | ||
[matTooltip]="linkedEntity.title"> | ||
</span> | ||
</div> | ||
<div> | ||
<span | ||
[textContent]="linkedEntity.title" | ||
[matTooltip]="linkedEntity.title"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Raksha-testsigma Needs a little formatting. In some cases, there is no line gap between two functions. In some other cases, there are quite a few. Use uniform line gaps