Model customers.
This commit is contained in:
@ -21,10 +21,10 @@
|
||||
<dd>
|
||||
<span>{{asset.comment}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.member">Member</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span></dt>
|
||||
<dd>
|
||||
<div *ngIf="asset.memberId">
|
||||
<a [routerLink]="['/membership', asset.memberId, 'view']">{{asset.memberId}}</a>
|
||||
<div *ngIf="asset.membershipId">
|
||||
<a [routerLink]="['/membership', asset.membershipId, 'view']">{{asset.membershipFrom}}</a>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
@ -70,16 +70,15 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.member" for="field_member">Member</label>
|
||||
<select class="form-control" id="field_member" name="member" [(ngModel)]="asset.memberId" required>
|
||||
<option *ngIf="!editForm.value.member" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.id}}</option>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.membership" for="field_membership">Membership</label>
|
||||
<select class="form-control" id="field_membership" name="membership" [(ngModel)]="asset.membershipId" required>
|
||||
<option *ngIf="!editForm.value.membership" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.from}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.member?.dirty && editForm.controls.member?.invalid)">
|
||||
<div [hidden]="!(editForm.controls.membership?.dirty && editForm.controls.membership?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.member?.errors?.required"
|
||||
jhiTranslate="entity.validation.required">
|
||||
[hidden]="!editForm.controls.membership?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<th jhiSortBy="action"><span jhiTranslate="hsadminNgApp.asset.action">Action</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="amount"><span jhiTranslate="hsadminNgApp.asset.amount">Amount</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="comment"><span jhiTranslate="hsadminNgApp.asset.comment">Comment</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="memberId"><span jhiTranslate="hsadminNgApp.asset.member">Member</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="membershipFrom"><span jhiTranslate="hsadminNgApp.asset.membership">Membership</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -31,8 +31,8 @@
|
||||
<td>{{asset.amount}}</td>
|
||||
<td>{{asset.comment}}</td>
|
||||
<td>
|
||||
<div *ngIf="asset.memberId">
|
||||
<a [routerLink]="['../membership', asset.memberId , 'view' ]" >{{asset.memberId}}</a>
|
||||
<div *ngIf="asset.membershipId">
|
||||
<a [routerLink]="['../membership', asset.membershipId , 'view' ]" >{{asset.membershipFrom}}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
|
@ -1,65 +0,0 @@
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { JhiEventManager } from 'ng-jhipster';
|
||||
|
||||
import { IContact } from 'app/shared/model/contact.model';
|
||||
import { ContactService } from './contact.service';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-contact-delete-dialog',
|
||||
templateUrl: './contact-delete-dialog.component.html'
|
||||
})
|
||||
export class ContactDeleteDialogComponent {
|
||||
contact: IContact;
|
||||
|
||||
constructor(protected contactService: ContactService, public activeModal: NgbActiveModal, protected eventManager: JhiEventManager) {}
|
||||
|
||||
clear() {
|
||||
this.activeModal.dismiss('cancel');
|
||||
}
|
||||
|
||||
confirmDelete(id: number) {
|
||||
this.contactService.delete(id).subscribe(response => {
|
||||
this.eventManager.broadcast({
|
||||
name: 'contactListModification',
|
||||
content: 'Deleted an contact'
|
||||
});
|
||||
this.activeModal.dismiss(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-contact-delete-popup',
|
||||
template: ''
|
||||
})
|
||||
export class ContactDeletePopupComponent implements OnInit, OnDestroy {
|
||||
protected ngbModalRef: NgbModalRef;
|
||||
|
||||
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.activatedRoute.data.subscribe(({ contact }) => {
|
||||
setTimeout(() => {
|
||||
this.ngbModalRef = this.modalService.open(ContactDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
|
||||
this.ngbModalRef.componentInstance.contact = contact;
|
||||
this.ngbModalRef.result.then(
|
||||
result => {
|
||||
this.router.navigate(['/contact', { outlets: { popup: null } }]);
|
||||
this.ngbModalRef = null;
|
||||
},
|
||||
reason => {
|
||||
this.router.navigate(['/contact', { outlets: { popup: null } }]);
|
||||
this.ngbModalRef = null;
|
||||
}
|
||||
);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.ngbModalRef = null;
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<div *ngIf="contact">
|
||||
<h2><span jhiTranslate="hsadminNgApp.contact.detail.title">Contact</span> {{contact.id}}</h2>
|
||||
<hr>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<dl class="row-md jh-entity-details">
|
||||
<dt><span jhiTranslate="hsadminNgApp.contact.firstName">First Name</span></dt>
|
||||
<dd>
|
||||
<span>{{contact.firstName}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.contact.lastName">Last Name</span></dt>
|
||||
<dd>
|
||||
<span>{{contact.lastName}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.contact.email">Email</span></dt>
|
||||
<dd>
|
||||
<span>{{contact.email}}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<button type="submit"
|
||||
(click)="previousState()"
|
||||
class="btn btn-info">
|
||||
<fa-icon [icon]="'arrow-left'"></fa-icon> <span jhiTranslate="entity.action.back"> Back</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
[routerLink]="['/contact', contact.id, 'edit']"
|
||||
class="btn btn-primary">
|
||||
<fa-icon [icon]="'pencil-alt'"></fa-icon> <span jhiTranslate="entity.action.edit"> Edit</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,24 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { IContact } from 'app/shared/model/contact.model';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-contact-detail',
|
||||
templateUrl: './contact-detail.component.html'
|
||||
})
|
||||
export class ContactDetailComponent implements OnInit {
|
||||
contact: IContact;
|
||||
|
||||
constructor(protected activatedRoute: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.activatedRoute.data.subscribe(({ contact }) => {
|
||||
this.contact = contact;
|
||||
});
|
||||
}
|
||||
|
||||
previousState() {
|
||||
window.history.back();
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
|
||||
<h2 id="jhi-contact-heading" jhiTranslate="hsadminNgApp.contact.home.createOrEditLabel">Create or edit a Contact</h2>
|
||||
<div>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<div class="form-group" [hidden]="!contact.id">
|
||||
<label for="id" jhiTranslate="global.field.id">ID</label>
|
||||
<input type="text" class="form-control" id="id" name="id"
|
||||
[(ngModel)]="contact.id" readonly />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.contact.firstName" for="field_firstName">First Name</label>
|
||||
<input type="text" class="form-control" name="firstName" id="field_firstName"
|
||||
[(ngModel)]="contact.firstName" required maxlength="80"/>
|
||||
<div [hidden]="!(editForm.controls.firstName?.dirty && editForm.controls.firstName?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.firstName?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.firstName?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.contact.lastName" for="field_lastName">Last Name</label>
|
||||
<input type="text" class="form-control" name="lastName" id="field_lastName"
|
||||
[(ngModel)]="contact.lastName" required maxlength="80"/>
|
||||
<div [hidden]="!(editForm.controls.lastName?.dirty && editForm.controls.lastName?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.lastName?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.lastName?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.contact.email" for="field_email">Email</label>
|
||||
<input type="text" class="form-control" name="email" id="field_email"
|
||||
[(ngModel)]="contact.email" required maxlength="80"/>
|
||||
<div [hidden]="!(editForm.controls.email?.dirty && editForm.controls.email?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.email?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.email?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
|
||||
<fa-icon [icon]="'ban'"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
<button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
|
||||
<fa-icon [icon]="'save'"></fa-icon> <span jhiTranslate="entity.action.save">Save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -1,51 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { IContact } from 'app/shared/model/contact.model';
|
||||
import { ContactService } from './contact.service';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-contact-update',
|
||||
templateUrl: './contact-update.component.html'
|
||||
})
|
||||
export class ContactUpdateComponent implements OnInit {
|
||||
contact: IContact;
|
||||
isSaving: boolean;
|
||||
|
||||
constructor(protected contactService: ContactService, protected activatedRoute: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.isSaving = false;
|
||||
this.activatedRoute.data.subscribe(({ contact }) => {
|
||||
this.contact = contact;
|
||||
});
|
||||
}
|
||||
|
||||
previousState() {
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
save() {
|
||||
this.isSaving = true;
|
||||
if (this.contact.id !== undefined) {
|
||||
this.subscribeToSaveResponse(this.contactService.update(this.contact));
|
||||
} else {
|
||||
this.subscribeToSaveResponse(this.contactService.create(this.contact));
|
||||
}
|
||||
}
|
||||
|
||||
protected subscribeToSaveResponse(result: Observable<HttpResponse<IContact>>) {
|
||||
result.subscribe((res: HttpResponse<IContact>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
|
||||
}
|
||||
|
||||
protected onSaveSuccess() {
|
||||
this.isSaving = false;
|
||||
this.previousState();
|
||||
}
|
||||
|
||||
protected onSaveError() {
|
||||
this.isSaving = false;
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
<div>
|
||||
<h2 id="page-heading">
|
||||
<span jhiTranslate="hsadminNgApp.contact.home.title">Contacts</span>
|
||||
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-contact" [routerLink]="['/contact/new']">
|
||||
<fa-icon [icon]="'plus'"></fa-icon>
|
||||
<span jhiTranslate="hsadminNgApp.contact.home.createLabel">
|
||||
Create new Contact
|
||||
</span>
|
||||
</button>
|
||||
</h2>
|
||||
<jhi-alert></jhi-alert>
|
||||
<br/>
|
||||
<div class="table-responsive" *ngIf="contacts">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
|
||||
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="firstName"><span jhiTranslate="hsadminNgApp.contact.firstName">First Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="lastName"><span jhiTranslate="hsadminNgApp.contact.lastName">Last Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="email"><span jhiTranslate="hsadminNgApp.contact.email">Email</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
|
||||
<tr *ngFor="let contact of contacts ;trackBy: trackId">
|
||||
<td><a [routerLink]="['/contact', contact.id, 'view' ]">{{contact.id}}</a></td>
|
||||
<td>{{contact.firstName}}</td>
|
||||
<td>{{contact.lastName}}</td>
|
||||
<td>{{contact.email}}</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group flex-btn-group-container">
|
||||
<button type="submit"
|
||||
[routerLink]="['/contact', contact.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>
|
||||
</button>
|
||||
<button type="submit"
|
||||
[routerLink]="['/contact', contact.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>
|
||||
</button>
|
||||
<button type="submit"
|
||||
[routerLink]="['/', 'contact', { outlets: { popup: contact.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>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -1,93 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
|
||||
import { UserRouteAccessService } from 'app/core';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { Contact } from 'app/shared/model/contact.model';
|
||||
import { ContactService } from './contact.service';
|
||||
import { ContactComponent } from './contact.component';
|
||||
import { ContactDetailComponent } from './contact-detail.component';
|
||||
import { ContactUpdateComponent } from './contact-update.component';
|
||||
import { ContactDeletePopupComponent } from './contact-delete-dialog.component';
|
||||
import { IContact } from 'app/shared/model/contact.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ContactResolve implements Resolve<IContact> {
|
||||
constructor(private service: ContactService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<IContact> {
|
||||
const id = route.params['id'] ? route.params['id'] : null;
|
||||
if (id) {
|
||||
return this.service.find(id).pipe(
|
||||
filter((response: HttpResponse<Contact>) => response.ok),
|
||||
map((contact: HttpResponse<Contact>) => contact.body)
|
||||
);
|
||||
}
|
||||
return of(new Contact());
|
||||
}
|
||||
}
|
||||
|
||||
export const contactRoute: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ContactComponent,
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.contact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: ':id/view',
|
||||
component: ContactDetailComponent,
|
||||
resolve: {
|
||||
contact: ContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.contact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: ContactUpdateComponent,
|
||||
resolve: {
|
||||
contact: ContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.contact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: ':id/edit',
|
||||
component: ContactUpdateComponent,
|
||||
resolve: {
|
||||
contact: ContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.contact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
}
|
||||
];
|
||||
|
||||
export const contactPopupRoute: Routes = [
|
||||
{
|
||||
path: ':id/delete',
|
||||
component: ContactDeletePopupComponent,
|
||||
resolve: {
|
||||
contact: ContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.contact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService],
|
||||
outlet: 'popup'
|
||||
}
|
||||
];
|
@ -1,38 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpResponse } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { SERVER_API_URL } from 'app/app.constants';
|
||||
import { createRequestOption } from 'app/shared';
|
||||
import { IContact } from 'app/shared/model/contact.model';
|
||||
|
||||
type EntityResponseType = HttpResponse<IContact>;
|
||||
type EntityArrayResponseType = HttpResponse<IContact[]>;
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ContactService {
|
||||
public resourceUrl = SERVER_API_URL + 'api/contacts';
|
||||
|
||||
constructor(protected http: HttpClient) {}
|
||||
|
||||
create(contact: IContact): Observable<EntityResponseType> {
|
||||
return this.http.post<IContact>(this.resourceUrl, contact, { observe: 'response' });
|
||||
}
|
||||
|
||||
update(contact: IContact): Observable<EntityResponseType> {
|
||||
return this.http.put<IContact>(this.resourceUrl, contact, { observe: 'response' });
|
||||
}
|
||||
|
||||
find(id: number): Observable<EntityResponseType> {
|
||||
return this.http.get<IContact>(`${this.resourceUrl}/${id}`, { observe: 'response' });
|
||||
}
|
||||
|
||||
query(req?: any): Observable<EntityArrayResponseType> {
|
||||
const options = createRequestOption(req);
|
||||
return this.http.get<IContact[]>(this.resourceUrl, { params: options, observe: 'response' });
|
||||
}
|
||||
|
||||
delete(id: number): Observable<HttpResponse<any>> {
|
||||
return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
export * from './contact.service';
|
||||
export * from './contact-update.component';
|
||||
export * from './contact-delete-dialog.component';
|
||||
export * from './contact-detail.component';
|
||||
export * from './contact.component';
|
||||
export * from './contact.route';
|
@ -1,19 +0,0 @@
|
||||
<form name="deleteForm" (ngSubmit)="confirmDelete(customerContact.id)">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
|
||||
(click)="clear()">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<p id="jhi-delete-customerContact-heading" jhiTranslate="hsadminNgApp.customerContact.delete.question" [translateValues]="{id: customerContact.id}">Are you sure you want to delete this Customer Contact?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
|
||||
<fa-icon [icon]="'ban'"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
<button id="jhi-confirm-delete-customerContact" type="submit" class="btn btn-danger">
|
||||
<fa-icon [icon]="'times'"></fa-icon> <span jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
@ -1,39 +0,0 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<div *ngIf="customerContact">
|
||||
<h2><span jhiTranslate="hsadminNgApp.customerContact.detail.title">Customer Contact</span> {{customerContact.id}}</h2>
|
||||
<hr>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<dl class="row-md jh-entity-details">
|
||||
<dt><span jhiTranslate="hsadminNgApp.customerContact.role">Role</span></dt>
|
||||
<dd>
|
||||
<span jhiTranslate="{{'hsadminNgApp.CustomerContactRole.' + customerContact.role}}">{{customerContact.role}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customerContact.contact">Contact</span></dt>
|
||||
<dd>
|
||||
<div *ngIf="customerContact.contactId">
|
||||
<a [routerLink]="['/contact', customerContact.contactId, 'view']">{{customerContact.contactEmail}}</a>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customerContact.customer">Customer</span></dt>
|
||||
<dd>
|
||||
<div *ngIf="customerContact.customerId">
|
||||
<a [routerLink]="['/customer', customerContact.customerId, 'view']">{{customerContact.customerPrefix}}</a>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<button type="submit"
|
||||
(click)="previousState()"
|
||||
class="btn btn-info">
|
||||
<fa-icon [icon]="'arrow-left'"></fa-icon> <span jhiTranslate="entity.action.back"> Back</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
[routerLink]="['/customer-contact', customerContact.id, 'edit']"
|
||||
class="btn btn-primary">
|
||||
<fa-icon [icon]="'pencil-alt'"></fa-icon> <span jhiTranslate="entity.action.edit"> Edit</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,24 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-customer-contact-detail',
|
||||
templateUrl: './customer-contact-detail.component.html'
|
||||
})
|
||||
export class CustomerContactDetailComponent implements OnInit {
|
||||
customerContact: ICustomerContact;
|
||||
|
||||
constructor(protected activatedRoute: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.activatedRoute.data.subscribe(({ customerContact }) => {
|
||||
this.customerContact = customerContact;
|
||||
});
|
||||
}
|
||||
|
||||
previousState() {
|
||||
window.history.back();
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
|
||||
<h2 id="jhi-customer-contact-heading" jhiTranslate="hsadminNgApp.customerContact.home.createOrEditLabel">Create or edit a Customer Contact</h2>
|
||||
<div>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<div class="form-group" [hidden]="!customerContact.id">
|
||||
<label for="id" jhiTranslate="global.field.id">ID</label>
|
||||
<input type="text" class="form-control" id="id" name="id"
|
||||
[(ngModel)]="customerContact.id" readonly />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customerContact.role" for="field_role">Role</label>
|
||||
<select class="form-control" name="role" [(ngModel)]="customerContact.role" id="field_role" required>
|
||||
<option value="CONTRACTUAL">{{'hsadminNgApp.CustomerContactRole.CONTRACTUAL' | translate}}</option>
|
||||
<option value="TECHNICAL">{{'hsadminNgApp.CustomerContactRole.TECHNICAL' | translate}}</option>
|
||||
<option value="FINANCIAL">{{'hsadminNgApp.CustomerContactRole.FINANCIAL' | translate}}</option>
|
||||
</select>
|
||||
<div [hidden]="!(editForm.controls.role?.dirty && editForm.controls.role?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.role?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customerContact.contact" for="field_contact">Contact</label>
|
||||
<select class="form-control" id="field_contact" name="contact" [(ngModel)]="customerContact.contactId" required>
|
||||
<option *ngIf="!editForm.value.contact" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="contactOption.id" *ngFor="let contactOption of contacts; trackBy: trackContactById">{{contactOption.email}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.contact?.dirty && editForm.controls.contact?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.contact?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customerContact.customer" for="field_customer">Customer</label>
|
||||
<select class="form-control" id="field_customer" name="customer" [(ngModel)]="customerContact.customerId" required>
|
||||
<option *ngIf="!editForm.value.customer" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="customerOption.id" *ngFor="let customerOption of customers; trackBy: trackCustomerById">{{customerOption.prefix}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.customer?.dirty && editForm.controls.customer?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.customer?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
|
||||
<fa-icon [icon]="'ban'"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
<button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
|
||||
<fa-icon [icon]="'save'"></fa-icon> <span jhiTranslate="entity.action.save">Save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -1,66 +0,0 @@
|
||||
<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">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
|
||||
<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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
|
||||
<tr *ngFor="let customerContact of customerContacts ;trackBy: trackId">
|
||||
<td><a [routerLink]="['/customer-contact', customerContact.id, 'view' ]">{{customerContact.id}}</a></td>
|
||||
<td jhiTranslate="{{'hsadminNgApp.CustomerContactRole.' + customerContact.role}}">{{customerContact.role}}</td>
|
||||
<td>
|
||||
<div *ngIf="customerContact.contactId">
|
||||
<a [routerLink]="['../contact', customerContact.contactId , 'view' ]" >{{customerContact.contactEmail}}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div *ngIf="customerContact.customerId">
|
||||
<a [routerLink]="['../customer', customerContact.customerId , 'view' ]" >{{customerContact.customerPrefix}}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group flex-btn-group-container">
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -1,108 +0,0 @@
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { HttpErrorResponse, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { JhiEventManager, JhiParseLinks, JhiAlertService } from 'ng-jhipster';
|
||||
|
||||
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
|
||||
import { AccountService } from 'app/core';
|
||||
|
||||
import { ITEMS_PER_PAGE } from 'app/shared';
|
||||
import { CustomerContactService } from './customer-contact.service';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-customer-contact',
|
||||
templateUrl: './customer-contact.component.html'
|
||||
})
|
||||
export class CustomerContactComponent implements OnInit, OnDestroy {
|
||||
customerContacts: ICustomerContact[];
|
||||
currentAccount: any;
|
||||
eventSubscriber: Subscription;
|
||||
itemsPerPage: number;
|
||||
links: any;
|
||||
page: any;
|
||||
predicate: any;
|
||||
reverse: any;
|
||||
totalItems: number;
|
||||
|
||||
constructor(
|
||||
protected customerContactService: CustomerContactService,
|
||||
protected jhiAlertService: JhiAlertService,
|
||||
protected eventManager: JhiEventManager,
|
||||
protected parseLinks: JhiParseLinks,
|
||||
protected accountService: AccountService
|
||||
) {
|
||||
this.customerContacts = [];
|
||||
this.itemsPerPage = ITEMS_PER_PAGE;
|
||||
this.page = 0;
|
||||
this.links = {
|
||||
last: 0
|
||||
};
|
||||
this.predicate = 'id';
|
||||
this.reverse = true;
|
||||
}
|
||||
|
||||
loadAll() {
|
||||
this.customerContactService
|
||||
.query({
|
||||
page: this.page,
|
||||
size: this.itemsPerPage,
|
||||
sort: this.sort()
|
||||
})
|
||||
.subscribe(
|
||||
(res: HttpResponse<ICustomerContact[]>) => this.paginateCustomerContacts(res.body, res.headers),
|
||||
(res: HttpErrorResponse) => this.onError(res.message)
|
||||
);
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.page = 0;
|
||||
this.customerContacts = [];
|
||||
this.loadAll();
|
||||
}
|
||||
|
||||
loadPage(page) {
|
||||
this.page = page;
|
||||
this.loadAll();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.loadAll();
|
||||
this.accountService.identity().then(account => {
|
||||
this.currentAccount = account;
|
||||
});
|
||||
this.registerChangeInCustomerContacts();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.eventManager.destroy(this.eventSubscriber);
|
||||
}
|
||||
|
||||
trackId(index: number, item: ICustomerContact) {
|
||||
return item.id;
|
||||
}
|
||||
|
||||
registerChangeInCustomerContacts() {
|
||||
this.eventSubscriber = this.eventManager.subscribe('customerContactListModification', response => this.reset());
|
||||
}
|
||||
|
||||
sort() {
|
||||
const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')];
|
||||
if (this.predicate !== 'id') {
|
||||
result.push('id');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected paginateCustomerContacts(data: ICustomerContact[], headers: HttpHeaders) {
|
||||
this.links = this.parseLinks.parse(headers.get('link'));
|
||||
this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
this.customerContacts.push(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
protected onError(errorMessage: string) {
|
||||
this.jhiAlertService.error(errorMessage, null, null);
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { JhiLanguageService } from 'ng-jhipster';
|
||||
import { JhiLanguageHelper } from 'app/core';
|
||||
|
||||
import { HsadminNgSharedModule } from 'app/shared';
|
||||
import {
|
||||
CustomerContactComponent,
|
||||
CustomerContactDetailComponent,
|
||||
CustomerContactUpdateComponent,
|
||||
CustomerContactDeletePopupComponent,
|
||||
CustomerContactDeleteDialogComponent,
|
||||
customerContactRoute,
|
||||
customerContactPopupRoute
|
||||
} from './';
|
||||
|
||||
const ENTITY_STATES = [...customerContactRoute, ...customerContactPopupRoute];
|
||||
|
||||
@NgModule({
|
||||
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
|
||||
declarations: [
|
||||
CustomerContactComponent,
|
||||
CustomerContactDetailComponent,
|
||||
CustomerContactUpdateComponent,
|
||||
CustomerContactDeleteDialogComponent,
|
||||
CustomerContactDeletePopupComponent
|
||||
],
|
||||
entryComponents: [
|
||||
CustomerContactComponent,
|
||||
CustomerContactUpdateComponent,
|
||||
CustomerContactDeleteDialogComponent,
|
||||
CustomerContactDeletePopupComponent
|
||||
],
|
||||
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class HsadminNgCustomerContactModule {
|
||||
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
|
||||
this.languageHelper.language.subscribe((languageKey: string) => {
|
||||
if (languageKey !== undefined) {
|
||||
this.languageService.changeLanguage(languageKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
|
||||
import { UserRouteAccessService } from 'app/core';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { CustomerContact } from 'app/shared/model/customer-contact.model';
|
||||
import { CustomerContactService } from './customer-contact.service';
|
||||
import { CustomerContactComponent } from './customer-contact.component';
|
||||
import { CustomerContactDetailComponent } from './customer-contact-detail.component';
|
||||
import { CustomerContactUpdateComponent } from './customer-contact-update.component';
|
||||
import { CustomerContactDeletePopupComponent } from './customer-contact-delete-dialog.component';
|
||||
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class CustomerContactResolve implements Resolve<ICustomerContact> {
|
||||
constructor(private service: CustomerContactService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<ICustomerContact> {
|
||||
const id = route.params['id'] ? route.params['id'] : null;
|
||||
if (id) {
|
||||
return this.service.find(id).pipe(
|
||||
filter((response: HttpResponse<CustomerContact>) => response.ok),
|
||||
map((customerContact: HttpResponse<CustomerContact>) => customerContact.body)
|
||||
);
|
||||
}
|
||||
return of(new CustomerContact());
|
||||
}
|
||||
}
|
||||
|
||||
export const customerContactRoute: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: CustomerContactComponent,
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.customerContact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: ':id/view',
|
||||
component: CustomerContactDetailComponent,
|
||||
resolve: {
|
||||
customerContact: CustomerContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.customerContact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: CustomerContactUpdateComponent,
|
||||
resolve: {
|
||||
customerContact: CustomerContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.customerContact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: ':id/edit',
|
||||
component: CustomerContactUpdateComponent,
|
||||
resolve: {
|
||||
customerContact: CustomerContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.customerContact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
}
|
||||
];
|
||||
|
||||
export const customerContactPopupRoute: Routes = [
|
||||
{
|
||||
path: ':id/delete',
|
||||
component: CustomerContactDeletePopupComponent,
|
||||
resolve: {
|
||||
customerContact: CustomerContactResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.customerContact.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService],
|
||||
outlet: 'popup'
|
||||
}
|
||||
];
|
@ -1,38 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpResponse } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { SERVER_API_URL } from 'app/app.constants';
|
||||
import { createRequestOption } from 'app/shared';
|
||||
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
|
||||
|
||||
type EntityResponseType = HttpResponse<ICustomerContact>;
|
||||
type EntityArrayResponseType = HttpResponse<ICustomerContact[]>;
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class CustomerContactService {
|
||||
public resourceUrl = SERVER_API_URL + 'api/customer-contacts';
|
||||
|
||||
constructor(protected http: HttpClient) {}
|
||||
|
||||
create(customerContact: ICustomerContact): Observable<EntityResponseType> {
|
||||
return this.http.post<ICustomerContact>(this.resourceUrl, customerContact, { observe: 'response' });
|
||||
}
|
||||
|
||||
update(customerContact: ICustomerContact): Observable<EntityResponseType> {
|
||||
return this.http.put<ICustomerContact>(this.resourceUrl, customerContact, { observe: 'response' });
|
||||
}
|
||||
|
||||
find(id: number): Observable<EntityResponseType> {
|
||||
return this.http.get<ICustomerContact>(`${this.resourceUrl}/${id}`, { observe: 'response' });
|
||||
}
|
||||
|
||||
query(req?: any): Observable<EntityArrayResponseType> {
|
||||
const options = createRequestOption(req);
|
||||
return this.http.get<ICustomerContact[]>(this.resourceUrl, { params: options, observe: 'response' });
|
||||
}
|
||||
|
||||
delete(id: number): Observable<HttpResponse<any>> {
|
||||
return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
export * from './customer-contact.service';
|
||||
export * from './customer-contact-update.component';
|
||||
export * from './customer-contact-delete-dialog.component';
|
||||
export * from './customer-contact-detail.component';
|
||||
export * from './customer-contact.component';
|
||||
export * from './customer-contact.route';
|
@ -17,22 +17,22 @@
|
||||
<dd>
|
||||
<span>{{customer.name}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span></dt>
|
||||
<dd>
|
||||
<span>{{customer.contractualAddress}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span></dt>
|
||||
<dd>
|
||||
<span>{{customer.contractualSalutation}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span></dt>
|
||||
<dd>
|
||||
<span>{{customer.billingAddress}}</span>
|
||||
<span>{{customer.contractualAddress}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span></dt>
|
||||
<dd>
|
||||
<span>{{customer.billingSalutation}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span></dt>
|
||||
<dd>
|
||||
<span>{{customer.billingAddress}}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<button type="submit"
|
||||
|
@ -48,82 +48,65 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.name"
|
||||
for="field_name">Name</label>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.name" for="field_name">Name</label>
|
||||
<input type="text" class="form-control" name="name" id="field_name"
|
||||
[(ngModel)]="customer.name" required maxlength="80"/>
|
||||
[(ngModel)]="customer.name" required maxlength="80"/>
|
||||
<div [hidden]="!(editForm.controls.name?.dirty && editForm.controls.name?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.name?.errors?.required"
|
||||
jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
[hidden]="!editForm.controls.name?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.name?.errors?.maxlength"
|
||||
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
[hidden]="!editForm.controls.name?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualAddress"
|
||||
for="field_contractualAddress">Contractual Address</label>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualSalutation" for="field_contractualSalutation">Contractual Salutation</label>
|
||||
<input type="text" class="form-control" name="contractualSalutation" id="field_contractualSalutation"
|
||||
[(ngModel)]="customer.contractualSalutation" maxlength="80"/>
|
||||
<div [hidden]="!(editForm.controls.contractualSalutation?.dirty && editForm.controls.contractualSalutation?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.contractualSalutation?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualAddress" for="field_contractualAddress">Contractual Address</label>
|
||||
<input type="text" class="form-control" name="contractualAddress" id="field_contractualAddress"
|
||||
[(ngModel)]="customer.contractualAddress" required maxlength="400"/>
|
||||
<div
|
||||
[hidden]="!(editForm.controls.contractualAddress?.dirty && editForm.controls.contractualAddress?.invalid)">
|
||||
[(ngModel)]="customer.contractualAddress" required maxlength="400"/>
|
||||
<div [hidden]="!(editForm.controls.contractualAddress?.dirty && editForm.controls.contractualAddress?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.contractualAddress?.errors?.required"
|
||||
jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
[hidden]="!editForm.controls.contractualAddress?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.contractualAddress?.errors?.maxlength"
|
||||
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
|
||||
This field cannot be longer than 400 characters.
|
||||
[hidden]="!editForm.controls.contractualAddress?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
|
||||
This field cannot be longer than 400 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualSalutation"
|
||||
for="field_contractualSalutation">Contractual Salutation</label>
|
||||
<input type="text" class="form-control" name="contractualSalutation"
|
||||
id="field_contractualSalutation"
|
||||
[(ngModel)]="customer.contractualSalutation" maxlength="80"/>
|
||||
<div
|
||||
[hidden]="!(editForm.controls.contractualSalutation?.dirty && editForm.controls.contractualSalutation?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.contractualSalutation?.errors?.maxlength"
|
||||
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingAddress"
|
||||
for="field_billingAddress">Billing Address</label>
|
||||
<input type="text" class="form-control" name="billingAddress" id="field_billingAddress"
|
||||
[(ngModel)]="customer.billingAddress" maxlength="400"/>
|
||||
<div
|
||||
[hidden]="!(editForm.controls.billingAddress?.dirty && editForm.controls.billingAddress?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.billingAddress?.errors?.maxlength"
|
||||
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
|
||||
This field cannot be longer than 400 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingSalutation"
|
||||
for="field_billingSalutation">Billing Salutation</label>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingSalutation" for="field_billingSalutation">Billing Salutation</label>
|
||||
<input type="text" class="form-control" name="billingSalutation" id="field_billingSalutation"
|
||||
[(ngModel)]="customer.billingSalutation" maxlength="80"/>
|
||||
<div
|
||||
[hidden]="!(editForm.controls.billingSalutation?.dirty && editForm.controls.billingSalutation?.invalid)">
|
||||
[(ngModel)]="customer.billingSalutation" maxlength="80"/>
|
||||
<div [hidden]="!(editForm.controls.billingSalutation?.dirty && editForm.controls.billingSalutation?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.billingSalutation?.errors?.maxlength"
|
||||
jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
[hidden]="!editForm.controls.billingSalutation?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 80 }">
|
||||
This field cannot be longer than 80 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingAddress" for="field_billingAddress">Billing Address</label>
|
||||
<input type="text" class="form-control" name="billingAddress" id="field_billingAddress"
|
||||
[(ngModel)]="customer.billingAddress" maxlength="400"/>
|
||||
<div [hidden]="!(editForm.controls.billingAddress?.dirty && editForm.controls.billingAddress?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.billingAddress?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">
|
||||
This field cannot be longer than 400 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -17,22 +17,11 @@
|
||||
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="number"><span jhiTranslate="hsadminNgApp.customer.number">Number</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="prefix"><span jhiTranslate="hsadminNgApp.customer.prefix">Prefix</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="name"><span jhiTranslate="hsadminNgApp.customer.name">Name</span>
|
||||
<fa-icon [icon]="'sort'"></fa-icon>
|
||||
</th>
|
||||
<th jhiSortBy="contractualAddress"><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span>
|
||||
<fa-icon [icon]="'sort'"></fa-icon>
|
||||
</th>
|
||||
<th jhiSortBy="contractualSalutation"><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span>
|
||||
<fa-icon [icon]="'sort'"></fa-icon>
|
||||
</th>
|
||||
<th jhiSortBy="billingAddress"><span
|
||||
jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span>
|
||||
<fa-icon [icon]="'sort'"></fa-icon>
|
||||
</th>
|
||||
<th jhiSortBy="billingSalutation"><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span>
|
||||
<fa-icon [icon]="'sort'"></fa-icon>
|
||||
</th>
|
||||
<th jhiSortBy="name"><span jhiTranslate="hsadminNgApp.customer.name">Name</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="contractualSalutation"><span jhiTranslate="hsadminNgApp.customer.contractualSalutation">Contractual Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="contractualAddress"><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="billingSalutation"><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="billingAddress"><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -42,10 +31,10 @@
|
||||
<td>{{customer.number}}</td>
|
||||
<td>{{customer.prefix}}</td>
|
||||
<td>{{customer.name}}</td>
|
||||
<td>{{customer.contractualAddress}}</td>
|
||||
<td>{{customer.contractualSalutation}}</td>
|
||||
<td>{{customer.billingAddress}}</td>
|
||||
<td>{{customer.contractualAddress}}</td>
|
||||
<td>{{customer.billingSalutation}}</td>
|
||||
<td>{{customer.billingAddress}}</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group flex-btn-group-container">
|
||||
<button type="submit"
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@NgModule({
|
||||
@ -8,14 +8,6 @@ import { RouterModule } from '@angular/router';
|
||||
path: 'customer',
|
||||
loadChildren: './customer/customer.module#HsadminNgCustomerModule'
|
||||
},
|
||||
{
|
||||
path: 'contact',
|
||||
loadChildren: './contact/contact.module#HsadminNgContactModule'
|
||||
},
|
||||
{
|
||||
path: 'customer-contact',
|
||||
loadChildren: './customer-contact/customer-contact.module#HsadminNgCustomerContactModule'
|
||||
},
|
||||
{
|
||||
path: 'membership',
|
||||
loadChildren: './membership/membership.module#HsadminNgMembershipModule'
|
||||
@ -29,20 +21,8 @@ import { RouterModule } from '@angular/router';
|
||||
loadChildren: './asset/asset.module#HsadminNgAssetModule'
|
||||
},
|
||||
{
|
||||
path: 'customer',
|
||||
loadChildren: './customer/customer.module#HsadminNgCustomerModule'
|
||||
},
|
||||
{
|
||||
path: 'membership',
|
||||
loadChildren: './membership/membership.module#HsadminNgMembershipModule'
|
||||
},
|
||||
{
|
||||
path: 'share',
|
||||
loadChildren: './share/share.module#HsadminNgShareModule'
|
||||
},
|
||||
{
|
||||
path: 'asset',
|
||||
loadChildren: './asset/asset.module#HsadminNgAssetModule'
|
||||
path: 'sepa-mandate',
|
||||
loadChildren: './sepa-mandate/sepa-mandate.module#HsadminNgSepaMandateModule'
|
||||
}
|
||||
/* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
|
||||
])
|
||||
|
@ -5,13 +5,17 @@
|
||||
<hr>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<dl class="row-md jh-entity-details">
|
||||
<dt><span jhiTranslate="hsadminNgApp.membership.sinceDate">Since Date</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.membership.from">From</span></dt>
|
||||
<dd>
|
||||
<span>{{membership.sinceDate}}</span>
|
||||
<span>{{membership.from}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.membership.untilDate">Until Date</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.membership.to">To</span></dt>
|
||||
<dd>
|
||||
<span>{{membership.untilDate}}</span>
|
||||
<span>{{membership.to}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.membership.comment">Comment</span></dt>
|
||||
<dd>
|
||||
<span>{{membership.comment}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span></dt>
|
||||
<dd>
|
||||
|
@ -10,44 +10,53 @@
|
||||
[(ngModel)]="membership.id" readonly />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.sinceDate" for="field_sinceDate">Since Date</label>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.from" for="field_from">From</label>
|
||||
<div class="input-group">
|
||||
<input id="field_sinceDate" type="text" class="form-control" name="sinceDate" ngbDatepicker #sinceDateDp="ngbDatepicker" [(ngModel)]="membership.sinceDate"
|
||||
<input id="field_from" type="text" class="form-control" name="from" ngbDatepicker #fromDp="ngbDatepicker" [(ngModel)]="membership.from"
|
||||
required/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="sinceDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
<button type="button" class="btn btn-secondary" (click)="fromDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.sinceDate?.dirty && editForm.controls.sinceDate?.invalid)">
|
||||
<div [hidden]="!(editForm.controls.from?.dirty && editForm.controls.from?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.sinceDate?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
[hidden]="!editForm.controls.from?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.untilDate" for="field_untilDate">Until Date</label>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.to" for="field_to">To</label>
|
||||
<div class="input-group">
|
||||
<input id="field_untilDate" type="text" class="form-control" name="untilDate" ngbDatepicker #untilDateDp="ngbDatepicker" [(ngModel)]="membership.untilDate"
|
||||
<input id="field_to" type="text" class="form-control" name="to" ngbDatepicker #toDp="ngbDatepicker" [(ngModel)]="membership.to"
|
||||
/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="untilDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
<button type="button" class="btn btn-secondary" (click)="toDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.comment" for="field_comment">Comment</label>
|
||||
<input type="text" class="form-control" name="comment" id="field_comment"
|
||||
[(ngModel)]="membership.comment" maxlength="160"/>
|
||||
<div [hidden]="!(editForm.controls.comment?.dirty && editForm.controls.comment?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.comment?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 160 }">
|
||||
This field cannot be longer than 160 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.customer" for="field_customer">Customer</label>
|
||||
<select class="form-control" id="field_customer" name="customer" [(ngModel)]="membership.customerId"
|
||||
required>
|
||||
<select class="form-control" id="field_customer" name="customer" [(ngModel)]="membership.customerId" required>
|
||||
<option *ngIf="!editForm.value.customer" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="customerOption.id" *ngFor="let customerOption of customers; trackBy: trackCustomerById">{{customerOption.prefix}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.customer?.dirty && editForm.controls.customer?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.customer?.errors?.required"
|
||||
jhiTranslate="entity.validation.required">
|
||||
[hidden]="!editForm.controls.customer?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
|
@ -19,8 +19,8 @@ export class MembershipUpdateComponent implements OnInit {
|
||||
isSaving: boolean;
|
||||
|
||||
customers: ICustomer[];
|
||||
sinceDateDp: any;
|
||||
untilDateDp: any;
|
||||
fromDp: any;
|
||||
toDp: any;
|
||||
|
||||
constructor(
|
||||
protected jhiAlertService: JhiAlertService,
|
||||
|
@ -15,8 +15,9 @@
|
||||
<thead>
|
||||
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
|
||||
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="sinceDate"><span jhiTranslate="hsadminNgApp.membership.sinceDate">Since Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="untilDate"><span jhiTranslate="hsadminNgApp.membership.untilDate">Until Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="from"><span jhiTranslate="hsadminNgApp.membership.from">From</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="to"><span jhiTranslate="hsadminNgApp.membership.to">To</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="comment"><span jhiTranslate="hsadminNgApp.membership.comment">Comment</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="customerPrefix"><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@ -24,8 +25,9 @@
|
||||
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
|
||||
<tr *ngFor="let membership of memberships ;trackBy: trackId">
|
||||
<td><a [routerLink]="['/membership', membership.id, 'view' ]">{{membership.id}}</a></td>
|
||||
<td>{{membership.sinceDate | date:'mediumDate'}}</td>
|
||||
<td>{{membership.untilDate | date:'mediumDate'}}</td>
|
||||
<td>{{membership.from | date:'mediumDate'}}</td>
|
||||
<td>{{membership.to | date:'mediumDate'}}</td>
|
||||
<td>{{membership.comment}}</td>
|
||||
<td>
|
||||
<div *ngIf="membership.customerId">
|
||||
<a [routerLink]="['../customer', membership.customerId , 'view' ]" >{{membership.customerPrefix}}</a>
|
||||
|
@ -51,16 +51,16 @@ export class MembershipService {
|
||||
|
||||
protected convertDateFromClient(membership: IMembership): IMembership {
|
||||
const copy: IMembership = Object.assign({}, membership, {
|
||||
sinceDate: membership.sinceDate != null && membership.sinceDate.isValid() ? membership.sinceDate.format(DATE_FORMAT) : null,
|
||||
untilDate: membership.untilDate != null && membership.untilDate.isValid() ? membership.untilDate.format(DATE_FORMAT) : null
|
||||
from: membership.from != null && membership.from.isValid() ? membership.from.format(DATE_FORMAT) : null,
|
||||
to: membership.to != null && membership.to.isValid() ? membership.to.format(DATE_FORMAT) : null
|
||||
});
|
||||
return copy;
|
||||
}
|
||||
|
||||
protected convertDateFromServer(res: EntityResponseType): EntityResponseType {
|
||||
if (res.body) {
|
||||
res.body.sinceDate = res.body.sinceDate != null ? moment(res.body.sinceDate) : null;
|
||||
res.body.untilDate = res.body.untilDate != null ? moment(res.body.untilDate) : null;
|
||||
res.body.from = res.body.from != null ? moment(res.body.from) : null;
|
||||
res.body.to = res.body.to != null ? moment(res.body.to) : null;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -68,8 +68,8 @@ export class MembershipService {
|
||||
protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType {
|
||||
if (res.body) {
|
||||
res.body.forEach((membership: IMembership) => {
|
||||
membership.sinceDate = membership.sinceDate != null ? moment(membership.sinceDate) : null;
|
||||
membership.untilDate = membership.untilDate != null ? moment(membership.untilDate) : null;
|
||||
membership.from = membership.from != null ? moment(membership.from) : null;
|
||||
membership.to = membership.to != null ? moment(membership.to) : null;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
|
6
src/main/webapp/app/entities/sepa-mandate/index.ts
Normal file
6
src/main/webapp/app/entities/sepa-mandate/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export * from './sepa-mandate.service';
|
||||
export * from './sepa-mandate-update.component';
|
||||
export * from './sepa-mandate-delete-dialog.component';
|
||||
export * from './sepa-mandate-detail.component';
|
||||
export * from './sepa-mandate.component';
|
||||
export * from './sepa-mandate.route';
|
@ -1,4 +1,4 @@
|
||||
<form name="deleteForm" (ngSubmit)="confirmDelete(contact.id)">
|
||||
<form name="deleteForm" (ngSubmit)="confirmDelete(sepaMandate.id)">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
|
||||
@ -6,13 +6,13 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<p id="jhi-delete-contact-heading" jhiTranslate="hsadminNgApp.contact.delete.question" [translateValues]="{id: contact.id}">Are you sure you want to delete this Contact?</p>
|
||||
<p id="jhi-delete-sepaMandate-heading" jhiTranslate="hsadminNgApp.sepaMandate.delete.question" [translateValues]="{id: sepaMandate.id}">Are you sure you want to delete this Sepa Mandate?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
|
||||
<fa-icon [icon]="'ban'"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
<button id="jhi-confirm-delete-contact" type="submit" class="btn btn-danger">
|
||||
<button id="jhi-confirm-delete-sepaMandate" type="submit" class="btn btn-danger">
|
||||
<fa-icon [icon]="'times'"></fa-icon> <span jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
@ -4,18 +4,18 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { JhiEventManager } from 'ng-jhipster';
|
||||
|
||||
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
|
||||
import { CustomerContactService } from './customer-contact.service';
|
||||
import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
|
||||
import { SepaMandateService } from './sepa-mandate.service';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-customer-contact-delete-dialog',
|
||||
templateUrl: './customer-contact-delete-dialog.component.html'
|
||||
selector: 'jhi-sepa-mandate-delete-dialog',
|
||||
templateUrl: './sepa-mandate-delete-dialog.component.html'
|
||||
})
|
||||
export class CustomerContactDeleteDialogComponent {
|
||||
customerContact: ICustomerContact;
|
||||
export class SepaMandateDeleteDialogComponent {
|
||||
sepaMandate: ISepaMandate;
|
||||
|
||||
constructor(
|
||||
protected customerContactService: CustomerContactService,
|
||||
protected sepaMandateService: SepaMandateService,
|
||||
public activeModal: NgbActiveModal,
|
||||
protected eventManager: JhiEventManager
|
||||
) {}
|
||||
@ -25,10 +25,10 @@ export class CustomerContactDeleteDialogComponent {
|
||||
}
|
||||
|
||||
confirmDelete(id: number) {
|
||||
this.customerContactService.delete(id).subscribe(response => {
|
||||
this.sepaMandateService.delete(id).subscribe(response => {
|
||||
this.eventManager.broadcast({
|
||||
name: 'customerContactListModification',
|
||||
content: 'Deleted an customerContact'
|
||||
name: 'sepaMandateListModification',
|
||||
content: 'Deleted an sepaMandate'
|
||||
});
|
||||
this.activeModal.dismiss(true);
|
||||
});
|
||||
@ -36,29 +36,29 @@ export class CustomerContactDeleteDialogComponent {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-customer-contact-delete-popup',
|
||||
selector: 'jhi-sepa-mandate-delete-popup',
|
||||
template: ''
|
||||
})
|
||||
export class CustomerContactDeletePopupComponent implements OnInit, OnDestroy {
|
||||
export class SepaMandateDeletePopupComponent implements OnInit, OnDestroy {
|
||||
protected ngbModalRef: NgbModalRef;
|
||||
|
||||
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.activatedRoute.data.subscribe(({ customerContact }) => {
|
||||
this.activatedRoute.data.subscribe(({ sepaMandate }) => {
|
||||
setTimeout(() => {
|
||||
this.ngbModalRef = this.modalService.open(CustomerContactDeleteDialogComponent as Component, {
|
||||
this.ngbModalRef = this.modalService.open(SepaMandateDeleteDialogComponent as Component, {
|
||||
size: 'lg',
|
||||
backdrop: 'static'
|
||||
});
|
||||
this.ngbModalRef.componentInstance.customerContact = customerContact;
|
||||
this.ngbModalRef.componentInstance.sepaMandate = sepaMandate;
|
||||
this.ngbModalRef.result.then(
|
||||
result => {
|
||||
this.router.navigate(['/customer-contact', { outlets: { popup: null } }]);
|
||||
this.router.navigate(['/sepa-mandate', { outlets: { popup: null } }]);
|
||||
this.ngbModalRef = null;
|
||||
},
|
||||
reason => {
|
||||
this.router.navigate(['/customer-contact', { outlets: { popup: null } }]);
|
||||
this.router.navigate(['/sepa-mandate', { outlets: { popup: null } }]);
|
||||
this.ngbModalRef = null;
|
||||
}
|
||||
);
|
@ -0,0 +1,65 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<div *ngIf="sepaMandate">
|
||||
<h2><span jhiTranslate="hsadminNgApp.sepaMandate.detail.title">Sepa Mandate</span> {{sepaMandate.id}}</h2>
|
||||
<hr>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<dl class="row-md jh-entity-details">
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.reference">Reference</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.reference}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.iban">Iban</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.iban}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.bic">Bic</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.bic}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.created">Created</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.created}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.validFrom">Valid From</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.validFrom}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.validTo">Valid To</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.validTo}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.lastUsed">Last Used</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.lastUsed}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.cancelled">Cancelled</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.cancelled}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.comment">Comment</span></dt>
|
||||
<dd>
|
||||
<span>{{sepaMandate.comment}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.sepaMandate.customer">Customer</span></dt>
|
||||
<dd>
|
||||
<div *ngIf="sepaMandate.customerId">
|
||||
<a [routerLink]="['/customer', sepaMandate.customerId, 'view']">{{sepaMandate.customerPrefix}}</a>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<button type="submit"
|
||||
(click)="previousState()"
|
||||
class="btn btn-info">
|
||||
<fa-icon [icon]="'arrow-left'"></fa-icon> <span jhiTranslate="entity.action.back"> Back</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
[routerLink]="['/sepa-mandate', sepaMandate.id, 'edit']"
|
||||
class="btn btn-primary">
|
||||
<fa-icon [icon]="'pencil-alt'"></fa-icon> <span jhiTranslate="entity.action.edit"> Edit</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,24 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-sepa-mandate-detail',
|
||||
templateUrl: './sepa-mandate-detail.component.html'
|
||||
})
|
||||
export class SepaMandateDetailComponent implements OnInit {
|
||||
sepaMandate: ISepaMandate;
|
||||
|
||||
constructor(protected activatedRoute: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.activatedRoute.data.subscribe(({ sepaMandate }) => {
|
||||
this.sepaMandate = sepaMandate;
|
||||
});
|
||||
}
|
||||
|
||||
previousState() {
|
||||
window.history.back();
|
||||
}
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
|
||||
<h2 id="jhi-sepa-mandate-heading" jhiTranslate="hsadminNgApp.sepaMandate.home.createOrEditLabel">Create or edit a Sepa Mandate</h2>
|
||||
<div>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<div class="form-group" [hidden]="!sepaMandate.id">
|
||||
<label for="id" jhiTranslate="global.field.id">ID</label>
|
||||
<input type="text" class="form-control" id="id" name="id"
|
||||
[(ngModel)]="sepaMandate.id" readonly />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.reference" for="field_reference">Reference</label>
|
||||
<input type="text" class="form-control" name="reference" id="field_reference"
|
||||
[(ngModel)]="sepaMandate.reference" required maxlength="40"/>
|
||||
<div [hidden]="!(editForm.controls.reference?.dirty && editForm.controls.reference?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.reference?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.reference?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 40 }">
|
||||
This field cannot be longer than 40 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.iban" for="field_iban">Iban</label>
|
||||
<input type="text" class="form-control" name="iban" id="field_iban"
|
||||
[(ngModel)]="sepaMandate.iban" maxlength="34"/>
|
||||
<div [hidden]="!(editForm.controls.iban?.dirty && editForm.controls.iban?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.iban?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 34 }">
|
||||
This field cannot be longer than 34 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.bic" for="field_bic">Bic</label>
|
||||
<input type="text" class="form-control" name="bic" id="field_bic"
|
||||
[(ngModel)]="sepaMandate.bic" maxlength="11"/>
|
||||
<div [hidden]="!(editForm.controls.bic?.dirty && editForm.controls.bic?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.bic?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 11 }">
|
||||
This field cannot be longer than 11 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.created" for="field_created">Created</label>
|
||||
<div class="input-group">
|
||||
<input id="field_created" type="text" class="form-control" name="created" ngbDatepicker #createdDp="ngbDatepicker" [(ngModel)]="sepaMandate.created"
|
||||
required/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="createdDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.created?.dirty && editForm.controls.created?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.created?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.validFrom" for="field_validFrom">Valid From</label>
|
||||
<div class="input-group">
|
||||
<input id="field_validFrom" type="text" class="form-control" name="validFrom" ngbDatepicker #validFromDp="ngbDatepicker" [(ngModel)]="sepaMandate.validFrom"
|
||||
required/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="validFromDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.validFrom?.dirty && editForm.controls.validFrom?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.validFrom?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.validTo" for="field_validTo">Valid To</label>
|
||||
<div class="input-group">
|
||||
<input id="field_validTo" type="text" class="form-control" name="validTo" ngbDatepicker #validToDp="ngbDatepicker" [(ngModel)]="sepaMandate.validTo"
|
||||
/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="validToDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.lastUsed" for="field_lastUsed">Last Used</label>
|
||||
<div class="input-group">
|
||||
<input id="field_lastUsed" type="text" class="form-control" name="lastUsed" ngbDatepicker #lastUsedDp="ngbDatepicker" [(ngModel)]="sepaMandate.lastUsed"
|
||||
/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="lastUsedDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.cancelled" for="field_cancelled">Cancelled</label>
|
||||
<div class="input-group">
|
||||
<input id="field_cancelled" type="text" class="form-control" name="cancelled" ngbDatepicker #cancelledDp="ngbDatepicker" [(ngModel)]="sepaMandate.cancelled"
|
||||
/>
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" (click)="cancelledDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.comment" for="field_comment">Comment</label>
|
||||
<input type="text" class="form-control" name="comment" id="field_comment"
|
||||
[(ngModel)]="sepaMandate.comment" maxlength="160"/>
|
||||
<div [hidden]="!(editForm.controls.comment?.dirty && editForm.controls.comment?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.comment?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 160 }">
|
||||
This field cannot be longer than 160 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.sepaMandate.customer" for="field_customer">Customer</label>
|
||||
<select class="form-control" id="field_customer" name="customer" [(ngModel)]="sepaMandate.customerId" required>
|
||||
<option *ngIf="!editForm.value.customer" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="customerOption.id" *ngFor="let customerOption of customers; trackBy: trackCustomerById">{{customerOption.prefix}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.customer?.dirty && editForm.controls.customer?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.customer?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
|
||||
<fa-icon [icon]="'ban'"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
<button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
|
||||
<fa-icon [icon]="'save'"></fa-icon> <span jhiTranslate="entity.action.save">Save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -3,46 +3,40 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import * as moment from 'moment';
|
||||
import { JhiAlertService } from 'ng-jhipster';
|
||||
import { ICustomerContact } from 'app/shared/model/customer-contact.model';
|
||||
import { CustomerContactService } from './customer-contact.service';
|
||||
import { IContact } from 'app/shared/model/contact.model';
|
||||
import { ContactService } from 'app/entities/contact';
|
||||
import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
|
||||
import { SepaMandateService } from './sepa-mandate.service';
|
||||
import { ICustomer } from 'app/shared/model/customer.model';
|
||||
import { CustomerService } from 'app/entities/customer';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-customer-contact-update',
|
||||
templateUrl: './customer-contact-update.component.html'
|
||||
selector: 'jhi-sepa-mandate-update',
|
||||
templateUrl: './sepa-mandate-update.component.html'
|
||||
})
|
||||
export class CustomerContactUpdateComponent implements OnInit {
|
||||
customerContact: ICustomerContact;
|
||||
export class SepaMandateUpdateComponent implements OnInit {
|
||||
sepaMandate: ISepaMandate;
|
||||
isSaving: boolean;
|
||||
|
||||
contacts: IContact[];
|
||||
|
||||
customers: ICustomer[];
|
||||
createdDp: any;
|
||||
validFromDp: any;
|
||||
validToDp: any;
|
||||
lastUsedDp: any;
|
||||
cancelledDp: any;
|
||||
|
||||
constructor(
|
||||
protected jhiAlertService: JhiAlertService,
|
||||
protected customerContactService: CustomerContactService,
|
||||
protected contactService: ContactService,
|
||||
protected sepaMandateService: SepaMandateService,
|
||||
protected customerService: CustomerService,
|
||||
protected activatedRoute: ActivatedRoute
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.isSaving = false;
|
||||
this.activatedRoute.data.subscribe(({ customerContact }) => {
|
||||
this.customerContact = customerContact;
|
||||
this.activatedRoute.data.subscribe(({ sepaMandate }) => {
|
||||
this.sepaMandate = sepaMandate;
|
||||
});
|
||||
this.contactService
|
||||
.query()
|
||||
.pipe(
|
||||
filter((mayBeOk: HttpResponse<IContact[]>) => mayBeOk.ok),
|
||||
map((response: HttpResponse<IContact[]>) => response.body)
|
||||
)
|
||||
.subscribe((res: IContact[]) => (this.contacts = res), (res: HttpErrorResponse) => this.onError(res.message));
|
||||
this.customerService
|
||||
.query()
|
||||
.pipe(
|
||||
@ -58,15 +52,15 @@ export class CustomerContactUpdateComponent implements OnInit {
|
||||
|
||||
save() {
|
||||
this.isSaving = true;
|
||||
if (this.customerContact.id !== undefined) {
|
||||
this.subscribeToSaveResponse(this.customerContactService.update(this.customerContact));
|
||||
if (this.sepaMandate.id !== undefined) {
|
||||
this.subscribeToSaveResponse(this.sepaMandateService.update(this.sepaMandate));
|
||||
} else {
|
||||
this.subscribeToSaveResponse(this.customerContactService.create(this.customerContact));
|
||||
this.subscribeToSaveResponse(this.sepaMandateService.create(this.sepaMandate));
|
||||
}
|
||||
}
|
||||
|
||||
protected subscribeToSaveResponse(result: Observable<HttpResponse<ICustomerContact>>) {
|
||||
result.subscribe((res: HttpResponse<ICustomerContact>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
|
||||
protected subscribeToSaveResponse(result: Observable<HttpResponse<ISepaMandate>>) {
|
||||
result.subscribe((res: HttpResponse<ISepaMandate>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
|
||||
}
|
||||
|
||||
protected onSaveSuccess() {
|
||||
@ -82,10 +76,6 @@ export class CustomerContactUpdateComponent implements OnInit {
|
||||
this.jhiAlertService.error(errorMessage, null, null);
|
||||
}
|
||||
|
||||
trackContactById(index: number, item: IContact) {
|
||||
return item.id;
|
||||
}
|
||||
|
||||
trackCustomerById(index: number, item: ICustomer) {
|
||||
return item.id;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
<div>
|
||||
<h2 id="page-heading">
|
||||
<span jhiTranslate="hsadminNgApp.sepaMandate.home.title">Sepa Mandates</span>
|
||||
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-sepa-mandate" [routerLink]="['/sepa-mandate/new']">
|
||||
<fa-icon [icon]="'plus'"></fa-icon>
|
||||
<span jhiTranslate="hsadminNgApp.sepaMandate.home.createLabel">
|
||||
Create new Sepa Mandate
|
||||
</span>
|
||||
</button>
|
||||
</h2>
|
||||
<jhi-alert></jhi-alert>
|
||||
<br/>
|
||||
<div class="table-responsive" *ngIf="sepaMandates">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
|
||||
<th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="reference"><span jhiTranslate="hsadminNgApp.sepaMandate.reference">Reference</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="iban"><span jhiTranslate="hsadminNgApp.sepaMandate.iban">Iban</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="bic"><span jhiTranslate="hsadminNgApp.sepaMandate.bic">Bic</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="created"><span jhiTranslate="hsadminNgApp.sepaMandate.created">Created</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="validFrom"><span jhiTranslate="hsadminNgApp.sepaMandate.validFrom">Valid From</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="validTo"><span jhiTranslate="hsadminNgApp.sepaMandate.validTo">Valid To</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="lastUsed"><span jhiTranslate="hsadminNgApp.sepaMandate.lastUsed">Last Used</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="cancelled"><span jhiTranslate="hsadminNgApp.sepaMandate.cancelled">Cancelled</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="comment"><span jhiTranslate="hsadminNgApp.sepaMandate.comment">Comment</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="customerPrefix"><span jhiTranslate="hsadminNgApp.sepaMandate.customer">Customer</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
|
||||
<tr *ngFor="let sepaMandate of sepaMandates ;trackBy: trackId">
|
||||
<td><a [routerLink]="['/sepa-mandate', sepaMandate.id, 'view' ]">{{sepaMandate.id}}</a></td>
|
||||
<td>{{sepaMandate.reference}}</td>
|
||||
<td>{{sepaMandate.iban}}</td>
|
||||
<td>{{sepaMandate.bic}}</td>
|
||||
<td>{{sepaMandate.created | date:'mediumDate'}}</td>
|
||||
<td>{{sepaMandate.validFrom | date:'mediumDate'}}</td>
|
||||
<td>{{sepaMandate.validTo | date:'mediumDate'}}</td>
|
||||
<td>{{sepaMandate.lastUsed | date:'mediumDate'}}</td>
|
||||
<td>{{sepaMandate.cancelled | date:'mediumDate'}}</td>
|
||||
<td>{{sepaMandate.comment}}</td>
|
||||
<td>
|
||||
<div *ngIf="sepaMandate.customerId">
|
||||
<a [routerLink]="['../customer', sepaMandate.customerId , 'view' ]" >{{sepaMandate.customerPrefix}}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group flex-btn-group-container">
|
||||
<button type="submit"
|
||||
[routerLink]="['/sepa-mandate', sepaMandate.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>
|
||||
</button>
|
||||
<button type="submit"
|
||||
[routerLink]="['/sepa-mandate', sepaMandate.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>
|
||||
</button>
|
||||
<button type="submit"
|
||||
[routerLink]="['/', 'sepa-mandate', { outlets: { popup: sepaMandate.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>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -4,18 +4,18 @@ import { Subscription } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { JhiEventManager, JhiParseLinks, JhiAlertService } from 'ng-jhipster';
|
||||
|
||||
import { IContact } from 'app/shared/model/contact.model';
|
||||
import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
|
||||
import { AccountService } from 'app/core';
|
||||
|
||||
import { ITEMS_PER_PAGE } from 'app/shared';
|
||||
import { ContactService } from './contact.service';
|
||||
import { SepaMandateService } from './sepa-mandate.service';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-contact',
|
||||
templateUrl: './contact.component.html'
|
||||
selector: 'jhi-sepa-mandate',
|
||||
templateUrl: './sepa-mandate.component.html'
|
||||
})
|
||||
export class ContactComponent implements OnInit, OnDestroy {
|
||||
contacts: IContact[];
|
||||
export class SepaMandateComponent implements OnInit, OnDestroy {
|
||||
sepaMandates: ISepaMandate[];
|
||||
currentAccount: any;
|
||||
eventSubscriber: Subscription;
|
||||
itemsPerPage: number;
|
||||
@ -26,13 +26,13 @@ export class ContactComponent implements OnInit, OnDestroy {
|
||||
totalItems: number;
|
||||
|
||||
constructor(
|
||||
protected contactService: ContactService,
|
||||
protected sepaMandateService: SepaMandateService,
|
||||
protected jhiAlertService: JhiAlertService,
|
||||
protected eventManager: JhiEventManager,
|
||||
protected parseLinks: JhiParseLinks,
|
||||
protected accountService: AccountService
|
||||
) {
|
||||
this.contacts = [];
|
||||
this.sepaMandates = [];
|
||||
this.itemsPerPage = ITEMS_PER_PAGE;
|
||||
this.page = 0;
|
||||
this.links = {
|
||||
@ -43,21 +43,21 @@ export class ContactComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
loadAll() {
|
||||
this.contactService
|
||||
this.sepaMandateService
|
||||
.query({
|
||||
page: this.page,
|
||||
size: this.itemsPerPage,
|
||||
sort: this.sort()
|
||||
})
|
||||
.subscribe(
|
||||
(res: HttpResponse<IContact[]>) => this.paginateContacts(res.body, res.headers),
|
||||
(res: HttpResponse<ISepaMandate[]>) => this.paginateSepaMandates(res.body, res.headers),
|
||||
(res: HttpErrorResponse) => this.onError(res.message)
|
||||
);
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.page = 0;
|
||||
this.contacts = [];
|
||||
this.sepaMandates = [];
|
||||
this.loadAll();
|
||||
}
|
||||
|
||||
@ -71,19 +71,19 @@ export class ContactComponent implements OnInit, OnDestroy {
|
||||
this.accountService.identity().then(account => {
|
||||
this.currentAccount = account;
|
||||
});
|
||||
this.registerChangeInContacts();
|
||||
this.registerChangeInSepaMandates();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.eventManager.destroy(this.eventSubscriber);
|
||||
}
|
||||
|
||||
trackId(index: number, item: IContact) {
|
||||
trackId(index: number, item: ISepaMandate) {
|
||||
return item.id;
|
||||
}
|
||||
|
||||
registerChangeInContacts() {
|
||||
this.eventSubscriber = this.eventManager.subscribe('contactListModification', response => this.reset());
|
||||
registerChangeInSepaMandates() {
|
||||
this.eventSubscriber = this.eventManager.subscribe('sepaMandateListModification', response => this.reset());
|
||||
}
|
||||
|
||||
sort() {
|
||||
@ -94,11 +94,11 @@ export class ContactComponent implements OnInit, OnDestroy {
|
||||
return result;
|
||||
}
|
||||
|
||||
protected paginateContacts(data: IContact[], headers: HttpHeaders) {
|
||||
protected paginateSepaMandates(data: ISepaMandate[], headers: HttpHeaders) {
|
||||
this.links = this.parseLinks.parse(headers.get('link'));
|
||||
this.totalItems = parseInt(headers.get('X-Total-Count'), 10);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
this.contacts.push(data[i]);
|
||||
this.sepaMandates.push(data[i]);
|
||||
}
|
||||
}
|
||||
|
@ -5,31 +5,31 @@ import { JhiLanguageHelper } from 'app/core';
|
||||
|
||||
import { HsadminNgSharedModule } from 'app/shared';
|
||||
import {
|
||||
ContactComponent,
|
||||
ContactDetailComponent,
|
||||
ContactUpdateComponent,
|
||||
ContactDeletePopupComponent,
|
||||
ContactDeleteDialogComponent,
|
||||
contactRoute,
|
||||
contactPopupRoute
|
||||
SepaMandateComponent,
|
||||
SepaMandateDetailComponent,
|
||||
SepaMandateUpdateComponent,
|
||||
SepaMandateDeletePopupComponent,
|
||||
SepaMandateDeleteDialogComponent,
|
||||
sepaMandateRoute,
|
||||
sepaMandatePopupRoute
|
||||
} from './';
|
||||
|
||||
const ENTITY_STATES = [...contactRoute, ...contactPopupRoute];
|
||||
const ENTITY_STATES = [...sepaMandateRoute, ...sepaMandatePopupRoute];
|
||||
|
||||
@NgModule({
|
||||
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
|
||||
declarations: [
|
||||
ContactComponent,
|
||||
ContactDetailComponent,
|
||||
ContactUpdateComponent,
|
||||
ContactDeleteDialogComponent,
|
||||
ContactDeletePopupComponent
|
||||
SepaMandateComponent,
|
||||
SepaMandateDetailComponent,
|
||||
SepaMandateUpdateComponent,
|
||||
SepaMandateDeleteDialogComponent,
|
||||
SepaMandateDeletePopupComponent
|
||||
],
|
||||
entryComponents: [ContactComponent, ContactUpdateComponent, ContactDeleteDialogComponent, ContactDeletePopupComponent],
|
||||
entryComponents: [SepaMandateComponent, SepaMandateUpdateComponent, SepaMandateDeleteDialogComponent, SepaMandateDeletePopupComponent],
|
||||
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class HsadminNgContactModule {
|
||||
export class HsadminNgSepaMandateModule {
|
||||
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
|
||||
this.languageHelper.language.subscribe((languageKey: string) => {
|
||||
if (languageKey !== undefined) {
|
@ -0,0 +1,93 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Routes } from '@angular/router';
|
||||
import { UserRouteAccessService } from 'app/core';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { SepaMandate } from 'app/shared/model/sepa-mandate.model';
|
||||
import { SepaMandateService } from './sepa-mandate.service';
|
||||
import { SepaMandateComponent } from './sepa-mandate.component';
|
||||
import { SepaMandateDetailComponent } from './sepa-mandate-detail.component';
|
||||
import { SepaMandateUpdateComponent } from './sepa-mandate-update.component';
|
||||
import { SepaMandateDeletePopupComponent } from './sepa-mandate-delete-dialog.component';
|
||||
import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class SepaMandateResolve implements Resolve<ISepaMandate> {
|
||||
constructor(private service: SepaMandateService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<ISepaMandate> {
|
||||
const id = route.params['id'] ? route.params['id'] : null;
|
||||
if (id) {
|
||||
return this.service.find(id).pipe(
|
||||
filter((response: HttpResponse<SepaMandate>) => response.ok),
|
||||
map((sepaMandate: HttpResponse<SepaMandate>) => sepaMandate.body)
|
||||
);
|
||||
}
|
||||
return of(new SepaMandate());
|
||||
}
|
||||
}
|
||||
|
||||
export const sepaMandateRoute: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: SepaMandateComponent,
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.sepaMandate.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: ':id/view',
|
||||
component: SepaMandateDetailComponent,
|
||||
resolve: {
|
||||
sepaMandate: SepaMandateResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.sepaMandate.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: SepaMandateUpdateComponent,
|
||||
resolve: {
|
||||
sepaMandate: SepaMandateResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.sepaMandate.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
},
|
||||
{
|
||||
path: ':id/edit',
|
||||
component: SepaMandateUpdateComponent,
|
||||
resolve: {
|
||||
sepaMandate: SepaMandateResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.sepaMandate.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService]
|
||||
}
|
||||
];
|
||||
|
||||
export const sepaMandatePopupRoute: Routes = [
|
||||
{
|
||||
path: ':id/delete',
|
||||
component: SepaMandateDeletePopupComponent,
|
||||
resolve: {
|
||||
sepaMandate: SepaMandateResolve
|
||||
},
|
||||
data: {
|
||||
authorities: ['ROLE_USER'],
|
||||
pageTitle: 'hsadminNgApp.sepaMandate.home.title'
|
||||
},
|
||||
canActivate: [UserRouteAccessService],
|
||||
outlet: 'popup'
|
||||
}
|
||||
];
|
@ -0,0 +1,86 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpResponse } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import * as moment from 'moment';
|
||||
import { DATE_FORMAT } from 'app/shared/constants/input.constants';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { SERVER_API_URL } from 'app/app.constants';
|
||||
import { createRequestOption } from 'app/shared';
|
||||
import { ISepaMandate } from 'app/shared/model/sepa-mandate.model';
|
||||
|
||||
type EntityResponseType = HttpResponse<ISepaMandate>;
|
||||
type EntityArrayResponseType = HttpResponse<ISepaMandate[]>;
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class SepaMandateService {
|
||||
public resourceUrl = SERVER_API_URL + 'api/sepa-mandates';
|
||||
|
||||
constructor(protected http: HttpClient) {}
|
||||
|
||||
create(sepaMandate: ISepaMandate): Observable<EntityResponseType> {
|
||||
const copy = this.convertDateFromClient(sepaMandate);
|
||||
return this.http
|
||||
.post<ISepaMandate>(this.resourceUrl, copy, { observe: 'response' })
|
||||
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
|
||||
}
|
||||
|
||||
update(sepaMandate: ISepaMandate): Observable<EntityResponseType> {
|
||||
const copy = this.convertDateFromClient(sepaMandate);
|
||||
return this.http
|
||||
.put<ISepaMandate>(this.resourceUrl, copy, { observe: 'response' })
|
||||
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
|
||||
}
|
||||
|
||||
find(id: number): Observable<EntityResponseType> {
|
||||
return this.http
|
||||
.get<ISepaMandate>(`${this.resourceUrl}/${id}`, { observe: 'response' })
|
||||
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
|
||||
}
|
||||
|
||||
query(req?: any): Observable<EntityArrayResponseType> {
|
||||
const options = createRequestOption(req);
|
||||
return this.http
|
||||
.get<ISepaMandate[]>(this.resourceUrl, { params: options, observe: 'response' })
|
||||
.pipe(map((res: EntityArrayResponseType) => this.convertDateArrayFromServer(res)));
|
||||
}
|
||||
|
||||
delete(id: number): Observable<HttpResponse<any>> {
|
||||
return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
|
||||
}
|
||||
|
||||
protected convertDateFromClient(sepaMandate: ISepaMandate): ISepaMandate {
|
||||
const copy: ISepaMandate = Object.assign({}, sepaMandate, {
|
||||
created: sepaMandate.created != null && sepaMandate.created.isValid() ? sepaMandate.created.format(DATE_FORMAT) : null,
|
||||
validFrom: sepaMandate.validFrom != null && sepaMandate.validFrom.isValid() ? sepaMandate.validFrom.format(DATE_FORMAT) : null,
|
||||
validTo: sepaMandate.validTo != null && sepaMandate.validTo.isValid() ? sepaMandate.validTo.format(DATE_FORMAT) : null,
|
||||
lastUsed: sepaMandate.lastUsed != null && sepaMandate.lastUsed.isValid() ? sepaMandate.lastUsed.format(DATE_FORMAT) : null,
|
||||
cancelled: sepaMandate.cancelled != null && sepaMandate.cancelled.isValid() ? sepaMandate.cancelled.format(DATE_FORMAT) : null
|
||||
});
|
||||
return copy;
|
||||
}
|
||||
|
||||
protected convertDateFromServer(res: EntityResponseType): EntityResponseType {
|
||||
if (res.body) {
|
||||
res.body.created = res.body.created != null ? moment(res.body.created) : null;
|
||||
res.body.validFrom = res.body.validFrom != null ? moment(res.body.validFrom) : null;
|
||||
res.body.validTo = res.body.validTo != null ? moment(res.body.validTo) : null;
|
||||
res.body.lastUsed = res.body.lastUsed != null ? moment(res.body.lastUsed) : null;
|
||||
res.body.cancelled = res.body.cancelled != null ? moment(res.body.cancelled) : null;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType {
|
||||
if (res.body) {
|
||||
res.body.forEach((sepaMandate: ISepaMandate) => {
|
||||
sepaMandate.created = sepaMandate.created != null ? moment(sepaMandate.created) : null;
|
||||
sepaMandate.validFrom = sepaMandate.validFrom != null ? moment(sepaMandate.validFrom) : null;
|
||||
sepaMandate.validTo = sepaMandate.validTo != null ? moment(sepaMandate.validTo) : null;
|
||||
sepaMandate.lastUsed = sepaMandate.lastUsed != null ? moment(sepaMandate.lastUsed) : null;
|
||||
sepaMandate.cancelled = sepaMandate.cancelled != null ? moment(sepaMandate.cancelled) : null;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
@ -21,10 +21,10 @@
|
||||
<dd>
|
||||
<span>{{share.comment}}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="hsadminNgApp.share.member">Member</span></dt>
|
||||
<dt><span jhiTranslate="hsadminNgApp.share.membership">Membership</span></dt>
|
||||
<dd>
|
||||
<div *ngIf="share.memberId">
|
||||
<a [routerLink]="['/membership', share.memberId, 'view']">{{share.memberId}}</a>
|
||||
<div *ngIf="share.membershipId">
|
||||
<a [routerLink]="['/membership', share.membershipId, 'view']">{{share.membershipFrom}}</a>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
@ -66,16 +66,15 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.share.member" for="field_member">Member</label>
|
||||
<select class="form-control" id="field_member" name="member" [(ngModel)]="share.memberId" required>
|
||||
<option *ngIf="!editForm.value.member" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.id}}</option>
|
||||
<label class="form-control-label" jhiTranslate="hsadminNgApp.share.membership" for="field_membership">Membership</label>
|
||||
<select class="form-control" id="field_membership" name="membership" [(ngModel)]="share.membershipId" required>
|
||||
<option *ngIf="!editForm.value.membership" [ngValue]="null" selected></option>
|
||||
<option [ngValue]="membershipOption.id" *ngFor="let membershipOption of memberships; trackBy: trackMembershipById">{{membershipOption.from}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div [hidden]="!(editForm.controls.member?.dirty && editForm.controls.member?.invalid)">
|
||||
<div [hidden]="!(editForm.controls.membership?.dirty && editForm.controls.membership?.invalid)">
|
||||
<small class="form-text text-danger"
|
||||
[hidden]="!editForm.controls.member?.errors?.required"
|
||||
jhiTranslate="entity.validation.required">
|
||||
[hidden]="!editForm.controls.membership?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<th jhiSortBy="action"><span jhiTranslate="hsadminNgApp.share.action">Action</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="quantity"><span jhiTranslate="hsadminNgApp.share.quantity">Quantity</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="comment"><span jhiTranslate="hsadminNgApp.share.comment">Comment</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="memberId"><span jhiTranslate="hsadminNgApp.share.member">Member</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th jhiSortBy="membershipFrom"><span jhiTranslate="hsadminNgApp.share.membership">Membership</span> <fa-icon [icon]="'sort'"></fa-icon></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -31,8 +31,8 @@
|
||||
<td>{{share.quantity}}</td>
|
||||
<td>{{share.comment}}</td>
|
||||
<td>
|
||||
<div *ngIf="share.memberId">
|
||||
<a [routerLink]="['../membership', share.memberId , 'view' ]" >{{share.memberId}}</a>
|
||||
<div *ngIf="share.membershipId">
|
||||
<a [routerLink]="['../membership', share.membershipId , 'view' ]" >{{share.membershipFrom}}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
|
Reference in New Issue
Block a user