diff --git a/src/main/webapp/app/entities/entity.module.ts b/src/main/webapp/app/entities/entity.module.ts index 261a460..b583b5c 100644 --- a/src/main/webapp/app/entities/entity.module.ts +++ b/src/main/webapp/app/entities/entity.module.ts @@ -12,6 +12,13 @@ import { RouterModule } from '@angular/router'; pageTitle: 'Tables SI', }, }, + { + path: 'timecardsreporting', + loadChildren: () => import('./timecardsreporting/timecardsreporting.module').then(m => m.TimeCardsReportingModule), + data: { + pageTitle: 'TimeCards Reporting', + }, + }, ]), ], }) diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-delete-dialog.component.html b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-delete-dialog.component.html new file mode 100644 index 0000000..b013bb0 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-delete-dialog.component.html @@ -0,0 +1,23 @@ +
+ + + + + +
diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-delete-dialog.component.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-delete-dialog.component.ts new file mode 100644 index 0000000..028bbc7 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-delete-dialog.component.ts @@ -0,0 +1,31 @@ +import { Component } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { JhiEventManager } from 'ng-jhipster'; + +import { TimeCardsReporting } from './timecardsreporting.model'; +import { TimeCardsReportingService } from './timecardsreporting.service'; + +@Component({ + selector: 'jhi-timecardsreporting-delete-dialog', + templateUrl: './timecardsreporting-delete-dialog.component.html', +}) +export class TimeCardsReportingDeleteDialogComponent { + timeCardsReporting?: TimeCardsReporting; + + constructor( + private timeCardsReportingService: TimeCardsReportingService, + public activeModal: NgbActiveModal, + private eventManager: JhiEventManager + ) {} + + cancel(): void { + this.activeModal.dismiss(); + } + + confirmDelete(id: string): void { + this.timeCardsReportingService.delete(id).subscribe(() => { + this.eventManager.broadcast('timeCardsReportingListModification'); + this.activeModal.close(); + }); + } +} diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-detail.component.html b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-detail.component.html new file mode 100644 index 0000000..f048a28 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-detail.component.html @@ -0,0 +1,30 @@ +
+
+
+

+ TimeCards Reporting [{{ timeCardsReporting.id }}] +

+ +
+
Id
+
{{ timeCardsReporting.id }}
+ +
Nome
+
{{ timeCardsReporting.year }}
+ +
Operazioni
+
{{ timeCardsReporting.month }}
+ +
Id Flusso
+
{{ timeCardsReporting.idFlusso }}
+ +
Last Updated
+
{{ timeCardsReporting.lastUpdate }}
+
+ + +
+
+
diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-detail.component.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-detail.component.ts new file mode 100644 index 0000000..db10438 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-detail.component.ts @@ -0,0 +1,18 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { TimeCardsReporting } from './timecardsreporting.model'; + +@Component({ + selector: 'jhi-timecardsreporting-detail', + templateUrl: './timecardsreporting-detail.component.html', +}) +export class TimeCardsReportingDetailComponent implements OnInit { + timeCardsReporting: TimeCardsReporting | null = null; + + constructor(private route: ActivatedRoute) {} + + ngOnInit(): void { + this.route.data.subscribe(({ timeCardsReporting }) => (this.timeCardsReporting = timeCardsReporting)); + } +} diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-update.component.html b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-update.component.html new file mode 100644 index 0000000..6acc6a2 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-update.component.html @@ -0,0 +1,81 @@ +
+
+
+

+ Create or edit TimeCards Reporting +

+ +
+ + +
+ + +
+ +
+ + + +
+ + This field is required. + +
+
+ +
+ + + +
+ + This field is required. + +
+
+ +
+ + + +
+ + This field is required. + +
+
+ +
+ + + +
+ + This field is required. + +
+
+
+ +
+ + + +
+
+
+
diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-update.component.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-update.component.ts new file mode 100644 index 0000000..a03a377 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting-update.component.ts @@ -0,0 +1,80 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; + +import { TimeCardsReporting } from './timecardsreporting.model'; +import { TimeCardsReportingService } from './timecardsreporting.service'; + +@Component({ + selector: 'jhi-timecardsreporting-update', + templateUrl: './timecardsreporting-update.component.html', +}) +export class TimeCardsReportingUpdateComponent implements OnInit { + timeCardsReporting!: TimeCardsReporting; + isSaving = false; + + editForm = this.fb.group({ + id: [], + year: ['', [Validators.required]], + month: ['', [Validators.required]], + idFlusso: ['', [Validators.required]], + lastUpdate: ['', [Validators.required]], + }); + + constructor(private timeCardsReportingService: TimeCardsReportingService, private route: ActivatedRoute, private fb: FormBuilder) {} + + ngOnInit(): void { + this.route.data.subscribe(({ timeCardsReporting }) => { + if (timeCardsReporting) { + this.timeCardsReporting = timeCardsReporting; + this.updateForm(timeCardsReporting); + } + }); + } + + previousState(): void { + window.history.back(); + } + + save(): void { + this.isSaving = true; + this.updateTimeCardsReporting(this.timeCardsReporting); + if (this.timeCardsReporting.id !== undefined) { + this.timeCardsReportingService.update(this.timeCardsReporting).subscribe( + () => this.onSaveSuccess(), + () => this.onSaveError() + ); + } else { + this.timeCardsReportingService.create(this.timeCardsReporting).subscribe( + () => this.onSaveSuccess(), + () => this.onSaveError() + ); + } + } + + private updateForm(timeCardsReporting: TimeCardsReporting): void { + this.editForm.patchValue({ + id: timeCardsReporting.id, + year: timeCardsReporting.year, + month: timeCardsReporting.month, + idFlusso: timeCardsReporting.idFlusso, + lastUpdate: timeCardsReporting.lastUpdate, + }); + } + + private updateTimeCardsReporting(timeCardsReporting: TimeCardsReporting): void { + timeCardsReporting.year = this.editForm.get(['year'])!.value; + timeCardsReporting.month = this.editForm.get(['month'])!.value; + timeCardsReporting.idFlusso = this.editForm.get(['idFlusso'])!.value; + timeCardsReporting.lastUpdate = this.editForm.get(['lastUpdate'])!.value; + } + + private onSaveSuccess(): void { + this.isSaving = false; + this.previousState(); + } + + private onSaveError(): void { + this.isSaving = false; + } +} diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.component.html b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.component.html new file mode 100644 index 0000000..390531b --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.component.html @@ -0,0 +1,75 @@ +
+

+ TimeCards Reporting + + +

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
ID AnnoMeseID FlussoLast Update
{{ timecardsreporting.id }}{{ timecardsreporting.year }}{{ timecardsreporting.month }}{{ timecardsreporting.idFlusso }}{{ timecardsreporting.lastUpdate }} +
+ + + +
+
+
+ +
+
+ +
+ +
+ +
+
+
diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.component.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.component.ts new file mode 100644 index 0000000..8135c81 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.component.ts @@ -0,0 +1,102 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { HttpResponse, HttpHeaders } from '@angular/common/http'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { Subscription, combineLatest } from 'rxjs'; +import { ActivatedRoute, ParamMap, Router, Data } from '@angular/router'; +import { JhiEventManager } from 'ng-jhipster'; + +import { ITEMS_PER_PAGE } from 'app/shared/constants/pagination.constants'; +// import { AccountService } from 'app/core/auth/account.service'; +// import { Account } from 'app/core/user/account.model'; +import { TimeCardsReportingService } from './timecardsreporting.service'; +import { TimeCardsReporting } from './timecardsreporting.model'; +import { TimeCardsReportingDeleteDialogComponent } from './timecardsreporting-delete-dialog.component'; + +@Component({ + selector: 'jhi-timecardsreporting', + templateUrl: './timecardsreporting.component.html', +}) +export class TimeCardsReportingComponent implements OnInit, OnDestroy { + // currentAccount: Account | null = null; + timecardsreportings: TimeCardsReporting[] | null = null; + timeCardsReportingListSubscription?: Subscription; + totalItems = 0; + itemsPerPage = ITEMS_PER_PAGE; + page!: number; + predicate!: string; + ascending!: boolean; + + constructor( + private timeCardsReportingService: TimeCardsReportingService, + // private accountService: AccountService, + private activatedRoute: ActivatedRoute, + private router: Router, + private eventManager: JhiEventManager, + private modalService: NgbModal + ) {} + + ngOnInit(): void { + // this.accountService.identity().subscribe(account => (this.currentAccount = account)); + this.timeCardsReportingListSubscription = this.eventManager.subscribe('timeCardsReportingListModification', () => this.loadAll()); + this.handleNavigation(); + } + + ngOnDestroy(): void { + if (this.timeCardsReportingListSubscription) { + this.eventManager.destroy(this.timeCardsReportingListSubscription); + } + } + + trackIdentity(index: number, item: TimeCardsReporting): any { + return item.id; + } + + deleteTimeCardsReporting(timeCardsReporting: TimeCardsReporting): void { + const modalRef = this.modalService.open(TimeCardsReportingDeleteDialogComponent, { size: 'lg', backdrop: 'static' }); + modalRef.componentInstance.timeCardsReporting = timeCardsReporting; + } + + transition(): void { + this.router.navigate(['./'], { + relativeTo: this.activatedRoute.parent, + queryParams: { + page: this.page, + sort: this.predicate + ',' + (this.ascending ? 'asc' : 'desc'), + }, + }); + } + + private handleNavigation(): void { + combineLatest(this.activatedRoute.data, this.activatedRoute.queryParamMap, (data: Data, params: ParamMap) => { + const page = params.get('page'); + this.page = page !== null ? +page : 1; + const sort = (params.get('sort') ?? data['defaultSort']).split(','); + this.predicate = sort[0]; + this.ascending = sort[1] === 'asc'; + this.loadAll(); + }).subscribe(); + } + + private loadAll(): void { + this.timeCardsReportingService + .query({ + page: this.page - 1, + size: this.itemsPerPage, + sort: this.sort(), + }) + .subscribe((res: HttpResponse) => this.onSuccess(res.body, res.headers)); + } + + private sort(): string[] { + const result = [this.predicate + ',' + (this.ascending ? 'asc' : 'desc')]; + if (this.predicate !== 'id') { + result.push('id'); + } + return result; + } + + private onSuccess(timecardsreportings: TimeCardsReporting[] | null, headers: HttpHeaders): void { + this.totalItems = Number(headers.get('X-Total-Count')); + this.timecardsreportings = timecardsreportings; + } +} diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.model.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.model.ts new file mode 100644 index 0000000..8bb6639 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.model.ts @@ -0,0 +1,11 @@ +export interface ITimeCardsReporting { + id?: any; + year?: any; + month?: any; + idFlusso?: any; + lastUpdate?: string; +} + +export class TimeCardsReporting implements ITimeCardsReporting { + constructor(public id?: any, public year?: any, public month?: any, public idFlusso?: any, public lastUpdate?: string) {} +} diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.module.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.module.ts new file mode 100644 index 0000000..e2be98b --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { EpasmedSharedModule } from 'app/shared/shared.module'; +import { TimeCardsReportingComponent } from './timecardsreporting.component'; +import { TimeCardsReportingDetailComponent } from './timecardsreporting-detail.component'; +import { TimeCardsReportingUpdateComponent } from './timecardsreporting-update.component'; +import { TimeCardsReportingDeleteDialogComponent } from './timecardsreporting-delete-dialog.component'; +import { timeCardsReportingRoute } from './timecardsreporting.route'; + +@NgModule({ + imports: [EpasmedSharedModule, RouterModule.forChild(timeCardsReportingRoute)], + declarations: [ + TimeCardsReportingComponent, + TimeCardsReportingDetailComponent, + TimeCardsReportingUpdateComponent, + TimeCardsReportingDeleteDialogComponent, + ], + entryComponents: [TimeCardsReportingComponent], +}) +export class TimeCardsReportingModule {} diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.route.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.route.ts new file mode 100644 index 0000000..4e03981 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.route.ts @@ -0,0 +1,53 @@ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot, Routes } from '@angular/router'; +import { Observable, of } from 'rxjs'; + +import { TimeCardsReporting, ITimeCardsReporting } from './timecardsreporting.model'; +import { TimeCardsReportingService } from './timecardsreporting.service'; +import { TimeCardsReportingComponent } from './timecardsreporting.component'; +import { TimeCardsReportingDetailComponent } from './timecardsreporting-detail.component'; +import { TimeCardsReportingUpdateComponent } from './timecardsreporting-update.component'; + +@Injectable({ providedIn: 'root' }) +export class TimeCardsReportingResolve implements Resolve { + constructor(private service: TimeCardsReportingService) {} + + resolve(route: ActivatedRouteSnapshot): Observable { + const id = route.params['id']; + if (id) { + return this.service.find(id); + } + return of(new TimeCardsReporting()); + } +} + +export const timeCardsReportingRoute: Routes = [ + { + path: '', + component: TimeCardsReportingComponent, + data: { + defaultSort: 'id,asc', + }, + }, + { + path: ':id/view', + component: TimeCardsReportingDetailComponent, + resolve: { + timeCardsReporting: TimeCardsReportingResolve, + }, + }, + { + path: 'new', + component: TimeCardsReportingUpdateComponent, + resolve: { + timeCardsReporting: TimeCardsReportingResolve, + }, + }, + { + path: ':id/edit', + component: TimeCardsReportingUpdateComponent, + resolve: { + timeCardsReporting: TimeCardsReportingResolve, + }, + }, +]; diff --git a/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.service.ts b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.service.ts new file mode 100644 index 0000000..2d6d6f0 --- /dev/null +++ b/src/main/webapp/app/entities/timecardsreporting/timecardsreporting.service.ts @@ -0,0 +1,35 @@ +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, Pagination } from 'app/shared/util/request-util'; +import { ITimeCardsReporting } from './timecardsreporting.model'; + +@Injectable({ providedIn: 'root' }) +export class TimeCardsReportingService { + public resourceUrl = SERVER_API_URL + 'api/timecardsreporting'; + + constructor(private http: HttpClient) {} + + query(req?: Pagination): Observable> { + const options = createRequestOption(req); + return this.http.get(this.resourceUrl, { params: options, observe: 'response' }); + } + + create(timecardsreporting: ITimeCardsReporting): Observable { + return this.http.post(this.resourceUrl, timecardsreporting); + } + + update(timecardsreporting: ITimeCardsReporting): Observable { + return this.http.put(this.resourceUrl, timecardsreporting); + } + + find(id: string): Observable { + return this.http.get(`${this.resourceUrl}/${id}`); + } + + delete(id: string): Observable<{}> { + return this.http.delete(`${this.resourceUrl}/${id}`); + } +} diff --git a/src/main/webapp/app/layouts/navbar/navbar.component.html b/src/main/webapp/app/layouts/navbar/navbar.component.html index c9a1061..5669414 100644 --- a/src/main/webapp/app/layouts/navbar/navbar.component.html +++ b/src/main/webapp/app/layouts/navbar/navbar.component.html @@ -33,6 +33,10 @@ Tabs SI + + + TimeCards Reporting +