Un de syle sur la liste des DZs

This commit is contained in:
Sébastien André
2020-07-29 13:22:19 +02:00
parent a755d5f362
commit 1e3e728fdd
4 changed files with 29 additions and 32 deletions

View File

@@ -4,8 +4,8 @@
<table mat-table [dataSource]="dataSourceTable"> <table mat-table [dataSource]="dataSourceTable">
<ng-container matColumnDef="isfavorite"> <ng-container matColumnDef="isfavorite">
<th mat-header-cell *matHeaderCellDef></th> <th mat-header-cell *matHeaderCellDef style="min-width: 144px;"></th>
<td mat-cell *matCellDef="let element" style="text-align: center;"> <td mat-cell *matCellDef="let element" style="text-align: left;">
<mat-icon aria-hidden="false" aria-label="Favorit" *ngIf="element.isFavorite === true" <mat-icon aria-hidden="false" aria-label="Favorit" *ngIf="element.isFavorite === true"
(click)="removeToFavorite(element)">favorite</mat-icon> (click)="removeToFavorite(element)">favorite</mat-icon>
<mat-icon aria-hidden="false" aria-label="Not favorite" *ngIf="element.isFavorite === false" <mat-icon aria-hidden="false" aria-label="Not favorite" *ngIf="element.isFavorite === false"
@@ -18,6 +18,9 @@
target="_blank"> target="_blank">
<mat-icon aria-hidden="false" aria-label="Location of the DZ">map</mat-icon> <mat-icon aria-hidden="false" aria-label="Location of the DZ">map</mat-icon>
</a> </a>
<a href="mailto:{{element.email}}" *ngIf="element.email">
<mat-icon aria-hidden="false" aria-label="Contact mail of the DZ">mail_outline</mat-icon>
</a>
</td> </td>
</ng-container> </ng-container>
@@ -39,10 +42,7 @@
<span class="spanWithBreakWord" [innerHTML]="element.address"></span> <span class="spanWithBreakWord" [innerHTML]="element.address"></span>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="email">
<th mat-header-cell *matHeaderCellDef>E-mail</th>
<td mat-cell *matCellDef="let element">{{element.email}}</td>
</ng-container>
<ng-container matColumnDef="type"> <ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef>Type</th> <th mat-header-cell *matHeaderCellDef>Type</th>
<td mat-cell *matCellDef="let element">{{element.type}}</td> <td mat-cell *matCellDef="let element">{{element.type}}</td>

View File

@@ -1,27 +1,26 @@
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 { MatDialog } from '@angular/material/dialog';
import { AddAction } from "../../models/add-action.enum"; import { AddAction } from '../../models/add-action.enum';
import { DropZoneResp } from "../../models/dropzone"; import { DropZoneResp } from '../../models/dropzone';
import { DropzoneService } from "../../services/dropzone.service"; import { DropzoneService } from '../../services/dropzone.service';
import { ServiceComm } from "../../services/service-comm.service"; import { ServiceComm } from '../../services/service-comm.service';
import { NewDropZoneComponent } from "../new-drop-zone/new-drop-zone.component"; import { NewDropZoneComponent } from '../new-drop-zone/new-drop-zone.component';
@Component({ @Component({
selector: "app-list-of-dzs", selector: 'app-list-of-dzs',
templateUrl: "./list-of-dzs.component.html", templateUrl: './list-of-dzs.component.html',
styleUrls: ["./list-of-dzs.component.css"], styleUrls: ['./list-of-dzs.component.css'],
}) })
export class ListOfDzsComponent implements OnInit { export class ListOfDzsComponent implements OnInit {
public displayedColumns: Array<string> = [ public displayedColumns: Array<string> = [
"isfavorite", 'isfavorite',
"id", 'id',
"name", 'name',
"address", 'address',
"email", 'type',
"type",
]; ];
public dataSourceTable: MatTableDataSource<DropZoneResp>; public dataSourceTable: MatTableDataSource<DropZoneResp>;
public resultsLength = 0; public resultsLength = 0;
@@ -31,7 +30,7 @@ export class ListOfDzsComponent implements OnInit {
private serviceApi: DropzoneService, private serviceApi: DropzoneService,
private serviceComm: ServiceComm, private serviceComm: ServiceComm,
public dialog: MatDialog public dialog: MatDialog
) {} ) { }
ngOnInit() { ngOnInit() {
this.serviceComm.refreshRequest.subscribe((action) => { this.serviceComm.refreshRequest.subscribe((action) => {
@@ -40,7 +39,7 @@ export class ListOfDzsComponent implements OnInit {
this.getListOfDropZones(); this.getListOfDropZones();
} }
}); });
this.serviceComm.UpdatedComponentTitle("List of DZs"); this.serviceComm.UpdatedComponentTitle('List of DZs');
this.getListOfDropZones(); this.getListOfDropZones();
} }
@@ -73,8 +72,8 @@ export class ListOfDzsComponent implements OnInit {
openDialogToAdd() { openDialogToAdd() {
this.dialog.open(NewDropZoneComponent, { this.dialog.open(NewDropZoneComponent, {
height: "400px", height: '400px',
width: "600px", width: '600px',
}); });
} }
} }

View File

@@ -5,10 +5,10 @@
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<mat-tab-group mat-align-tabs="center" animationDuration="0ms"> <mat-tab-group mat-align-tabs="center" animationDuration="0ms">
<mat-tab label="Login with a user"> <mat-tab label="Login with a user" tabIndex="-1">
<app-login-user></app-login-user> <app-login-user></app-login-user>
</mat-tab> </mat-tab>
<mat-tab label="Create and login a user"> <mat-tab label="Create and login a user" tabIndex="-1">
<app-create-user></app-create-user> <app-create-user></app-create-user>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>

View File

@@ -1,5 +1,3 @@
/* @import 'bootstrap-4.3.1.min.css'; */
html, html,
body { body {
min-height: 100vh; min-height: 100vh;