diff --git a/build.gradle b/build.gradle index 28009c423b3..9b76a9abc3b 100644 --- a/build.gradle +++ b/build.gradle @@ -539,6 +539,7 @@ task coreDev { dependsOn 'javadoc' dependsOn 'checkDependenciesDotGradle' dependsOn 'checkLicense' + dependsOn ':console-webapp:runConsoleWebappUnitTests' dependsOn ':core:check' dependsOn 'assemble' diff --git a/config/presubmits.py b/config/presubmits.py index 50b73167308..68c609b232c 100644 --- a/config/presubmits.py +++ b/config/presubmits.py @@ -26,10 +26,11 @@ # We should never analyze any generated files UNIVERSALLY_SKIPPED_PATTERNS = {"/build/", "cloudbuild-caches", "/out/", ".git/", - ".gradle/", "/dist/", "/console-alpha/", "/console-crash/", "/console-qa", - "/console-sandbox", "/console-production", "karma.conf.js", "polyfills.ts", - "test.ts", "/docs/console-endpoints/", "/bin/generated-sources/", - "/bin/generated-test-sources/", "src/main/generated", "src/test/generated"} + ".gradle/", "/.angular/", "/dist/", "/console-alpha/", "/console-crash/", + "/console-qa", "/console-sandbox", "/console-production", "karma.conf.js", + "polyfills.ts", "test.ts", "/docs/console-endpoints/", + "/bin/generated-sources/", "/bin/generated-test-sources/", + "src/main/generated", "src/test/generated"} # We can't rely on CI to have the Enum package installed so we do this instead. FORBIDDEN = 1 REQUIRED = 2 diff --git a/console-webapp/angular.json b/console-webapp/angular.json index 2631ae0f74c..0e780b22fdf 100644 --- a/console-webapp/angular.json +++ b/console-webapp/angular.json @@ -173,7 +173,7 @@ }, "cli": { "cache": { - "enabled": false + "enabled": true }, "analytics": false, "schematicCollections": ["@angular-eslint/schematics"] diff --git a/console-webapp/build.gradle b/console-webapp/build.gradle index 93dfff82c67..9e0adf3c406 100644 --- a/console-webapp/build.gradle +++ b/console-webapp/build.gradle @@ -15,12 +15,23 @@ def consoleDir = "${rootDir}/console-webapp" def projectParam = "--project=${rootProject.gcpProject}" clean { + delete "${consoleDir}/.angular" delete "${consoleDir}/node_modules" delete "${consoleDir}/staged/dist" } +def consoleSourceInputs = [ + "${consoleDir}/package.json", + "${consoleDir}/package-lock.json", + "${consoleDir}/angular.json", + "${consoleDir}/tsconfig.json", + "${consoleDir}/tsconfig.app.json", +] + task npmInstallDeps(type: Exec) { workingDir "${consoleDir}/" + inputs.files("${consoleDir}/package.json", "${consoleDir}/package-lock.json") + outputs.dir("${consoleDir}/node_modules") commandLine 'sh', '-c', 'npm i --no-audit --no-fund --loglevel=error' } @@ -31,12 +42,20 @@ task runConsoleWebappLocally(type: Exec) { task runConsoleWebappUnitTests(type: Exec) { workingDir "${consoleDir}/" + inputs.dir("${consoleDir}/src") + inputs.files(consoleSourceInputs) + inputs.file("${consoleDir}/tsconfig.spec.json") + outputs.upToDateWhen { true } commandLine 'sh', '-c', 'npm run test' } task buildConsoleWebapp(type: Exec) { workingDir "${consoleDir}/" def configuration = project.getProperty('configuration') + inputs.property('configuration', configuration) + inputs.dir("${consoleDir}/src") + inputs.files(consoleSourceInputs) + outputs.dir("${consoleDir}/staged/dist") commandLine 'sh', '-c', "npx ng build --base-href=/console/ --configuration=${configuration} --output-path=staged/dist" doFirst { println "Building console for environment: ${configuration}" @@ -45,9 +64,12 @@ task buildConsoleWebapp(type: Exec) { task buildConsoleForAll() {} -def createConsoleTask = { env -> +def createConsoleBuildTask = { env -> project.tasks.register("buildConsoleFor${env.capitalize()}", Exec) { workingDir "${consoleDir}/" + inputs.dir("${consoleDir}/src") + inputs.files(consoleSourceInputs) + outputs.dir("${consoleDir}/staged/console-${env}") commandLine 'sh', '-c', "npx ng build --base-href=/console/ --configuration=${env}" doFirst { println "Building console for environment: ${env}" @@ -61,6 +83,26 @@ def createConsoleTask = { env -> } dependsOn(tasks.npmInstallDeps) } +} + +def createConsoleCopyTask = { env, sourceEnv -> + project.tasks.register("buildConsoleFor${env.capitalize()}", Copy) { + from "${consoleDir}/staged/console-${sourceEnv}" + into "${consoleDir}/staged/console-${env}" + dependsOn(tasks.named("buildConsoleFor${sourceEnv.capitalize()}")) + } +} + +['alpha', 'sandbox', 'production'].forEach { env -> + createConsoleBuildTask(env) +} + +// 'crash' and 'qa' share the exact same unoptimized build configuration as 'alpha' +['crash', 'qa'].forEach { env -> + createConsoleCopyTask(env, 'alpha') +} + +['alpha', 'crash', 'qa', 'sandbox', 'production'].forEach { env -> project.tasks.register("deleteConsoleFor${env.capitalize()}", Delete) { delete "${consoleDir}/staged/console-${env}" } @@ -72,14 +114,8 @@ def createConsoleTask = { env -> } } -['alpha', 'crash', 'qa', 'sandbox', 'production'].forEach {env -> - createConsoleTask(env) -} - -// Force an order so we don't run these tasks in parallel. -tasks.buildConsoleForCrash.mustRunAfter(tasks.buildConsoleForAlpha) -tasks.buildConsoleForQa.mustRunAfter(tasks.buildConsoleForCrash) -tasks.buildConsoleForSandbox.mustRunAfter(tasks.buildConsoleForQa) +// Force an order so the Exec tasks that stage through staged/dist don't run in parallel. +tasks.buildConsoleForSandbox.mustRunAfter(tasks.buildConsoleForAlpha) tasks.buildConsoleForProduction.mustRunAfter(tasks.buildConsoleForSandbox) // This task must run last, otherwise the previous tasks will have deleted the "dist" folder. tasks.buildConsoleWebapp.mustRunAfter(tasks.buildConsoleForProduction) @@ -91,6 +127,8 @@ task applyFormatting(type: Exec) { task checkFormatting(type: Exec) { workingDir "${consoleDir}/" + inputs.dir("${consoleDir}/src") + outputs.upToDateWhen { true } commandLine 'sh', '-c', 'npm run prettify:check' } @@ -98,6 +136,7 @@ tasks.buildConsoleWebapp.dependsOn(tasks.npmInstallDeps) tasks.runConsoleWebappUnitTests.dependsOn(tasks.npmInstallDeps) tasks.applyFormatting.dependsOn(tasks.npmInstallDeps) tasks.checkFormatting.dependsOn(tasks.npmInstallDeps) +tasks.test.dependsOn(tasks.runConsoleWebappUnitTests) tasks.build.dependsOn(tasks.checkFormatting) tasks.build.dependsOn(tasks.runConsoleWebappUnitTests) tasks.build.dependsOn(tasks.buildConsoleForAll) diff --git a/console-webapp/package-lock.json b/console-webapp/package-lock.json index d6989119aaf..625c0818517 100644 --- a/console-webapp/package-lock.json +++ b/console-webapp/package-lock.json @@ -8,7 +8,6 @@ "name": "console-webapp", "version": "0.0.0", "dependencies": { - "@angular/animations": "^22.0.6", "@angular/cdk": "^22.0.4", "@angular/common": "^22.0.6", "@angular/compiler": "^22.0.6", @@ -574,22 +573,6 @@ "typescript": "*" } }, - "node_modules/@angular/animations": { - "version": "22.0.6", - "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-22.0.6.tgz", - "integrity": "sha512-5bBAuKtawVK4KPq6U/yoE5yCyKymEnXNN7UJ1Lb7PUuuYmLnUXb7zJpC7HwtHTuV/0PTCkGlLE59NtcrrolTuA==", - "deprecated": "@angular/animations is deprecated. Use `animate.enter` and `animate.leave` instead. For more information see: https://v22.angular.dev/guide/animations.", - "license": "MIT", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": "^22.22.3 || ^24.15.0 || >=26.0.0" - }, - "peerDependencies": { - "@angular/core": "22.0.6" - } - }, "node_modules/@angular/build": { "version": "22.0.6", "resolved": "https://registry.npmjs.org/@angular/build/-/build-22.0.6.tgz", diff --git a/console-webapp/package.json b/console-webapp/package.json index bd9ccdfa1a5..23eea9ad167 100644 --- a/console-webapp/package.json +++ b/console-webapp/package.json @@ -16,7 +16,6 @@ }, "private": true, "dependencies": { - "@angular/animations": "^22.0.6", "@angular/cdk": "^22.0.4", "@angular/common": "^22.0.6", "@angular/compiler": "^22.0.6", diff --git a/console-webapp/src/app/app.component.spec.ts b/console-webapp/src/app/app.component.spec.ts index e9759755fc2..abc9109d575 100644 --- a/console-webapp/src/app/app.component.spec.ts +++ b/console-webapp/src/app/app.component.spec.ts @@ -15,7 +15,6 @@ import { provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent } from './app.component'; import { routes } from './app.routes'; import { PocReminderComponent } from './shared/components/pocReminder/pocReminder.component'; @@ -66,7 +65,6 @@ describe('AppComponent', () => { await TestBed.configureTestingModule({ imports: [ MatSidenavModule, - NoopAnimationsModule, MatSnackBarModule, AppComponent, RouterModule.forRoot(routes), @@ -166,17 +164,17 @@ describe('AppComponent', () => { describe('Sidenav behavior', () => { it('should toggle sidenav open and closed', () => { fixture.detectChanges(); - const closeSpy = vi.spyOn(component.sidenav, 'close'); - const openSpy = vi.spyOn(component.sidenav, 'open'); + const closeSpy = vi.spyOn(component.sidenav(), 'close'); + const openSpy = vi.spyOn(component.sidenav(), 'open'); - Object.defineProperty(component.sidenav, 'opened', { + Object.defineProperty(component.sidenav(), 'opened', { value: true, configurable: true, }); component.toggleSidenav(); expect(closeSpy).toHaveBeenCalled(); - Object.defineProperty(component.sidenav, 'opened', { + Object.defineProperty(component.sidenav(), 'opened', { value: false, configurable: true, }); @@ -189,7 +187,7 @@ describe('AppComponent', () => { const eventsSubject = router.events as unknown as Subject; fixture.detectChanges(); - const closeSpy = vi.spyOn(component.sidenav, 'close'); + const closeSpy = vi.spyOn(component.sidenav(), 'close'); mockBreakPointService.isMobileView.set(true); eventsSubject.next(new NavigationEnd(1, '/home', '/home')); @@ -201,7 +199,7 @@ describe('AppComponent', () => { const eventsSubject = router.events as unknown as Subject; fixture.detectChanges(); - const closeSpy = vi.spyOn(component.sidenav, 'close'); + const closeSpy = vi.spyOn(component.sidenav(), 'close'); mockBreakPointService.isMobileView.set(false); eventsSubject.next(new NavigationEnd(1, '/home', '/home')); diff --git a/console-webapp/src/app/app.component.ts b/console-webapp/src/app/app.component.ts index c2f0b9104ac..93fbd5d29f8 100644 --- a/console-webapp/src/app/app.component.ts +++ b/console-webapp/src/app/app.component.ts @@ -16,7 +16,7 @@ import { AfterViewInit, Component, effect, - ViewChild, + viewChild, ChangeDetectionStrategy, } from '@angular/core'; import { MatSidenav } from '@angular/material/sidenav'; @@ -39,8 +39,7 @@ import { PocReminderComponent } from './shared/components/pocReminder/pocReminde changeDetection: ChangeDetectionStrategy.OnPush, }) export class AppComponent implements AfterViewInit { - @ViewChild(MatSidenav) - sidenav!: MatSidenav; + sidenav = viewChild.required(MatSidenav); constructor( protected registrarService: RegistrarService, @@ -74,17 +73,17 @@ export class AppComponent implements AfterViewInit { this.router.events.subscribe((event) => { if (event instanceof NavigationEnd) { if (this.breakpointObserver.isMobileView()) { - this.sidenav.close(); + this.sidenav().close(); } } }); } toggleSidenav() { - if (this.sidenav.opened) { - this.sidenav.close(); + if (this.sidenav().opened) { + this.sidenav().close(); } else { - this.sidenav.open(); + this.sidenav().open(); } } } diff --git a/console-webapp/src/app/app.config.ts b/console-webapp/src/app/app.config.ts index bce0e387183..9cbdf281978 100644 --- a/console-webapp/src/app/app.config.ts +++ b/console-webapp/src/app/app.config.ts @@ -19,15 +19,12 @@ import { } from '@angular/common/http'; import { ApplicationConfig, - importProvidersFrom, provideZonelessChangeDetection, } from '@angular/core'; import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar'; -import { provideAnimations } from '@angular/platform-browser/animations'; import { provideRouter, withHashLocation } from '@angular/router'; import { routes } from './app.routes'; -import { MaterialModule } from './material.module'; import { BackendService } from './shared/services/backend.service'; import { BreakPointObserverService } from './shared/services/breakPoint.service'; import { GlobalLoaderService } from './shared/services/globalLoader.service'; @@ -37,8 +34,6 @@ export const appConfig: ApplicationConfig = { providers: [ provideZonelessChangeDetection(), provideRouter(routes, withHashLocation()), - provideAnimations(), - importProvidersFrom(MaterialModule), provideHttpClient( withInterceptorsFromDi(), withXsrfConfiguration({ diff --git a/console-webapp/src/app/billingInfo/billingInfo.component.html b/console-webapp/src/app/billingInfo/billingInfo.component.html index 893d298885d..84fe2333fa9 100644 --- a/console-webapp/src/app/billingInfo/billingInfo.component.html +++ b/console-webapp/src/app/billingInfo/billingInfo.component.html @@ -14,7 +14,11 @@

Billing Info

>
- Generic billing image + Generic billing image
diff --git a/console-webapp/src/app/domains/domainList.component.spec.ts b/console-webapp/src/app/domains/domainList.component.spec.ts index f8a7ef4b3a1..2ebd737dd08 100644 --- a/console-webapp/src/app/domains/domainList.component.spec.ts +++ b/console-webapp/src/app/domains/domainList.component.spec.ts @@ -20,7 +20,6 @@ import { provideHttpClient, } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MaterialModule } from '../material.module'; import { BackendService } from '../shared/services/backend.service'; import { @@ -32,14 +31,15 @@ import { FormsModule } from '@angular/forms'; import { BULK_ACTION_NAME, Domain, + DomainListResult, DomainListService, } from './domainList.service'; -import { RegistryLockService } from './registryLock.service'; +import { DomainLocksResult, RegistryLockService } from './registryLock.service'; import { RegistrarService } from '../registrar/registrar.service'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatDialog } from '@angular/material/dialog'; import { signal } from '@angular/core'; -import { of, throwError } from 'rxjs'; +import { of, Subject, throwError } from 'rxjs'; import { PageEvent } from '@angular/material/paginator'; import { RegistryLockComponent } from './registryLock.component'; import { RESTRICTED_ELEMENTS } from '../shared/directives/userLevelVisiblity.directive'; @@ -79,12 +79,7 @@ describe('DomainListComponent', () => { registrarIdSignal = signal('reg-1'); await TestBed.configureTestingModule({ - imports: [ - DomainListComponent, - MaterialModule, - BrowserAnimationsModule, - FormsModule, - ], + imports: [DomainListComponent, MaterialModule, FormsModule], providers: [ BackendService, DomainListService, @@ -321,4 +316,51 @@ describe('DomainListComponent', () => { ); expect(snackBarOpenSpy).toHaveBeenCalledWith('Cannot unsuspend'); }); + + it('should reset stale domain, selection, and lock state when switching registrars', () => { + component.pageNumber = 2; + component.toggleAllRows(); + component.operationResult.set({ + 'example.tld': { message: 'Deleted', responseCode: '1000' }, + }); + domainListService.checkpointTime = '2024-06-01T00:00:00Z'; + component.openRegistryLock('example.tld'); + + const pendingDomains$ = new Subject(); + const pendingLocks$ = new Subject(); + const retrieveDomainsSpy = vi + .spyOn(domainListService, 'retrieveDomains') + .mockReturnValueOnce(pendingDomains$.asObservable()); + const retrieveLocksSpy = vi + .spyOn(registryLockService, 'retrieveLocks') + .mockReturnValueOnce(pendingLocks$.asObservable()); + + registrarIdSignal.set('reg-2'); + TestBed.flushEffects(); + + expect(component.pageNumber).toBe(0); + expect(component.totalResults()).toBe(0); + expect(component.selection.selected).toEqual([]); + expect(component.isAllSelected).toBe(false); + expect(component.operationResult()).toBeUndefined(); + expect(component.dataSource.data).toEqual([]); + expect(domainListService.checkpointTime).toBeUndefined(); + expect(domainListService.selectedDomain()).toBeUndefined(); + expect(domainListService.activeActionComponent()).toBeNull(); + expect(domainListService.domainsList()).toEqual([]); + expect(registryLockService.domainsLocks()).toEqual([]); + expect(retrieveDomainsSpy).toHaveBeenCalledTimes(2); + expect(retrieveLocksSpy).toHaveBeenCalledTimes(2); + + pendingDomains$.complete(); + pendingLocks$.complete(); + + retrieveDomainsSpy.mockClear(); + retrieveLocksSpy.mockClear(); + registrarIdSignal.set(''); + TestBed.flushEffects(); + + expect(retrieveDomainsSpy).not.toHaveBeenCalled(); + expect(retrieveLocksSpy).not.toHaveBeenCalled(); + }); }); diff --git a/console-webapp/src/app/domains/domainList.component.ts b/console-webapp/src/app/domains/domainList.component.ts index 5663da5f821..3ea1c5d430f 100644 --- a/console-webapp/src/app/domains/domainList.component.ts +++ b/console-webapp/src/app/domains/domainList.component.ts @@ -19,13 +19,14 @@ import { Component, effect, Inject, + OnDestroy, + OnInit, signal, untracked, - ViewChild, ChangeDetectionStrategy, } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { PageEvent } from '@angular/material/paginator'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableDataSource } from '@angular/material/table'; import { debounceTime, filter, Subject, take } from 'rxjs'; @@ -147,7 +148,7 @@ export class ReasonDialogComponent { changeDetection: ChangeDetectionStrategy.OnPush, providers: [CdkColumnDef], }) -export class DomainListComponent { +export class DomainListComponent implements OnInit, OnDestroy { public static PATH = 'domain-list'; private static SUSPENDED_STATUSES = [ 'SERVER_RENEW_PROHIBITED', @@ -184,8 +185,6 @@ export class DomainListComponent { operationResult = signal(undefined); - @ViewChild(MatPaginator, { static: true }) paginator!: MatPaginator; - constructor( protected domainListService: DomainListService, protected registrarService: RegistrarService, @@ -196,8 +195,7 @@ export class DomainListComponent { effect(() => { const registrarId = this.registrarService.registrarId(); untracked(() => { - this.pageNumber = 0; - this.totalResults.set(0); + this.resetStateForRegistrarChange(); if (registrarId) { this.loadLocks(); this.reloadData(); @@ -206,8 +204,22 @@ export class DomainListComponent { }); } + /** + * Clears registrar-scoped table, selection, and service state so stale data + * cannot bleed across registrars when switching context. + */ + private resetStateForRegistrarChange() { + this.pageNumber = 0; + this.totalResults.set(0); + this.selection.clear(); + this.isAllSelected = false; + this.operationResult.set(undefined); + this.dataSource.data = []; + this.domainListService.resetState(); + this.registryLockService.domainsLocks.set([]); + } + ngOnInit() { - this.dataSource.paginator = this.paginator; // Don't spam the server unnecessarily while the user is typing this.searchTermSubject .pipe(debounceTime(this.DEBOUNCE_MS)) diff --git a/console-webapp/src/app/domains/domainList.service.ts b/console-webapp/src/app/domains/domainList.service.ts index 4aa3933a3a7..eec7ff9e314 100644 --- a/console-webapp/src/app/domains/domainList.service.ts +++ b/console-webapp/src/app/domains/domainList.service.ts @@ -54,6 +54,14 @@ export class DomainListService { private backendService: BackendService, private registrarService: RegistrarService ) {} + + resetState() { + this.checkpointTime = undefined; + this.selectedDomain.set(undefined); + this.activeActionComponent.set(null); + this.domainsList.set([]); + } + retrieveDomains( pageNumber?: number, resultsPerPage?: number, diff --git a/console-webapp/src/app/domains/registryLock.component.spec.ts b/console-webapp/src/app/domains/registryLock.component.spec.ts index eea63a7ce08..ae1c22db2a0 100644 --- a/console-webapp/src/app/domains/registryLock.component.spec.ts +++ b/console-webapp/src/app/domains/registryLock.component.spec.ts @@ -15,7 +15,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatSnackBar } from '@angular/material/snack-bar'; import { signal } from '@angular/core'; import { of, throwError } from 'rxjs'; @@ -37,7 +36,7 @@ describe('RegistryLockComponent, DomainListService & RegistryLockService', () => beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [RegistryLockComponent, MaterialModule, NoopAnimationsModule], + imports: [RegistryLockComponent, MaterialModule], providers: [ BackendService, DomainListService, diff --git a/console-webapp/src/app/header/header.component.spec.ts b/console-webapp/src/app/header/header.component.spec.ts index 941ce44d5f4..bc03f32a28c 100644 --- a/console-webapp/src/app/header/header.component.spec.ts +++ b/console-webapp/src/app/header/header.component.spec.ts @@ -15,7 +15,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HeaderComponent } from './header.component'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MaterialModule } from '../material.module'; import { ActivatedRoute, RouterModule } from '@angular/router'; import { routes } from '../app.routes'; @@ -29,12 +28,7 @@ describe('HeaderComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - HeaderComponent, - MaterialModule, - BrowserAnimationsModule, - RouterModule.forRoot(routes), - ], + imports: [HeaderComponent, MaterialModule, RouterModule.forRoot(routes)], providers: [ BackendService, { provide: ActivatedRoute, useValue: {} as ActivatedRoute }, diff --git a/console-webapp/src/app/header/header.component.ts b/console-webapp/src/app/header/header.component.ts index e9cbf0ffe8a..5c633d01a54 100644 --- a/console-webapp/src/app/header/header.component.ts +++ b/console-webapp/src/app/header/header.component.ts @@ -12,12 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { - Component, - EventEmitter, - Output, - ChangeDetectionStrategy, -} from '@angular/core'; +import { Component, output, ChangeDetectionStrategy } from '@angular/core'; import { RouterModule } from '@angular/router'; import { MaterialModule } from '../material.module'; import { RegistrarSelectorComponent } from '../registrar/registrarSelector.component'; @@ -35,7 +30,7 @@ export class HeaderComponent { constructor(protected breakpointObserver: BreakPointObserverService) {} - @Output() toggleNavOpen = new EventEmitter(); + toggleNavOpen = output(); toggleNavPane() { this.isNavOpen = !this.isNavOpen; diff --git a/console-webapp/src/app/history/history.component.html b/console-webapp/src/app/history/history.component.html index 46722261be4..f323c0cadf4 100644 --- a/console-webapp/src/app/history/history.component.html +++ b/console-webapp/src/app/history/history.component.html @@ -17,7 +17,7 @@

-
+
Console User Email: diff --git a/console-webapp/src/app/history/history.component.spec.ts b/console-webapp/src/app/history/history.component.spec.ts index cc7bb001f39..39f120c0e60 100644 --- a/console-webapp/src/app/history/history.component.spec.ts +++ b/console-webapp/src/app/history/history.component.spec.ts @@ -15,7 +15,6 @@ import { TestBed } from '@angular/core/testing'; import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatSnackBar } from '@angular/material/snack-bar'; import { signal } from '@angular/core'; import { of, throwError } from 'rxjs'; @@ -45,12 +44,7 @@ describe('HistoryComponent, HistoryListComponent & HistoryService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - HistoryComponent, - HistoryListComponent, - MaterialModule, - NoopAnimationsModule, - ], + imports: [HistoryComponent, HistoryListComponent, MaterialModule], providers: [ BackendService, HistoryService, @@ -89,8 +83,9 @@ describe('HistoryComponent, HistoryListComponent & HistoryService', () => { expect(historyService.historyRecordsUser()).toEqual(sampleRecords); }); - it('should load history on registrarId effect, manage globalLoader, and handle errors', () => { + it('should load registrar and user history separately, manage globalLoader, and handle errors', () => { const fixture = TestBed.createComponent(HistoryComponent); + const historyService = fixture.debugElement.injector.get(HistoryService); mockSnackBar = { open: vi .spyOn(fixture.debugElement.injector.get(MatSnackBar), 'open') @@ -99,13 +94,38 @@ describe('HistoryComponent, HistoryListComponent & HistoryService', () => { const component = fixture.componentInstance; fixture.detectChanges(); - expect(backendService.getHistoryLog).toHaveBeenCalledWith('reg-1', ''); + expect(backendService.getHistoryLog).toHaveBeenCalledWith( + 'reg-1', + undefined + ); + expect(historyService.historyRecordsRegistrar()).toEqual(sampleRecords); expect(component.isLoading()).toBe(false); expect(globalLoader.isLoading()).toBe(false); expect(component.getElementIdForUserLog()).toBe( RESTRICTED_ELEMENTS.ACTIVITY_PER_USER ); + const userRecords: HistoryRecord[] = [ + { + modificationTime: '2025-02-01T12:00:00Z', + type: 'USER_UPDATE', + description: 'Updated user', + actingUser: { emailAddress: 'user@example.com' }, + }, + ]; + vi.spyOn(backendService, 'getHistoryLog').mockReturnValueOnce( + of(userRecords) + ); + component.consoleUserEmail = 'user@example.com'; + component.loadUserHistory(); + + expect(backendService.getHistoryLog).toHaveBeenCalledWith( + 'reg-1', + 'user@example.com' + ); + expect(historyService.historyRecordsUser()).toEqual(userRecords); + expect(historyService.historyRecordsRegistrar()).toEqual(sampleRecords); + component.loadingTimeout(); expect(mockSnackBar.open).toHaveBeenCalledWith( 'Timeout loading records history' @@ -114,7 +134,7 @@ describe('HistoryComponent, HistoryListComponent & HistoryService', () => { vi.spyOn(backendService, 'getHistoryLog').mockReturnValueOnce( throwError(() => new HttpErrorResponse({ error: 'History fetch error' })) ); - component.loadHistory(); + component.loadUserHistory(); expect(mockSnackBar.open).toHaveBeenCalledWith('History fetch error'); expect(globalLoader.isLoading()).toBe(false); expect(component.isLoading()).toBe(false); diff --git a/console-webapp/src/app/history/history.component.ts b/console-webapp/src/app/history/history.component.ts index 0a31e9f91bd..caa0f4ef809 100644 --- a/console-webapp/src/app/history/history.component.ts +++ b/console-webapp/src/app/history/history.component.ts @@ -71,7 +71,7 @@ export class HistoryComponent implements GlobalLoader { effect(() => { if (registrarService.registrarId()) { untracked(() => { - this.loadHistory(); + this.loadRegistrarHistory(); }); } }); @@ -85,11 +85,23 @@ export class HistoryComponent implements GlobalLoader { this._snackBar.open('Timeout loading records history'); } - loadHistory() { + loadRegistrarHistory() { + this.consoleUserEmail = ''; + this.historyService.historyRecordsRegistrar.set([]); + this.historyService.historyRecordsUser.set([]); + this.fetchHistory(); + } + + loadUserHistory() { + this.historyService.historyRecordsUser.set([]); + this.fetchHistory(this.consoleUserEmail); + } + + private fetchHistory(userEmail?: string) { this.globalLoader.startGlobalLoader(this); this.isLoading.set(true); this.historyService - .getHistoryLog(this.registrarService.registrarId(), this.consoleUserEmail) + .getHistoryLog(this.registrarService.registrarId(), userEmail) .subscribe({ error: (err: HttpErrorResponse) => { this._snackBar.open(err.error || err.message); diff --git a/console-webapp/src/app/history/historyList.component.html b/console-webapp/src/app/history/historyList.component.html index dfb77ee83f1..3fb9e2ec6a9 100644 --- a/console-webapp/src/app/history/historyList.component.html +++ b/console-webapp/src/app/history/historyList.component.html @@ -1,15 +1,15 @@ -@if (!isLoading && historyRecords.length == 0) { +@if (!isLoading() && historyRecords().length == 0) {
apps_outage

No records found

-} @else { +} @else if (!isLoading()) { - @for (item of historyRecords; track item; let last = $last) { + @for (item of historyRecords(); track item; let last = $last) { ([]); + isLoading = input(false); getIconForType(type: string): string { switch (type) { diff --git a/console-webapp/src/app/lock/registryLockVerify.component.ts b/console-webapp/src/app/lock/registryLockVerify.component.ts index 8af3dddf2d5..12540144915 100644 --- a/console-webapp/src/app/lock/registryLockVerify.component.ts +++ b/console-webapp/src/app/lock/registryLockVerify.component.ts @@ -12,7 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, signal, ChangeDetectionStrategy } from '@angular/core'; +import { + Component, + OnInit, + signal, + ChangeDetectionStrategy, +} from '@angular/core'; import { RegistrarService } from '../registrar/registrar.service'; import { ActivatedRoute, ParamMap, RouterModule } from '@angular/router'; import { RegistryLockVerifyService } from './registryLockVerify.service'; @@ -29,7 +34,7 @@ import { MaterialModule } from '../material.module'; providers: [RegistryLockVerifyService], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class RegistryLockVerifyComponent { +export class RegistryLockVerifyComponent implements OnInit { public static PATH = 'registry-lock-verify'; readonly DOMAIN_LIST_COMPONENT_PATH = `/${PATHS.DomainListComponent}`; diff --git a/console-webapp/src/app/material.module.ts b/console-webapp/src/app/material.module.ts index e541b806bc3..a2988b8ac19 100644 --- a/console-webapp/src/app/material.module.ts +++ b/console-webapp/src/app/material.module.ts @@ -13,25 +13,15 @@ // limitations under the License. import { A11yModule } from '@angular/cdk/a11y'; -import { DialogModule } from '@angular/cdk/dialog'; -import { CdkMenuModule } from '@angular/cdk/menu'; -import { OverlayModule } from '@angular/cdk/overlay'; -import { CdkTableModule } from '@angular/cdk/table'; -import { CdkTreeModule } from '@angular/cdk/tree'; import { NgModule } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatBottomSheetModule } from '@angular/material/bottom-sheet'; import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatChipsModule } from '@angular/material/chips'; -import { MatNativeDateModule, MatRippleModule } from '@angular/material/core'; import { MatDialogModule } from '@angular/material/dialog'; import { MatDividerModule } from '@angular/material/divider'; -import { MatGridListModule } from '@angular/material/grid-list'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatListModule } from '@angular/material/list'; @@ -43,6 +33,7 @@ import { MatRadioModule } from '@angular/material/radio'; import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatSortModule } from '@angular/material/sort'; import { MatTableModule } from '@angular/material/table'; import { MatTabsModule } from '@angular/material/tabs'; import { MatToolbarModule } from '@angular/material/toolbar'; @@ -52,36 +43,26 @@ import { MatTreeModule } from '@angular/material/tree'; @NgModule({ exports: [ A11yModule, - CdkMenuModule, - CdkTableModule, - CdkTreeModule, - MatBadgeModule, MatButtonModule, - MatButtonToggleModule, - MatBottomSheetModule, MatCardModule, MatCheckboxModule, MatDialogModule, MatDividerModule, - MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, - MatNativeDateModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, - MatRippleModule, MatSelectModule, MatSidenavModule, + MatSortModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatTreeModule, - OverlayModule, - DialogModule, MatSnackBarModule, MatPaginatorModule, MatChipsModule, diff --git a/console-webapp/src/app/navigation/navigation.component.ts b/console-webapp/src/app/navigation/navigation.component.ts index 9b72353c1b1..d7588f0f88c 100644 --- a/console-webapp/src/app/navigation/navigation.component.ts +++ b/console-webapp/src/app/navigation/navigation.component.ts @@ -13,7 +13,13 @@ // limitations under the License. import { NestedTreeControl } from '@angular/cdk/tree'; -import { Component, signal, ChangeDetectionStrategy } from '@angular/core'; +import { + Component, + OnDestroy, + OnInit, + signal, + ChangeDetectionStrategy, +} from '@angular/core'; import { MatTreeNestedDataSource } from '@angular/material/tree'; import { NavigationEnd, Router } from '@angular/router'; import { Subscription } from 'rxjs'; @@ -39,7 +45,7 @@ interface NavMenuNode extends RouteWithIcon { styleUrls: ['./navigation.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class NavigationComponent { +export class NavigationComponent implements OnInit, OnDestroy { renderRouter: boolean = true; currentUrl = signal(''); treeControl = new NestedTreeControl((node) => node.children); diff --git a/console-webapp/src/app/ote/ote.spec.ts b/console-webapp/src/app/ote/ote.spec.ts index 758579beb95..83aeea9ea23 100644 --- a/console-webapp/src/app/ote/ote.spec.ts +++ b/console-webapp/src/app/ote/ote.spec.ts @@ -15,7 +15,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, convertToParamMap } from '@angular/router'; import { MatSnackBar } from '@angular/material/snack-bar'; import { signal } from '@angular/core'; @@ -55,12 +54,7 @@ describe('NewOteComponent & OteStatusComponent', () => { }; await TestBed.configureTestingModule({ - imports: [ - NewOteComponent, - OteStatusComponent, - MaterialModule, - NoopAnimationsModule, - ], + imports: [NewOteComponent, OteStatusComponent, MaterialModule], providers: [ { provide: RegistrarService, useValue: mockRegistrarService }, { diff --git a/console-webapp/src/app/registrar/newRegistrar.component.ts b/console-webapp/src/app/registrar/newRegistrar.component.ts index b19f33a95c4..e467034cfcd 100644 --- a/console-webapp/src/app/registrar/newRegistrar.component.ts +++ b/console-webapp/src/app/registrar/newRegistrar.component.ts @@ -16,7 +16,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, ElementRef, - ViewChild, + viewChild, ViewEncapsulation, ChangeDetectionStrategy, } from '@angular/core'; @@ -44,7 +44,7 @@ export class NewRegistrarComponent { protected localizedAddressStreet: LocalizedAddressStreet; protected billingAccountMap: String = ''; - @ViewChild('form') form!: ElementRef; + form = viewChild.required>('form'); constructor( private registrarService: RegistrarService, private _snackBar: MatSnackBar @@ -81,7 +81,7 @@ export class NewRegistrarComponent { save(e: SubmitEvent) { e.preventDefault(); - if (this.form.nativeElement.checkValidity()) { + if (this.form().nativeElement.checkValidity()) { const { line1, line2, line3 } = this.localizedAddressStreet; this.newRegistrar.localizedAddress.street = [line1, line2, line3].filter( (v) => !!v @@ -95,7 +95,7 @@ export class NewRegistrarComponent { }, }); } else { - this.form.nativeElement.reportValidity(); + this.form().nativeElement.reportValidity(); } } diff --git a/console-webapp/src/app/registrar/registrarDetails.component.spec.ts b/console-webapp/src/app/registrar/registrarDetails.component.spec.ts index 4e79f4c40d0..babda35fa51 100644 --- a/console-webapp/src/app/registrar/registrarDetails.component.spec.ts +++ b/console-webapp/src/app/registrar/registrarDetails.component.spec.ts @@ -15,7 +15,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, convertToParamMap, Router } from '@angular/router'; import { MatChipInputEvent } from '@angular/material/chips'; import { MatSnackBar } from '@angular/material/snack-bar'; @@ -61,7 +60,6 @@ describe('RegistrarDetailsComponent & NewRegistrarComponent', () => { RegistrarDetailsComponent, NewRegistrarComponent, MaterialModule, - NoopAnimationsModule, ], providers: [ BackendService, @@ -171,12 +169,10 @@ describe('RegistrarDetailsComponent & NewRegistrarComponent', () => { line2: '', line3: 'Bldg 43', }; - component.form = { - nativeElement: { - checkValidity: vi.fn().mockReturnValue(true), - reportValidity: vi.fn(), - }, - }; + vi.spyOn(component.form().nativeElement, 'checkValidity').mockReturnValue( + true + ); + vi.spyOn(component.form().nativeElement, 'reportValidity'); const submitEvent = { preventDefault: vi.fn() } as unknown as SubmitEvent; component.save(submitEvent); @@ -191,19 +187,18 @@ describe('RegistrarDetailsComponent & NewRegistrarComponent', () => { }); it('should call reportValidity when form is invalid and show snackbar on backend error', () => { - const reportValiditySpy = vi.fn(); - component.form = { - nativeElement: { - checkValidity: vi.fn().mockReturnValue(false), - reportValidity: reportValiditySpy, - }, - }; + const checkValiditySpy = vi + .spyOn(component.form().nativeElement, 'checkValidity') + .mockReturnValue(false); + const reportValiditySpy = vi + .spyOn(component.form().nativeElement, 'reportValidity') + .mockImplementation(() => false); const submitEvent = { preventDefault: vi.fn() } as unknown as SubmitEvent; component.save(submitEvent); expect(reportValiditySpy).toHaveBeenCalled(); - component.form.nativeElement.checkValidity.mockReturnValue(true); + checkValiditySpy.mockReturnValue(true); mockRegistrarService.createRegistrar.mockReturnValueOnce( throwError(() => new HttpErrorResponse({ error: 'Duplicate ID' })) ); diff --git a/console-webapp/src/app/registrar/registrarDetails.component.ts b/console-webapp/src/app/registrar/registrarDetails.component.ts index 4569e89813a..8eae8a84b40 100644 --- a/console-webapp/src/app/registrar/registrarDetails.component.ts +++ b/console-webapp/src/app/registrar/registrarDetails.component.ts @@ -15,6 +15,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, + OnDestroy, OnInit, signal, ChangeDetectionStrategy, @@ -47,7 +48,7 @@ import { environment } from '../../environments/environment'; styleUrls: ['./registrarDetails.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class RegistrarDetailsComponent implements OnInit { +export class RegistrarDetailsComponent implements OnInit, OnDestroy { public static PATH = 'registrars/:id'; inEdit: boolean = false; oteButtonVisible = environment.sandbox; diff --git a/console-webapp/src/app/registrar/registrarSelector.component.spec.ts b/console-webapp/src/app/registrar/registrarSelector.component.spec.ts index f820317eec2..af428645f61 100644 --- a/console-webapp/src/app/registrar/registrarSelector.component.spec.ts +++ b/console-webapp/src/app/registrar/registrarSelector.component.spec.ts @@ -16,7 +16,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MaterialModule } from '../material.module'; import { BackendService } from '../shared/services/backend.service'; import { RegistrarSelectorComponent } from './registrarSelector.component'; @@ -45,12 +44,7 @@ describe('RegistrarSelectorComponent', () => { }; await TestBed.configureTestingModule({ - imports: [ - RegistrarSelectorComponent, - MaterialModule, - BrowserAnimationsModule, - FormsModule, - ], + imports: [RegistrarSelectorComponent, MaterialModule, FormsModule], providers: [ BackendService, { provide: RegistrarService, useValue: mockRegistrarService }, diff --git a/console-webapp/src/app/registrar/registrarsTable.component.html b/console-webapp/src/app/registrar/registrarsTable.component.html index 41b33b9c0ae..010ca543752 100644 --- a/console-webapp/src/app/registrar/registrarsTable.component.html +++ b/console-webapp/src/app/registrar/registrarsTable.component.html @@ -46,7 +46,7 @@

Registrars

> @for (column of columns; track column) { - + {{ column.header }} {{ diff --git a/console-webapp/src/app/registrar/registrarsTable.component.spec.ts b/console-webapp/src/app/registrar/registrarsTable.component.spec.ts index da76fefac9a..1e519df01ef 100644 --- a/console-webapp/src/app/registrar/registrarsTable.component.spec.ts +++ b/console-webapp/src/app/registrar/registrarsTable.component.spec.ts @@ -16,8 +16,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; +import { MatSort } from '@angular/material/sort'; import { MaterialModule } from '../material.module'; import { BackendService } from '../shared/services/backend.service'; import { RegistrarComponent, columns } from './registrarsTable.component'; @@ -51,7 +51,7 @@ describe('RegistrarComponent', () => { inNewRegistrarModeSignal = signal(false); await TestBed.configureTestingModule({ - imports: [RegistrarComponent, MaterialModule, BrowserAnimationsModule], + imports: [RegistrarComponent, MaterialModule], providers: [ BackendService, { @@ -123,9 +123,91 @@ describe('RegistrarComponent', () => { expect(navigateSpy).toHaveBeenCalledWith(['new-ote']); }); - it('should enable new registrar mode and return OTE restricted element ID', () => { + it('should enable new registrar mode, rebind paginator and sort on return, and return OTE restricted element ID', () => { expect(component.getElementIdForOteBlock()).toBe(RESTRICTED_ELEMENTS.OTE); + expect(component.dataSource.paginator).toBeTruthy(); + expect(component.dataSource.sort).toBeTruthy(); + component.openNewRegistrar(); expect(inNewRegistrarModeSignal()).toBe(true); + fixture.detectChanges(); + expect(component.dataSource.paginator).toBeNull(); + expect(component.dataSource.sort).toBeNull(); + + inNewRegistrarModeSignal.set(false); + fixture.detectChanges(); + expect(component.dataSource.paginator).toBeTruthy(); + expect(component.dataSource.sort).toBeTruthy(); + }); + + it('should sort displayed columns using formatted values and numeric IANA IDs', () => { + const first: Registrar = { + ...sampleRegistrar, + registrarId: 'reg-1', + registrarName: 'zeta Corp', + ianaIdentifier: 10, + allowedTlds: ['dev', 'app'], + billingAccountMap: { USD: '200' }, + driveFolderId: 'folder-b', + }; + const second: Registrar = { + ...sampleRegistrar, + registrarId: 'reg-2', + registrarName: 'Alpha Corp', + ianaIdentifier: 2, + allowedTlds: ['app'], + billingAccountMap: { EUR: '100' }, + driveFolderId: 'folder-a', + }; + const withoutIana: Registrar = { + ...sampleRegistrar, + registrarId: 'reg-3', + ianaIdentifier: undefined, + driveFolderId: undefined, + billingAccountMap: undefined, + allowedTlds: undefined, + }; + + const byDrive = component.dataSource.sortData( + [first, second, withoutIana], + { active: 'driveId', direction: 'asc' } as MatSort + ); + expect(byDrive.map((r) => r.registrarId)).toEqual([ + 'reg-3', + 'reg-2', + 'reg-1', + ]); + + const byIana = component.dataSource.sortData([first, second, withoutIana], { + active: 'ianaIdentifier', + direction: 'asc', + } as MatSort); + expect(byIana.map((r) => r.registrarId)).toEqual([ + 'reg-3', + 'reg-2', + 'reg-1', + ]); + + const byBilling = component.dataSource.sortData( + [first, second, withoutIana], + { active: 'billingAccountMap', direction: 'asc' } as MatSort + ); + expect(byBilling.map((r) => r.registrarId)).toEqual([ + 'reg-3', + 'reg-2', + 'reg-1', + ]); + + const byTlds = component.dataSource.sortData([first, second], { + active: 'allowedTlds', + direction: 'asc', + } as MatSort); + expect(byTlds.map((r) => r.registrarId)).toEqual(['reg-2', 'reg-1']); + + const byName = component.dataSource.sortData([first, second], { + active: 'registrarName', + direction: 'asc', + } as MatSort); + expect(byName.map((r) => r.registrarId)).toEqual(['reg-2', 'reg-1']); }); }); diff --git a/console-webapp/src/app/registrar/registrarsTable.component.ts b/console-webapp/src/app/registrar/registrarsTable.component.ts index f411f81592e..fad08b746c3 100644 --- a/console-webapp/src/app/registrar/registrarsTable.component.ts +++ b/console-webapp/src/app/registrar/registrarsTable.component.ts @@ -15,7 +15,7 @@ import { Component, effect, - ViewChild, + viewChild, ViewEncapsulation, ChangeDetectionStrategy, } from '@angular/core'; @@ -105,8 +105,8 @@ export class RegistrarComponent { oteButtonVisible = environment.sandbox; displayedColumns = this.columns.map((c) => c.columnDef); - @ViewChild(MatPaginator) paginator!: MatPaginator; - @ViewChild(MatSort) sort!: MatSort; + paginator = viewChild(MatPaginator); + sort = viewChild(MatSort); constructor( protected registrarService: RegistrarService, @@ -115,16 +115,23 @@ export class RegistrarComponent { this.dataSource = new MatTableDataSource( registrarService.registrars() ); + const columnByDef = new Map(this.columns.map((c) => [c.columnDef, c])); + this.dataSource.sortingDataAccessor = ( + item: Registrar, + property: string + ): string | number => { + if (property === 'ianaIdentifier') { + return item.ianaIdentifier ?? -1; + } + return (columnByDef.get(property)?.cell(item) ?? '').toLowerCase(); + }; effect(() => { this.dataSource.data = registrarService.registrars(); + this.dataSource.paginator = this.paginator() ?? null; + this.dataSource.sort = this.sort() ?? null; }); } - ngAfterViewInit() { - this.dataSource.paginator = this.paginator; - this.dataSource.sort = this.sort; - } - createOteAccount() { this.router.navigate([PATHS.NewOteComponent]); } diff --git a/console-webapp/src/app/resources/resources.component.html b/console-webapp/src/app/resources/resources.component.html index e5e7e0fcfa3..69fd7eff051 100644 --- a/console-webapp/src/app/resources/resources.component.html +++ b/console-webapp/src/app/resources/resources.component.html @@ -11,6 +11,10 @@

Resources

>
- Generic resources image + Generic resources image
diff --git a/console-webapp/src/app/settings/contact/contact.component.html b/console-webapp/src/app/settings/contact/contact.component.html index ed1767fbdd8..50cb29d8c78 100644 --- a/console-webapp/src/app/settings/contact/contact.component.html +++ b/console-webapp/src/app/settings/contact/contact.component.html @@ -14,7 +14,7 @@
- @if (contactService.contacts().length === 0) { + @if (!isLoading()) { @if (contactService.contacts().length === 0) {
apps_outageNo contacts found

(keyup.enter)="openDetails(row)" > - } + } } } diff --git a/console-webapp/src/app/settings/contact/contact.component.spec.ts b/console-webapp/src/app/settings/contact/contact.component.spec.ts index b7e663d5c16..1c8ef75ce93 100644 --- a/console-webapp/src/app/settings/contact/contact.component.spec.ts +++ b/console-webapp/src/app/settings/contact/contact.component.spec.ts @@ -31,7 +31,6 @@ import { MatSnackBar } from '@angular/material/snack-bar'; import { MatCheckboxChange } from '@angular/material/checkbox'; import { signal } from '@angular/core'; import { of, Subject, throwError } from 'rxjs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('ContactComponent & ContactService & ContactDetailsComponent', () => { let component: ContactComponent; @@ -54,12 +53,7 @@ describe('ContactComponent & ContactService & ContactDetailsComponent', () => { registrarIdSignal = signal('reg-1'); await TestBed.configureTestingModule({ - imports: [ - ContactComponent, - ContactDetailsComponent, - MaterialModule, - NoopAnimationsModule, - ], + imports: [ContactComponent, ContactDetailsComponent, MaterialModule], providers: [ BackendService, ContactService, @@ -101,6 +95,27 @@ describe('ContactComponent & ContactService & ContactDetailsComponent', () => { expect(component.dataSource.data[0].name).toBe('Jane Doe'); }); + it('should clear stale contacts and set isLoading while fetching contacts for a new registrar', () => { + const pending$ = new Subject(); + vi.spyOn(backendService, 'getContacts').mockReturnValueOnce( + pending$.asObservable() + ); + + registrarIdSignal.set('reg-2'); + TestBed.flushEffects(); + + expect(component.isLoading()).toBe(true); + expect(contactService.contacts()).toEqual([]); + expect(component.dataSource.data).toEqual([]); + + pending$.next([sampleContact]); + pending$.complete(); + TestBed.flushEffects(); + + expect(component.isLoading()).toBe(false); + expect(component.dataSource.data).toHaveLength(1); + }); + it('should show snackbar and stop globalLoader when fetchContacts fails', () => { const snackBarSpy = vi .spyOn(fixture.debugElement.injector.get(MatSnackBar), 'open') diff --git a/console-webapp/src/app/settings/contact/contact.component.ts b/console-webapp/src/app/settings/contact/contact.component.ts index c19a6d349b7..d15afce0689 100644 --- a/console-webapp/src/app/settings/contact/contact.component.ts +++ b/console-webapp/src/app/settings/contact/contact.component.ts @@ -16,13 +16,14 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, effect, + signal, untracked, ViewEncapsulation, ChangeDetectionStrategy, } from '@angular/core'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableDataSource } from '@angular/material/table'; -import { take } from 'rxjs'; +import { finalize, take } from 'rxjs'; import { MaterialModule } from 'src/app/material.module'; import { RegistrarService } from 'src/app/registrar/registrar.service'; import { @@ -43,6 +44,7 @@ import { ContactDetailsComponent } from './contactDetails.component'; export class ContactComponent implements GlobalLoader { public static PATH = 'contact'; + isLoading = signal(false); dataSource: MatTableDataSource = new MatTableDataSource([]); columns = [ @@ -86,15 +88,21 @@ export class ContactComponent implements GlobalLoader { untracked(() => { this.contactService.isContactDetailsView.set(false); this.contactService.isContactNewView.set(false); + this.contactService.contacts.set([]); + this.isLoading.set(true); this.globalLoader.startGlobalLoader(this); this.contactService .fetchContacts() - .pipe(take(1)) + .pipe( + take(1), + finalize(() => { + this.isLoading.set(false); + this.globalLoader.stopGlobalLoader(this); + }) + ) .subscribe({ - complete: () => this.globalLoader.stopGlobalLoader(this), error: (err: HttpErrorResponse) => { this._snackBar.open(err.error || err.message); - this.globalLoader.stopGlobalLoader(this); }, }); }); diff --git a/console-webapp/src/app/settings/rdap/rdap.component.spec.ts b/console-webapp/src/app/settings/rdap/rdap.component.spec.ts index a8385ca9d92..1218d0c873b 100644 --- a/console-webapp/src/app/settings/rdap/rdap.component.spec.ts +++ b/console-webapp/src/app/settings/rdap/rdap.component.spec.ts @@ -16,7 +16,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MaterialModule } from 'src/app/material.module'; import { Registrar, @@ -61,12 +60,7 @@ describe('RdapComponent & RdapEditComponent & RdapService', () => { loadRegistrarsSpy = vi.fn().mockReturnValue(of([sampleRegistrar])); await TestBed.configureTestingModule({ - imports: [ - RdapComponent, - RdapEditComponent, - MaterialModule, - BrowserAnimationsModule, - ], + imports: [RdapComponent, RdapEditComponent, MaterialModule], providers: [ BackendService, RdapService, diff --git a/console-webapp/src/app/settings/rdap/rdap.component.ts b/console-webapp/src/app/settings/rdap/rdap.component.ts index 2f8a400f746..79ceccbea0d 100644 --- a/console-webapp/src/app/settings/rdap/rdap.component.ts +++ b/console-webapp/src/app/settings/rdap/rdap.component.ts @@ -12,7 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, computed, ChangeDetectionStrategy } from '@angular/core'; +import { + Component, + computed, + effect, + untracked, + ChangeDetectionStrategy, +} from '@angular/core'; import { MaterialModule } from 'src/app/material.module'; import { RegistrarService } from 'src/app/registrar/registrar.service'; import { RdapService } from './rdap.service'; @@ -51,5 +57,13 @@ export class RdapComponent { constructor( public rdapService: RdapService, public registrarService: RegistrarService - ) {} + ) { + effect(() => { + if (this.registrarService.registrar()) { + untracked(() => { + this.rdapService.editing.set(false); + }); + } + }); + } } diff --git a/console-webapp/src/app/settings/security/security.component.spec.ts b/console-webapp/src/app/settings/security/security.component.spec.ts index 9af43448757..3005bc4cb00 100644 --- a/console-webapp/src/app/settings/security/security.component.spec.ts +++ b/console-webapp/src/app/settings/security/security.component.spec.ts @@ -17,7 +17,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { FormsModule } from '@angular/forms'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { of, throwError } from 'rxjs'; import { MaterialModule } from 'src/app/material.module'; import { RegistrarService } from 'src/app/registrar/registrar.service'; @@ -47,7 +46,6 @@ describe('SecurityComponent & EppPasswordEditComponent', () => { EppPasswordEditComponent, SecurityComponent, MaterialModule, - BrowserAnimationsModule, FormsModule, ], providers: [ diff --git a/console-webapp/src/app/settings/settings.component.spec.ts b/console-webapp/src/app/settings/settings.component.spec.ts index 18b09911533..921a7c7caa7 100644 --- a/console-webapp/src/app/settings/settings.component.spec.ts +++ b/console-webapp/src/app/settings/settings.component.spec.ts @@ -16,7 +16,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SettingsComponent } from './settings.component'; import { MaterialModule } from '../material.module'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, RouterModule } from '@angular/router'; import { BackendService } from '../shared/services/backend.service'; import { provideHttpClient } from '@angular/common/http'; @@ -32,7 +31,6 @@ describe('SettingsComponent', () => { imports: [ SettingsComponent, MaterialModule, - BrowserAnimationsModule, RouterModule.forRoot(routes), ], providers: [ diff --git a/console-webapp/src/app/shared/components/passwordReset/passwordInputForm.component.ts b/console-webapp/src/app/shared/components/passwordReset/passwordInputForm.component.ts index 057611b45c2..de9c828c37d 100644 --- a/console-webapp/src/app/shared/components/passwordReset/passwordInputForm.component.ts +++ b/console-webapp/src/app/shared/components/passwordReset/passwordInputForm.component.ts @@ -14,9 +14,8 @@ import { Component, - EventEmitter, input, - Output, + output, ChangeDetectionStrategy, } from '@angular/core'; import { @@ -74,7 +73,7 @@ export class PasswordInputForm { displayOldPasswordField = input(false); formGroup = input(); - @Output() submitResults = new EventEmitter(); + submitResults = output(); hasError(controlName: string) { const maybeErrors = this.formGroup()!.get(controlName)?.errors; diff --git a/console-webapp/src/app/shared/components/passwordReset/passwordResetVerify.component.ts b/console-webapp/src/app/shared/components/passwordReset/passwordResetVerify.component.ts index 97d3486343b..4e77f18437c 100644 --- a/console-webapp/src/app/shared/components/passwordReset/passwordResetVerify.component.ts +++ b/console-webapp/src/app/shared/components/passwordReset/passwordResetVerify.component.ts @@ -12,7 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, signal, ChangeDetectionStrategy } from '@angular/core'; +import { + Component, + OnInit, + signal, + ChangeDetectionStrategy, +} from '@angular/core'; import { ActivatedRoute, ParamMap, @@ -43,7 +48,7 @@ export interface PasswordResetVerifyResponse { templateUrl: './passwordResetVerify.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class PasswordResetVerifyComponent { +export class PasswordResetVerifyComponent implements OnInit { public static PATH = 'password-reset-verify'; REGISTRY_LOCK_PASSWORD_VALIDATORS = [ diff --git a/console-webapp/src/app/shared/directives/userLevelVisiblity.directive.ts b/console-webapp/src/app/shared/directives/userLevelVisiblity.directive.ts index aff49ccde2c..cb7432f7b70 100644 --- a/console-webapp/src/app/shared/directives/userLevelVisiblity.directive.ts +++ b/console-webapp/src/app/shared/directives/userLevelVisiblity.directive.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Directive, ElementRef, Input, effect } from '@angular/core'; +import { Directive, ElementRef, input, effect } from '@angular/core'; import { UserDataService } from '../services/userData.service'; export enum RESTRICTED_ELEMENTS { @@ -38,9 +38,9 @@ export const DISABLED_ELEMENTS_PER_ROLE = { selector: '[elementId]', }) export class UserLevelVisibility { - @Input() elementId!: RESTRICTED_ELEMENTS | null; + elementId = input(null); - @Input() isReverse: boolean = false; + isReverse = input(false); constructor( private userDataService: UserDataService, @@ -51,16 +51,17 @@ export class UserLevelVisibility { processElement() { const globalRole = this.userDataService?.userData()?.globalRole || 'NONE'; - if (this.elementId === null) { + const elementId = this.elementId(); + if (elementId === null) { return; } if ( // @ts-ignore - (DISABLED_ELEMENTS_PER_ROLE[globalRole] || []).includes(this.elementId) + (DISABLED_ELEMENTS_PER_ROLE[globalRole] || []).includes(elementId) ) { - this.el.nativeElement.style.display = this.isReverse ? '' : 'none'; + this.el.nativeElement.style.display = this.isReverse() ? '' : 'none'; } else { - this.el.nativeElement.style.display = this.isReverse ? 'none' : ''; + this.el.nativeElement.style.display = this.isReverse() ? 'none' : ''; } } } diff --git a/console-webapp/src/app/shared/shared.spec.ts b/console-webapp/src/app/shared/shared.spec.ts index 3f36c081df5..e2b779c1754 100644 --- a/console-webapp/src/app/shared/shared.spec.ts +++ b/console-webapp/src/app/shared/shared.spec.ts @@ -22,7 +22,6 @@ import { import { TestBed } from '@angular/core/testing'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { MatSnackBar, MatSnackBarRef } from '@angular/material/snack-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, convertToParamMap, Router } from '@angular/router'; import { of, throwError } from 'rxjs'; import { MaterialModule } from '../material.module'; @@ -78,7 +77,6 @@ describe('Shared Services, Directives & Components', () => { PasswordResetVerifyComponent, PocReminderComponent, MaterialModule, - NoopAnimationsModule, ], providers: [ BackendService, diff --git a/console-webapp/src/app/users/userEditForm.component.ts b/console-webapp/src/app/users/userEditForm.component.ts index 74745c8190d..71d3aa5caad 100644 --- a/console-webapp/src/app/users/userEditForm.component.ts +++ b/console-webapp/src/app/users/userEditForm.component.ts @@ -15,11 +15,10 @@ import { Component, ElementRef, - EventEmitter, Inject, input, - Output, - ViewChild, + output, + viewChild, ChangeDetectionStrategy, } from '@angular/core'; import { MaterialModule } from '../material.module'; @@ -78,7 +77,7 @@ export class ResetRegistryLockPasswordComponent { providers: [], }) export class UserEditFormComponent { - @ViewChild('form') form!: ElementRef; + form = viewChild.required>('form'); isNew = input(false); user = input( { @@ -89,7 +88,7 @@ export class UserEditFormComponent { { transform: (user: User) => structuredClone(user) } ); - @Output() onEditComplete = new EventEmitter(); + onEditComplete = output(); constructor( protected userDataService: UserDataService, @@ -102,10 +101,10 @@ export class UserEditFormComponent { saveEdit(e: SubmitEvent) { e.preventDefault(); - if (this.form.nativeElement.checkValidity()) { + if (this.form().nativeElement.checkValidity()) { this.onEditComplete.emit(this.user()); } else { - this.form.nativeElement.reportValidity(); + this.form().nativeElement.reportValidity(); } } diff --git a/console-webapp/src/app/users/users.component.spec.ts b/console-webapp/src/app/users/users.component.spec.ts index fb5112533a8..dca25c549b7 100644 --- a/console-webapp/src/app/users/users.component.spec.ts +++ b/console-webapp/src/app/users/users.component.spec.ts @@ -15,12 +15,12 @@ import { TestBed } from '@angular/core/testing'; import { HttpErrorResponse, provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatDialog } from '@angular/material/dialog'; import { MatSelectChange } from '@angular/material/select'; +import { MatSort } from '@angular/material/sort'; import { signal } from '@angular/core'; -import { of, throwError } from 'rxjs'; +import { of, Subject, throwError } from 'rxjs'; import { MaterialModule } from '../material.module'; import { BackendService } from '../shared/services/backend.service'; import { RegistrarService } from '../registrar/registrar.service'; @@ -51,7 +51,6 @@ describe('Users Feature (UsersService, UsersComponent, UserDetailsComponent, Use UsersListComponent, UserEditFormComponent, MaterialModule, - NoopAnimationsModule, ], providers: [ BackendService, @@ -162,6 +161,7 @@ describe('Users Feature (UsersService, UsersComponent, UserDetailsComponent, Use fixture.detectChanges(); expect(component.dataSource.data).toEqual([sampleUser]); + expect(component.dataSource.sort).toBeTruthy(); expect(columns[0].cell(sampleUser)).toBe('alice@example.com'); expect(columns[1].cell(sampleUser)).toBe('Viewer'); @@ -171,6 +171,62 @@ describe('Users Feature (UsersService, UsersComponent, UserDetailsComponent, Use expect(selected).toEqual(sampleUser); expect(component.isRowSelected(sampleUser)).toBe(true); + + const editorUser: User = { + emailAddress: 'bob@example.com', + role: 'TECH_CONTACT', + }; + const sortedByRole = component.dataSource.sortData( + [sampleUser, editorUser], + { active: 'role', direction: 'asc' } as MatSort + ); + expect(sortedByRole.map((u) => u.emailAddress)).toEqual([ + 'bob@example.com', + 'alice@example.com', + ]); + }); + + it('should reset cached users and open sub-views when switching registrars', () => { + const fixture = TestBed.createComponent(UsersComponent); + const component = fixture.componentInstance; + const usersService = fixture.debugElement.injector.get(UsersService); + fixture.detectChanges(); + + usersService.currentlyOpenUserEmail.set(sampleUser.emailAddress); + usersService.isNewUser = true; + component.isNew = true; + component.addExistingUser(); + component.selectedRegistrarId = 'reg-2'; + component.usersSelection.set([sampleUser]); + component.existingUserSelected(sampleUser); + + const pending$ = new Subject(); + vi.spyOn(backendService, 'getUsers').mockReturnValueOnce( + pending$.asObservable() + ); + + registrarIdSignal.set('reg-2'); + TestBed.flushEffects(); + + expect(component.isLoading()).toBe(true); + expect(usersService.users()).toEqual([]); + expect(usersService.currentlyOpenUserEmail()).toBe(''); + expect(usersService.isNewUser).toBe(false); + expect(component.isNew).toBe(false); + expect(component.selectingExistingUser()).toBe(false); + expect(component.selectedRegistrarId).toBe(''); + expect(component.usersSelection()).toEqual([]); + expect(component.selectedExistingUser).toBeUndefined(); + + const reg2User: User = { + emailAddress: 'bob@example.com', + role: 'TECH_CONTACT', + }; + pending$.next([reg2User]); + pending$.complete(); + + expect(component.isLoading()).toBe(false); + expect(usersService.users()).toEqual([reg2User]); }); it('should validate form and trigger registry lock password reset in UserEditFormComponent', () => { @@ -188,12 +244,10 @@ describe('Users Feature (UsersService, UsersComponent, UserDetailsComponent, Use let emittedUser: User | undefined; component.onEditComplete.subscribe((u) => (emittedUser = u)); - component.form = { - nativeElement: { - checkValidity: vi.fn().mockReturnValue(true), - reportValidity: vi.fn(), - }, - }; + vi.spyOn(component.form().nativeElement, 'checkValidity').mockReturnValue( + true + ); + vi.spyOn(component.form().nativeElement, 'reportValidity'); component.saveEdit({ preventDefault: vi.fn() } as unknown as SubmitEvent); expect(emittedUser).toEqual(sampleUser); diff --git a/console-webapp/src/app/users/users.component.ts b/console-webapp/src/app/users/users.component.ts index 5683b17160b..36e310aa525 100644 --- a/console-webapp/src/app/users/users.component.ts +++ b/console-webapp/src/app/users/users.component.ts @@ -60,21 +60,38 @@ export class UsersComponent { private _snackBar: MatSnackBar ) { effect(() => { - if (registrarService.registrarId()) { - untracked(() => { + const registrarId = registrarService.registrarId(); + untracked(() => { + this.resetStateForRegistrarChange(); + if (registrarId) { this.loadUsers(); - }); - } + } + }); }); } - addExistingUser() { - this.selectingExistingUser.set(true); + /** + * Clears cached users and exits any open user detail or creation flow when + * switching to a different registrar. + */ + private resetStateForRegistrarChange() { + this.usersService.resetState(); + this.isNew = false; + this.selectingExistingUser.set(false); + this.resetExistingUserSelection(); + } + + private resetExistingUserSelection() { this.selectedRegistrarId = ''; this.usersSelection.set([]); this.selectedExistingUser = undefined; } + addExistingUser() { + this.selectingExistingUser.set(true); + this.resetExistingUserSelection(); + } + existingUserSelected(user: User) { this.selectedExistingUser = user; } diff --git a/console-webapp/src/app/users/users.service.ts b/console-webapp/src/app/users/users.service.ts index c65f194cc28..aaced011c05 100644 --- a/console-webapp/src/app/users/users.service.ts +++ b/console-webapp/src/app/users/users.service.ts @@ -47,6 +47,12 @@ export class UsersService { private registrarService: RegistrarService ) {} + resetState() { + this.users.set([]); + this.currentlyOpenUserEmail.set(''); + this.isNewUser = false; + } + fetchUsersForRegistrar(registrarId: string) { return this.backendService.getUsers(registrarId); } diff --git a/console-webapp/src/app/users/usersList.component.html b/console-webapp/src/app/users/usersList.component.html index 8cc7b2a0c61..ddfa1f10368 100644 --- a/console-webapp/src/app/users/usersList.component.html +++ b/console-webapp/src/app/users/usersList.component.html @@ -7,7 +7,7 @@ > @for (column of columns; track column) { - + {{ column.header }} {{ column.cell(row) }} diff --git a/console-webapp/src/app/users/usersList.component.ts b/console-webapp/src/app/users/usersList.component.ts index 7ed0b461ebf..1ac1d93122b 100644 --- a/console-webapp/src/app/users/usersList.component.ts +++ b/console-webapp/src/app/users/usersList.component.ts @@ -15,10 +15,9 @@ import { Component, effect, - EventEmitter, input, - Output, - ViewChild, + output, + viewChild, ChangeDetectionStrategy, } from '@angular/core'; import { MaterialModule } from '../material.module'; @@ -53,20 +52,23 @@ export class UsersListComponent { dataSource: MatTableDataSource; selectedRow!: User; users = input([]); - @Output() onSelect = new EventEmitter(); - @ViewChild(MatSort) sort!: MatSort; + onSelect = output(); + sort = viewChild(MatSort); constructor() { this.dataSource = new MatTableDataSource(this.users()); + const columnByDef = new Map(this.columns.map((c) => [c.columnDef, c])); + this.dataSource.sortingDataAccessor = ( + item: User, + property: string + ): string | number => + (columnByDef.get(property)?.cell(item) ?? '').toLowerCase(); effect(() => { this.dataSource.data = this.users(); + this.dataSource.sort = this.sort() ?? null; }); } - ngAfterViewInit() { - this.dataSource.sort = this.sort; - } - onClick(row: User) { this.selectedRow = row; this.onSelect.emit(row); diff --git a/console-webapp/src/assets/billing.png b/console-webapp/src/assets/billing.png index 2ce4e0f6d13..c6507716660 100644 Binary files a/console-webapp/src/assets/billing.png and b/console-webapp/src/assets/billing.png differ diff --git a/console-webapp/src/assets/resources.png b/console-webapp/src/assets/resources.png index 8b249b5393c..8d582ba2787 100644 Binary files a/console-webapp/src/assets/resources.png and b/console-webapp/src/assets/resources.png differ