Renommage du composant 'Home' en 'Dashboard'

This commit is contained in:
Julien Gautier
2023-10-03 16:28:03 +02:00
parent 340228e698
commit 2ccc9fc858
12 changed files with 65 additions and 63 deletions
@@ -125,54 +125,54 @@
<hr />
<h4 class="border-bottom border-secondary py-2 mb-2">Tableau des tailles de voile par poids</h4>
<table mat-table [dataSource]="canopy_size_table" matSort class="table table-striped table-dark table-hover mat-elevation-z2">
<!-- Numero Column -->
<!-- weight column -->
<ng-container matColumnDef="weight">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="first {{tableHeader[0].active}}"> {{tableHeader[0].name}} </th>
<th mat-cell *matCellDef="let element;" class="text-end ps-3 pe-4 fs-6" role="button" (click)="setCurrentWeight(element.weight)">
<span class="text-warn d-block">{{element.weight}}</span>
</th>
</ng-container>
<!-- range_ Column -->
<!-- range_1 column -->
<ng-container matColumnDef="range_1">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[1].active}}"> {{tableHeader[1].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[0].active}}">{{element.ranges[0].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_2 column -->
<ng-container matColumnDef="range_2">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[2].active}}"> {{tableHeader[2].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[1].active}}">{{element.ranges[1].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_3 column -->
<ng-container matColumnDef="range_3">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[3].active}}"> {{tableHeader[3].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[2].active}}">{{element.ranges[2].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_4 column -->
<ng-container matColumnDef="range_4">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[4].active}}"> {{tableHeader[4].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[3].active}}">{{element.ranges[3].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_5 column -->
<ng-container matColumnDef="range_5">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[5].active}}"> {{tableHeader[5].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[4].active}}">{{element.ranges[4].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_6 column -->
<ng-container matColumnDef="range_6">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[6].active}}"> {{tableHeader[6].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[5].active}}">{{element.ranges[5].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_7 column -->
<ng-container matColumnDef="range_7">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[7].active}}"> {{tableHeader[7].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[6].active}}">{{element.ranges[6].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_8 column -->
<ng-container matColumnDef="range_8">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[8].active}}"> {{tableHeader[8].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[7].active}}">{{element.ranges[7].value}}</td>
</ng-container>
<!-- range_ Column -->
<!-- range_9 column -->
<ng-container matColumnDef="range_9">
<th class="pl-3" mat-header-cell *matHeaderCellDef class="{{tableHeader[9].active}}"> {{tableHeader[9].name}} </th>
<td mat-cell *matCellDef="let element;" class="pl-3 text-nowrap fs-6 {{element.ranges[8].active}}">{{element.ranges[8].value}}</td>
@@ -186,11 +186,11 @@
</mat-card-content>
</mat-card>
</div>
<!--
<div class="content">
<h1>{{title}}</h1>
<div class="col-xs-12">
<div class="demo-buttons my-2">
<!-- primary buttons -->
<button mat-button color="primary" class="me-2">Texte</button>
<button mat-stroked-button color="primary" class="me-2">Texte Stroked</button>
<button mat-flat-button color="primary" class="me-2">Texte Flat</button>
@@ -206,7 +206,6 @@
</button>
</div>
<div class="demo-buttons my-2">
<!-- accent buttons -->
<button mat-button color="accent" class="me-2">Texte</button>
<button mat-stroked-button color="accent" class="me-2">Texte Stroked</button>
<button mat-flat-button color="accent" class="me-2">Texte Flat</button>
@@ -222,7 +221,6 @@
</button>
</div>
<div class="demo-buttons my-2">
<!-- warn buttons -->
<button mat-button color="warn" class="me-2">Texte</button>
<button mat-stroked-button color="warn" class="me-2">Texte Stroked</button>
<button mat-flat-button color="warn" class="me-2">Texte Flat</button>
@@ -238,7 +236,6 @@
</button>
</div>
<div class="demo-buttons my-2">
<!-- danger buttons -->
<button mat-button color="danger" class="me-2">Texte</button>
<button mat-stroked-button color="danger" class="me-2">Texte Stroked</button>
<button mat-flat-button color="danger" class="me-2">Texte Flat</button>
@@ -254,7 +251,6 @@
</button>
</div>
<div class="demo-buttons my-2">
<!-- info buttons -->
<button mat-button color="info" class="me-2">Texte</button>
<button mat-stroked-button color="info" class="me-2">Texte Stroked</button>
<button mat-flat-button color="info" class="me-2">Texte Flat</button>
@@ -270,7 +266,6 @@
</button>
</div>
<div class="demo-buttons my-2">
<!-- success buttons -->
<button mat-button color="success" class="me-2">Texte</button>
<button mat-stroked-button color="success" class="me-2">Texte Stroked</button>
<button mat-flat-button color="success" class="me-2">Texte Flat</button>
@@ -463,4 +458,5 @@
</div>
</div>
</section>
</div>
</div>
-->
@@ -1,13 +1,13 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
import { DashboardComponent } from './dashboard.component';
import { AuthResolver } from 'src/app/core/services';
const routes: Routes = [
{
path: '',
component: HomeComponent,
component: DashboardComponent,
resolve: {
isAuthenticated: AuthResolver
}
@@ -18,4 +18,4 @@ const routes: Routes = [
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class HomeRoutingModule { }
export class DashboardRoutingModule { }
@@ -1,16 +1,16 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
import { DashboardComponent } from './dashboard.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [HomeComponent]
declarations: [DashboardComponent]
});
fixture = TestBed.createComponent(HomeComponent);
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
@@ -6,7 +6,8 @@ import { Observable, Subscription } from 'rxjs';
import { take } from 'rxjs/operators';
import { User, Errors, Aeronef, AeronefByImat, Canopy, CanopyModelBySize, DropZone, DropZoneByYear } from 'src/app/core/models';
import { AeronefsService, CanopiesService, DropZonesService, UserService } from 'src/app/core/services';
//import { AeronefsService, CanopiesService, DropZonesService, UserService } from 'src/app/core/services';
import { UserService } from 'src/app/core/services';
import { ShowAuthedDirective } from 'src/app/components/shared/show-authed.directive';
import {
AeronefsComponent, AeronefsBarComponent,
@@ -24,16 +25,18 @@ import {
DropZonesComponent, DropZonesBarComponent,
JumpsByMonthComponent
],
selector: 'huapp-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
selector: 'huapp-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class HomeComponent implements OnInit, OnDestroy {
export class DashboardComponent implements OnInit, OnDestroy {
private _currentUser: Subscription = new Subscription();
private _data: Subscription = new Subscription();
/*
private _aeronefs: Subscription = new Subscription();
private _canopies: Subscription = new Subscription();
private _dropzones: Subscription = new Subscription();
*/
title = 'Dashboard';
errors!: Errors;
isAuthenticated = false;
@@ -45,7 +48,7 @@ export class HomeComponent implements OnInit, OnDestroy {
canopyAggregate!: Array<CanopyModelBySize>;
canopies!: Array<Canopy>;
canopiesCount = 0;
dropzoneAggregate!: Array<DropZoneByYear>; // Array<DropZoneByOaci>
dropzoneAggregate!: Array<DropZoneByYear>;
dropzones!: Array<DropZone>;
dropzonesCount = 0;
@@ -53,10 +56,12 @@ export class HomeComponent implements OnInit, OnDestroy {
private route: ActivatedRoute,
private router: Router,
private titleService: Title,
private userService: UserService,
private userService: UserService
/*
private aeronefsService: AeronefsService,
private canopiesService: CanopiesService,
private dropzonesService: DropZonesService
*/
) {
this._resetErrors();
}
@@ -85,6 +90,7 @@ export class HomeComponent implements OnInit, OnDestroy {
ngOnDestroy() {
this._currentUser.unsubscribe();
this._data.unsubscribe();
/*
this._aeronefs.unsubscribe();
this._canopies.unsubscribe();
@@ -96,6 +102,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this.errors = { errors: {} };
}
/*
private _loadAeronefs(): void {
const aeronefs$: Observable<Array<AeronefByImat>> = this.aeronefsService.getAllByImat();
this._aeronefs = aeronefs$.subscribe((aggregate: Array<AeronefByImat>) => {
@@ -117,8 +124,6 @@ export class HomeComponent implements OnInit, OnDestroy {
}
private _loadDropzones(): void {
//const dropzones$: Observable<Array<DropZoneByOaci>> = this.dropzonesService.getAllByOaci();
//this._dropzones = dropzones$.subscribe((aggregate: Array<DropZoneByOaci>) => {
const dropzones$: Observable<Array<DropZoneByYear>> = this.dropzonesService.getAllByDate();
this._dropzones = dropzones$.subscribe((aggregate: Array<DropZoneByYear>) => {
this.dropzoneAggregate = aggregate;
@@ -127,4 +132,5 @@ export class HomeComponent implements OnInit, OnDestroy {
console.log(this.dropzonesCount);
});
}
*/
}
@@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { AuthResolver } from 'src/app/core/services';
import { DashboardComponent } from './dashboard.component';
import { DashboardRoutingModule } from './dashboard-routing.module';
@NgModule({
imports: [
DashboardRoutingModule,
DashboardComponent
],
exports: [],
providers: [AuthResolver]
})
export class DashboardModule { }
-15
View File
@@ -1,15 +0,0 @@
import { NgModule } from '@angular/core';
import { AuthResolver } from 'src/app/core/services';
import { HomeComponent } from './home.component';
import { HomeRoutingModule } from './home-routing.module';
@NgModule({
imports: [
HomeRoutingModule,
HomeComponent
],
exports: [],
providers: [AuthResolver]
})
export class HomeModule { }
+1 -1
View File
@@ -1,6 +1,6 @@
export * from './auth/auth.component';
export * from './calculator/calculator.component';
export * from './home/home.component';
export * from './dashboard/dashboard.component';
export * from './logbook/logbook.component';
export * from './profile/profile.component';
export * from './shared';