Skip to content

Commit

Permalink
Fix overview handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mnhock committed Jul 27, 2023
1 parent bbc3610 commit 28d9431
Show file tree
Hide file tree
Showing 36 changed files with 152 additions and 204 deletions.
28 changes: 2 additions & 26 deletions naikan-client/src/app/overview/contact/contact.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,6 @@ <h5> {{page?.totalElements}} Contacts</h5>
</p-columnFilter>
<p-sortIcon field="group.name"></p-sortIcon>
</th>
<th pSortableColumn="group.title">Title
<p-columnFilter field="group.title" display="menu"
placeholder="Title">
</p-columnFilter>
<p-sortIcon field="group.title"></p-sortIcon>
</th>
<th pSortableColumn="group.email">Email
<p-columnFilter field="group.email" display="menu"
placeholder="Email">
</p-columnFilter>
<p-sortIcon field="group.email"></p-sortIcon>
</th>
<th pSortableColumn="group.phone">Phone
<p-columnFilter field="group.phone" display="menu"
placeholder="Phone">
</p-columnFilter>
<p-sortIcon field="group.phone"></p-sortIcon>
</th>
<th pSortableColumn="count" class="w-10rem">Projects
<p-sortIcon field="count"></p-sortIcon>
</th>
Expand All @@ -87,14 +69,8 @@ <h5> {{page?.totalElements}} Contacts</h5>
</button>
</td>
<td>
<span tooltipPosition="top"
pTooltip="{{ overviewGroup.group.description }}">{{ overviewGroup.group.name }}
</span>
</td>
<td>{{ overviewGroup.group.title }}</td>
<td><a href="mailto:{{ overviewGroup.group.email }}">{{ overviewGroup.group.email }}</a>
{{ overviewGroup.group.name }}
</td>
<td>{{ overviewGroup.group.phone }}</td>
<td class="text-center w-4rem">
<p-tag severity="primary" value="{{ overviewGroup.count }}" [rounded]="true"></p-tag>
</td>
Expand All @@ -104,7 +80,7 @@ <h5> {{page?.totalElements}} Contacts</h5>
<ng-template pTemplate="rowexpansion" let-group>
<tr>
<td></td>
<td colspan="5">
<td colspan="2">
<naikan-overview-project-table [overviewBoms]="group.boms">
</naikan-overview-project-table>
</td>
Expand Down
4 changes: 2 additions & 2 deletions naikan-client/src/app/overview/contact/contact.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {ContactService} from './contact.service';
import {Breadcrumb, Contact, Search} from '../../shared';
import {Breadcrumb, Search} from '../../shared';
import {SharedModule} from 'primeng/api';
import {AbstractOverviewComponent} from "../abstract-overview.component";
import {LayoutService} from "../../layout/app.layout.service";
Expand Down Expand Up @@ -28,7 +28,7 @@ import {OverviewGroup} from "../overview";
],
providers: [ContactService, DatePipe]
})
export class ContactComponent extends AbstractOverviewComponent<OverviewGroup<Contact>> {
export class ContactComponent extends AbstractOverviewComponent<OverviewGroup> {

constructor(private readonly contactService: ContactService, layoutService: LayoutService) {
super(layoutService)
Expand Down
6 changes: 3 additions & 3 deletions naikan-client/src/app/overview/contact/contact.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {Contact, Page, Pageables} from '../../shared';
import {Page, Pageables} from '../../shared';
import {OverviewGroup} from "../overview";
import {TableLazyLoadEvent} from "primeng/table";

Expand All @@ -13,7 +13,7 @@ export class ContactService {
constructor(private readonly http: HttpClient) {
}

getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup<Contact>>> {
return this.http.get<Page<OverviewGroup<Contact>>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup>> {
return this.http.get<Page<OverviewGroup>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
}
}
43 changes: 3 additions & 40 deletions naikan-client/src/app/overview/developer/developer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,6 @@ <h5> {{page?.totalElements}} Developers</h5>
</p-columnFilter>
<p-sortIcon field="group.name"></p-sortIcon>
</th>
<th pSortableColumn="group.title">Title
<p-columnFilter field="group.title" display="menu"
placeholder="Title">
</p-columnFilter>
<p-sortIcon field="group.title"></p-sortIcon>
</th>
<th pSortableColumn="group.organization">Organization
<p-columnFilter field="group.email" display="menu"
placeholder="Organization">
</p-columnFilter>
<p-sortIcon field="group.organization"></p-sortIcon>
</th>
<th pSortableColumn="group.email">Email
<p-columnFilter field="group.email" display="menu"
placeholder="Email">
</p-columnFilter>
<p-sortIcon field="group.email"></p-sortIcon>
</th>
<th pSortableColumn="group.phone">Phone
<p-columnFilter field="group.phone" display="menu"
placeholder="Phone">
</p-columnFilter>
<p-sortIcon field="group.phone"></p-sortIcon>
</th>
<th pSortableColumn="count" class="w-10rem">Projects
<p-sortIcon field="count"></p-sortIcon>
</th>
Expand All @@ -93,31 +69,18 @@ <h5> {{page?.totalElements}} Developers</h5>
</button>
</td>
<td>
<span tooltipPosition="top" pTooltip="{{ overviewGroup.group.description }}">
{{ overviewGroup.group.name }}
</span>
</td>
<td>{{ overviewGroup.group.title }}</td>
<td>
<span tooltipPosition="top" pTooltip="{{ overviewGroup.group.organizationUrl }}">
{{ overviewGroup.group.organization }}
</span>
</td>
<td>
<a href="mailto:{{ overviewGroup.group.email }}">{{ overviewGroup.group.email }}</a>
{{ overviewGroup.group.name }}
</td>
<td>{{ overviewGroup.group.phone }}</td>
<td class="text-center w-4rem">
<p-tag severity="primary" value="{{ overviewGroup.count }}"
[rounded]="true"></p-tag>
<p-tag severity="primary" value="{{ overviewGroup.count }}" [rounded]="true"></p-tag>
</td>
</tr>
</ng-template>

<ng-template pTemplate="rowexpansion" let-group>
<tr>
<td></td>
<td colspan="6">
<td colspan="2">
<naikan-overview-project-table [overviewBoms]="group.boms">
</naikan-overview-project-table>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component} from '@angular/core';
import {DeveloperService} from './developer.service';
import {SharedModule} from 'primeng/api';
import {Breadcrumb, Developer, Search} from '../../shared';
import {Breadcrumb, Search} from '../../shared';
import {AbstractOverviewComponent} from "../abstract-overview.component";
import {LayoutService} from "../../layout/app.layout.service";
import {OverviewProjectTable} from '../overview-project-table';
Expand All @@ -28,7 +28,7 @@ import {OverviewGroup} from "../overview";
],
providers: [DeveloperService, DatePipe]
})
export class DeveloperComponent extends AbstractOverviewComponent<OverviewGroup<Developer>> {
export class DeveloperComponent extends AbstractOverviewComponent<OverviewGroup> {

constructor(private readonly developerService: DeveloperService, layoutService: LayoutService) {
super(layoutService)
Expand Down
6 changes: 3 additions & 3 deletions naikan-client/src/app/overview/developer/developer.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {Developer, Page, Pageables} from '../../shared';
import {Page, Pageables} from '../../shared';
import {OverviewGroup} from "../overview";
import {TableLazyLoadEvent} from "primeng/table";

Expand All @@ -13,7 +13,7 @@ export class DeveloperService {
constructor(private readonly http: HttpClient) {
}

getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup<Developer>>> {
return this.http.get<Page<OverviewGroup<Developer>>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup>> {
return this.http.get<Page<OverviewGroup>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ <h5> {{page?.totalElements}} Environments
</p-columnFilter>
<p-sortIcon field="group.name"></p-sortIcon>
</th>
<th pSortableColumn="group.location">Location
<p-columnFilter field="group.location" display="menu"
placeholder="Location">
</p-columnFilter>
<p-sortIcon field="group.location"></p-sortIcon>
</th>
<th pSortableColumn="count" class="w-10rem">Projects
<p-sortIcon field="count"></p-sortIcon>
</th>
Expand All @@ -77,11 +71,7 @@ <h5> {{page?.totalElements}} Environments
[icon]="expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'"></button>
</td>
<td>
<span tooltipPosition="top"
pTooltip="{{ overviewGroup.group.description }}">{{ overviewGroup.group.name }}</span>
</td>
<td>
<naikan-url [url]="overviewGroup.group.location"></naikan-url>
{{ overviewGroup.group.name }}
</td>
<td class="text-center w-4rem">
<p-tag severity="primary" value="{{ overviewGroup.count }}" [rounded]="true"></p-tag>
Expand All @@ -92,9 +82,9 @@ <h5> {{page?.totalElements}} Environments
<ng-template pTemplate="rowexpansion" let-group>
<tr>
<td></td>
<td colspan="3">
<naikan-overview-project-table
[overviewBoms]="group.boms"></naikan-overview-project-table>
<td colspan="2">
<naikan-overview-project-table [overviewBoms]="group.boms">
</naikan-overview-project-table>
</td>
</tr>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {EnvironmentService} from './environment.service';
import {Breadcrumb, Charts, Developer, Search, Url} from '../../shared';
import {Breadcrumb, Charts, Search, Url} from '../../shared';
import {SharedModule} from 'primeng/api';
import {LayoutService} from '../../layout/app.layout.service';
import {AbstractOverviewComponent} from "../abstract-overview.component";
Expand Down Expand Up @@ -31,7 +31,7 @@ import {OverviewGroup} from "../overview";
],
providers: [EnvironmentService, DatePipe]
})
export class EnvironmentComponent extends AbstractOverviewComponent<OverviewGroup<Developer>> {
export class EnvironmentComponent extends AbstractOverviewComponent<OverviewGroup> {

constructor(private readonly environmentService: EnvironmentService, layoutService: LayoutService) {
super(layoutService);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {Environment, Page, Pageables} from '../../shared';
import {Page, Pageables} from '../../shared';
import {OverviewTopGroups} from '../overview-top-groups';
import {OverviewGroup} from "../overview";
import {TableLazyLoadEvent} from "primeng/table";
Expand All @@ -14,8 +14,8 @@ export class EnvironmentService {
constructor(private readonly http: HttpClient) {
}

getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup<Environment>>> {
return this.http.get<Page<OverviewGroup<Environment>>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup>> {
return this.http.get<Page<OverviewGroup>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
}

getTopGroups(topN: number): Observable<OverviewTopGroups> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ <h5> {{page?.totalElements}} Integrations</h5>
</p-columnFilter>
<p-sortIcon field="group.name"></p-sortIcon>
</th>
<th pSortableColumn="group.url">URL
<p-columnFilter field="group.url" display="menu"
placeholder="URL">
</p-columnFilter>
<p-sortIcon field="group.url"></p-sortIcon>
</th>
<th pSortableColumn="count" class="w-10rem">Projects
<p-sortIcon field="count"></p-sortIcon>
</th>
Expand All @@ -73,12 +67,7 @@ <h5> {{page?.totalElements}} Integrations</h5>
[icon]="expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'"></button>
</td>
<td>
<span tooltipPosition="top" pTooltip="{{ overviewGroup.group.description }}">
{{ overviewGroup.group.name }}
</span>
</td>
<td>
<naikan-url [url]="overviewGroup.group.url"></naikan-url>
{{ overviewGroup.group.name }}
</td>
<td class="text-center w-4rem">
<p-tag severity="primary" value="{{ overviewGroup.count }}" [rounded]="true"></p-tag>
Expand All @@ -89,7 +78,7 @@ <h5> {{page?.totalElements}} Integrations</h5>
<ng-template pTemplate="rowexpansion" let-group>
<tr>
<td></td>
<td colspan="3">
<td colspan="2">
<naikan-overview-project-table [overviewBoms]="group.boms">
</naikan-overview-project-table>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {IntegrationService} from './integration.service';
import {Breadcrumb, Integration, Search, Url} from '../../shared';
import {Breadcrumb, Search, Url} from '../../shared';
import {SharedModule} from 'primeng/api';
import {AbstractOverviewComponent} from "../abstract-overview.component";
import {LayoutService} from "../../layout/app.layout.service";
Expand Down Expand Up @@ -29,7 +29,7 @@ import {OverviewGroup} from "../overview";
],
providers: [IntegrationService, DatePipe]
})
export class IntegrationComponent extends AbstractOverviewComponent<OverviewGroup<Integration>> {
export class IntegrationComponent extends AbstractOverviewComponent<OverviewGroup> {

constructor(private readonly integrationService: IntegrationService, layoutService: LayoutService) {
super(layoutService)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {Integration, Page, Pageables} from '../../shared';
import {Page, Pageables} from '../../shared';
import {OverviewGroup} from "../overview";
import {TableLazyLoadEvent} from "primeng/table";

Expand All @@ -13,7 +13,7 @@ export class IntegrationService {
constructor(private readonly http: HttpClient) {
}

getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup<Integration>>> {
return this.http.get<Page<OverviewGroup<Integration>>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
getOverviews(event?: TableLazyLoadEvent): Observable<Page<OverviewGroup>> {
return this.http.get<Page<OverviewGroup>>(`/${endpoint}`, {params: Pageables.toPageRequestHttpParams(event)});
}
}
8 changes: 6 additions & 2 deletions naikan-client/src/app/overview/overview.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import {Project} from '../shared';

export interface OverviewGroup<T> {
export interface OverviewGroup {
uuid: string;
group: T;
group: Group;
boms?: OverviewBom[];
count: number;
}

export interface Group {
name: string;
}

export interface OverviewBom {
id: string,
timestamp?: Date,
Expand Down
4 changes: 1 addition & 3 deletions naikan-client/src/app/overview/team/team.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ <h5> {{page?.totalElements}} Teams
[icon]="expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'"></button>
</td>
<td>
<span tooltipPosition="top" pTooltip="{{ overviewGroup.group.description }}">
{{ overviewGroup.group.name }}
</span>
{{ overviewGroup.group.name }}
</td>
<td class="text-center w-4rem">
<p-tag severity="primary" value="{{ overviewGroup.count }}" [rounded]="true"></p-tag>
Expand Down
4 changes: 2 additions & 2 deletions naikan-client/src/app/overview/team/team.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component} from '@angular/core';
import {LayoutService} from 'src/app/layout/app.layout.service';
import {TeamService} from './team.service';
import {Breadcrumb, Charts, Search, Team} from '../../shared';
import {Breadcrumb, Charts, Search} from '../../shared';
import {AbstractOverviewComponent} from "../abstract-overview.component";
import {SharedModule} from "primeng/api";
import {OverviewProjectTable} from '../overview-project-table';
Expand Down Expand Up @@ -30,7 +30,7 @@ import {OverviewGroup} from "../overview";
],
providers: [TeamService, DatePipe]
})
export class TeamComponent extends AbstractOverviewComponent<OverviewGroup<Team>> {
export class TeamComponent extends AbstractOverviewComponent<OverviewGroup> {

constructor(private readonly teamService: TeamService, layoutService: LayoutService) {
super(layoutService)
Expand Down
Loading

0 comments on commit 28d9431

Please sign in to comment.