Skip to content

Commit

Permalink
Make tariff and condition links configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Rusakov authored and lanseg committed Jan 10, 2025
1 parent 6e89313 commit 2803474
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/app/_components/help-overlay/help-overlay.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
</div>
</a>

<a *ngIf="tariffsUrl" color="primary" mat-button href="{{tariffsUrl}}" target="_blank">
<div class="flex-row" i18n>
Informations sur la tarification
</div>
</a>

<a *ngIf="conditionsUrl" color="primary" mat-button href="{{conditionsUrl}}" target="_blank">
<div class="flex-row" i18n>
Conditions d'utilisation
</div>
</a>

<!-- TODO: add links to the pricing document -->
<!-- TODO: add links to the usage conditions -->
<hr>
Expand Down
6 changes: 6 additions & 0 deletions src/app/_components/help-overlay/help-overlay.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export class HelpOverlayComponent implements OnInit {

@HostBinding('class') class = 'overlay-container';

tariffsUrl: string;
conditionsUrl: string;
phoneLabel: string;
phoneNumber: string;
email: string;
Expand All @@ -18,9 +20,13 @@ export class HelpOverlayComponent implements OnInit {
this.phoneLabel = configService.config?.contact.phone.label || '';
this.phoneNumber = configService.config?.contact.phone.number || '';
this.email = configService.config?.contact.email || '';
this.conditionsUrl = configService.config?.contact.links.conditions || '';
this.tariffsUrl = configService.config?.contact.links.tariffs || '';
}

ngOnInit(): void {
}



}
6 changes: 5 additions & 1 deletion src/app/_models/IConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export interface IConfig {
baseMapUrl: string;
geocoderUrl: string;
geocoderLayers: string[];
contact: { phone: { label: string; number: string }; email: string; };
contact: {
links: {conditions: string; tariffs:string;};
phone: { label: string; number: string };
email: string;
};
basemaps: Array<IBasemap>;
initialCenter: number[];
initialExtent: number[];
Expand Down
4 changes: 4 additions & 0 deletions src/assets/configs/config.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"label": "",
"number": ""
},
"links": {
"conditions": "http://conditions",
"tariffs": "http://tariffs"
},
"email": "[email protected]"
},
"initialCenter": [
Expand Down
20 changes: 17 additions & 3 deletions src/locale/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,32 @@
<context context-type="linenumber">5</context>
</context-group>
</trans-unit>
<trans-unit id="d64327efbdd0f8653d689489ea4b486c7cb5d8b0" datatype="html">
<source> Informations sur la tarification </source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/_components/help-overlay/help-overlay.component.html</context>
<context context-type="linenumber">10,12</context>
</context-group>
</trans-unit>
<trans-unit id="42da761136b351118ec563cfb5d4a5a53aa6348f" datatype="html">
<source> Conditions d&apos;utilisation </source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/_components/help-overlay/help-overlay.component.html</context>
<context context-type="linenumber">16,18</context>
</context-group>
</trans-unit>
<trans-unit id="b6b06490c915e07bc8ba7c88177574efa714af32" datatype="html">
<source>Avez-vous des questions ?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/_components/help-overlay/help-overlay.component.html</context>
<context context-type="linenumber">12</context>
<context context-type="linenumber">24</context>
</context-group>
</trans-unit>
<trans-unit id="main.phone" datatype="html">
<source>phone</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/_components/help-overlay/help-overlay.component.html</context>
<context context-type="linenumber">16</context>
<context context-type="linenumber">28</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/account/profile/profile.component.html</context>
Expand All @@ -158,7 +172,7 @@
<source>email</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/_components/help-overlay/help-overlay.component.html</context>
<context context-type="linenumber">23</context>
<context context-type="linenumber">35</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/account/profile/profile.component.html</context>
Expand Down

0 comments on commit 2803474

Please sign in to comment.