New popin for the jump infos
This commit is contained in:
@@ -52,7 +52,6 @@ import { MatTabsModule } from "@angular/material/tabs";
|
|||||||
import { MatDialogModule } from "@angular/material/dialog";
|
import { MatDialogModule } from "@angular/material/dialog";
|
||||||
import { MatCardModule } from "@angular/material/card";
|
import { MatCardModule } from "@angular/material/card";
|
||||||
import { MatRadioModule } from "@angular/material/radio";
|
import { MatRadioModule } from "@angular/material/radio";
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
||||||
|
|
||||||
import { CachingInterceptor } from "../interceptor/caching.interceptor";
|
import { CachingInterceptor } from "../interceptor/caching.interceptor";
|
||||||
//import { BasicAuthInterceptor } from '../interceptor/basic-auth.interceptor';
|
//import { BasicAuthInterceptor } from '../interceptor/basic-auth.interceptor';
|
||||||
@@ -60,6 +59,7 @@ import { JwtAuthInterceptor } from "../interceptor/jwt-auth.interceptor";
|
|||||||
import { ErrorInterceptor } from "../interceptor/error.interceptor";
|
import { ErrorInterceptor } from "../interceptor/error.interceptor";
|
||||||
import { UserProfileComponent } from "./user-profile/user-profile.component";
|
import { UserProfileComponent } from "./user-profile/user-profile.component";
|
||||||
import { ListOfImagesComponent } from "./list-of-images/list-of-images.component";
|
import { ListOfImagesComponent } from "./list-of-images/list-of-images.component";
|
||||||
|
import { JumpInfosComponent } from './jump-infos/jump-infos.component';
|
||||||
|
|
||||||
const appRoutes: Routes = [
|
const appRoutes: Routes = [
|
||||||
{ path: "", component: DefaultComponent, canActivate: [AuthGuardService] },
|
{ path: "", component: DefaultComponent, canActivate: [AuthGuardService] },
|
||||||
@@ -130,6 +130,7 @@ const appRoutes: Routes = [
|
|||||||
LoginUserComponent,
|
LoginUserComponent,
|
||||||
UserProfileComponent,
|
UserProfileComponent,
|
||||||
ListOfImagesComponent,
|
ListOfImagesComponent,
|
||||||
|
JumpInfosComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoot(
|
RouterModule.forRoot(
|
||||||
@@ -157,8 +158,7 @@ const appRoutes: Routes = [
|
|||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatRadioModule,
|
MatRadioModule
|
||||||
MatTooltipModule
|
|
||||||
],
|
],
|
||||||
exports: [HttpClientModule],
|
exports: [HttpClientModule],
|
||||||
providers: [
|
providers: [
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<p><span>Gear : {{data.gear.mainCanopy}} ({{data.gear.mainCanopy}})</span></p>
|
||||||
|
<p><span>Cutaway : {{data.withCutaway}}</span></p>
|
||||||
|
<p><span>Notes : {{data.notes}}</span></p>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { JumpInfosComponent } from './jump-infos.component';
|
||||||
|
|
||||||
|
describe('JumpInfosComponent', () => {
|
||||||
|
let component: JumpInfosComponent;
|
||||||
|
let fixture: ComponentFixture<JumpInfosComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ JumpInfosComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(JumpInfosComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
|
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||||
|
|
||||||
|
import { JumpResp } from '../../models/jump';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-jump-infos',
|
||||||
|
templateUrl: './jump-infos.component.html',
|
||||||
|
styleUrls: ['./jump-infos.component.css']
|
||||||
|
})
|
||||||
|
export class JumpInfosComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(@Inject(MAT_DIALOG_DATA) public data: JumpResp) {}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,28 +7,7 @@
|
|||||||
<th mat-header-cell *matHeaderCellDef></th>
|
<th mat-header-cell *matHeaderCellDef></th>
|
||||||
<td mat-cell *matCellDef="let element" style="text-align: left;">
|
<td mat-cell *matCellDef="let element" style="text-align: left;">
|
||||||
<mat-icon aria-hidden="false" aria-label="All informations of the jump" style="cursor: pointer;"
|
<mat-icon aria-hidden="false" aria-label="All informations of the jump" style="cursor: pointer;"
|
||||||
#tooltip="matTooltip" matTooltip="Tooltips in Angular" matTooltipPosition="above"
|
(click)='openDialog(element)'>info</mat-icon>
|
||||||
(click)="tooltip.toggle()">info</mat-icon>
|
|
||||||
|
|
||||||
<ng-template #popinContent>
|
|
||||||
<span>
|
|
||||||
Gear : {{element.gear.mainCanopy}} ({{element.gear.mainCanopy}})
|
|
||||||
<br>Cutaway : {{element.withCutaway}}
|
|
||||||
<br>Notes : {{element.notes}}
|
|
||||||
</span>
|
|
||||||
</ng-template>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
(mouseover)='showPopin($event, element)'
|
|
||||||
(mouseout)='hidePopin($event, element)'
|
|
||||||
|
|
||||||
<div [ngClass]="calculateClasses(element)" style="display: none;">
|
|
||||||
<span>
|
|
||||||
Gear : {{element.gear.mainCanopy}} ({{element.gear.mainCanopy}})
|
|
||||||
<br>Cutaway : {{element.withCutaway}}
|
|
||||||
<br>Notes : {{element.notes}}</span>
|
|
||||||
</div> -->
|
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { MatPaginator } from '@angular/material/paginator';
|
import { MatPaginator } from '@angular/material/paginator';
|
||||||
import { MatTableDataSource } from '@angular/material/table';
|
import { MatTableDataSource } from '@angular/material/table';
|
||||||
|
import { MatDialog } from "@angular/material/dialog";
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { JumpResp } from '../../models/jump';
|
import { JumpResp } from '../../models/jump';
|
||||||
import { JumpService } from '../../services/jump.service';
|
import { JumpService } from '../../services/jump.service';
|
||||||
import { ServiceComm } from '../../services/service-comm.service';
|
import { ServiceComm } from '../../services/service-comm.service';
|
||||||
|
import { JumpInfosComponent } from "../jump-infos/jump-infos.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-list-of-jumps',
|
selector: 'app-list-of-jumps',
|
||||||
@@ -29,7 +31,8 @@ export class ListOfJumpsComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private serviceApi: JumpService,
|
private serviceApi: JumpService,
|
||||||
private serviceComm: ServiceComm
|
private serviceComm: ServiceComm,
|
||||||
|
public dialog: MatDialog
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -60,6 +63,16 @@ export class ListOfJumpsComponent implements OnInit {
|
|||||||
calculateClasses(item) {
|
calculateClasses(item) {
|
||||||
return {
|
return {
|
||||||
'showPopin': this.showPopinForItemId != -1 && item.id === this.showPopinForItemId,
|
'showPopin': this.showPopinForItemId != -1 && item.id === this.showPopinForItemId,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
openDialog(item: JumpResp) {
|
||||||
|
this.dialog.open(JumpInfosComponent, {
|
||||||
|
data: item,
|
||||||
|
position: {
|
||||||
|
top: '0px',
|
||||||
|
left: '0px'
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user