experimentelles extrahieren von customer-contact.table (noch nicht korrekt)

This commit is contained in:
Michael Hoennig 2019-04-08 10:57:55 +02:00
parent 1b852707b7
commit 346d350c6f
4 changed files with 31 additions and 26 deletions

View File

@ -1,13 +1,4 @@
<div>
<h2 id="page-heading">
<span jhiTranslate="hsadminNgApp.customerContact.home.title">Customer Contacts</span>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-customer-contact" [routerLink]="['/customer-contact/new']">
<fa-icon [icon]="'plus'"></fa-icon>
<span jhiTranslate="hsadminNgApp.customerContact.home.createLabel">
Create new Customer Contact
</span>
</button>
</h2>
<jhi-alert></jhi-alert>
<br/>
<div class="table-responsive" *ngIf="customerContacts">
@ -17,8 +8,12 @@
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="role"><span jhiTranslate="hsadminNgApp.customerContact.role">Role</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="contactEmail"><span jhiTranslate="hsadminNgApp.customerContact.contact">Contact</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th jhiSortBy="customerPrefix"><span jhiTranslate="hsadminNgApp.customerContact.customer">Customer</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th></th>
<th jhiSortBy="customerPrefix" *ngIf="!customerId"><span jhiTranslate="hsadminNgApp.customerContact.customer">Customer</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<th>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-customer-contact" [routerLink]="['/customer-contact/new']">
<fa-icon [icon]="'plus'" [title]="'hsadminNgApp.customerContact.home.createLabel' | translate"></fa-icon>
</button>
</th>
</tr>
</thead>
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
@ -27,12 +22,12 @@
<td jhiTranslate="{{'hsadminNgApp.CustomerContactRole.' + customerContact.role}}">{{customerContact.role}}</td>
<td>
<div *ngIf="customerContact.contactId">
<a [routerLink]="['../contact', customerContact.contactId , 'view' ]" >{{customerContact.contactEmail}}</a>
<a [routerLink]="['/contact', customerContact.contactId , 'view' ]" >{{customerContact.contactEmail}}</a>
</div>
</td>
<td>
<td *ngIf="!customerId">
<div *ngIf="customerContact.customerId">
<a [routerLink]="['../customer', customerContact.customerId , 'view' ]" >{{customerContact.customerPrefix}}</a>
<a [routerLink]="['/customer', customerContact.customerId , 'view' ]" >{{customerContact.customerPrefix}}</a>
</div>
</td>
<td class="text-right">
@ -40,22 +35,22 @@
<button type="submit"
[routerLink]="['/customer-contact', customerContact.id, 'view' ]"
class="btn btn-info btn-sm">
<fa-icon [icon]="'eye'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
<fa-icon [icon]="'eye'" [title]="'entity.action.view' | translate"></fa-icon>
<span *ngIf="!customerId" class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
</button>
<button type="submit"
[routerLink]="['/customer-contact', customerContact.id, 'edit']"
class="btn btn-primary btn-sm">
<fa-icon [icon]="'pencil-alt'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
<fa-icon [icon]="'pencil-alt'" [title]="'entity.action.edit' | translate"></fa-icon>
<span *ngIf="!customerId" class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
</button>
<button type="submit"
[routerLink]="['/', 'customer-contact', { outlets: { popup: customerContact.id + '/delete'} }]"
replaceUrl="true"
queryParamsHandling="merge"
class="btn btn-danger btn-sm">
<fa-icon [icon]="'times'"></fa-icon>
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
<fa-icon [icon]="'times'" [title]="'entity.action.delete' | translate"></fa-icon>
<span *ngIf="!customerId" class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</td>

View File

@ -30,7 +30,7 @@ export class CustomerContactResolve implements Resolve<ICustomerContact> {
export const customerContactRoute: Routes = [
{
path: '',
path: '/customer-contact',
component: CustomerContactComponent,
data: {
authorities: ['ROLE_USER'],
@ -39,7 +39,7 @@ export const customerContactRoute: Routes = [
canActivate: [UserRouteAccessService]
},
{
path: ':id/view',
path: '/customer-contact/:id/view',
component: CustomerContactDetailComponent,
resolve: {
customerContact: CustomerContactResolve
@ -51,7 +51,7 @@ export const customerContactRoute: Routes = [
canActivate: [UserRouteAccessService]
},
{
path: 'new',
path: '/customer-contact/new',
component: CustomerContactUpdateComponent,
resolve: {
customerContact: CustomerContactResolve
@ -63,7 +63,7 @@ export const customerContactRoute: Routes = [
canActivate: [UserRouteAccessService]
},
{
path: ':id/edit',
path: '/customer-contact/:id/edit',
component: CustomerContactUpdateComponent,
resolve: {
customerContact: CustomerContactResolve

View File

@ -28,8 +28,14 @@
</button>
<hr/>
<h2>Related Entities</h2>
<jhi-customer-contact-table [customer]="customer.id"></jhi-customer-contact-table>
<!--
<hs-table referenceKey="customer" [referenceValue]="customer.id">
<hs-table-column field="role"
contactEmail
customerPrefix
</hs-table>
-->
<hr/>
</div>

View File

@ -6,6 +6,7 @@ import { JhiLanguageHelper } from 'app/core';
import { HsadminNgCustomerContactModule } from 'app/entities/customer-contact/customer-contact.module';
import { HsadminNgSharedModule } from 'app/shared';
import { CustomerContactTableComponent } from 'app/entities/customer-contact';
import {
CustomerComponent,
CustomerDetailComponent,
@ -28,7 +29,10 @@ const ENTITY_STATES = [...customerRoute, ...customerPopupRoute];
CustomerDeletePopupComponent
],
entryComponents: [CustomerComponent, CustomerUpdateComponent, CustomerDeleteDialogComponent, CustomerDeletePopupComponent],
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
providers: [
{ provide: JhiLanguageService, useClass: JhiLanguageService },
{ provide: CustomerContactTableComponent, useClass: CustomerContactTableComponent }
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HsadminNgCustomerModule {