From 1ae70759b2de009094857801ab4bfc55e2ef9936 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Fernadez Date: Fri, 15 Dec 2023 11:32:12 -0600 Subject: [PATCH 1/4] 8909-prod-link-to-remove-duplicate-record-section-not-working --- ...settings-actions-deactivate.component.html | 4 ++-- .../settings-actions-deactivate.component.ts | 4 +++- .../settings-actions.component.ts | 22 ++++++++++++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html index 2867165429..e8a795d2f3 100644 --- a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html +++ b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html @@ -49,12 +49,12 @@ Account settings > Remove duplicate record -

+

{ + if (fragment === 'remove-duplicate-record') { + const element = this._window.document.querySelector('#cy-remove-duplicate-panel') + this.displayPanelByHashName('remove-duplicate') + setTimeout(() => { + if (element) { + element.scrollIntoView() + } + }) + } + }) + } + + private displayPanelByHashName(hash: string) { switch (hash) { case 'download-data': this.settingDownload = true From e841a46fd34a1b26c6aace6ca857b272e48067c7 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Fernadez Date: Fri, 15 Dec 2023 11:36:10 -0600 Subject: [PATCH 2/4] Clean up --- .../settings-actions-deactivate.component.html | 2 +- .../components/settings-actions/settings-actions.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html index e8a795d2f3..4b46bd613e 100644 --- a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html +++ b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html @@ -49,7 +49,7 @@ Account settings > Remove duplicate record diff --git a/src/app/account-settings/components/settings-actions/settings-actions.component.ts b/src/app/account-settings/components/settings-actions/settings-actions.component.ts index e24bd49825..5b87a88984 100644 --- a/src/app/account-settings/components/settings-actions/settings-actions.component.ts +++ b/src/app/account-settings/components/settings-actions/settings-actions.component.ts @@ -29,9 +29,9 @@ export class SettingsActionsComponent implements OnInit { const hash = this._window.location.hash.substr(1) this.displayPanelByHashName(hash) this.activeRoute.fragment.subscribe((fragment) => { - if (fragment === 'remove-duplicate-record') { + if (fragment === 'remove-duplicate') { const element = this._window.document.querySelector('#cy-remove-duplicate-panel') - this.displayPanelByHashName('remove-duplicate') + this.displayPanelByHashName(fragment) setTimeout(() => { if (element) { element.scrollIntoView() From e9eda6880952b1d02ff70a86776c6ad47cedc21b Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Fernadez Date: Fri, 15 Dec 2023 11:59:19 -0600 Subject: [PATCH 3/4] fix test --- .../settings-actions/settings-actions.component.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts b/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts index 833399f9d9..4123ff54ea 100644 --- a/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts +++ b/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts @@ -2,6 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' import { SettingsActionsComponent } from './settings-actions.component' import { WINDOW_PROVIDERS } from 'src/app/cdk/window/window.service' +import { ActivatedRoute } from '@angular/router' describe('SettingsActionsComponent', () => { let component: SettingsActionsComponent @@ -10,7 +11,7 @@ describe('SettingsActionsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [SettingsActionsComponent], - providers: [WINDOW_PROVIDERS], + providers: [WINDOW_PROVIDERS, { provide: ActivatedRoute, useValue: {} }], }).compileComponents() }) From ee5b6937d5027775f3382f8bb1c37f136d29855e Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Fernadez Date: Fri, 15 Dec 2023 12:03:50 -0600 Subject: [PATCH 4/4] fix test --- .../settings-actions/settings-actions.component.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts b/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts index 4123ff54ea..19f90933d6 100644 --- a/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts +++ b/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts @@ -3,6 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' import { SettingsActionsComponent } from './settings-actions.component' import { WINDOW_PROVIDERS } from 'src/app/cdk/window/window.service' import { ActivatedRoute } from '@angular/router' +import { of } from 'rxjs' describe('SettingsActionsComponent', () => { let component: SettingsActionsComponent @@ -11,7 +12,7 @@ describe('SettingsActionsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [SettingsActionsComponent], - providers: [WINDOW_PROVIDERS, { provide: ActivatedRoute, useValue: {} }], + providers: [WINDOW_PROVIDERS, { provide: ActivatedRoute, useValue: {fragment: of({})} }], }).compileComponents() })