-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support of view all dependencies of project
- Loading branch information
rbaul
authored and
rbaul
committed
Feb 15, 2024
1 parent
f30b4c7
commit b8c217d
Showing
18 changed files
with
299 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...ice-visualization-webapp/src/app/project-dependencies/project-dependencies.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<p-toolbar> | ||
<div class="p-toolbar-group-start"> | ||
Dependencies of {{data.projectVersion.name}} | ||
</div> | ||
<p-tag value="{{data.version}}" severity="success"></p-tag> | ||
<div class="p-toolbar-group-end"> | ||
<button label="Open Project" pButton pRipple icon="pi pi-external-link" class="p-button-text" | ||
(click)="openProject()"></button> | ||
</div> | ||
</p-toolbar> | ||
<p-table #dt1 [value]="data.dependencies" [tableStyle]="{ 'min-width': '50rem' }" [paginator]="true" [rows]="25" | ||
[showCurrentPageReport]="true" currentPageReportTemplate="Showing {first} to {last} of {totalRecords} entries" | ||
[rowsPerPageOptions]="[10, 25, 50]" [scrollable]="true" scrollHeight="calc(80vh - 200px)" (sortFunction)="customSort($event)" [customSort]="true" | ||
[styleClass]="'p-datatable-sm'" [resizableColumns]="true" [reorderableColumns]="true" | ||
[globalFilterFields]="globalFilterFields"> | ||
|
||
<ng-template pTemplate="caption"> | ||
<div class="flex"> | ||
<button pButton label="Clear" class="p-button-outlined" icon="pi pi-filter-slash" | ||
(click)="clear(dt1)"></button> | ||
<span class="p-input-icon-left ml-auto"> | ||
<i class="pi pi-search"></i> | ||
<input #filterInput pInputText type="text" (input)="dt1.filterGlobal(filterInput.value, 'contains')" | ||
placeholder="Search keyword" /> | ||
</span> | ||
</div> | ||
</ng-template> | ||
|
||
<ng-template pTemplate="header"> | ||
<tr> | ||
<th pSortableColumn="packageName" pResizableColumn [style]="{ 'width': '50px' }"> | ||
<p-columnFilter type="text" field="packageName" display="menu"></p-columnFilter> | ||
Package Name | ||
<p-sortIcon field="packageName"></p-sortIcon> | ||
</th> | ||
<th pSortableColumn="artifactName" pResizableColumn [style]="{ 'width': '50px' }"> | ||
<p-columnFilter type="text" field="artifactName" display="menu"></p-columnFilter> | ||
Artifact Name | ||
<p-sortIcon field="artifactName"></p-sortIcon> | ||
</th> | ||
<th pSortableColumn="version" pResizableColumn [style]="{ 'width': '50px' }"> | ||
<p-columnFilter type="text" field="version" display="menu"></p-columnFilter> | ||
Version | ||
<p-sortIcon field="version"></p-sortIcon> | ||
</th> | ||
<th>Usage</th> | ||
<!-- <th style="width: 5rem"></th> --> | ||
</tr> | ||
</ng-template> | ||
<ng-template pTemplate="body" let-dependency> | ||
<tr> | ||
<td>{{ dependency.packageName }}</td> | ||
<td>{{ dependency.artifactName }}</td> | ||
<td>{{ dependency.version }}</td> | ||
<td [style]="{ 'text-wrap': 'wrap' }">{{ dependency.usageOf }}</td> | ||
<!-- <td style="display: flex"> | ||
<button label="Open" pButton pRipple icon="pi pi-external-link" class="p-button-text" (click)="openVersion(project)"></button> | ||
<button label="Dependencies" pButton pRipple icon="pi pi-window-maximize" class="p-button-text" (click)="showProjectDependencies(project)"></button> | ||
</td> --> | ||
</tr> | ||
</ng-template> | ||
<ng-template pTemplate="summary"> | ||
<div class="flex align-items-center justify-content-between"> | ||
In total there are {{data.dependencies ? data.dependencies.length : 0 }} dependencies. | ||
</div> | ||
</ng-template> | ||
</p-table> |
Empty file.
23 changes: 23 additions & 0 deletions
23
...-visualization-webapp/src/app/project-dependencies/project-dependencies.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ProjectDependenciesComponent } from './project-dependencies.component'; | ||
|
||
describe('ProjectDependenciesComponent', () => { | ||
let component: ProjectDependenciesComponent; | ||
let fixture: ComponentFixture<ProjectDependenciesComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ProjectDependenciesComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ProjectDependenciesComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
72 changes: 72 additions & 0 deletions
72
...rvice-visualization-webapp/src/app/project-dependencies/project-dependencies.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, inject } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { ButtonModule } from 'primeng/button'; | ||
import { InputTextModule } from 'primeng/inputtext'; | ||
import { Table, TableModule } from 'primeng/table'; | ||
import { ToolbarModule } from 'primeng/toolbar'; | ||
import { ProjectApiService } from '../api/project-api.service'; | ||
import { TagModule } from 'primeng/tag'; | ||
import { ProjectDependenciesDto } from '../api/project-api.model'; | ||
|
||
@Component({ | ||
selector: 'app-project-dependencies', | ||
standalone: true, | ||
imports: [ | ||
CommonModule, | ||
ToolbarModule, | ||
TableModule, | ||
InputTextModule, | ||
ButtonModule, | ||
TagModule | ||
], | ||
templateUrl: './project-dependencies.component.html', | ||
styleUrl: './project-dependencies.component.scss' | ||
}) | ||
export class ProjectDependenciesComponent { | ||
private activatedRoute = inject(ActivatedRoute); | ||
private router = inject(Router); | ||
private projectApiService = inject(ProjectApiService); | ||
|
||
data!: ProjectDependenciesDto; | ||
|
||
globalFilterFields: string[] = ['packageName', 'artifactName']; | ||
|
||
ngOnInit() { | ||
this.activatedRoute.params.subscribe(value => { | ||
let projectId: number = value['id']; | ||
if (projectId) { | ||
this.projectApiService.getDependencies(projectId).subscribe(result => { | ||
this.data = result; | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
openProject(): void { | ||
this.router.navigate([`projects/${this.data.id}`]); | ||
} | ||
|
||
clear(table: Table) { | ||
table.clear(); | ||
} | ||
|
||
customSort(event: any) { | ||
event.data.sort((data1: any, data2: any) => { | ||
let value1 = data1[event.field]; | ||
let value2 = data2[event.field]; | ||
let result = null; | ||
|
||
if (value1 == null && value2 != null) result = -1; | ||
else if (value1 != null && value2 == null) result = 1; | ||
else if (value1 == null && value2 == null) result = 0; | ||
else if (typeof value1 === 'string' && typeof value2 === 'string') { | ||
result = value1.localeCompare(value2, undefined, { numeric: true }); | ||
} | ||
else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0; | ||
|
||
return event.order * result; | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.