Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 587f046

Browse files
authored
Feature/setup country codes (#39)
* wip * wip * done country selector
1 parent 9edab3a commit 587f046

File tree

15 files changed

+434
-307
lines changed

15 files changed

+434
-307
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ root = true
44
[*]
55
charset = utf-8
66
indent_style = space
7-
indent_size = 2
7+
indent_size = 4
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

.github/workflows/build-dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
contents: read
1313
packages: write
1414

15+
environment:
16+
name: development
17+
url: https://dev.dashboard.funixproductions.com
18+
1519
steps:
1620
- name: Checkout code
1721
uses: actions/checkout@v3

.github/workflows/build-prod.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ jobs:
3434

3535
runs-on: ubuntu-latest
3636

37+
environment:
38+
name: production
39+
url: https://dashboard.funixproductions.com
40+
3741
steps:
3842
- name: Set up kubectl
3943
uses: azure/k8s-set-context@v3

angular.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
"input": "node_modules/tinymce",
2929
"output": "/tinymce/"
3030
},
31+
{
32+
"glob": "**/*",
33+
"input": "node_modules/svg-country-flags/svg",
34+
"output": "/assets/svg-country-flags/svg"
35+
},
3136
"src/manifest.webmanifest"
3237
],
3338
"styles": [

package-lock.json

Lines changed: 43 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13+
"@angular-material-extensions/select-country": "^17.0.0",
1314
"@angular/animations": "^17.1.0",
1415
"@angular/cdk": "^17.1.0",
1516
"@angular/common": "^17.1.0",
@@ -26,10 +27,11 @@
2627
"@fortawesome/free-brands-svg-icons": "^6.4.0",
2728
"@fortawesome/free-regular-svg-icons": "^6.4.0",
2829
"@fortawesome/free-solid-svg-icons": "^6.4.0",
29-
"@funixproductions/funixproductions-requests": "^0.0.4",
30+
"@funixproductions/funixproductions-requests": "^0.0.5",
3031
"@tinymce/tinymce-angular": "^7.0.0",
3132
"ng-recaptcha": "^13.2.1",
3233
"rxjs": "~7.8.1",
34+
"svg-country-flags": "^1.2.10",
3335
"tslib": "^2.6.0",
3436
"zone.js": "~0.14.3"
3537
},
Lines changed: 100 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,118 @@
11
<h1 class="h3 mb-2 text-gray-800">Utilisateurs</h1>
22
<p class="mb-4">
3-
Depuis cette liste vous pouvez gérer les différents comptes qui existent pour la FunixProduction.<br/>
4-
Que ce soit pour Pacifista ou les autres projets.
3+
Depuis cette liste vous pouvez gérer les différents comptes qui existent pour la FunixProduction.<br/>
4+
Que ce soit pour Pacifista ou les autres projets.
55
</p>
66

77
<div class="card shadow mb-4">
8-
<div class="card-header py-3">
9-
<h4 class="m-0 font-weight-bold text-primary">Utilisateurs de la FunixProduction</h4>
10-
</div>
11-
12-
<div class="card-body">
13-
<div class="col-md-12">
14-
<p>Nombre de comptes : {{ entities.totalElementsDatabase }}</p>
8+
<div class="card-header py-3">
9+
<h4 class="m-0 font-weight-bold text-primary">Utilisateurs de la FunixProduction</h4>
1510
</div>
1611

17-
<div class="table-responsive">
18-
<table mat-table [dataSource]="entities.content" class="table table-bordered" id="dataTable">
12+
<div class="card-body">
13+
<div class="col-md-12">
14+
<p>Nombre de comptes : {{ entities.totalElementsDatabase }}</p>
15+
</div>
16+
17+
<div class="table-responsive">
18+
<table mat-table [dataSource]="entities.content" class="table table-bordered" id="dataTable">
19+
20+
<ng-container matColumnDef="username">
21+
<th mat-header-cell *matHeaderCellDef>
22+
Username
23+
<div class="input-group">
24+
<input #searchUser (keyup)="onSearchChange('username', searchUser.value)" type="text" class="form-control bg-light border-0 small" placeholder="Recherche username">
25+
</div>
26+
</th>
27+
<td mat-cell *matCellDef="let user">{{ user.username }}</td>
28+
<th mat-footer-cell *matFooterCellDef>Username</th>
29+
</ng-container>
30+
31+
<ng-container matColumnDef="email">
32+
<th mat-header-cell *matHeaderCellDef>
33+
Email
34+
<div class="input-group">
35+
<input #searchEmail (keyup)="onSearchChange('email', searchEmail.value)" type="text" class="form-control bg-light border-0 small" placeholder="Recherche email">
36+
</div>
37+
</th>
38+
<td mat-cell *matCellDef="let user">{{ user.email }}</td>
39+
<th mat-footer-cell *matFooterCellDef>Email</th>
40+
</ng-container>
1941

20-
<ng-container matColumnDef="username">
21-
<th mat-header-cell *matHeaderCellDef>
22-
Username
23-
<div class="input-group">
24-
<input #searchUser (keyup)="onSearchChange('username', searchUser.value)" type="text" class="form-control bg-light border-0 small" placeholder="Recherche username">
25-
</div>
26-
</th>
27-
<td mat-cell *matCellDef="let user">{{ user.username }}</td>
28-
<th mat-footer-cell *matFooterCellDef>Username</th>
29-
</ng-container>
42+
<ng-container matColumnDef="role">
43+
<th mat-header-cell *matHeaderCellDef>
44+
Role
45+
<div class="custom-control custom-checkbox small">
46+
<input #checkStaff (click)="switchRoleList(checkStaff.checked)" type="checkbox" class="custom-control-input" id="checkStaff">
47+
<label class="custom-control-label" for="checkStaff">Uniquement le staff</label>
48+
</div>
49+
</th>
50+
<td mat-cell *matCellDef="let user">{{ user.role }}</td>
51+
<th mat-footer-cell *matFooterCellDef>Role</th>
52+
</ng-container>
3053

31-
<ng-container matColumnDef="email">
32-
<th mat-header-cell *matHeaderCellDef>
33-
Email
34-
<div class="input-group">
35-
<input #searchEmail (keyup)="onSearchChange('email', searchEmail.value)" type="text" class="form-control bg-light border-0 small" placeholder="Recherche email">
36-
</div>
37-
</th>
38-
<td mat-cell *matCellDef="let user">{{ user.email }}</td>
39-
<th mat-footer-cell *matFooterCellDef>Email</th>
40-
</ng-container>
54+
<ng-container matColumnDef="valid">
55+
<th mat-header-cell *matHeaderCellDef>
56+
Validé<br/>
57+
<select class="form-control" [(ngModel)]="valid" (ngModelChange)="switchValidList()">
58+
<option [ngValue]="''">Tous</option>
59+
<option [ngValue]="'true'">Oui</option>
60+
<option [ngValue]="'false'">Non</option>
61+
</select>
62+
</th>
63+
<td mat-cell *matCellDef="let user">{{ user.valid ? 'Oui' : 'Non' }}</td>
64+
<th mat-footer-cell *matFooterCellDef>Validé</th>
65+
</ng-container>
4166

42-
<ng-container matColumnDef="role">
43-
<th mat-header-cell *matHeaderCellDef>
44-
Role
45-
<div class="custom-control custom-checkbox small">
46-
<input #checkStaff (click)="switchRoleList(checkStaff.checked)" type="checkbox" class="custom-control-input" id="checkStaff">
47-
<label class="custom-control-label" for="checkStaff">Uniquement le staff</label>
48-
</div>
49-
</th>
50-
<td mat-cell *matCellDef="let user">{{ user.role }}</td>
51-
<th mat-footer-cell *matFooterCellDef>Role</th>
52-
</ng-container>
67+
<ng-container matColumnDef="country">
68+
<th mat-header-cell *matHeaderCellDef>
69+
Pays
70+
</th>
71+
<td mat-cell *matCellDef="let user">{{ user.country.name }}</td>
72+
<th mat-footer-cell *matFooterCellDef>Pays</th>
73+
</ng-container>
5374

54-
<ng-container matColumnDef="createdAt">
55-
<th mat-header-cell *matHeaderCellDef> Date de création </th>
56-
<td mat-cell *matCellDef="let user">{{ user.createdAt ? (user.createdAt | date : 'dd/MM/YY - HH:mm') : '-' }}</td>
57-
<th mat-footer-cell *matFooterCellDef> Date de création </th>
58-
</ng-container>
75+
<ng-container matColumnDef="createdAt">
76+
<th mat-header-cell *matHeaderCellDef> Date de création </th>
77+
<td mat-cell *matCellDef="let user">{{ user.createdAt ? (user.createdAt | date : 'dd/MM/YY - HH:mm') : '-' }}</td>
78+
<th mat-footer-cell *matFooterCellDef> Date de création </th>
79+
</ng-container>
5980

60-
<ng-container matColumnDef="updatedAt">
61-
<th mat-header-cell *matHeaderCellDef> Date de mise à jour </th>
62-
<td mat-cell *matCellDef="let user">{{ user.updatedAt ? (user.updatedAt | date : 'dd/MM/YY - HH:mm') : '-' }}</td>
63-
<th mat-footer-cell *matFooterCellDef> Date de mise à jour </th>
64-
</ng-container>
81+
<ng-container matColumnDef="updatedAt">
82+
<th mat-header-cell *matHeaderCellDef> Date de mise à jour </th>
83+
<td mat-cell *matCellDef="let user">{{ user.updatedAt ? (user.updatedAt | date : 'dd/MM/YY - HH:mm') : '-' }}</td>
84+
<th mat-footer-cell *matFooterCellDef> Date de mise à jour </th>
85+
</ng-container>
6586

66-
<ng-container matColumnDef="actions">
67-
<th mat-header-cell *matHeaderCellDef> Actions </th>
68-
<td mat-cell *matCellDef="let user">
69-
<div class="container-fluid">
70-
<a href="{{ getEditUrl(user) }}" class="btn btn-info btn-circle btn-sm">
71-
<i class="fas fa-pen"></i>
72-
</a>
87+
<ng-container matColumnDef="actions">
88+
<th mat-header-cell *matHeaderCellDef> Actions </th>
89+
<td mat-cell *matCellDef="let user">
90+
<div class="container-fluid">
91+
<a href="{{ getEditUrl(user) }}" class="btn btn-info btn-circle btn-sm">
92+
<i class="fas fa-pen"></i>
93+
</a>
7394

74-
<button (click)="openRemoveDialog(user)" class="btn btn-danger btn-circle btn-sm">
75-
<i class="fas fa-trash"></i>
76-
</button>
77-
</div>
78-
</td>
79-
<th mat-footer-cell *matFooterCellDef> Actions </th>
80-
</ng-container>
95+
<button (click)="openRemoveDialog(user)" class="btn btn-danger btn-circle btn-sm">
96+
<i class="fas fa-trash"></i>
97+
</button>
98+
</div>
99+
</td>
100+
<th mat-footer-cell *matFooterCellDef> Actions </th>
101+
</ng-container>
81102

82-
<tr mat-header-row *matHeaderRowDef="columnsToDisplay"></tr>
83-
<tr mat-row *matRowDef="let row; columns: columnsToDisplay"></tr>
84-
<tr mat-footer-row *matFooterRowDef="columnsToDisplay"></tr>
85-
</table>
103+
<tr mat-header-row *matHeaderRowDef="columnsToDisplay"></tr>
104+
<tr mat-row *matRowDef="let row; columns: columnsToDisplay"></tr>
105+
<tr mat-footer-row *matFooterRowDef="columnsToDisplay"></tr>
106+
</table>
86107

87-
<mat-paginator [length]="entities.totalElementsDatabase"
88-
(page)="onPaginateChange($event.pageIndex)"
89-
[pageIndex]="page"
90-
[pageSize]="elemsPerPage"
91-
[hidePageSize]="true"
92-
aria-label="Pages"
93-
showFirstLastButtons>
94-
</mat-paginator>
108+
<mat-paginator [length]="entities.totalElementsDatabase"
109+
(page)="onPaginateChange($event.pageIndex)"
110+
[pageIndex]="page"
111+
[pageSize]="elemsPerPage"
112+
[hidePageSize]="true"
113+
aria-label="Pages"
114+
showFirstLastButtons>
115+
</mat-paginator>
116+
</div>
95117
</div>
96-
</div>
97118
</div>

0 commit comments

Comments
 (0)