Skip to content

Commit ede3315

Browse files
committed
fix: improve sensitive area detail
1 parent 7f27805 commit ede3315

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/app/components/sensitive-area/sensitive-area.component.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626
</div>
2727
<div class="sensitive-area-practices">
2828
<div
29-
*ngFor="let practice of sensitiveArea.properties.practices"
29+
*ngFor="
30+
let practice of sensitiveArea.properties.practices;
31+
let i = index
32+
"
3033
class="sensitive-area-practice"
31-
[innerHTML]="getSensitiveAreaPracticeName(practice)"
34+
[innerHTML]="getSensitiveAreaPracticeName(practice, i)"
3235
></div>
3336
</div>
3437
</div>

src/app/components/sensitive-area/sensitive-area.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
}
3939
}
4040

41+
.sensitive-area-period {
42+
text-transform: capitalize;
43+
}
44+
4145
.sensitive-area-period-container,
4246
.sensitive-area-practice-container,
4347
.sensitive-area-contact-container,

src/app/components/sensitive-area/sensitive-area.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ export class SensitiveAreaComponent {
1111
@Input() public sensitiveArea!: SensitiveArea | any;
1212
@Input() public sensitiveAreaPractices!: DataSetting | undefined;
1313

14-
getSensitiveAreaPracticeName(id: number): string {
15-
return this.sensitiveAreaPractices!.values.find(
16-
(sensitiveAreaPractice) => sensitiveAreaPractice.id === id
17-
)!.name;
14+
getSensitiveAreaPracticeName(id: number, index: number): string {
15+
return `${
16+
this.sensitiveAreaPractices!.values.find(
17+
(sensitiveAreaPractice) => sensitiveAreaPractice.id === id
18+
)!.name
19+
}${!(index + 1 === this.sensitiveArea.properties.practices.length) ? ' -&nbsp;' : ''}`;
1820
}
1921

2022
getSensitiveAreaPeriod(index: number): string {
21-
return `${new Date(0, index + 1, 0).toLocaleDateString('fr', { month: 'long' }).toUpperCase()}${
23+
return `${new Date(0, index + 1, 0).toLocaleDateString('fr', { month: 'long' })}${
2224
this.sensitiveArea.properties.period
2325
.slice(index + 1)
2426
.find((month: boolean) => month)

0 commit comments

Comments
 (0)