Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Rusakov authored and lanseg committed Dec 12, 2024
1 parent 94fd7c0 commit 55c514d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/app/account/new-order/new-order.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,8 @@
<mat-form-field> <!-- TODO Why is there only Suiss and France?-->
<mat-label i18n>Pays</mat-label>
<mat-select formControlName="country">
<mat-option [value]="'Suisse'">
Suisse
</mat-option>
<mat-option [value]="'France'">
France
</mat-option>
<mat-option [value]="'{{COUNTRIES.CH.name}}'">{{COUNTRIES.CH.name}}</mat-option>
<mat-option [value]="'{{COUNTRIES.FR.name}}'">{{COUNTRIES.FR.name}}</mat-option>
</mat-select>
</mat-form-field>

Expand Down
3 changes: 2 additions & 1 deletion src/app/account/new-order/new-order.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class NewOrderComponent implements OnInit, OnDestroy {
readonly NEXT = ConstantsService.NEXT;
readonly PREVIOUS = ConstantsService.PREVIOUS;
readonly BACK: string = $localize`Réinitialiser`;
readonly COUNTRIES = ConstantsService.COUNTRIES;


orderFormGroup: UntypedFormGroup;
Expand Down Expand Up @@ -371,7 +372,7 @@ export class NewOrderComponent implements OnInit, OnDestroy {
this.updateContactForm('2');
for (const key in this.invoiceContactsFormControls) {
if (key === 'country') {
this.contactFormGroup.get(key)?.setValue($localize`Suisse`);
this.contactFormGroup.get(key)?.setValue(this.COUNTRIES.CH.name);
} else {
this.contactFormGroup.get(key)?.setValue('');
}
Expand Down
9 changes: 9 additions & 0 deletions src/app/constants.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ export class ConstantsService {
PUBLIC: $localize `:@@order.public:Public`,
PRIVATE: $localize `:@@order.private:Privé`
}

static COUNTRIES = {
CH: {
name: $localize`@@country.ch.name:Suisse`
},
FR: {
name: $localize`@@country.fr.name:France`
}
};
}

0 comments on commit 55c514d

Please sign in to comment.