1
0

Customer JDL

This commit is contained in:
Michael Hierweck
2019-04-18 16:18:26 +02:00
parent bd5bb859d9
commit c6be30895e
206 changed files with 33 additions and 16148 deletions

View File

@ -1,19 +0,0 @@
<form name="deleteForm" (ngSubmit)="confirmDelete(asset.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()">&times;</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-asset-heading" jhiTranslate="hsadminNgApp.asset.delete.question" [translateValues]="{id: asset.id}">Are you sure you want to delete this Asset?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-asset" type="submit" class="btn btn-danger">
<fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -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 { IAsset } from 'app/shared/model/asset.model';
import { AssetService } from './asset.service';
@Component({
selector: 'jhi-asset-delete-dialog',
templateUrl: './asset-delete-dialog.component.html'
})
export class AssetDeleteDialogComponent {
asset: IAsset;
constructor(protected assetService: AssetService, public activeModal: NgbActiveModal, protected eventManager: JhiEventManager) {}
clear() {
this.activeModal.dismiss('cancel');
}
confirmDelete(id: number) {
this.assetService.delete(id).subscribe(response => {
this.eventManager.broadcast({
name: 'assetListModification',
content: 'Deleted an asset'
});
this.activeModal.dismiss(true);
});
}
}
@Component({
selector: 'jhi-asset-delete-popup',
template: ''
})
export class AssetDeletePopupComponent implements OnInit, OnDestroy {
protected ngbModalRef: NgbModalRef;
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ asset }) => {
setTimeout(() => {
this.ngbModalRef = this.modalService.open(AssetDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
this.ngbModalRef.componentInstance.asset = asset;
this.ngbModalRef.result.then(
result => {
this.router.navigate(['/asset', { outlets: { popup: null } }]);
this.ngbModalRef = null;
},
reason => {
this.router.navigate(['/asset', { outlets: { popup: null } }]);
this.ngbModalRef = null;
}
);
}, 0);
});
}
ngOnDestroy() {
this.ngbModalRef = null;
}
}

View File

@ -1,45 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<div *ngIf="asset">
<h2><span jhiTranslate="hsadminNgApp.asset.detail.title">Asset</span> {{asset.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="row-md jh-entity-details">
<dt><span jhiTranslate="hsadminNgApp.asset.date">Date</span></dt>
<dd>
<span>{{asset.date}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.asset.action">Action</span></dt>
<dd>
<span jhiTranslate="{{'hsadminNgApp.AssetAction.' + asset.action}}">{{asset.action}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.asset.amount">Amount</span></dt>
<dd>
<span>{{asset.amount}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.asset.comment">Comment</span></dt>
<dd>
<span>{{asset.comment}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.asset.member">Member</span></dt>
<dd>
<div *ngIf="asset.memberId">
<a [routerLink]="['/membership', asset.memberId, 'view']">{{asset.memberId}}</a>
</div>
</dd>
</dl>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
</button>
<button type="button"
[routerLink]="['/asset', asset.id, 'edit']"
class="btn btn-primary">
<fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -1,24 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { IAsset } from 'app/shared/model/asset.model';
@Component({
selector: 'jhi-asset-detail',
templateUrl: './asset-detail.component.html'
})
export class AssetDetailComponent implements OnInit {
asset: IAsset;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ asset }) => {
this.asset = asset;
});
}
previousState() {
window.history.back();
}
}

View File

@ -1,97 +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-asset-heading" jhiTranslate="hsadminNgApp.asset.home.createOrEditLabel">Create or edit a Asset</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group" [hidden]="!asset.id">
<label for="id" jhiTranslate="global.field.id">ID</label>
<input type="text" class="form-control" id="id" name="id"
[(ngModel)]="asset.id" readonly />
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.date" for="field_date">Date</label>
<div class="input-group">
<input id="field_date" type="text" class="form-control" name="date" ngbDatepicker #dateDp="ngbDatepicker" [(ngModel)]="asset.date"
required/>
<span class="input-group-append">
<button type="button" class="btn btn-secondary" (click)="dateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
</span>
</div>
<div [hidden]="!(editForm.controls.date?.dirty && editForm.controls.date?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.date?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.action" for="field_action">Action</label>
<select class="form-control" name="action" [(ngModel)]="asset.action" id="field_action" required>
<option value="PAYMENT">{{'hsadminNgApp.AssetAction.PAYMENT' | translate}}</option>
<option value="HANDOVER">{{'hsadminNgApp.AssetAction.HANDOVER' | translate}}</option>
<option value="ADOPTION">{{'hsadminNgApp.AssetAction.ADOPTION' | translate}}</option>
<option value="LOSS">{{'hsadminNgApp.AssetAction.LOSS' | translate}}</option>
<option value="CLEARING">{{'hsadminNgApp.AssetAction.CLEARING' | translate}}</option>
<option value="PAYBACK">{{'hsadminNgApp.AssetAction.PAYBACK' | translate}}</option>
</select>
<div [hidden]="!(editForm.controls.action?.dirty && editForm.controls.action?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.action?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.amount" for="field_amount">Amount</label>
<input type="number" class="form-control" name="amount" id="field_amount"
[(ngModel)]="asset.amount" required/>
<div [hidden]="!(editForm.controls.amount?.dirty && editForm.controls.amount?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.amount?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.amount?.errors?.number" jhiTranslate="entity.validation.number">
This field should be a number.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.asset.comment" for="field_comment">Comment</label>
<input type="text" class="form-control" name="comment" id="field_comment"
[(ngModel)]="asset.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.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>
</select>
</div>
<div [hidden]="!(editForm.controls.member?.dirty && editForm.controls.member?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.member?.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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -1,78 +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 * as moment from 'moment';
import { JhiAlertService } from 'ng-jhipster';
import { IAsset } from 'app/shared/model/asset.model';
import { AssetService } from './asset.service';
import { IMembership } from 'app/shared/model/membership.model';
import { MembershipService } from 'app/entities/membership';
@Component({
selector: 'jhi-asset-update',
templateUrl: './asset-update.component.html'
})
export class AssetUpdateComponent implements OnInit {
asset: IAsset;
isSaving: boolean;
memberships: IMembership[];
dateDp: any;
constructor(
protected jhiAlertService: JhiAlertService,
protected assetService: AssetService,
protected membershipService: MembershipService,
protected activatedRoute: ActivatedRoute
) {}
ngOnInit() {
this.isSaving = false;
this.activatedRoute.data.subscribe(({ asset }) => {
this.asset = asset;
});
this.membershipService
.query()
.pipe(
filter((mayBeOk: HttpResponse<IMembership[]>) => mayBeOk.ok),
map((response: HttpResponse<IMembership[]>) => response.body)
)
.subscribe((res: IMembership[]) => (this.memberships = res), (res: HttpErrorResponse) => this.onError(res.message));
}
previousState() {
window.history.back();
}
save() {
this.isSaving = true;
if (this.asset.id !== undefined) {
this.subscribeToSaveResponse(this.assetService.update(this.asset));
} else {
this.subscribeToSaveResponse(this.assetService.create(this.asset));
}
}
protected subscribeToSaveResponse(result: Observable<HttpResponse<IAsset>>) {
result.subscribe((res: HttpResponse<IAsset>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
}
protected onSaveSuccess() {
this.isSaving = false;
this.previousState();
}
protected onSaveError() {
this.isSaving = false;
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
trackMembershipById(index: number, item: IMembership) {
return item.id;
}
}

View File

@ -1,66 +0,0 @@
<div>
<h2 id="page-heading">
<span jhiTranslate="hsadminNgApp.asset.home.title">Assets</span>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-asset" [routerLink]="['/asset/new']">
<fa-icon [icon]="'plus'"></fa-icon>
<span jhiTranslate="hsadminNgApp.asset.home.createLabel">
Create new Asset
</span>
</button>
</h2>
<jhi-alert></jhi-alert>
<br/>
<div class="table-responsive" *ngIf="assets">
<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="date"><span jhiTranslate="hsadminNgApp.asset.date">Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<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></th>
</tr>
</thead>
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
<tr *ngFor="let asset of assets ;trackBy: trackId">
<td><a [routerLink]="['/asset', asset.id, 'view' ]">{{asset.id}}</a></td>
<td>{{asset.date | date:'mediumDate'}}</td>
<td jhiTranslate="{{'hsadminNgApp.AssetAction.' + asset.action}}">{{asset.action}}</td>
<td>{{asset.amount}}</td>
<td>{{asset.comment}}</td>
<td>
<div *ngIf="asset.memberId">
<a [routerLink]="['../membership', asset.memberId , 'view' ]" >{{asset.memberId}}</a>
</div>
</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"
[routerLink]="['/asset', asset.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]="['/asset', asset.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]="['/', 'asset', { outlets: { popup: asset.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>

View File

@ -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 { IAsset } from 'app/shared/model/asset.model';
import { AccountService } from 'app/core';
import { ITEMS_PER_PAGE } from 'app/shared';
import { AssetService } from './asset.service';
@Component({
selector: 'jhi-asset',
templateUrl: './asset.component.html'
})
export class AssetComponent implements OnInit, OnDestroy {
assets: IAsset[];
currentAccount: any;
eventSubscriber: Subscription;
itemsPerPage: number;
links: any;
page: any;
predicate: any;
reverse: any;
totalItems: number;
constructor(
protected assetService: AssetService,
protected jhiAlertService: JhiAlertService,
protected eventManager: JhiEventManager,
protected parseLinks: JhiParseLinks,
protected accountService: AccountService
) {
this.assets = [];
this.itemsPerPage = ITEMS_PER_PAGE;
this.page = 0;
this.links = {
last: 0
};
this.predicate = 'id';
this.reverse = true;
}
loadAll() {
this.assetService
.query({
page: this.page,
size: this.itemsPerPage,
sort: this.sort()
})
.subscribe(
(res: HttpResponse<IAsset[]>) => this.paginateAssets(res.body, res.headers),
(res: HttpErrorResponse) => this.onError(res.message)
);
}
reset() {
this.page = 0;
this.assets = [];
this.loadAll();
}
loadPage(page) {
this.page = page;
this.loadAll();
}
ngOnInit() {
this.loadAll();
this.accountService.identity().then(account => {
this.currentAccount = account;
});
this.registerChangeInAssets();
}
ngOnDestroy() {
this.eventManager.destroy(this.eventSubscriber);
}
trackId(index: number, item: IAsset) {
return item.id;
}
registerChangeInAssets() {
this.eventSubscriber = this.eventManager.subscribe('assetListModification', response => this.reset());
}
sort() {
const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')];
if (this.predicate !== 'id') {
result.push('id');
}
return result;
}
protected paginateAssets(data: IAsset[], 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.assets.push(data[i]);
}
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
}

View File

@ -1,34 +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 {
AssetComponent,
AssetDetailComponent,
AssetUpdateComponent,
AssetDeletePopupComponent,
AssetDeleteDialogComponent,
assetRoute,
assetPopupRoute
} from './';
const ENTITY_STATES = [...assetRoute, ...assetPopupRoute];
@NgModule({
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
declarations: [AssetComponent, AssetDetailComponent, AssetUpdateComponent, AssetDeleteDialogComponent, AssetDeletePopupComponent],
entryComponents: [AssetComponent, AssetUpdateComponent, AssetDeleteDialogComponent, AssetDeletePopupComponent],
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HsadminNgAssetModule {
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
this.languageHelper.language.subscribe((languageKey: string) => {
if (languageKey !== undefined) {
this.languageService.changeLanguage(languageKey);
}
});
}
}

View File

@ -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 { Asset } from 'app/shared/model/asset.model';
import { AssetService } from './asset.service';
import { AssetComponent } from './asset.component';
import { AssetDetailComponent } from './asset-detail.component';
import { AssetUpdateComponent } from './asset-update.component';
import { AssetDeletePopupComponent } from './asset-delete-dialog.component';
import { IAsset } from 'app/shared/model/asset.model';
@Injectable({ providedIn: 'root' })
export class AssetResolve implements Resolve<IAsset> {
constructor(private service: AssetService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<IAsset> {
const id = route.params['id'] ? route.params['id'] : null;
if (id) {
return this.service.find(id).pipe(
filter((response: HttpResponse<Asset>) => response.ok),
map((asset: HttpResponse<Asset>) => asset.body)
);
}
return of(new Asset());
}
}
export const assetRoute: Routes = [
{
path: '',
component: AssetComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.asset.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/view',
component: AssetDetailComponent,
resolve: {
asset: AssetResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.asset.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: 'new',
component: AssetUpdateComponent,
resolve: {
asset: AssetResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.asset.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/edit',
component: AssetUpdateComponent,
resolve: {
asset: AssetResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.asset.home.title'
},
canActivate: [UserRouteAccessService]
}
];
export const assetPopupRoute: Routes = [
{
path: ':id/delete',
component: AssetDeletePopupComponent,
resolve: {
asset: AssetResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.asset.home.title'
},
canActivate: [UserRouteAccessService],
outlet: 'popup'
}
];

View File

@ -1,74 +0,0 @@
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 { IAsset } from 'app/shared/model/asset.model';
type EntityResponseType = HttpResponse<IAsset>;
type EntityArrayResponseType = HttpResponse<IAsset[]>;
@Injectable({ providedIn: 'root' })
export class AssetService {
public resourceUrl = SERVER_API_URL + 'api/assets';
constructor(protected http: HttpClient) {}
create(asset: IAsset): Observable<EntityResponseType> {
const copy = this.convertDateFromClient(asset);
return this.http
.post<IAsset>(this.resourceUrl, copy, { observe: 'response' })
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
}
update(asset: IAsset): Observable<EntityResponseType> {
const copy = this.convertDateFromClient(asset);
return this.http
.put<IAsset>(this.resourceUrl, copy, { observe: 'response' })
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
}
find(id: number): Observable<EntityResponseType> {
return this.http
.get<IAsset>(`${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<IAsset[]>(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(asset: IAsset): IAsset {
const copy: IAsset = Object.assign({}, asset, {
date: asset.date != null && asset.date.isValid() ? asset.date.format(DATE_FORMAT) : null
});
return copy;
}
protected convertDateFromServer(res: EntityResponseType): EntityResponseType {
if (res.body) {
res.body.date = res.body.date != null ? moment(res.body.date) : null;
}
return res;
}
protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType {
if (res.body) {
res.body.forEach((asset: IAsset) => {
asset.date = asset.date != null ? moment(asset.date) : null;
});
}
return res;
}
}

View File

@ -1,6 +0,0 @@
export * from './asset.service';
export * from './asset-update.component';
export * from './asset-delete-dialog.component';
export * from './asset-detail.component';
export * from './asset.component';
export * from './asset.route';

View File

@ -1,19 +0,0 @@
<form name="deleteForm" (ngSubmit)="confirmDelete(contact.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()">&times;</button>
</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>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-contact" type="submit" class="btn btn-danger">
<fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -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;
}
}

View File

@ -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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -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();
}
}

View File

@ -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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -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;
}
}

View File

@ -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>

View File

@ -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 { IContact } from 'app/shared/model/contact.model';
import { AccountService } from 'app/core';
import { ITEMS_PER_PAGE } from 'app/shared';
import { ContactService } from './contact.service';
@Component({
selector: 'jhi-contact',
templateUrl: './contact.component.html'
})
export class ContactComponent implements OnInit, OnDestroy {
contacts: IContact[];
currentAccount: any;
eventSubscriber: Subscription;
itemsPerPage: number;
links: any;
page: any;
predicate: any;
reverse: any;
totalItems: number;
constructor(
protected contactService: ContactService,
protected jhiAlertService: JhiAlertService,
protected eventManager: JhiEventManager,
protected parseLinks: JhiParseLinks,
protected accountService: AccountService
) {
this.contacts = [];
this.itemsPerPage = ITEMS_PER_PAGE;
this.page = 0;
this.links = {
last: 0
};
this.predicate = 'id';
this.reverse = true;
}
loadAll() {
this.contactService
.query({
page: this.page,
size: this.itemsPerPage,
sort: this.sort()
})
.subscribe(
(res: HttpResponse<IContact[]>) => this.paginateContacts(res.body, res.headers),
(res: HttpErrorResponse) => this.onError(res.message)
);
}
reset() {
this.page = 0;
this.contacts = [];
this.loadAll();
}
loadPage(page) {
this.page = page;
this.loadAll();
}
ngOnInit() {
this.loadAll();
this.accountService.identity().then(account => {
this.currentAccount = account;
});
this.registerChangeInContacts();
}
ngOnDestroy() {
this.eventManager.destroy(this.eventSubscriber);
}
trackId(index: number, item: IContact) {
return item.id;
}
registerChangeInContacts() {
this.eventSubscriber = this.eventManager.subscribe('contactListModification', response => this.reset());
}
sort() {
const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')];
if (this.predicate !== 'id') {
result.push('id');
}
return result;
}
protected paginateContacts(data: IContact[], 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]);
}
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
}

View File

@ -1,40 +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 {
ContactComponent,
ContactDetailComponent,
ContactUpdateComponent,
ContactDeletePopupComponent,
ContactDeleteDialogComponent,
contactRoute,
contactPopupRoute
} from './';
const ENTITY_STATES = [...contactRoute, ...contactPopupRoute];
@NgModule({
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
declarations: [
ContactComponent,
ContactDetailComponent,
ContactUpdateComponent,
ContactDeleteDialogComponent,
ContactDeletePopupComponent
],
entryComponents: [ContactComponent, ContactUpdateComponent, ContactDeleteDialogComponent, ContactDeletePopupComponent],
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HsadminNgContactModule {
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
this.languageHelper.language.subscribe((languageKey: string) => {
if (languageKey !== undefined) {
this.languageService.changeLanguage(languageKey);
}
});
}
}

View File

@ -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'
}
];

View File

@ -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' });
}
}

View File

@ -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';

View File

@ -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()">&times;</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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -1,72 +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 { ICustomerContact } from 'app/shared/model/customer-contact.model';
import { CustomerContactService } from './customer-contact.service';
@Component({
selector: 'jhi-customer-contact-delete-dialog',
templateUrl: './customer-contact-delete-dialog.component.html'
})
export class CustomerContactDeleteDialogComponent {
customerContact: ICustomerContact;
constructor(
protected customerContactService: CustomerContactService,
public activeModal: NgbActiveModal,
protected eventManager: JhiEventManager
) {}
clear() {
this.activeModal.dismiss('cancel');
}
confirmDelete(id: number) {
this.customerContactService.delete(id).subscribe(response => {
this.eventManager.broadcast({
name: 'customerContactListModification',
content: 'Deleted an customerContact'
});
this.activeModal.dismiss(true);
});
}
}
@Component({
selector: 'jhi-customer-contact-delete-popup',
template: ''
})
export class CustomerContactDeletePopupComponent implements OnInit, OnDestroy {
protected ngbModalRef: NgbModalRef;
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ customerContact }) => {
setTimeout(() => {
this.ngbModalRef = this.modalService.open(CustomerContactDeleteDialogComponent as Component, {
size: 'lg',
backdrop: 'static'
});
this.ngbModalRef.componentInstance.customerContact = customerContact;
this.ngbModalRef.result.then(
result => {
this.router.navigate(['/customer-contact', { outlets: { popup: null } }]);
this.ngbModalRef = null;
},
reason => {
this.router.navigate(['/customer-contact', { outlets: { popup: null } }]);
this.ngbModalRef = null;
}
);
}, 0);
});
}
ngOnDestroy() {
this.ngbModalRef = null;
}
}

View File

@ -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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -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();
}
}

View File

@ -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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -1,92 +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 { 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 { 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'
})
export class CustomerContactUpdateComponent implements OnInit {
customerContact: ICustomerContact;
isSaving: boolean;
contacts: IContact[];
customers: ICustomer[];
constructor(
protected jhiAlertService: JhiAlertService,
protected customerContactService: CustomerContactService,
protected contactService: ContactService,
protected customerService: CustomerService,
protected activatedRoute: ActivatedRoute
) {}
ngOnInit() {
this.isSaving = false;
this.activatedRoute.data.subscribe(({ customerContact }) => {
this.customerContact = customerContact;
});
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(
filter((mayBeOk: HttpResponse<ICustomer[]>) => mayBeOk.ok),
map((response: HttpResponse<ICustomer[]>) => response.body)
)
.subscribe((res: ICustomer[]) => (this.customers = res), (res: HttpErrorResponse) => this.onError(res.message));
}
previousState() {
window.history.back();
}
save() {
this.isSaving = true;
if (this.customerContact.id !== undefined) {
this.subscribeToSaveResponse(this.customerContactService.update(this.customerContact));
} else {
this.subscribeToSaveResponse(this.customerContactService.create(this.customerContact));
}
}
protected subscribeToSaveResponse(result: Observable<HttpResponse<ICustomerContact>>) {
result.subscribe((res: HttpResponse<ICustomerContact>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
}
protected onSaveSuccess() {
this.isSaving = false;
this.previousState();
}
protected onSaveError() {
this.isSaving = false;
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
trackContactById(index: number, item: IContact) {
return item.id;
}
trackCustomerById(index: number, item: ICustomer) {
return item.id;
}
}

View File

@ -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>

View File

@ -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);
}
}

View File

@ -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);
}
});
}
}

View File

@ -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'
}
];

View File

@ -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' });
}
}

View File

@ -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';

View File

@ -1,19 +0,0 @@
<form name="deleteForm" (ngSubmit)="confirmDelete(customer.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()">&times;</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-customer-heading" jhiTranslate="hsadminNgApp.customer.delete.question" [translateValues]="{id: customer.id}">Are you sure you want to delete this Customer?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-customer" type="submit" class="btn btn-danger">
<fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -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 { ICustomer } from 'app/shared/model/customer.model';
import { CustomerService } from './customer.service';
@Component({
selector: 'jhi-customer-delete-dialog',
templateUrl: './customer-delete-dialog.component.html'
})
export class CustomerDeleteDialogComponent {
customer: ICustomer;
constructor(protected customerService: CustomerService, public activeModal: NgbActiveModal, protected eventManager: JhiEventManager) {}
clear() {
this.activeModal.dismiss('cancel');
}
confirmDelete(id: number) {
this.customerService.delete(id).subscribe(response => {
this.eventManager.broadcast({
name: 'customerListModification',
content: 'Deleted an customer'
});
this.activeModal.dismiss(true);
});
}
}
@Component({
selector: 'jhi-customer-delete-popup',
template: ''
})
export class CustomerDeletePopupComponent implements OnInit, OnDestroy {
protected ngbModalRef: NgbModalRef;
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ customer }) => {
setTimeout(() => {
this.ngbModalRef = this.modalService.open(CustomerDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
this.ngbModalRef.componentInstance.customer = customer;
this.ngbModalRef.result.then(
result => {
this.router.navigate(['/customer', { outlets: { popup: null } }]);
this.ngbModalRef = null;
},
reason => {
this.router.navigate(['/customer', { outlets: { popup: null } }]);
this.ngbModalRef = null;
}
);
}, 0);
});
}
ngOnDestroy() {
this.ngbModalRef = null;
}
}

View File

@ -1,51 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<div *ngIf="customer">
<h2><span jhiTranslate="hsadminNgApp.customer.detail.title">Customer</span> {{customer.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="row-md jh-entity-details">
<dt><span jhiTranslate="hsadminNgApp.customer.number">Number</span></dt>
<dd>
<span>{{customer.number}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.customer.prefix">Prefix</span></dt>
<dd>
<span>{{customer.prefix}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.customer.name">Name</span></dt>
<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>
<dd>
<span>{{customer.billingAddress}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span></dt>
<dd>
<span>{{customer.billingSalutation}}</span>
</dd>
</dl>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
</button>
<button type="button"
[routerLink]="['/customer', customer.id, 'edit']"
class="btn btn-primary">
<fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -1,24 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ICustomer } from 'app/shared/model/customer.model';
@Component({
selector: 'jhi-customer-detail',
templateUrl: './customer-detail.component.html'
})
export class CustomerDetailComponent implements OnInit {
customer: ICustomer;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ customer }) => {
this.customer = customer;
});
}
previousState() {
window.history.back();
}
}

View File

@ -1,142 +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-heading" jhiTranslate="hsadminNgApp.customer.home.createOrEditLabel">Create or edit a Customer</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group" [hidden]="!customer.id">
<label for="id" jhiTranslate="global.field.id">ID</label>
<input type="text" class="form-control" id="id" name="id"
[(ngModel)]="customer.id" readonly />
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.number" for="field_number">Number</label>
<input type="number" class="form-control" name="number" id="field_number"
[(ngModel)]="customer.number" required min="10000" jhiMin="10000" max="99999" jhiMax="99999"/>
<div [hidden]="!(editForm.controls.number?.dirty && editForm.controls.number?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.number?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.number?.errors?.min" jhiTranslate="entity.validation.min" [translateValues]="{ min: 10000 }">
This field should be at least 10000.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.number?.errors?.max" jhiTranslate="entity.validation.max" [translateValues]="{ max: 99999 }">
This field cannot be more than 99999.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.number?.errors?.number" jhiTranslate="entity.validation.number">
This field should be a number.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.prefix" for="field_prefix">Prefix</label>
<input type="text" class="form-control" name="prefix" id="field_prefix"
[(ngModel)]="customer.prefix" required pattern="[a-z][a-z0-9]+"/>
<div [hidden]="!(editForm.controls.prefix?.dirty && editForm.controls.prefix?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.prefix?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.prefix?.errors?.pattern" jhiTranslate="entity.validation.pattern" [translateValues]="{ pattern: 'Prefix' }">
This field should follow pattern for "Prefix".
</small>
</div>
</div>
<div class="form-group">
<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"/>
<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.
</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.
</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)">
<small class="form-text text-danger"
[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.
</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>
<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)">
<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.
</small>
</div>
</div>
</div>
<div>
<button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -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 { ICustomer } from 'app/shared/model/customer.model';
import { CustomerService } from './customer.service';
@Component({
selector: 'jhi-customer-update',
templateUrl: './customer-update.component.html'
})
export class CustomerUpdateComponent implements OnInit {
customer: ICustomer;
isSaving: boolean;
constructor(protected customerService: CustomerService, protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.isSaving = false;
this.activatedRoute.data.subscribe(({ customer }) => {
this.customer = customer;
});
}
previousState() {
window.history.back();
}
save() {
this.isSaving = true;
if (this.customer.id !== undefined) {
this.subscribeToSaveResponse(this.customerService.update(this.customer));
} else {
this.subscribeToSaveResponse(this.customerService.create(this.customer));
}
}
protected subscribeToSaveResponse(result: Observable<HttpResponse<ICustomer>>) {
result.subscribe((res: HttpResponse<ICustomer>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
}
protected onSaveSuccess() {
this.isSaving = false;
this.previousState();
}
protected onSaveError() {
this.isSaving = false;
}
}

View File

@ -1,77 +0,0 @@
<div>
<h2 id="page-heading">
<span jhiTranslate="hsadminNgApp.customer.home.title">Customers</span>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-customer" [routerLink]="['/customer/new']">
<fa-icon [icon]="'plus'"></fa-icon>
<span jhiTranslate="hsadminNgApp.customer.home.createLabel">
Create new Customer
</span>
</button>
</h2>
<jhi-alert></jhi-alert>
<br/>
<div class="table-responsive" *ngIf="customers">
<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="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></th>
</tr>
</thead>
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
<tr *ngFor="let customer of customers ;trackBy: trackId">
<td><a [routerLink]="['/customer', customer.id, 'view' ]">{{customer.id}}</a></td>
<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.billingSalutation}}</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"
[routerLink]="['/customer', customer.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', customer.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', { outlets: { popup: customer.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>

View File

@ -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 { ICustomer } from 'app/shared/model/customer.model';
import { AccountService } from 'app/core';
import { ITEMS_PER_PAGE } from 'app/shared';
import { CustomerService } from './customer.service';
@Component({
selector: 'jhi-customer',
templateUrl: './customer.component.html'
})
export class CustomerComponent implements OnInit, OnDestroy {
customers: ICustomer[];
currentAccount: any;
eventSubscriber: Subscription;
itemsPerPage: number;
links: any;
page: any;
predicate: any;
reverse: any;
totalItems: number;
constructor(
protected customerService: CustomerService,
protected jhiAlertService: JhiAlertService,
protected eventManager: JhiEventManager,
protected parseLinks: JhiParseLinks,
protected accountService: AccountService
) {
this.customers = [];
this.itemsPerPage = ITEMS_PER_PAGE;
this.page = 0;
this.links = {
last: 0
};
this.predicate = 'id';
this.reverse = true;
}
loadAll() {
this.customerService
.query({
page: this.page,
size: this.itemsPerPage,
sort: this.sort()
})
.subscribe(
(res: HttpResponse<ICustomer[]>) => this.paginateCustomers(res.body, res.headers),
(res: HttpErrorResponse) => this.onError(res.message)
);
}
reset() {
this.page = 0;
this.customers = [];
this.loadAll();
}
loadPage(page) {
this.page = page;
this.loadAll();
}
ngOnInit() {
this.loadAll();
this.accountService.identity().then(account => {
this.currentAccount = account;
});
this.registerChangeInCustomers();
}
ngOnDestroy() {
this.eventManager.destroy(this.eventSubscriber);
}
trackId(index: number, item: ICustomer) {
return item.id;
}
registerChangeInCustomers() {
this.eventSubscriber = this.eventManager.subscribe('customerListModification', response => this.reset());
}
sort() {
const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')];
if (this.predicate !== 'id') {
result.push('id');
}
return result;
}
protected paginateCustomers(data: ICustomer[], 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.customers.push(data[i]);
}
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
}

View File

@ -1,40 +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 {
CustomerComponent,
CustomerDetailComponent,
CustomerUpdateComponent,
CustomerDeletePopupComponent,
CustomerDeleteDialogComponent,
customerRoute,
customerPopupRoute
} from './';
const ENTITY_STATES = [...customerRoute, ...customerPopupRoute];
@NgModule({
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
declarations: [
CustomerComponent,
CustomerDetailComponent,
CustomerUpdateComponent,
CustomerDeleteDialogComponent,
CustomerDeletePopupComponent
],
entryComponents: [CustomerComponent, CustomerUpdateComponent, CustomerDeleteDialogComponent, CustomerDeletePopupComponent],
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HsadminNgCustomerModule {
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
this.languageHelper.language.subscribe((languageKey: string) => {
if (languageKey !== undefined) {
this.languageService.changeLanguage(languageKey);
}
});
}
}

View File

@ -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 { Customer } from 'app/shared/model/customer.model';
import { CustomerService } from './customer.service';
import { CustomerComponent } from './customer.component';
import { CustomerDetailComponent } from './customer-detail.component';
import { CustomerUpdateComponent } from './customer-update.component';
import { CustomerDeletePopupComponent } from './customer-delete-dialog.component';
import { ICustomer } from 'app/shared/model/customer.model';
@Injectable({ providedIn: 'root' })
export class CustomerResolve implements Resolve<ICustomer> {
constructor(private service: CustomerService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<ICustomer> {
const id = route.params['id'] ? route.params['id'] : null;
if (id) {
return this.service.find(id).pipe(
filter((response: HttpResponse<Customer>) => response.ok),
map((customer: HttpResponse<Customer>) => customer.body)
);
}
return of(new Customer());
}
}
export const customerRoute: Routes = [
{
path: '',
component: CustomerComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customer.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/view',
component: CustomerDetailComponent,
resolve: {
customer: CustomerResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customer.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: 'new',
component: CustomerUpdateComponent,
resolve: {
customer: CustomerResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customer.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/edit',
component: CustomerUpdateComponent,
resolve: {
customer: CustomerResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customer.home.title'
},
canActivate: [UserRouteAccessService]
}
];
export const customerPopupRoute: Routes = [
{
path: ':id/delete',
component: CustomerDeletePopupComponent,
resolve: {
customer: CustomerResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.customer.home.title'
},
canActivate: [UserRouteAccessService],
outlet: 'popup'
}
];

View File

@ -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 { ICustomer } from 'app/shared/model/customer.model';
type EntityResponseType = HttpResponse<ICustomer>;
type EntityArrayResponseType = HttpResponse<ICustomer[]>;
@Injectable({ providedIn: 'root' })
export class CustomerService {
public resourceUrl = SERVER_API_URL + 'api/customers';
constructor(protected http: HttpClient) {}
create(customer: ICustomer): Observable<EntityResponseType> {
return this.http.post<ICustomer>(this.resourceUrl, customer, { observe: 'response' });
}
update(customer: ICustomer): Observable<EntityResponseType> {
return this.http.put<ICustomer>(this.resourceUrl, customer, { observe: 'response' });
}
find(id: number): Observable<EntityResponseType> {
return this.http.get<ICustomer>(`${this.resourceUrl}/${id}`, { observe: 'response' });
}
query(req?: any): Observable<EntityArrayResponseType> {
const options = createRequestOption(req);
return this.http.get<ICustomer[]>(this.resourceUrl, { params: options, observe: 'response' });
}
delete(id: number): Observable<HttpResponse<any>> {
return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response' });
}
}

View File

@ -1,6 +0,0 @@
export * from './customer.service';
export * from './customer-update.component';
export * from './customer-delete-dialog.component';
export * from './customer-detail.component';
export * from './customer.component';
export * from './customer.route';

View File

@ -1,49 +1,9 @@
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule } from '@angular/router';
@NgModule({
imports: [
RouterModule.forChild([
{
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'
},
{
path: 'share',
loadChildren: './share/share.module#HsadminNgShareModule'
},
{
path: 'asset',
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'
}
/* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
])
],

View File

@ -1,6 +0,0 @@
export * from './membership.service';
export * from './membership-update.component';
export * from './membership-delete-dialog.component';
export * from './membership-detail.component';
export * from './membership.component';
export * from './membership.route';

View File

@ -1,19 +0,0 @@
<form name="deleteForm" (ngSubmit)="confirmDelete(membership.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()">&times;</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-membership-heading" jhiTranslate="hsadminNgApp.membership.delete.question" [translateValues]="{id: membership.id}">Are you sure you want to delete this Membership?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-membership" type="submit" class="btn btn-danger">
<fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -1,69 +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 { IMembership } from 'app/shared/model/membership.model';
import { MembershipService } from './membership.service';
@Component({
selector: 'jhi-membership-delete-dialog',
templateUrl: './membership-delete-dialog.component.html'
})
export class MembershipDeleteDialogComponent {
membership: IMembership;
constructor(
protected membershipService: MembershipService,
public activeModal: NgbActiveModal,
protected eventManager: JhiEventManager
) {}
clear() {
this.activeModal.dismiss('cancel');
}
confirmDelete(id: number) {
this.membershipService.delete(id).subscribe(response => {
this.eventManager.broadcast({
name: 'membershipListModification',
content: 'Deleted an membership'
});
this.activeModal.dismiss(true);
});
}
}
@Component({
selector: 'jhi-membership-delete-popup',
template: ''
})
export class MembershipDeletePopupComponent implements OnInit, OnDestroy {
protected ngbModalRef: NgbModalRef;
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ membership }) => {
setTimeout(() => {
this.ngbModalRef = this.modalService.open(MembershipDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
this.ngbModalRef.componentInstance.membership = membership;
this.ngbModalRef.result.then(
result => {
this.router.navigate(['/membership', { outlets: { popup: null } }]);
this.ngbModalRef = null;
},
reason => {
this.router.navigate(['/membership', { outlets: { popup: null } }]);
this.ngbModalRef = null;
}
);
}, 0);
});
}
ngOnDestroy() {
this.ngbModalRef = null;
}
}

View File

@ -1,37 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<div *ngIf="membership">
<h2><span jhiTranslate="hsadminNgApp.membership.detail.title">Membership</span> {{membership.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="row-md jh-entity-details">
<dt><span jhiTranslate="hsadminNgApp.membership.sinceDate">Since Date</span></dt>
<dd>
<span>{{membership.sinceDate}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.membership.untilDate">Until Date</span></dt>
<dd>
<span>{{membership.untilDate}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.membership.customer">Customer</span></dt>
<dd>
<div *ngIf="membership.customerId">
<a [routerLink]="['/customer', membership.customerId, 'view']">{{membership.customerPrefix}}</a>
</div>
</dd>
</dl>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
</button>
<button type="button"
[routerLink]="['/membership', membership.id, 'edit']"
class="btn btn-primary">
<fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -1,24 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { IMembership } from 'app/shared/model/membership.model';
@Component({
selector: 'jhi-membership-detail',
templateUrl: './membership-detail.component.html'
})
export class MembershipDetailComponent implements OnInit {
membership: IMembership;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ membership }) => {
this.membership = membership;
});
}
previousState() {
window.history.back();
}
}

View File

@ -1,65 +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-membership-heading" jhiTranslate="hsadminNgApp.membership.home.createOrEditLabel">Create or edit a Membership</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group" [hidden]="!membership.id">
<label for="id" jhiTranslate="global.field.id">ID</label>
<input type="text" class="form-control" id="id" name="id"
[(ngModel)]="membership.id" readonly />
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.membership.sinceDate" for="field_sinceDate">Since Date</label>
<div class="input-group">
<input id="field_sinceDate" type="text" class="form-control" name="sinceDate" ngbDatepicker #sinceDateDp="ngbDatepicker" [(ngModel)]="membership.sinceDate"
required/>
<span class="input-group-append">
<button type="button" class="btn btn-secondary" (click)="sinceDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
</span>
</div>
<div [hidden]="!(editForm.controls.sinceDate?.dirty && editForm.controls.sinceDate?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.sinceDate?.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>
<div class="input-group">
<input id="field_untilDate" type="text" class="form-control" name="untilDate" ngbDatepicker #untilDateDp="ngbDatepicker" [(ngModel)]="membership.untilDate"
/>
<span class="input-group-append">
<button type="button" class="btn btn-secondary" (click)="untilDateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
</span>
</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>
<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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -1,79 +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 * as moment from 'moment';
import { JhiAlertService } from 'ng-jhipster';
import { IMembership } from 'app/shared/model/membership.model';
import { MembershipService } from './membership.service';
import { ICustomer } from 'app/shared/model/customer.model';
import { CustomerService } from 'app/entities/customer';
@Component({
selector: 'jhi-membership-update',
templateUrl: './membership-update.component.html'
})
export class MembershipUpdateComponent implements OnInit {
membership: IMembership;
isSaving: boolean;
customers: ICustomer[];
sinceDateDp: any;
untilDateDp: any;
constructor(
protected jhiAlertService: JhiAlertService,
protected membershipService: MembershipService,
protected customerService: CustomerService,
protected activatedRoute: ActivatedRoute
) {}
ngOnInit() {
this.isSaving = false;
this.activatedRoute.data.subscribe(({ membership }) => {
this.membership = membership;
});
this.customerService
.query()
.pipe(
filter((mayBeOk: HttpResponse<ICustomer[]>) => mayBeOk.ok),
map((response: HttpResponse<ICustomer[]>) => response.body)
)
.subscribe((res: ICustomer[]) => (this.customers = res), (res: HttpErrorResponse) => this.onError(res.message));
}
previousState() {
window.history.back();
}
save() {
this.isSaving = true;
if (this.membership.id !== undefined) {
this.subscribeToSaveResponse(this.membershipService.update(this.membership));
} else {
this.subscribeToSaveResponse(this.membershipService.create(this.membership));
}
}
protected subscribeToSaveResponse(result: Observable<HttpResponse<IMembership>>) {
result.subscribe((res: HttpResponse<IMembership>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
}
protected onSaveSuccess() {
this.isSaving = false;
this.previousState();
}
protected onSaveError() {
this.isSaving = false;
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
trackCustomerById(index: number, item: ICustomer) {
return item.id;
}
}

View File

@ -1,62 +0,0 @@
<div>
<h2 id="page-heading">
<span jhiTranslate="hsadminNgApp.membership.home.title">Memberships</span>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-membership" [routerLink]="['/membership/new']">
<fa-icon [icon]="'plus'"></fa-icon>
<span jhiTranslate="hsadminNgApp.membership.home.createLabel">
Create new Membership
</span>
</button>
</h2>
<jhi-alert></jhi-alert>
<br/>
<div class="table-responsive" *ngIf="memberships">
<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="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="customerPrefix"><span jhiTranslate="hsadminNgApp.membership.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 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>
<div *ngIf="membership.customerId">
<a [routerLink]="['../customer', membership.customerId , 'view' ]" >{{membership.customerPrefix}}</a>
</div>
</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"
[routerLink]="['/membership', membership.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]="['/membership', membership.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]="['/', 'membership', { outlets: { popup: membership.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>

View File

@ -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 { IMembership } from 'app/shared/model/membership.model';
import { AccountService } from 'app/core';
import { ITEMS_PER_PAGE } from 'app/shared';
import { MembershipService } from './membership.service';
@Component({
selector: 'jhi-membership',
templateUrl: './membership.component.html'
})
export class MembershipComponent implements OnInit, OnDestroy {
memberships: IMembership[];
currentAccount: any;
eventSubscriber: Subscription;
itemsPerPage: number;
links: any;
page: any;
predicate: any;
reverse: any;
totalItems: number;
constructor(
protected membershipService: MembershipService,
protected jhiAlertService: JhiAlertService,
protected eventManager: JhiEventManager,
protected parseLinks: JhiParseLinks,
protected accountService: AccountService
) {
this.memberships = [];
this.itemsPerPage = ITEMS_PER_PAGE;
this.page = 0;
this.links = {
last: 0
};
this.predicate = 'id';
this.reverse = true;
}
loadAll() {
this.membershipService
.query({
page: this.page,
size: this.itemsPerPage,
sort: this.sort()
})
.subscribe(
(res: HttpResponse<IMembership[]>) => this.paginateMemberships(res.body, res.headers),
(res: HttpErrorResponse) => this.onError(res.message)
);
}
reset() {
this.page = 0;
this.memberships = [];
this.loadAll();
}
loadPage(page) {
this.page = page;
this.loadAll();
}
ngOnInit() {
this.loadAll();
this.accountService.identity().then(account => {
this.currentAccount = account;
});
this.registerChangeInMemberships();
}
ngOnDestroy() {
this.eventManager.destroy(this.eventSubscriber);
}
trackId(index: number, item: IMembership) {
return item.id;
}
registerChangeInMemberships() {
this.eventSubscriber = this.eventManager.subscribe('membershipListModification', response => this.reset());
}
sort() {
const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')];
if (this.predicate !== 'id') {
result.push('id');
}
return result;
}
protected paginateMemberships(data: IMembership[], 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.memberships.push(data[i]);
}
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
}

View File

@ -1,40 +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 {
MembershipComponent,
MembershipDetailComponent,
MembershipUpdateComponent,
MembershipDeletePopupComponent,
MembershipDeleteDialogComponent,
membershipRoute,
membershipPopupRoute
} from './';
const ENTITY_STATES = [...membershipRoute, ...membershipPopupRoute];
@NgModule({
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
declarations: [
MembershipComponent,
MembershipDetailComponent,
MembershipUpdateComponent,
MembershipDeleteDialogComponent,
MembershipDeletePopupComponent
],
entryComponents: [MembershipComponent, MembershipUpdateComponent, MembershipDeleteDialogComponent, MembershipDeletePopupComponent],
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HsadminNgMembershipModule {
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
this.languageHelper.language.subscribe((languageKey: string) => {
if (languageKey !== undefined) {
this.languageService.changeLanguage(languageKey);
}
});
}
}

View File

@ -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 { Membership } from 'app/shared/model/membership.model';
import { MembershipService } from './membership.service';
import { MembershipComponent } from './membership.component';
import { MembershipDetailComponent } from './membership-detail.component';
import { MembershipUpdateComponent } from './membership-update.component';
import { MembershipDeletePopupComponent } from './membership-delete-dialog.component';
import { IMembership } from 'app/shared/model/membership.model';
@Injectable({ providedIn: 'root' })
export class MembershipResolve implements Resolve<IMembership> {
constructor(private service: MembershipService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<IMembership> {
const id = route.params['id'] ? route.params['id'] : null;
if (id) {
return this.service.find(id).pipe(
filter((response: HttpResponse<Membership>) => response.ok),
map((membership: HttpResponse<Membership>) => membership.body)
);
}
return of(new Membership());
}
}
export const membershipRoute: Routes = [
{
path: '',
component: MembershipComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.membership.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/view',
component: MembershipDetailComponent,
resolve: {
membership: MembershipResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.membership.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: 'new',
component: MembershipUpdateComponent,
resolve: {
membership: MembershipResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.membership.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/edit',
component: MembershipUpdateComponent,
resolve: {
membership: MembershipResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.membership.home.title'
},
canActivate: [UserRouteAccessService]
}
];
export const membershipPopupRoute: Routes = [
{
path: ':id/delete',
component: MembershipDeletePopupComponent,
resolve: {
membership: MembershipResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.membership.home.title'
},
canActivate: [UserRouteAccessService],
outlet: 'popup'
}
];

View File

@ -1,77 +0,0 @@
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 { IMembership } from 'app/shared/model/membership.model';
type EntityResponseType = HttpResponse<IMembership>;
type EntityArrayResponseType = HttpResponse<IMembership[]>;
@Injectable({ providedIn: 'root' })
export class MembershipService {
public resourceUrl = SERVER_API_URL + 'api/memberships';
constructor(protected http: HttpClient) {}
create(membership: IMembership): Observable<EntityResponseType> {
const copy = this.convertDateFromClient(membership);
return this.http
.post<IMembership>(this.resourceUrl, copy, { observe: 'response' })
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
}
update(membership: IMembership): Observable<EntityResponseType> {
const copy = this.convertDateFromClient(membership);
return this.http
.put<IMembership>(this.resourceUrl, copy, { observe: 'response' })
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
}
find(id: number): Observable<EntityResponseType> {
return this.http
.get<IMembership>(`${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<IMembership[]>(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(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
});
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;
}
return res;
}
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;
});
}
return res;
}
}

View File

@ -1,6 +0,0 @@
export * from './share.service';
export * from './share-update.component';
export * from './share-delete-dialog.component';
export * from './share-detail.component';
export * from './share.component';
export * from './share.route';

View File

@ -1,19 +0,0 @@
<form name="deleteForm" (ngSubmit)="confirmDelete(share.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()">&times;</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-share-heading" jhiTranslate="hsadminNgApp.share.delete.question" [translateValues]="{id: share.id}">Are you sure you want to delete this Share?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
<fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
</button>
<button id="jhi-confirm-delete-share" type="submit" class="btn btn-danger">
<fa-icon [icon]="'times'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.delete">Delete</span>
</button>
</div>
</form>

View File

@ -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 { IShare } from 'app/shared/model/share.model';
import { ShareService } from './share.service';
@Component({
selector: 'jhi-share-delete-dialog',
templateUrl: './share-delete-dialog.component.html'
})
export class ShareDeleteDialogComponent {
share: IShare;
constructor(protected shareService: ShareService, public activeModal: NgbActiveModal, protected eventManager: JhiEventManager) {}
clear() {
this.activeModal.dismiss('cancel');
}
confirmDelete(id: number) {
this.shareService.delete(id).subscribe(response => {
this.eventManager.broadcast({
name: 'shareListModification',
content: 'Deleted an share'
});
this.activeModal.dismiss(true);
});
}
}
@Component({
selector: 'jhi-share-delete-popup',
template: ''
})
export class ShareDeletePopupComponent implements OnInit, OnDestroy {
protected ngbModalRef: NgbModalRef;
constructor(protected activatedRoute: ActivatedRoute, protected router: Router, protected modalService: NgbModal) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ share }) => {
setTimeout(() => {
this.ngbModalRef = this.modalService.open(ShareDeleteDialogComponent as Component, { size: 'lg', backdrop: 'static' });
this.ngbModalRef.componentInstance.share = share;
this.ngbModalRef.result.then(
result => {
this.router.navigate(['/share', { outlets: { popup: null } }]);
this.ngbModalRef = null;
},
reason => {
this.router.navigate(['/share', { outlets: { popup: null } }]);
this.ngbModalRef = null;
}
);
}, 0);
});
}
ngOnDestroy() {
this.ngbModalRef = null;
}
}

View File

@ -1,45 +0,0 @@
<div class="row justify-content-center">
<div class="col-8">
<div *ngIf="share">
<h2><span jhiTranslate="hsadminNgApp.share.detail.title">Share</span> {{share.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="row-md jh-entity-details">
<dt><span jhiTranslate="hsadminNgApp.share.date">Date</span></dt>
<dd>
<span>{{share.date}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.share.action">Action</span></dt>
<dd>
<span jhiTranslate="{{'hsadminNgApp.ShareAction.' + share.action}}">{{share.action}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.share.quantity">Quantity</span></dt>
<dd>
<span>{{share.quantity}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.share.comment">Comment</span></dt>
<dd>
<span>{{share.comment}}</span>
</dd>
<dt><span jhiTranslate="hsadminNgApp.share.member">Member</span></dt>
<dd>
<div *ngIf="share.memberId">
<a [routerLink]="['/membership', share.memberId, 'view']">{{share.memberId}}</a>
</div>
</dd>
</dl>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon [icon]="'arrow-left'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.back"> Back</span>
</button>
<button type="button"
[routerLink]="['/share', share.id, 'edit']"
class="btn btn-primary">
<fa-icon [icon]="'pencil-alt'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.edit"> Edit</span>
</button>
</div>
</div>
</div>

View File

@ -1,24 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { IShare } from 'app/shared/model/share.model';
@Component({
selector: 'jhi-share-detail',
templateUrl: './share-detail.component.html'
})
export class ShareDetailComponent implements OnInit {
share: IShare;
constructor(protected activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.data.subscribe(({ share }) => {
this.share = share;
});
}
previousState() {
window.history.back();
}
}

View File

@ -1,93 +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-share-heading" jhiTranslate="hsadminNgApp.share.home.createOrEditLabel">Create or edit a Share</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group" [hidden]="!share.id">
<label for="id" jhiTranslate="global.field.id">ID</label>
<input type="text" class="form-control" id="id" name="id"
[(ngModel)]="share.id" readonly />
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.share.date" for="field_date">Date</label>
<div class="input-group">
<input id="field_date" type="text" class="form-control" name="date" ngbDatepicker #dateDp="ngbDatepicker" [(ngModel)]="share.date"
required/>
<span class="input-group-append">
<button type="button" class="btn btn-secondary" (click)="dateDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
</span>
</div>
<div [hidden]="!(editForm.controls.date?.dirty && editForm.controls.date?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.date?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.share.action" for="field_action">Action</label>
<select class="form-control" name="action" [(ngModel)]="share.action" id="field_action" required>
<option value="SUBSCRIPTION">{{'hsadminNgApp.ShareAction.SUBSCRIPTION' | translate}}</option>
<option value="CANCELLATION">{{'hsadminNgApp.ShareAction.CANCELLATION' | translate}}</option>
</select>
<div [hidden]="!(editForm.controls.action?.dirty && editForm.controls.action?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.action?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.share.quantity" for="field_quantity">Quantity</label>
<input type="number" class="form-control" name="quantity" id="field_quantity"
[(ngModel)]="share.quantity" required/>
<div [hidden]="!(editForm.controls.quantity?.dirty && editForm.controls.quantity?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.quantity?.errors?.required" jhiTranslate="entity.validation.required">
This field is required.
</small>
<small class="form-text text-danger"
[hidden]="!editForm.controls.quantity?.errors?.number" jhiTranslate="entity.validation.number">
This field should be a number.
</small>
</div>
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.share.comment" for="field_comment">Comment</label>
<input type="text" class="form-control" name="comment" id="field_comment"
[(ngModel)]="share.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.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>
</select>
</div>
<div [hidden]="!(editForm.controls.member?.dirty && editForm.controls.member?.invalid)">
<small class="form-text text-danger"
[hidden]="!editForm.controls.member?.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>&nbsp;<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>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
</button>
</div>
</form>
</div>
</div>

View File

@ -1,78 +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 * as moment from 'moment';
import { JhiAlertService } from 'ng-jhipster';
import { IShare } from 'app/shared/model/share.model';
import { ShareService } from './share.service';
import { IMembership } from 'app/shared/model/membership.model';
import { MembershipService } from 'app/entities/membership';
@Component({
selector: 'jhi-share-update',
templateUrl: './share-update.component.html'
})
export class ShareUpdateComponent implements OnInit {
share: IShare;
isSaving: boolean;
memberships: IMembership[];
dateDp: any;
constructor(
protected jhiAlertService: JhiAlertService,
protected shareService: ShareService,
protected membershipService: MembershipService,
protected activatedRoute: ActivatedRoute
) {}
ngOnInit() {
this.isSaving = false;
this.activatedRoute.data.subscribe(({ share }) => {
this.share = share;
});
this.membershipService
.query()
.pipe(
filter((mayBeOk: HttpResponse<IMembership[]>) => mayBeOk.ok),
map((response: HttpResponse<IMembership[]>) => response.body)
)
.subscribe((res: IMembership[]) => (this.memberships = res), (res: HttpErrorResponse) => this.onError(res.message));
}
previousState() {
window.history.back();
}
save() {
this.isSaving = true;
if (this.share.id !== undefined) {
this.subscribeToSaveResponse(this.shareService.update(this.share));
} else {
this.subscribeToSaveResponse(this.shareService.create(this.share));
}
}
protected subscribeToSaveResponse(result: Observable<HttpResponse<IShare>>) {
result.subscribe((res: HttpResponse<IShare>) => this.onSaveSuccess(), (res: HttpErrorResponse) => this.onSaveError());
}
protected onSaveSuccess() {
this.isSaving = false;
this.previousState();
}
protected onSaveError() {
this.isSaving = false;
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
trackMembershipById(index: number, item: IMembership) {
return item.id;
}
}

View File

@ -1,66 +0,0 @@
<div>
<h2 id="page-heading">
<span jhiTranslate="hsadminNgApp.share.home.title">Shares</span>
<button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-share" [routerLink]="['/share/new']">
<fa-icon [icon]="'plus'"></fa-icon>
<span jhiTranslate="hsadminNgApp.share.home.createLabel">
Create new Share
</span>
</button>
</h2>
<jhi-alert></jhi-alert>
<br/>
<div class="table-responsive" *ngIf="shares">
<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="date"><span jhiTranslate="hsadminNgApp.share.date">Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
<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></th>
</tr>
</thead>
<tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
<tr *ngFor="let share of shares ;trackBy: trackId">
<td><a [routerLink]="['/share', share.id, 'view' ]">{{share.id}}</a></td>
<td>{{share.date | date:'mediumDate'}}</td>
<td jhiTranslate="{{'hsadminNgApp.ShareAction.' + share.action}}">{{share.action}}</td>
<td>{{share.quantity}}</td>
<td>{{share.comment}}</td>
<td>
<div *ngIf="share.memberId">
<a [routerLink]="['../membership', share.memberId , 'view' ]" >{{share.memberId}}</a>
</div>
</td>
<td class="text-right">
<div class="btn-group flex-btn-group-container">
<button type="submit"
[routerLink]="['/share', share.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]="['/share', share.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]="['/', 'share', { outlets: { popup: share.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>

View File

@ -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 { IShare } from 'app/shared/model/share.model';
import { AccountService } from 'app/core';
import { ITEMS_PER_PAGE } from 'app/shared';
import { ShareService } from './share.service';
@Component({
selector: 'jhi-share',
templateUrl: './share.component.html'
})
export class ShareComponent implements OnInit, OnDestroy {
shares: IShare[];
currentAccount: any;
eventSubscriber: Subscription;
itemsPerPage: number;
links: any;
page: any;
predicate: any;
reverse: any;
totalItems: number;
constructor(
protected shareService: ShareService,
protected jhiAlertService: JhiAlertService,
protected eventManager: JhiEventManager,
protected parseLinks: JhiParseLinks,
protected accountService: AccountService
) {
this.shares = [];
this.itemsPerPage = ITEMS_PER_PAGE;
this.page = 0;
this.links = {
last: 0
};
this.predicate = 'id';
this.reverse = true;
}
loadAll() {
this.shareService
.query({
page: this.page,
size: this.itemsPerPage,
sort: this.sort()
})
.subscribe(
(res: HttpResponse<IShare[]>) => this.paginateShares(res.body, res.headers),
(res: HttpErrorResponse) => this.onError(res.message)
);
}
reset() {
this.page = 0;
this.shares = [];
this.loadAll();
}
loadPage(page) {
this.page = page;
this.loadAll();
}
ngOnInit() {
this.loadAll();
this.accountService.identity().then(account => {
this.currentAccount = account;
});
this.registerChangeInShares();
}
ngOnDestroy() {
this.eventManager.destroy(this.eventSubscriber);
}
trackId(index: number, item: IShare) {
return item.id;
}
registerChangeInShares() {
this.eventSubscriber = this.eventManager.subscribe('shareListModification', response => this.reset());
}
sort() {
const result = [this.predicate + ',' + (this.reverse ? 'asc' : 'desc')];
if (this.predicate !== 'id') {
result.push('id');
}
return result;
}
protected paginateShares(data: IShare[], 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.shares.push(data[i]);
}
}
protected onError(errorMessage: string) {
this.jhiAlertService.error(errorMessage, null, null);
}
}

View File

@ -1,34 +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 {
ShareComponent,
ShareDetailComponent,
ShareUpdateComponent,
ShareDeletePopupComponent,
ShareDeleteDialogComponent,
shareRoute,
sharePopupRoute
} from './';
const ENTITY_STATES = [...shareRoute, ...sharePopupRoute];
@NgModule({
imports: [HsadminNgSharedModule, RouterModule.forChild(ENTITY_STATES)],
declarations: [ShareComponent, ShareDetailComponent, ShareUpdateComponent, ShareDeleteDialogComponent, ShareDeletePopupComponent],
entryComponents: [ShareComponent, ShareUpdateComponent, ShareDeleteDialogComponent, ShareDeletePopupComponent],
providers: [{ provide: JhiLanguageService, useClass: JhiLanguageService }],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HsadminNgShareModule {
constructor(private languageService: JhiLanguageService, private languageHelper: JhiLanguageHelper) {
this.languageHelper.language.subscribe((languageKey: string) => {
if (languageKey !== undefined) {
this.languageService.changeLanguage(languageKey);
}
});
}
}

View File

@ -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 { Share } from 'app/shared/model/share.model';
import { ShareService } from './share.service';
import { ShareComponent } from './share.component';
import { ShareDetailComponent } from './share-detail.component';
import { ShareUpdateComponent } from './share-update.component';
import { ShareDeletePopupComponent } from './share-delete-dialog.component';
import { IShare } from 'app/shared/model/share.model';
@Injectable({ providedIn: 'root' })
export class ShareResolve implements Resolve<IShare> {
constructor(private service: ShareService) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<IShare> {
const id = route.params['id'] ? route.params['id'] : null;
if (id) {
return this.service.find(id).pipe(
filter((response: HttpResponse<Share>) => response.ok),
map((share: HttpResponse<Share>) => share.body)
);
}
return of(new Share());
}
}
export const shareRoute: Routes = [
{
path: '',
component: ShareComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.share.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/view',
component: ShareDetailComponent,
resolve: {
share: ShareResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.share.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: 'new',
component: ShareUpdateComponent,
resolve: {
share: ShareResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.share.home.title'
},
canActivate: [UserRouteAccessService]
},
{
path: ':id/edit',
component: ShareUpdateComponent,
resolve: {
share: ShareResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.share.home.title'
},
canActivate: [UserRouteAccessService]
}
];
export const sharePopupRoute: Routes = [
{
path: ':id/delete',
component: ShareDeletePopupComponent,
resolve: {
share: ShareResolve
},
data: {
authorities: ['ROLE_USER'],
pageTitle: 'hsadminNgApp.share.home.title'
},
canActivate: [UserRouteAccessService],
outlet: 'popup'
}
];

View File

@ -1,74 +0,0 @@
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 { IShare } from 'app/shared/model/share.model';
type EntityResponseType = HttpResponse<IShare>;
type EntityArrayResponseType = HttpResponse<IShare[]>;
@Injectable({ providedIn: 'root' })
export class ShareService {
public resourceUrl = SERVER_API_URL + 'api/shares';
constructor(protected http: HttpClient) {}
create(share: IShare): Observable<EntityResponseType> {
const copy = this.convertDateFromClient(share);
return this.http
.post<IShare>(this.resourceUrl, copy, { observe: 'response' })
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
}
update(share: IShare): Observable<EntityResponseType> {
const copy = this.convertDateFromClient(share);
return this.http
.put<IShare>(this.resourceUrl, copy, { observe: 'response' })
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
}
find(id: number): Observable<EntityResponseType> {
return this.http
.get<IShare>(`${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<IShare[]>(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(share: IShare): IShare {
const copy: IShare = Object.assign({}, share, {
date: share.date != null && share.date.isValid() ? share.date.format(DATE_FORMAT) : null
});
return copy;
}
protected convertDateFromServer(res: EntityResponseType): EntityResponseType {
if (res.body) {
res.body.date = res.body.date != null ? moment(res.body.date) : null;
}
return res;
}
protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType {
if (res.body) {
res.body.forEach((share: IShare) => {
share.date = share.date != null ? moment(share.date) : null;
});
}
return res;
}
}