Skip to content

Commit

Permalink
chore(frontend): delete useless components
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Oct 16, 2024
1 parent a735a39 commit 9f96789
Show file tree
Hide file tree
Showing 53 changed files with 131 additions and 134 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
export const STRUCTURE_DOC_EXTENSIONS_LABELS: {
[key: string]: string;
} = {
"image/jpg": "Document au format Image JPEG",
"image/jpeg": "Document au format Image JPEG",
"image/png": "Document au format Image PNG",
"application/pdf": "Document au format PDF",
"application/msword": "Document au format Docx",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document":
"Document au format Docx",
"application/vnd.oasis.opendocument.text": "Document au format Docx",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
"Feuille de calcul",
"application/vnd.ms-excel": "Feuille de calcul Excel",
};

export const STRUCTURE_DOC_EXTENSIONS: {
[key: string]: string;
} = {
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/_common/model/telephone/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@index('./*', f => `export * from '${f.path}'`)
export * from "./COUNTRY_CODES";
export * from "./PREFERRED_COUNTRIES.const";
export * from "./Telephone.type";
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
CustomDatepickerI18n,
} from "../shared/services";
import { CKEditorModule } from "@ckeditor/ckeditor5-angular";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";

@NgModule({
declarations: [
Expand All @@ -39,6 +40,7 @@ import { CKEditorModule } from "@ckeditor/ckeditor5-angular";
SharedModule,
GeneralModule,
CKEditorModule,
FontAwesomeModule,
],
providers: [
StructureInformationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { SharedModule } from "../../../shared/shared.module";
import { StoreModule } from "@ngrx/store";
import { _usagerReducer } from "../../../../shared";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";

describe("ImportComponent", () => {
let fixture: ComponentFixture<ImportComponent>;
Expand All @@ -30,6 +31,7 @@ describe("ImportComponent", () => {
SharedModule,
ReactiveFormsModule,
FormsModule,
FontAwesomeModule,
],
providers: [{ provide: APP_BASE_HREF, useValue: "/" }],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SharedModule } from "../shared/shared.module";
import { UsagerSharedModule } from "../usager-shared/usager-shared.module";
import { UsersModule } from "../users/users.module";
import { ImportUsagersRoutingModule } from "./import-usagers-routing.module";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";

@NgModule({
declarations: [ImportComponent],
Expand All @@ -21,6 +22,7 @@ import { ImportUsagersRoutingModule } from "./import-usagers-routing.module";
SharedModule,
UsersModule,
ImportUsagersRoutingModule,
FontAwesomeModule,
],
})
export class ImportUsagersModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export class ImportUsagersService {
return this.http.post<{
importMode: UsagersImportMode;
previewTable: ImportPreviewTable;
}>(environment.apiUrl + "import/" + mode, data);
}>(`${environment.apiUrl}import/${mode}`, data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ManageFiltersComponent implements OnInit, OnDestroy {
@Input() public usagersRadiesTotalCount: number;
@Input() public nbResults: number;

@Output() public updateFilters = new EventEmitter();
@Output() public readonly updateFilters = new EventEmitter();

private subscription = new Subscription();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export class ManageUsagersTableComponent implements OnDestroy {
public deleteUsagersModal!: TemplateRef<NgbModalRef>;

@Output()
public goToPrint = new EventEmitter<void>();
public readonly goToPrint = new EventEmitter<void>();

@Output()
public updateFilters = new EventEmitter<{
public readonly updateFilters = new EventEmitter<{
element: keyof UsagersFilterCriteria;
value: UsagersFilterCriteria[keyof UsagersFilterCriteria] | null;
sortValue?: UsagersFilterCriteriaSortValues;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ function check({
}: {
usager: UsagerLight;
} & Pick<UsagersFilterCriteria, "statut">): boolean {
if (statut && statut !== "TOUS" && statut !== usager.statut) {
return false;
}
return true;
return !(statut && statut !== "TOUS" && statut !== usager.statut);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { UsagersFilterCriteria } from "../UsagersFilterCriteria";
import { format } from "date-fns";
import { UsagerLight } from "../../../../../../_common/model";
import { search } from "../../../../../shared";
import { UsagerProcuration } from "../../../../usager-shared/interfaces/UsagerProcuration.interface";
import { UsagerAyantDroit } from "@domifa/common";
import { search } from "../../../utils/search";

export const usagersSearchStringFilter = {
filter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UsagerLight } from "../../../../../../_common/model";
import { dataSorter, SortableAttribute } from "../../../../../shared";
import { dataSorter, SortableAttribute } from "../../../utils/sorter";
import { UsagersFilterCriteria } from "../UsagersFilterCriteria";

export const usagersSorter = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { ColumnInformationsComponent } from "./components/column-informations/co
import { ManageFiltersComponent } from "./components/manage-filters/manage-filters.component";
import { ColumnInteractionsComponent } from "./components/column-interactions/column-interactions.component";
import { FormatInternationalPhoneNumberPipe } from "../usager-shared/formatInternationalPhoneNumber.pipe";
import {} from "../shared/pipes";
import { UsagerNomCompletPipe } from "../usager-shared/pipes";

@NgModule({
declarations: [
Expand All @@ -39,6 +41,7 @@ import { FormatInternationalPhoneNumberPipe } from "../usager-shared/formatInter
UsersModule,
ManageUsagersRoutingModule,
FormatInternationalPhoneNumberPipe,
UsagerNomCompletPipe,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Component, Input } from "@angular/core";

import {
STRUCTURE_DOC_EXTENSIONS_LABELS,
StructureDoc,
UsagerDoc,
} from "@domifa/common";
import { StructureDoc, UsagerDoc } from "@domifa/common";
import { STRUCTURE_DOC_ICONS } from "./STRUCTURE_DOC_ICONS.const";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { NgClass } from "@angular/common";
Expand All @@ -17,7 +13,21 @@ import { NgClass } from "@angular/common";
})
export class DisplayTableImageComponent {
@Input() public document!: UsagerDoc | StructureDoc;
public readonly STRUCTURE_DOC_EXTENSIONS_LABELS =
STRUCTURE_DOC_EXTENSIONS_LABELS;
public readonly STRUCTURE_DOC_EXTENSIONS_LABELS: {
[key: string]: string;
} = {
"image/jpg": "Document au format Image JPEG",
"image/jpeg": "Document au format Image JPEG",
"image/png": "Document au format Image PNG",
"application/pdf": "Document au format PDF",
"application/msword": "Document au format Docx",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document":
"Document au format Docx",
"application/vnd.oasis.opendocument.text": "Document au format Docx",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
"Feuille de calcul",
"application/vnd.ms-excel": "Feuille de calcul Excel",
};

public readonly STRUCTURE_DOC_ICONS = STRUCTURE_DOC_ICONS;
}
2 changes: 0 additions & 2 deletions packages/frontend/src/app/modules/shared/pipes/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @index('./*.pipe.ts', f => `export * from '${f.path}'`)
export * from "./format-big-number.pipe";
export * from "./nl2br.pipe";
export * from "./sort-array.pipe";
export * from "./usager-nom-complet.pipe";
10 changes: 1 addition & 9 deletions packages/frontend/src/app/modules/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,20 @@ import { FA_ICONS } from "./constants/FA_ICONS.const";

import { CustomToastrComponent } from "./components/custom-toastr/custom-toastr.component";

import {
UsagerNomCompletPipe,
FormatBigNumberPipe,
ReplaceLineBreaks,
} from "./pipes";
import { ReplaceLineBreaks } from "./pipes";
import { DateFrDirective, CleanStrDirective } from "./directives";

@NgModule({
declarations: [
DateFrDirective,
CleanStrDirective,
UsagerNomCompletPipe,
FormatBigNumberPipe,
CustomToastrComponent,
ReplaceLineBreaks,
],
exports: [
ReplaceLineBreaks,
DateFrDirective,
CleanStrDirective,
UsagerNomCompletPipe,
FormatBigNumberPipe,
CustomToastrComponent,
],
imports: [CommonModule, FontAwesomeModule],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Pipe, PipeTransform } from "@angular/core";

@Pipe({ name: "formatBigNumber" })
@Pipe({ name: "formatBigNumber", standalone: true })
export class FormatBigNumberPipe implements PipeTransform {
public transform(nb: number): string {
let strNb = nb.toString();
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/src/app/modules/stats/pipes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @index('./*.pipe.ts', f => `export * from '${f.path}'`)
export * from "./format-big-number.pipe";
2 changes: 2 additions & 0 deletions packages/frontend/src/app/modules/stats/stats.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { NgxChartsModule } from "@swimlane/ngx-charts";
import { StatsMapComponent } from "./components/elements/stats-map/stats-map.component";
import { ImpactLineComponent } from "./components/elements/impact-line/impact-line.component";
import { CountUpModule } from "ngx-countup";
import { FormatBigNumberPipe } from "./pipes";

@NgModule({
declarations: [
Expand All @@ -38,6 +39,7 @@ import { CountUpModule } from "ngx-countup";
FormsModule,
ReactiveFormsModule,
StatsRoutingModule,
FormatBigNumberPipe,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { FormEmailTakenValidator } from "./../../../../../_common/model/_general/FormEmailTakenValidator.type";
import { COUNTRY_CODES_TIMEZONE } from "./../../../../../_common/model/telephone/COUNTRY_CODES";
import { Component, Input, OnDestroy, OnInit } from "@angular/core";
import {
AbstractControl,
Expand All @@ -16,11 +14,7 @@ import {
PhoneNumberFormat,
SearchCountryField,
} from "@khazii/ngx-intl-tel-input";
import {
PREFERRED_COUNTRIES,
NoWhiteSpaceValidator,
EmailValidator,
} from "../../../../shared";
import { NoWhiteSpaceValidator, EmailValidator } from "../../../../shared";
import {
setFormPhone,
anyPhoneValidator,
Expand All @@ -40,7 +34,12 @@ import {
Structure,
STRUCTURE_ORGANISME_TYPE_LABELS,
DEPARTEMENTS_LISTE,
COUNTRY_CODES_TIMEZONE,
} from "@domifa/common";
import {
FormEmailTakenValidator,
PREFERRED_COUNTRIES,
} from "../../../../../_common/model";

@Component({
selector: "app-structure-edit-form",
Expand Down Expand Up @@ -133,7 +132,9 @@ export class StructureEditFormComponent implements OnInit, OnDestroy {
organismeType: [this.structure.organismeType, assoRequired],
});

this.selectedCountryISO = COUNTRY_CODES_TIMEZONE[this.structure.timeZone];
this.selectedCountryISO = COUNTRY_CODES_TIMEZONE[
this.structure.timeZone
] as CountryISO;
this.subscription.add(
this.structureForm
.get("adresseCourrier")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ import { CustomToastService } from "src/app/modules/shared/services/custom-toast
import { Subject, Subscription, of } from "rxjs";
import { map, takeUntil } from "rxjs/operators";

import { FormEmailTakenValidator } from "../../../../../_common/model";
import {
FormEmailTakenValidator,
PREFERRED_COUNTRIES,
} from "../../../../../_common/model";
import { StructureService } from "../../services/structure.service";
import { StructureCommonWeb } from "../../classes/StructureCommonWeb.class";

import { anyPhoneValidator } from "../../../shared/phone/mobilePhone.validator";
import { getFormPhone } from "../../../shared/phone";
import { PREFERRED_COUNTRIES, EmailValidator } from "../../../../shared";
import { EmailValidator } from "../../../../shared";
import {
StructureCommon,
Structure,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ import { Observable, Subscription } from "rxjs";

import { Store } from "@ngrx/store";
import { UsagerLight } from "../../../../../_common/model";
import {
selectUsagerById,
getUsagerNomComplet,
UsagerState,
} from "../../../../shared";
import { selectUsagerById, UsagerState } from "../../../../shared";
import { AuthService, CustomToastService } from "../../../shared/services";
import { UsagerFormModel } from "../../../usager-shared/interfaces";
import { UsagerDossierService } from "../../services/usager-dossier.service";
import { Usager, UserStructure } from "@domifa/common";
import { getUsagerNomComplet } from "../../../usager-shared/utils/getUsagerNomComplet";

@Component({
selector: "app-base-usager-dossier-page",
Expand Down Expand Up @@ -72,7 +69,7 @@ export class BaseUsagerDossierPageComponent implements OnInit, OnDestroy {

public setTitle() {
this.titleService.setTitle(
this.titlePrefix + " de " + getUsagerNomComplet(this.usager) + " - DomiFa"
`${this.titlePrefix} de ${getUsagerNomComplet(this.usager)} - DomiFa`
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ import {
ETAPES_FORM_DOM_TITRES,
UsagerLight,
} from "../../../../../_common/model";
import {
getUsagerNomComplet,
selectUsagerById,
UsagerState,
} from "../../../../shared";
import { selectUsagerById, UsagerState } from "../../../../shared";
import { CustomToastService } from "../../../shared/services";
import { UsagerFormModel } from "../../../usager-shared/interfaces";
import { Store } from "@ngrx/store";
import { Subscription } from "rxjs";
import { getUsagerNomComplet } from "../../../usager-shared/utils/getUsagerNomComplet";

@Component({
selector: "app-step-header",
Expand All @@ -35,7 +32,7 @@ export class StepHeaderComponent implements OnInit, OnDestroy {
public currentUrl = "";

private subscription = new Subscription();
public isMobile: boolean = false;
public isMobile = false;

constructor(
private readonly router: Router,
Expand All @@ -62,7 +59,7 @@ export class StepHeaderComponent implements OnInit, OnDestroy {
this.usager.decision.statut === "ATTENTE_DECISION" &&
this.currentStep !== 4
) {
this.router.navigate(["usager/" + this.usager.ref + "/edit/decision"]);
this.router.navigate([`usager/${this.usager.ref}/edit/decision`]);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { BaseUsagerDossierPageComponent } from "./components/base-usager-dossier
import { FormatInternationalPhoneNumberPipe } from "../usager-shared/formatInternationalPhoneNumber.pipe";
import { DisplayContactDetailsDecisionComponent } from "./components/display-contact-details-decision/display-contact-details-decision.component";
import { DecisionStandbyFormComponent } from "./components/decision-standby-form/decision-standby-form.component";
import { UsagerNomCompletPipe } from "../usager-shared/pipes";

@NgModule({
declarations: [
Expand Down Expand Up @@ -61,6 +62,7 @@ import { DecisionStandbyFormComponent } from "./components/decision-standby-form
NgxIntlTelInputModule,
UsagerNotesModule,
FormatInternationalPhoneNumberPipe,
UsagerNomCompletPipe,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [
Expand Down
Loading

0 comments on commit 9f96789

Please sign in to comment.