Skip to content

Commit be13142

Browse files
authored
Merge pull request #1977 from ORCID/8662-qa-items-in-countries-modal-not-displayed-correctly-for-de-pl-and-tr
8662 qa items in countries modal not displayed correctly for de pl and tr
2 parents 790a9d1 + d01277b commit be13142

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

src/app/cdk/side-bar/modals/modal-country/modal-country.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@
126126
#descriptionInput
127127
[attr.aria-label]="ariaLabelCountryLocationReadOnly"
128128
matInput
129-
formControlName="country"
130-
placeholder=" {{ ngOrcidCountry }}"
131129
[ngClass]="{ 'website-input': screenDirection === 'rtl' }"
130+
[value]="country.countryName || ''"
132131
/>
133132
<mat-hint *ngIf="country.putCode.indexOf('new') < 0">
134133
<app-source-hit

src/app/core/google-tag-manager/google-tag-manager.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { ItemGTM } from '../../types/item_gtm'
1313
import { ERROR_REPORT } from '../../errors'
1414
import { ErrorHandlerService } from '../error-handler/error-handler.service'
1515
import { WINDOW } from 'src/app/cdk/window'
16-
import { log } from 'console'
1716

1817
@Injectable({
1918
providedIn: 'root',

src/app/core/record-countries/record-countries.service.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { HttpClient, HttpHeaders } from '@angular/common/http'
22
import { Injectable } from '@angular/core'
3-
import { Observable, of, ReplaySubject } from 'rxjs'
3+
import { forkJoin, merge, Observable, of, ReplaySubject } from 'rxjs'
44
import { retry, catchError, tap, map } from 'rxjs/operators'
55
import { CountriesEndpoint } from 'src/app/types/record-country.endpoint'
6-
import { UserRecordOptions } from 'src/app/types/record.local'
6+
import {
7+
SideBarPublicUserRecord,
8+
UserRecordOptions,
9+
} from 'src/app/types/record.local'
710
import { environment } from 'src/environments/environment'
811
import { ErrorHandlerService } from '../error-handler/error-handler.service'
912
import { RecordPublicSideBarService } from '../record-public-side-bar/record-public-side-bar.service'
@@ -297,9 +300,20 @@ export class RecordCountriesService {
297300
}
298301
): Observable<CountriesEndpoint> {
299302
if (options.publicRecordId) {
300-
return this._recordPublicSidebar
301-
.getPublicRecordSideBar(options)
302-
.pipe(map((value) => value.countries))
303+
return forkJoin([
304+
this._recordPublicSidebar.getPublicRecordSideBar(options),
305+
this.getCountryCodes(),
306+
]).pipe(
307+
map((value) => {
308+
const countries = value[0].countries
309+
const countryCodes = value[1]
310+
countries.addresses.forEach((country) => {
311+
//Override backend country name translations
312+
country.countryName = countryCodes[country.iso2Country.value] || ''
313+
})
314+
return countries
315+
})
316+
)
303317
}
304318

305319
if (!this.$addresses) {

0 commit comments

Comments
 (0)