-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
171 additions
and
1 deletion.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
front-end/src/app/synthesis-interface/dialogs/filter-dialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<h2 mat-dialog-title>Filtrer</h2> | ||
<mat-dialog-content> | ||
<div> | ||
<mat-form-field> | ||
<mat-label>Types d'observation</mat-label> | ||
<mat-select [formControl]="observationTypesForm" multiple> | ||
@for (observationType of observationTypes; track observationType.id) { | ||
<mat-option [value]="observationType" | ||
>{{observationType.name}}</mat-option | ||
> | ||
} | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
<div> | ||
<mat-form-field> | ||
<mat-label>Date</mat-label> | ||
<mat-date-range-input | ||
[formGroup]="observationsDates" | ||
[rangePicker]="observationsDatesPicker" | ||
> | ||
<input | ||
matStartDate | ||
placeholder="Date de début" | ||
formControlName="start" | ||
/> | ||
<input matEndDate placeholder="Date de fin" formControlName="end" /> | ||
</mat-date-range-input> | ||
<mat-datepicker-toggle | ||
matIconSuffix | ||
[for]="observationsDatesPicker" | ||
></mat-datepicker-toggle> | ||
<mat-date-range-picker #observationsDatesPicker></mat-date-range-picker> | ||
</mat-form-field> | ||
</div> | ||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<button mat-button (click)="filterCancel()">Annuler</button> | ||
<button mat-button (click)="filterConfirm()" cdkFocusInitial> | ||
Confirmer | ||
</button> | ||
</mat-dialog-actions> |
3 changes: 3 additions & 0 deletions
3
front-end/src/app/synthesis-interface/dialogs/filter-dialog.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.mat-mdc-form-field { | ||
width: 100%; | ||
} |
56 changes: 56 additions & 0 deletions
56
front-end/src/app/synthesis-interface/dialogs/filter-dialog.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; | ||
import { | ||
FormControl, | ||
FormGroup, | ||
FormsModule, | ||
ReactiveFormsModule, | ||
} from '@angular/forms'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { | ||
MatDialogActions, | ||
MatDialogClose, | ||
MatDialogContent, | ||
MatDialogRef, | ||
MatDialogTitle, | ||
} from '@angular/material/dialog'; | ||
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { MatSelectModule } from '@angular/material/select'; | ||
|
||
import observationsTypes from './types.json'; | ||
import { MatDatepickerModule } from '@angular/material/datepicker'; | ||
|
||
@Component({ | ||
selector: 'filter-dialog', | ||
templateUrl: 'filter-dialog.html', | ||
standalone: true, | ||
imports: [ | ||
MatButtonModule, | ||
MatDialogActions, | ||
MatDialogClose, | ||
MatDialogTitle, | ||
MatDialogContent, | ||
MatFormFieldModule, | ||
MatSelectModule, | ||
FormsModule, | ||
ReactiveFormsModule, | ||
MatDatepickerModule, | ||
], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
styleUrl: './filter-dialog.scss', | ||
}) | ||
export class FilterDialog { | ||
dialogRef = inject(MatDialogRef<FilterDialog>); | ||
observationTypesForm = new FormControl(''); | ||
observationTypes: any = observationsTypes; | ||
readonly observationsDates = new FormGroup({ | ||
start: new FormControl(null), | ||
end: new FormControl(null), | ||
}); | ||
|
||
filterCancel() { | ||
this.dialogRef.close(); | ||
} | ||
filterConfirm() { | ||
this.dialogRef.close({ filter: true }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "Avalanche" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Chablis" | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "Chute de blocs" | ||
}, | ||
{ | ||
"id": 4, | ||
"name": "Crue torrentielle" | ||
}, | ||
{ | ||
"id": 5, | ||
"name": "Incendie" | ||
}, | ||
{ | ||
"id": 6, | ||
"name": "Inondation" | ||
}, | ||
{ | ||
"id": 7, | ||
"name": "Lave torrentielle" | ||
}, | ||
{ | ||
"id": 8, | ||
"name": "Ravinement" | ||
}, | ||
{ | ||
"id": 9, | ||
"name": "Volis" | ||
}, | ||
{ | ||
"id": 10, | ||
"name": "Apparition d'un nouveau lac" | ||
}, | ||
{ | ||
"id": 11, | ||
"name": "Glissement de terrain" | ||
}, | ||
{ | ||
"id": 12, | ||
"name": "Phénomène glaciaire" | ||
} | ||
] |
2 changes: 1 addition & 1 deletion
2
front-end/src/app/synthesis-interface/synthesis-interface.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters