Skip to content

Commit 6a42ee4

Browse files
committed
fix(frontend): delete bootstrap
1 parent ed7d2b8 commit 6a42ee4

File tree

177 files changed

+2210
-3724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+2210
-3724
lines changed

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"Bash(xargs:*)",
1111
"Bash(npx ng:*)",
1212
"Bash(python3:*)",
13-
"Bash(read f:*)"
13+
"Bash(read f:*)",
14+
"Bash(ls:*)"
1415
]
1516
}
1617
}

packages/frontend/angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
],
3131
"styles": [
3232
"src/styles.scss",
33-
"src/assets/css/custom-dsfr.scss",
3433
"src/assets/css/main.scss",
3534
"src/assets/css/print.css",
3635
"node_modules/intl-tel-input/build/css/intlTelInput.css"

packages/frontend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
"lodash.clonedeep": "^4.5.0",
9191
"lodash.isequal": "^4.5.0",
9292
"marked": "4.0.12",
93-
"ngx-bootstrap": "^12.0.0",
9493
"ngx-countup": "^13.2.0",
9594
"ngx-matomo-client": "^6.2.0",
9695
"parchment": "^3.0.0",

packages/frontend/src/_common/model/usager/dossier/FormAyantDroit.type.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { AyantDroiLienParent } from "@domifa/common";
2-
import { NgbDate } from "@ng-bootstrap/ng-bootstrap";
32

43
export interface UsagerFormAyantDroit {
5-
dateNaissance: NgbDate;
4+
dateNaissance: string;
65
lien: AyantDroiLienParent;
76
nom: string;
87
prenom: string;

packages/frontend/src/app/app.module.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import { FormsModule, ReactiveFormsModule } from "@angular/forms";
1616
import { BrowserModule } from "@angular/platform-browser";
1717
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
1818

19-
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
20-
2119
import { environment } from "src/environments/environment";
2220
import { AppRoutingModule } from "./app-routing.module";
2321
import { AppComponent } from "./app.component";
@@ -69,7 +67,7 @@ registerLocaleData(localeFr, "fr");
6967
FormsModule,
7068
ReactiveFormsModule,
7169
GeneralModule,
72-
NgbModule,
70+
7371
StoreModule.forRoot({ app: _usagerReducer }),
7472
SharedModule,
7573
MATOMO_INJECTORS,

packages/frontend/src/app/modules/admin-portail-usagers/admin-portail-usagers.module.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ import {
66
withInterceptorsFromDi,
77
} from "@angular/common/http";
88
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
9-
import {
10-
NgbDateParserFormatter,
11-
NgbDatepickerI18n,
12-
NgbModule,
13-
} from "@ng-bootstrap/ng-bootstrap";
9+
1410
import { GeneralModule } from "../general/general.module";
1511
import { SharedModule } from "../shared/shared.module";
1612
import { AdminPortailUsagersMenuComponent } from "./components/admin-portail-usagers-menu/admin-portail-usagers-menu.component";
@@ -19,10 +15,6 @@ import { ManageStructureInformationComponent } from "./components/manage-structu
1915
import { ManageStructureInformationFormComponent } from "./components/manage-structure-information-form/manage-structure-information-form.component";
2016
import { StructureInformationService } from "./services/structure-information.service";
2117
import { ManagePortailUsagersService } from "./services/manage-portail-usagers.service";
22-
import {
23-
NgbDateCustomParserFormatter,
24-
CustomDatepickerI18n,
25-
} from "../shared/services";
2618

2719
import { ManageUserUsagerComponent } from "./components/manage-user-usager/manage-user-usager.component";
2820
import { DsfrEditorComponent } from "@edugouvfr/ngx-dsfr-ext/editor";
@@ -31,6 +23,7 @@ import {
3123
DsfrPaginationComponent,
3224
} from "@edugouvfr/ngx-dsfr";
3325
import { DisplayLastLoginComponent } from "../shared/components/display-last-login/display-last-login.component";
26+
import { DsfrDatePickerComponent } from "@edugouvfr/ngx-dsfr-ext";
3427

3528
@NgModule({
3629
declarations: [
@@ -44,11 +37,11 @@ import { DisplayLastLoginComponent } from "../shared/components/display-last-log
4437
CommonModule,
4538
AdminPortailUsagersRoutingModule,
4639
FormsModule,
47-
NgbModule,
40+
4841
ReactiveFormsModule,
4942
SharedModule,
5043
GeneralModule,
51-
44+
DsfrDatePickerComponent,
5245
DsfrEditorComponent,
5346
DsfrModalComponent,
5447
DisplayLastLoginComponent,
@@ -57,9 +50,7 @@ import { DisplayLastLoginComponent } from "../shared/components/display-last-log
5750
providers: [
5851
StructureInformationService,
5952
ManagePortailUsagersService,
60-
NgbDateCustomParserFormatter,
61-
{ provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n },
62-
{ provide: NgbDateParserFormatter, useClass: NgbDateCustomParserFormatter },
53+
6354
provideHttpClient(withInterceptorsFromDi()),
6455
],
6556
})

packages/frontend/src/app/modules/admin-portail-usagers/components/manage-structure-information-form/manage-structure-information-form.component.html

Lines changed: 22 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -133,128 +133,34 @@
133133
*ngIf="f.isTemporary.value === true"
134134
>
135135
<div class="fr-col-12 fr-col-md-6">
136-
<div
137-
class="fr-input-group"
138-
[class.fr-input-group--error]="
136+
<dsfr-ext-datepicker
137+
formControlName="startDate"
138+
label="Date de début de diffusion"
139+
[required]="true"
140+
[showMask]="true"
141+
[message]="
139142
(f.startDate.dirty || submitted) && f.startDate.errors
143+
? 'La date de début est incorrecte. Exemple : 20/12/1996'
144+
: ''
140145
"
141-
>
142-
<label for="startDate" class="fr-label"
143-
>Date de début de diffusion
144-
</label>
145-
<div class="fr-date-input">
146-
<input
147-
class="fr-input"
148-
placeholder="jj/mm/aaaa"
149-
placement="auto"
150-
id="startDate"
151-
formControlName="startDate"
152-
name="startDate"
153-
ngbDatepicker
154-
dateFr
155-
value
156-
[class.fr-input--error]="
157-
(f.startDate.dirty || submitted) && f.startDate.errors
158-
"
159-
[attr.aria-describedby]="
160-
(f.startDate.dirty || submitted) && f.startDate.errors
161-
? 'startDate-errors'
162-
: null
163-
"
164-
[attr.aria-invalid]="
165-
(f.startDate.dirty || submitted) && f.startDate.errors
166-
? true
167-
: false
168-
"
169-
#startDate="ngbDatepicker"
170-
maxlength="10"
171-
required
172-
/>
173-
174-
<button
175-
type="button"
176-
aria-label="Choisir une date de début de validité dans le calendrier"
177-
class="date-btn"
178-
(click)="startDate.toggle()"
179-
>
180-
<span class="fr-icon-calendar-line" aria-hidden="true"></span>
181-
</button>
182-
</div>
183-
184-
<p
185-
*ngIf="(f.startDate.dirty || submitted) && f.startDate.errors"
186-
id="startDate-errors"
187-
class="fr-error-text"
188-
>
189-
La date de debut est incorrecte. Exemple : 20/12/1996
190-
</p>
191-
</div>
146+
[messageSeverity]="'error'"
147+
></dsfr-ext-datepicker>
192148
</div>
193149
<div class="fr-col-12 fr-col-md-6">
194-
<div
195-
class="fr-input-group"
196-
[class.fr-input-group--error]="
150+
<dsfr-ext-datepicker
151+
formControlName="endDate"
152+
label="Date de fin"
153+
[required]="true"
154+
[showMask]="true"
155+
[message]="
197156
(f.endDate.dirty || submitted) && f.endDate.errors
157+
? f.endDate.errors.required
158+
? 'La date de fin est obligatoire'
159+
: 'La date de fin est incorrecte. Exemple : 20/12/1996'
160+
: ''
198161
"
199-
>
200-
<label for="endDate" class="fr-label">Date de fin </label>
201-
<div class="fr-date-input">
202-
<input
203-
class="fr-input"
204-
placeholder="jj/mm/aaaa"
205-
placement="auto"
206-
id="endDate"
207-
formControlName="endDate"
208-
name="endDate"
209-
ngbDatepicker
210-
dateFr
211-
required
212-
value
213-
[class.fr-input--error]="
214-
(f.endDate.dirty || submitted) && f.endDate.errors
215-
"
216-
[attr.aria-describedby]="
217-
(f.endDate.dirty || submitted) && f.endDate.errors
218-
? 'endDate-errors'
219-
: null
220-
"
221-
[attr.aria-invalid]="
222-
(f.endDate.dirty || submitted) && f.endDate.errors
223-
? true
224-
: false
225-
"
226-
#endDate="ngbDatepicker"
227-
maxlength="10"
228-
/>
229-
230-
<button
231-
type="button"
232-
aria-label="Choisir une date de fin de validité dans le calendrier"
233-
class="date-btn"
234-
(click)="endDate.toggle()"
235-
>
236-
<span class="fr-icon-calendar-line" aria-hidden="true"></span>
237-
</button>
238-
</div>
239-
</div>
240-
241-
<div
242-
*ngIf="(f.endDate.dirty || submitted) && f.endDate.errors"
243-
id="endDate-errors"
244-
class="fr-error-text"
245-
>
246-
<p *ngIf="f.endDate.errors.required">
247-
La date de fin est obligatoire
248-
</p>
249-
<p
250-
*ngIf="
251-
f.endDate.errors.ngbDate ||
252-
f.endDate.errors.endDateAfterBeginDate
253-
"
254-
>
255-
La date de fin est incorrecte. Exemple : 20/12/1996
256-
</p>
257-
</div>
162+
[messageSeverity]="'error'"
163+
></dsfr-ext-datepicker>
258164
</div>
259165
</div>
260166
</form>

packages/frontend/src/app/modules/admin-portail-usagers/components/manage-structure-information-form/manage-structure-information-form.component.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ import {
1212
Validators,
1313
ValidationErrors,
1414
} from "@angular/forms";
15-
import {
16-
CustomToastService,
17-
NgbDateCustomParserFormatter,
18-
} from "../../../shared/services";
15+
import { CustomToastService } from "../../../shared/services";
1916
import { StructureInformation } from "@domifa/common";
2017
import { StructureInformationService } from "../../services/structure-information.service";
2118

2219
import {
2320
endDateAfterBeginDateCheck,
24-
formatDateToNgb,
21+
formatDateToFr,
22+
parseFrDate,
2523
} from "../../../../shared";
2624
import { Subscription } from "rxjs";
2725
import {
@@ -67,7 +65,6 @@ export class ManageStructureInformationFormComponent implements OnDestroy {
6765

6866
constructor(
6967
private readonly fb: FormBuilder,
70-
private readonly nbgDate: NgbDateCustomParserFormatter,
7168
private readonly structureInformationService: StructureInformationService,
7269
private readonly toastService: CustomToastService
7370
) {}
@@ -103,13 +100,13 @@ export class ManageStructureInformationFormComponent implements OnDestroy {
103100
],
104101
startDate: [
105102
this.structureInformation?.startDate
106-
? formatDateToNgb(this.structureInformation?.startDate)
103+
? formatDateToFr(this.structureInformation?.startDate)
107104
: null,
108105
this.structureInformation?.isTemporary ? Validators.required : null,
109106
],
110107
endDate: [
111108
this.structureInformation?.endDate
112-
? formatDateToNgb(this.structureInformation?.endDate)
109+
? formatDateToFr(this.structureInformation?.endDate)
113110
: null,
114111
this.structureInformation?.isTemporary ? Validators.required : null,
115112
],
@@ -169,19 +166,11 @@ export class ManageStructureInformationFormComponent implements OnDestroy {
169166
...this.tempMessageForm.value,
170167
startDate:
171168
this.tempMessageForm.controls.isTemporary.value === true
172-
? new Date(
173-
this.nbgDate.formatEn(
174-
this.tempMessageForm.controls.startDate.value
175-
)
176-
)
169+
? parseFrDate(this.tempMessageForm.controls.startDate.value)
177170
: null,
178171
endDate:
179172
this.tempMessageForm.controls.isTemporary.value === true
180-
? new Date(
181-
this.nbgDate.formatEn(
182-
this.tempMessageForm.controls.endDate.value
183-
)
184-
)
173+
? parseFrDate(this.tempMessageForm.controls.endDate.value)
185174
: null,
186175
};
187176

packages/frontend/src/app/modules/admin-portail-usagers/components/manage-structure-information/manage-structure-information.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ComponentFixture, TestBed } from "@angular/core/testing";
22
import { ManageStructureInformationComponent } from "./manage-structure-information.component";
33
import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
4-
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
4+
55
import { RouterModule } from "@angular/router";
66
import { provideHttpClient } from "@angular/common/http";
77

@@ -13,7 +13,7 @@ describe("ManageStructureInformationComponent", () => {
1313
await TestBed.configureTestingModule({
1414
declarations: [ManageStructureInformationComponent],
1515
schemas: [CUSTOM_ELEMENTS_SCHEMA],
16-
imports: [NgbModule, RouterModule.forRoot([])],
16+
imports: [RouterModule.forRoot([])],
1717
providers: [provideHttpClient()],
1818
}).compileComponents();
1919

packages/frontend/src/app/modules/admin-portail-usagers/components/portail-usagers-params/portail-usagers-params.component.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PortailUsagersParamsComponent } from "./portail-usagers-params.componen
33
import { APP_BASE_HREF } from "@angular/common";
44
import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
55
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
6-
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
6+
77
import {
88
MockAuthService,
99
USER_STRUCTURE_MOCK,
@@ -18,12 +18,7 @@ describe("PortailUsagersParamsComponent", () => {
1818

1919
beforeEach(async () => {
2020
TestBed.configureTestingModule({
21-
imports: [
22-
NgbModule,
23-
ReactiveFormsModule,
24-
FormsModule,
25-
RouterModule.forRoot([]),
26-
],
21+
imports: [ReactiveFormsModule, FormsModule, RouterModule.forRoot([])],
2722
providers: [
2823
provideHttpClient(),
2924
{ provide: APP_BASE_HREF, useValue: "/" },

0 commit comments

Comments
 (0)