-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(frontend): add format phone in a standalone component
- Loading branch information
Showing
18 changed files
with
129 additions
and
45 deletions.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
...mponents/display-contact-details-decision/display-contact-details-decision.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<p class="my-2"> | ||
<b>Téléphone:</b> | ||
<span class="valeur" *ngIf="usager.telephone.numero">{{ | ||
usager.telephone | formatInternationalPhoneNumber | ||
}}</span> | ||
<span class="valeur" *ngIf="!usager.telephone.numero">Non renseigné</span> | ||
</p> | ||
<p class="my-2"> | ||
<b>Adresse e-mail:</b> | ||
<span *ngIf="usager.email"> | ||
{{ usager.email }} | ||
</span> | ||
<span *ngIf="!usager.email">Non renseigné</span> | ||
</p> | ||
<p class="my-2"> | ||
<b>Notifications par SMS activés: </b> | ||
<span> | ||
{{ usager.contactByPhone ? "oui" : "non" }} | ||
</span> | ||
</p> |
27 changes: 27 additions & 0 deletions
27
...nents/display-contact-details-decision/display-contact-details-decision.component.spec.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,27 @@ | ||
import { ComponentFixture, TestBed } from "@angular/core/testing"; | ||
|
||
import { DisplayContactDetailsDecisionComponent } from "./display-contact-details-decision.component"; | ||
import { USAGER_ACTIF_MOCK } from "../../../../../_common/mocks"; | ||
import { UsagerFormModel } from "../../../usager-shared/interfaces"; | ||
import { FormatInternationalPhoneNumberPipe } from "../../../usager-shared/formatInternationalPhoneNumber.pipe"; | ||
|
||
describe("DisplayContactDetailsDecisionComponent", () => { | ||
let component: DisplayContactDetailsDecisionComponent; | ||
let fixture: ComponentFixture<DisplayContactDetailsDecisionComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DisplayContactDetailsDecisionComponent], | ||
imports: [FormatInternationalPhoneNumberPipe], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DisplayContactDetailsDecisionComponent); | ||
component = fixture.componentInstance; | ||
component.usager = new UsagerFormModel(USAGER_ACTIF_MOCK); | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should create", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
...components/display-contact-details-decision/display-contact-details-decision.component.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,10 @@ | ||
import { Component, Input } from "@angular/core"; | ||
import { UsagerFormModel } from "../../../usager-shared/interfaces"; | ||
|
||
@Component({ | ||
selector: "app-display-contact-details-decision", | ||
templateUrl: "./display-contact-details-decision.component.html", | ||
}) | ||
export class DisplayContactDetailsDecisionComponent { | ||
@Input() public usager!: UsagerFormModel; | ||
} |
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
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
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
File renamed without changes.
File renamed without changes.
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
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
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