From b3160d45f583146d378da2065de3e008460f4f8d Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Wed, 4 Oct 2023 12:53:30 -0500 Subject: [PATCH 01/12] feature: Add `SOURCE_SORTING` togglz --- .../affiliation-stacks-groups.component.html | 2 +- .../affiliation-stacks-groups.component.ts | 11 ++++++++++- .../funding-stacks-groups.component.html | 2 +- .../funding-stacks-groups.component.ts | 17 ++++++++++++++--- .../work-stack-group.component.html | 2 +- .../work-stack-group.component.ts | 17 ++++++++++++++--- 6 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.html b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.html index 167ff9144d..4b8b51ebda 100644 --- a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.html +++ b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.html @@ -21,7 +21,7 @@ [(expandedContent)]="expandedContent['EMPLOYMENT']" (expandedContentChange)="expandedContentChange.emit(expandedContent)" [isPublicRecord]="isPublicRecord" - [sortTypes]="['title', 'start', 'end', 'source']" + [sortTypes]="sortTypes" [sortType]="'end'" (sort)="sortEvent($event, 'EMPLOYMENT')" id="cy-affiliation-employment" diff --git a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts index 98969f2c02..1e4c6e13c5 100644 --- a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts +++ b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts @@ -15,7 +15,7 @@ import { UserRecord, UserRecordOptions, } from 'src/app/types/record.local' -import { SortData } from 'src/app/types/sort' +import { SortData, SortOrderType } from 'src/app/types/sort' import { UserInfo } from '../../../types' import { TogglzService } from '../../../core/togglz/togglz.service' @@ -54,6 +54,8 @@ export class AffiliationStacksGroupsComponent implements OnInit { @Output() expandedContentChange: EventEmitter = new EventEmitter() professionalActivitiesTogglz = false + sourceSorting = false + sortTypes: SortOrderType[] = ['title', 'start', 'end'] constructor( private _record: RecordService, @@ -66,6 +68,10 @@ export class AffiliationStacksGroupsComponent implements OnInit { .getStateOf('PROFESSIONAL_ACTIVITIES') .pipe(take(1)) .subscribe((value) => (this.professionalActivitiesTogglz = value)) + this._togglz + .getStateOf('SOURCE_SORTING') + .pipe(take(1)) + .subscribe((value) => (this.sourceSorting = value)) this.$loading = this._recordAffiliationService.$loading this._record .getRecord({ @@ -106,6 +112,9 @@ export class AffiliationStacksGroupsComponent implements OnInit { } } }) + if (this.sourceSorting) { + this.sortTypes.push('source') + } } trackByProfileAffiliationUiGroups(index, item: AffiliationUIGroup) { diff --git a/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.html b/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.html index bccb353be2..b496ed01ae 100644 --- a/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.html +++ b/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.html @@ -15,7 +15,7 @@ [isPublicRecord]="isPublicRecord" [(expandedContent)]="expandedContent['FUNDING']" (expandedContentChange)="expandedContentChange.emit(expandedContent)" - [sortTypes]="['date', 'title', 'type', 'source']" + [sortTypes]="sortTypes" [sortType]="'date'" (sort)="sortEvent($event)" > diff --git a/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts b/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts index 0ed5bc56e5..0de17ff27a 100644 --- a/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts +++ b/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { Observable, Subject } from 'rxjs' -import { first, takeUntil } from 'rxjs/operators' +import { first, take, takeUntil } from 'rxjs/operators' import { UserService } from 'src/app/core' import { RecordCountriesService } from 'src/app/core/record-countries/record-countries.service' import { RecordService } from 'src/app/core/record/record.service' @@ -11,10 +11,11 @@ import { UserRecordOptions, } from 'src/app/types/record.local' import { UserSession } from 'src/app/types/session.local' -import { SortData } from 'src/app/types/sort' +import { SortData, SortOrderType } from 'src/app/types/sort' import { RecordFundingsService } from '../../../core/record-fundings/record-fundings.service' import { UserInfo } from '../../../types' +import { TogglzService } from '../../../core/togglz/togglz.service' @Component({ selector: 'app-fundings', @@ -40,16 +41,26 @@ export class FundingStacksGroupsComponent implements OnInit { ngOrcidFunding = $localize`:@@shared.funding:Funding` countryCodes: { key: string; value: string }[] loading = true + sourceSorting = false + sortTypes: SortOrderType[] = ['title', 'start', 'end'] constructor( private _userSession: UserService, private _record: RecordService, private _recordFundingsService: RecordFundingsService, - private _recordCountryService: RecordCountriesService + private _recordCountryService: RecordCountriesService, + private _togglz: TogglzService ) {} ngOnInit(): void { + this._togglz + .getStateOf('SOURCE_SORTING') + .pipe(take(1)) + .subscribe((value) => (this.sourceSorting = value)) this.getRecord() + if (this.sourceSorting) { + this.sortTypes.push('source') + } } private getRecord() { diff --git a/src/app/record/components/work-stack-group/work-stack-group.component.html b/src/app/record/components/work-stack-group/work-stack-group.component.html index a729b151c7..7f4647d858 100644 --- a/src/app/record/components/work-stack-group/work-stack-group.component.html +++ b/src/app/record/components/work-stack-group/work-stack-group.component.html @@ -15,7 +15,7 @@ [isPublicRecord]="isPublicRecord" [(expandedContent)]="expandedContent['WORK']" (expandedContentChange)="expandedContentChange.emit(expandedContent)" - [sortTypes]="['date', 'title', 'type', 'source']" + [sortTypes]="sortTypes" [sortType]="'date'" [addMenuOptions]="addMenuOptions" (sort)="sortEvent($event)" diff --git a/src/app/record/components/work-stack-group/work-stack-group.component.ts b/src/app/record/components/work-stack-group/work-stack-group.component.ts index eacfafe2ec..1bc48f040d 100644 --- a/src/app/record/components/work-stack-group/work-stack-group.component.ts +++ b/src/app/record/components/work-stack-group/work-stack-group.component.ts @@ -15,7 +15,7 @@ import { MatDialog } from '@angular/material/dialog' import { MatPaginatorIntl, PageEvent } from '@angular/material/paginator' import { isEmpty } from 'lodash' import { Observable, Subject } from 'rxjs' -import { first } from 'rxjs/operators' +import { first, take } from 'rxjs/operators' import { PlatformInfo, PlatformInfoService } from 'src/app/cdk/platform-info' import { ADD_EVENT_ACTION, @@ -34,7 +34,7 @@ import { UserRecord, UserRecordOptions, } from 'src/app/types/record.local' -import { SortData } from 'src/app/types/sort' +import { SortData, SortOrderType } from 'src/app/types/sort' import { UserInfo } from '../../../types' import { ModalDeleteItemsComponent } from '../modals/modal-delete-item/modal-delete-items.component' @@ -49,6 +49,7 @@ import { WorkBibtexModalComponent } from './modals/work-bibtex-modal/work-bibtex import { ModalCombineWorksWithSelectorComponent } from '../work/modals/modal-combine-works-with-selector/modal-combine-works-with-selector.component' import { GroupingSuggestions } from 'src/app/types/works.endpoint' import { AnnouncerService } from 'src/app/core/announcer/announcer.service' +import { TogglzService } from '../../../core/togglz/togglz.service' @Component({ selector: 'app-work-stack-group', @@ -127,6 +128,8 @@ export class WorkStackGroupComponent implements OnInit { platform: PlatformInfo selectedWorks: string[] = [] selectAll: false + sourceSorting = false + sortTypes: SortOrderType[] = ['title', 'start', 'end'] @ViewChildren('selectAllCheckbox') selectAllCheckbox: MatCheckbox @ViewChildren('appWorkStacks') appWorkStacks: QueryList @@ -138,10 +141,15 @@ export class WorkStackGroupComponent implements OnInit { private _record: RecordService, private _works: RecordWorksService, private _matPaginatorIntl: MatPaginatorIntl, - private _announce: AnnouncerService + private _announce: AnnouncerService, + private _togglz: TogglzService ) {} ngOnInit(): void { + this._togglz + .getStateOf('SOURCE_SORTING') + .pipe(take(1)) + .subscribe((value) => (this.sourceSorting = value)) this.$loading = this._works.$loading this._record .getRecord({ publicRecordId: this.isPublicRecord }) @@ -163,6 +171,9 @@ export class WorkStackGroupComponent implements OnInit { this._platform.get().subscribe((platform) => { this.platform = platform }) + if (this.sourceSorting) { + this.sortTypes.push('source') + } } private getGroupingSuggestions() { From f1c91080c9c30a7f339f7fc853160f7d0f981aff Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Wed, 4 Oct 2023 15:51:36 -0500 Subject: [PATCH 02/12] fix: Add source sorting togglz inside togglz subscribe --- .../affiliation-stacks-groups.component.ts | 10 +++++----- .../funding-stacks-groups.component.ts | 14 +++++++------- .../work-stack-group/work-stack-group.component.ts | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts index 1e4c6e13c5..8dc07c6674 100644 --- a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts +++ b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts @@ -54,7 +54,6 @@ export class AffiliationStacksGroupsComponent implements OnInit { @Output() expandedContentChange: EventEmitter = new EventEmitter() professionalActivitiesTogglz = false - sourceSorting = false sortTypes: SortOrderType[] = ['title', 'start', 'end'] constructor( @@ -71,7 +70,11 @@ export class AffiliationStacksGroupsComponent implements OnInit { this._togglz .getStateOf('SOURCE_SORTING') .pipe(take(1)) - .subscribe((value) => (this.sourceSorting = value)) + .subscribe((sourceSortingTogglz: boolean) => { + if (sourceSortingTogglz) { + this.sortTypes.push('source') + } + }) this.$loading = this._recordAffiliationService.$loading this._record .getRecord({ @@ -112,9 +115,6 @@ export class AffiliationStacksGroupsComponent implements OnInit { } } }) - if (this.sourceSorting) { - this.sortTypes.push('source') - } } trackByProfileAffiliationUiGroups(index, item: AffiliationUIGroup) { diff --git a/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts b/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts index 0de17ff27a..216a300742 100644 --- a/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts +++ b/src/app/record/components/funding-stacks-groups/funding-stacks-groups.component.ts @@ -41,7 +41,6 @@ export class FundingStacksGroupsComponent implements OnInit { ngOrcidFunding = $localize`:@@shared.funding:Funding` countryCodes: { key: string; value: string }[] loading = true - sourceSorting = false sortTypes: SortOrderType[] = ['title', 'start', 'end'] constructor( @@ -54,13 +53,14 @@ export class FundingStacksGroupsComponent implements OnInit { ngOnInit(): void { this._togglz - .getStateOf('SOURCE_SORTING') - .pipe(take(1)) - .subscribe((value) => (this.sourceSorting = value)) + .getStateOf('SOURCE_SORTING') + .pipe(take(1)) + .subscribe((sourceSortingTogglz: boolean) => { + if (sourceSortingTogglz) { + this.sortTypes.push('source') + } + }) this.getRecord() - if (this.sourceSorting) { - this.sortTypes.push('source') - } } private getRecord() { diff --git a/src/app/record/components/work-stack-group/work-stack-group.component.ts b/src/app/record/components/work-stack-group/work-stack-group.component.ts index 1bc48f040d..d6aaf6377f 100644 --- a/src/app/record/components/work-stack-group/work-stack-group.component.ts +++ b/src/app/record/components/work-stack-group/work-stack-group.component.ts @@ -128,7 +128,6 @@ export class WorkStackGroupComponent implements OnInit { platform: PlatformInfo selectedWorks: string[] = [] selectAll: false - sourceSorting = false sortTypes: SortOrderType[] = ['title', 'start', 'end'] @ViewChildren('selectAllCheckbox') selectAllCheckbox: MatCheckbox @@ -147,9 +146,13 @@ export class WorkStackGroupComponent implements OnInit { ngOnInit(): void { this._togglz - .getStateOf('SOURCE_SORTING') - .pipe(take(1)) - .subscribe((value) => (this.sourceSorting = value)) + .getStateOf('SOURCE_SORTING') + .pipe(take(1)) + .subscribe((sourceSortingTogglz: boolean) => { + if (sourceSortingTogglz) { + this.sortTypes.push('source') + } + }) this.$loading = this._works.$loading this._record .getRecord({ publicRecordId: this.isPublicRecord }) @@ -171,9 +174,6 @@ export class WorkStackGroupComponent implements OnInit { this._platform.get().subscribe((platform) => { this.platform = platform }) - if (this.sourceSorting) { - this.sortTypes.push('source') - } } private getGroupingSuggestions() { From 87c7f2c27016046a351a8187d0d7f5522bf0548e Mon Sep 17 00:00:00 2001 From: leomendoza123 Date: Wed, 4 Oct 2023 21:28:38 +0000 Subject: [PATCH 03/12] =?UTF-8?q?=F0=9F=A4=96=20GITHUB=20ACTIONS=20format?= =?UTF-8?q?=5Fprettier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../affiliation-stacks-groups.component.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts index 8dc07c6674..46ffd5cd59 100644 --- a/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts +++ b/src/app/record/components/affiliation-stacks-groups/affiliation-stacks-groups.component.ts @@ -68,13 +68,13 @@ export class AffiliationStacksGroupsComponent implements OnInit { .pipe(take(1)) .subscribe((value) => (this.professionalActivitiesTogglz = value)) this._togglz - .getStateOf('SOURCE_SORTING') - .pipe(take(1)) - .subscribe((sourceSortingTogglz: boolean) => { - if (sourceSortingTogglz) { - this.sortTypes.push('source') - } - }) + .getStateOf('SOURCE_SORTING') + .pipe(take(1)) + .subscribe((sourceSortingTogglz: boolean) => { + if (sourceSortingTogglz) { + this.sortTypes.push('source') + } + }) this.$loading = this._recordAffiliationService.$loading this._record .getRecord({ From 69c0567b4ada1450d68f9aaec23f21f7adbc3856 Mon Sep 17 00:00:00 2001 From: github actions Date: Wed, 4 Oct 2023 21:43:38 +0000 Subject: [PATCH 04/12] v2.41.0 changelog update --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1bb0300a2..f09ed7e4a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## v2.41.0 - 2023-10-04 + +[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.40.6...v2.41.0) + +- [#2069](https://github.com/ORCID/orcid-angular/pull/2069): feature: Add `SOURCE_SORTING` togglz + +### Fix + +- Add source sorting togglz inside togglz subscribe + +### Feature + +- Add `SOURCE_SORTING` togglz + ## v2.40.6 - 2023-10-04 [Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.40.5...v2.40.6) From 2b04dfeae9888c4a54f880a82af86044e1a31842 Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Thu, 5 Oct 2023 22:20:16 -0500 Subject: [PATCH 05/12] fix: Add one trust auto-blocking script and remove unused attributes in gtag (#2070) --- src/environments/environment.local.ts | 2 +- src/index.html | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/environments/environment.local.ts b/src/environments/environment.local.ts index 19b844ebb1..5d737d50ed 100644 --- a/src/environments/environment.local.ts +++ b/src/environments/environment.local.ts @@ -8,7 +8,7 @@ export const environment = { BASE_URL: '', INFO_SITE: 'https://info.orcid.org/', GOOGLE_ANALYTICS_TESTING_MODE: true, - GOOGLE_TAG_MANAGER: 'GTM-M9Z7DHS', + GOOGLE_TAG_MANAGER: 'GTM-0000000', GOOGLE_RECAPTCHA: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', HELP_HERO_ID: 'oYFQMrzFHA', ZENDESK: null, diff --git a/src/index.html b/src/index.html index 84e30ec09b..b062faa4d0 100644 --- a/src/index.html +++ b/src/index.html @@ -66,7 +66,6 @@ gtag('consent', 'default', { analytics_storage: 'denied', ad_storage: 'denied', - functionality_storage: 'denied', region: countries, wait_for_update: 500, }) @@ -74,10 +73,10 @@ gtag('consent', 'default', { analytics_storage: 'granted', ad_storage: 'granted', - functionality_storage: 'granted', wait_for_update: 500, }) + - + -