Skip to content

Commit 151e73e

Browse files
authored
Merge branch 'main' into aromanovv/PD-4790-revert-pr-#2737
2 parents db3249f + 99130a1 commit 151e73e

9 files changed

Lines changed: 1767 additions & 1437 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## v2.129.4 - 2026-02-10
2+
3+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.129.3...v2.129.4)
4+
5+
## v2.129.3 - 2026-02-10
6+
7+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.129.2...v2.129.3)
8+
9+
## v2.129.2 - 2026-02-04
10+
11+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.129.1...v2.129.2)
12+
13+
## v2.129.1 - 2026-01-30
14+
15+
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.129.0...v2.129.1)
16+
17+
- [#2737](https://github.com/ORCID/orcid-angular/pull/2737): Aromanovv/pd 4790 add 2fa to account settings password reset
18+
119
## v2.129.0 - 2026-01-29
220

321
[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.128.17...v2.129.0)

projects/orcid-ui/src/lib/components/record-header/record-header.component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@
198198
align-items: center;
199199
justify-content: flex-end;
200200
height: 36px; // Match title height
201-
margin-left: 16px; // Add spacing between title and actions
201+
margin-left: 32px; // Add spacing between title and actions
202+
grid-column: 3;
202203
}
203204

204205
.main-action-button {

src/app/constants.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ export const ORCID_URI_REGEXP =
4848
// https://regex101.com/r/M1fqZi/1
4949
export const URL_REGEXP =
5050
/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+\\,;=.>< ]+$/i
51-
// ISSN pattern using same validation as the backend
52-
//https://regex101.com/r/NYZTYS/1
53-
export const ISSN_REGEXP = /\b\d{4}-?\d{3}[\dXx]\b/
51+
export const ISSN_PORTAL_URL = 'https://portal.issn.org/resource/ISSN/'
52+
// Escape the URL characters for Regex (handling slashes and dots)
53+
const escapedUrl = ISSN_PORTAL_URL.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
54+
export const ISSN_REGEXP = new RegExp(
55+
`^(?:${escapedUrl})?\\d{4}-?\\d{3}[\\dXx]$`
56+
)
57+
5458
/* PROTOCOL REQUIRED*/
5559
// https://regex101.com/r/pSnDC7/1
5660
export const URL_REGEXP_BACKEND =
@@ -516,3 +520,22 @@ function isValidIsbn13(isbn: string): boolean {
516520
// The checksum must be perfectly divisible by 10.
517521
return checksum % 10 === 0
518522
}
523+
524+
function normaliseIssn(issn: string): string {
525+
if (issn) {
526+
// 1. Remove the portal URL
527+
issn = issn.replace(new RegExp(ISSN_PORTAL_URL, 'g'), '')
528+
529+
// 2. Remove ALL non-alphanumeric characters (spaces, hyphens, dots, etc.)
530+
issn = issn.replace(/[^a-zA-Z0-9]/g, '')
531+
532+
// 3. Force 'X' to uppercase
533+
issn = issn.replace(/x/g, 'X')
534+
535+
// 4. Format as 0000-000X if valid length
536+
if (issn.length === 8) {
537+
return issn.substring(0, 4) + '-' + issn.substring(4, 8)
538+
}
539+
}
540+
return ''
541+
}

src/app/record/components/affiliation-stacks-groups/modals/modal-affiliations/modal-affiliations.component.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { RecordCountriesService } from '../../../../../core/record-countries/rec
2727
import { first, map, switchMap, tap } from 'rxjs/operators'
2828
import {
2929
ISSN_REGEXP,
30+
ISSN_PORTAL_URL,
3031
MAX_LENGTH_LESS_THAN_ONE_THOUSAND,
3132
MAX_LENGTH_LESS_THAN_TWO_THOUSAND,
3233
URL_REGEXP,
@@ -63,8 +64,6 @@ export class ModalAffiliationsComponent implements OnInit, OnDestroy {
6364
issnLabel = $localize`:@@shared.link:Link`
6465
endDateLabel = $localize`:@@shared.endDate:End date`
6566

66-
ISSN_PORTAL_URL = 'https://portal.issn.org/resource/ISSN/'
67-
6867
private _type: AffiliationType
6968
dateLabel: string
7069
@Input()
@@ -394,13 +393,17 @@ export class ModalAffiliationsComponent implements OnInit, OnDestroy {
394393
const normalizedIssn = this.normaliseIssn(
395394
affiliationForm.get('issn')?.value?.trim()
396395
)
397-
const issnUrl = `${this.ISSN_PORTAL_URL}${normalizedIssn}`
396+
const issnValue = affiliationForm.get('issn')?.value?.trim()
397+
const issnUrl = `${ISSN_PORTAL_URL}${normalizedIssn}`
398398
affiliationToSave.affiliationExternalIdentifiers = [
399399
{
400400
errors: [],
401401
externalIdentifierId: {
402402
errors: [],
403-
value: affiliationForm.get('issn')?.value?.trim(),
403+
value:
404+
issnValue && issnValue.startsWith(ISSN_PORTAL_URL)
405+
? issnUrl
406+
: normalizedIssn,
404407
required: true,
405408
},
406409
externalIdentifierType: { value: 'issn' },
@@ -744,7 +747,7 @@ export class ModalAffiliationsComponent implements OnInit, OnDestroy {
744747
normaliseIssn(issn: string) {
745748
if (issn) {
746749
// 1. Remove the portal URL
747-
issn = issn.replace(new RegExp(this.ISSN_PORTAL_URL, 'g'), '')
750+
issn = issn.replace(new RegExp(ISSN_PORTAL_URL, 'g'), '')
748751

749752
// 2. Remove ALL non-alphanumeric characters (spaces, hyphens, dots, etc.)
750753
issn = issn.replace(/[^a-zA-Z0-9]/g, '')

src/app/record/components/work-form/work-form/work-form.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
MAX_LENGTH_LESS_THAN_TWO_THOUSAND,
3838
URL_REGEXP,
3939
isValidISBN,
40+
ISSN_REGEXP,
4041
} from '../../../../constants'
4142
import {
4243
Contributor,
@@ -258,6 +259,17 @@ export class WorkFormComponent implements OnInit {
258259
}
259260
}
260261

262+
if (externalIdentifierType === 'issn') {
263+
if (!ISSN_REGEXP.test(control.value)) {
264+
control.markAsTouched()
265+
return of({
266+
validFormat: true,
267+
resolved: false,
268+
attemptedResolution: false,
269+
})
270+
}
271+
}
272+
261273
return this._workService
262274
.validateWorkIdTypes(externalIdentifierType, control.value)
263275
.pipe(

0 commit comments

Comments
 (0)