Skip to content

Commit

Permalink
fix(structures): add edition of structureType
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Dec 28, 2023
1 parent 5ac8b44 commit 2e4f686
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,78 @@ <h2 class="title">Modifier les informations de votre structure</h2>
<span class="fw-bold text-danger">*</span> sont obligatoires
</p>

<div class="row" *ngIf="structure.structureType !== 'asso'">
<div class="col-12 col-md-12 form-group required">
<fieldset class="text-center">
<legend>Vous appartenez à quel type de structure</legend>
<div class="btn-group btn-group-toggle required">
<label
for="cias"
class="btn py-3 px-4"
[ngClass]="{
'btn-primary': f.structureType.value === 'cias',
'btn-outline-primary': f.structureType.value !== 'cias',
'btn-outline-danger': submitted && f.structureType.value === null
}"
>
<input
id="cias"
formControlName="structureType"
name="structureType"
type="radio"
value="cias"
/>
CIAS / COMMUNE
</label>
<label
for="ccas"
class="btn py-3 px-4"
[ngClass]="{
'btn-primary': f.structureType.value === 'ccas',
'btn-outline-primary': f.structureType.value !== 'ccas',
'btn-outline-danger': submitted && f.structureType.value === null
}"
>
<input
formControlName="structureType"
name="structureType"
type="radio"
id="ccas"
value="ccas"
/>
CCAS
</label>

<label
for="mairie"
class="btn py-3 px-4"
[ngClass]="{
'btn-primary': f.structureType.value === 'mairie',
'btn-outline-primary': f.structureType.value !== 'mairie',
'btn-outline-danger': submitted && f.structureType.value === null
}"
>
<input
formControlName="structureType"
name="structureType"
type="radio"
value="mairie"
id="mairie"
/>
Mairie
</label>
</div>
<p
*ngIf="submitted && f.structureType.value === null"
class="py-2 text-danger text-center"
>
Veuillez sélectionner un des types d'organismes suivants :
CIAS/Commune, CCAS ou organisme agréé
</p>
</fieldset>
</div>
</div>

<div class="row">
<div class="col-12 col-md-12 form-group required">
<label for="nom">Raison sociale (nom de la structure)</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { StructureCommon, Structure } from "@domifa/common";
@Component({
selector: "app-structure-edit-form",
templateUrl: "./structure-edit-form.component.html",
styleUrls: ["./structure-edit-form.component.css"],
})
export class StructureEditFormComponent implements OnInit, OnDestroy {
public readonly PhoneNumberFormat = PhoneNumberFormat;
Expand Down Expand Up @@ -91,8 +92,8 @@ export class StructureEditFormComponent implements OnInit, OnDestroy {
email: [this.structure.email, [Validators.required, EmailValidator]],
nom: [this.structure.nom, [Validators.required]],
options: this.formBuilder.group({
numeroBoite: [this.structure.options.numeroBoite, []],
surnom: [this.structure.options.surnom, []],
numeroBoite: [this.structure.options.numeroBoite ?? false, []],
surnom: [this.structure.options.surnom ?? false, []],
}),
adresseCourrier: this.formBuilder.group({
actif: [this.structure.adresseCourrier.actif, []],
Expand Down

0 comments on commit 2e4f686

Please sign in to comment.