From 78ea83b42e0ce629ca8af3d47f725aa6c658c316 Mon Sep 17 00:00:00 2001 From: Sofia Kurilova Date: Fri, 16 May 2025 08:40:18 +0000 Subject: [PATCH 01/84] Show loader for stopping status (#1299) --- .../testrun-status-card.component.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html index 2ba1a0664..59d8977d3 100644 --- a/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html +++ b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html @@ -66,15 +66,17 @@ *ngSwitchCase="StatusOfTestrun.Cancelling" [ngTemplateOutlet]="Cancelling"> - - + + +
+
From e661702e7414e179a19bbb6b36a84d72a623d606 Mon Sep 17 00:00:00 2001 From: Sofia Kurilova Date: Fri, 16 May 2025 11:20:16 +0200 Subject: [PATCH 02/84] Fix settings update (#1300) Co-authored-by: J Boddey --- .../general-settings.store.ts | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/ui/src/app/pages/general-settings/general-settings.store.ts b/modules/ui/src/app/pages/general-settings/general-settings.store.ts index ec2b5c99f..11bcfd802 100644 --- a/modules/ui/src/app/pages/general-settings/general-settings.store.ts +++ b/modules/ui/src/app/pages/general-settings/general-settings.store.ts @@ -151,17 +151,20 @@ export class GeneralSettingsStore extends ComponentStore config: SystemConfig; }>(trigger$ => { return trigger$.pipe( - exhaustMap(trigger => { - return this.testRunService.createSystemConfig(trigger.config).pipe( - tap(() => { - this.store.dispatch( - AppActions.fetchSystemConfigSuccess({ - systemConfig: trigger.config, - }) - ); - trigger.onSystemConfigUpdate(); - }) - ); + withLatestFrom(this.systemConfig$), + exhaustMap(([trigger, currentConfig]) => { + return this.testRunService + .createSystemConfig({ ...currentConfig, ...trigger.config }) + .pipe( + tap(() => { + this.store.dispatch( + AppActions.fetchSystemConfigSuccess({ + systemConfig: { ...currentConfig, ...trigger.config }, + }) + ); + trigger.onSystemConfigUpdate(); + }) + ); }) ); }); From 48ae7bd24a66b5b76d2f0a7081e2f36d7faaa1bb Mon Sep 17 00:00:00 2001 From: Sofia Kurilova Date: Wed, 21 May 2025 12:23:45 +0200 Subject: [PATCH 03/84] Highlight Required if possible and Required with Non-Compliant result (#1305) --- resources/test_packs/pilot/report_templates/results.jinja | 2 +- .../test_packs/qualification/report_templates/results.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/test_packs/pilot/report_templates/results.jinja b/resources/test_packs/pilot/report_templates/results.jinja index 1e8b99899..e1e06c862 100644 --- a/resources/test_packs/pilot/report_templates/results.jinja +++ b/resources/test_packs/pilot/report_templates/results.jinja @@ -8,7 +8,7 @@
Required result
{% for i in range(results_from, results_to) %} - {% if test_results[i]['result'] == 'Non-Compliant' and test_results[i]['required_result'] == "Required" %} + {% if test_results[i]['result'] == 'Non-Compliant' and test_results[i]['required_result'] in ["Required", "Required if Applicable"] %}
{% else %}
diff --git a/resources/test_packs/qualification/report_templates/results.jinja b/resources/test_packs/qualification/report_templates/results.jinja index 5153e3695..56478086d 100644 --- a/resources/test_packs/qualification/report_templates/results.jinja +++ b/resources/test_packs/qualification/report_templates/results.jinja @@ -8,7 +8,7 @@
Required result
{% for i in range(results_from, results_to) %} - {% if test_results[i]['result'] == 'Non-Compliant' and test_results[i]['required_result'] == "Required" %} + {% if test_results[i]['result'] == 'Non-Compliant' and test_results[i]['required_result'] in ["Required", "Required if Applicable"] %}
{% else %}
From 3ee8f1394fbec37b78ac905a9eeef6fb98c46c74 Mon Sep 17 00:00:00 2001 From: Olga Mardvilko Date: Thu, 22 May 2025 10:43:43 +0200 Subject: [PATCH 04/84] 409766621: (feat) add clear search button (#1307) --- .../list-layout/list-layout.component.html | 21 +++++-- .../list-layout/list-layout.component.scss | 4 ++ .../list-layout/list-layout.component.spec.ts | 57 ++++++++++++++++++- .../list-layout/list-layout.component.ts | 4 ++ 4 files changed, 81 insertions(+), 5 deletions(-) diff --git a/modules/ui/src/app/components/list-layout/list-layout.component.html b/modules/ui/src/app/components/list-layout/list-layout.component.html index 55ffb7c1b..c33c614fa 100644 --- a/modules/ui/src/app/components/list-layout/list-layout.component.html +++ b/modules/ui/src/app/components/list-layout/list-layout.component.html @@ -38,10 +38,23 @@
- - search -
+ + + + search + +
+
diff --git a/modules/ui/src/app/components/list-layout/list-layout.component.scss b/modules/ui/src/app/components/list-layout/list-layout.component.scss index c00a11764..d2e55371d 100644 --- a/modules/ui/src/app/components/list-layout/list-layout.component.scss +++ b/modules/ui/src/app/components/list-layout/list-layout.component.scss @@ -112,6 +112,10 @@ } } +.clear-search-button { + margin-right: 10px; +} + ::ng-deep .using-mouse .search-field input:focus { outline: none; } diff --git a/modules/ui/src/app/components/list-layout/list-layout.component.spec.ts b/modules/ui/src/app/components/list-layout/list-layout.component.spec.ts index 02089934e..a0e8647eb 100644 --- a/modules/ui/src/app/components/list-layout/list-layout.component.spec.ts +++ b/modules/ui/src/app/components/list-layout/list-layout.component.spec.ts @@ -13,7 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, +} from '@angular/core/testing'; import { ListLayoutComponent } from './list-layout.component'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatToolbarModule } from '@angular/material/toolbar'; @@ -22,6 +27,7 @@ import { MatButtonModule } from '@angular/material/button'; import { ListItemComponent } from '../list-item/list-item.component'; import { Component } from '@angular/core'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { By } from '@angular/platform-browser'; interface Entity { id: number; @@ -63,6 +69,7 @@ describe('ListLayoutComponent', () => { let component: HostComponent; let fixture: ComponentFixture; let compiled: HTMLElement; + let listLayoutComponentInstance: ListLayoutComponent; beforeEach(async () => { await TestBed.configureTestingModule({ @@ -79,6 +86,13 @@ describe('ListLayoutComponent', () => { fixture = TestBed.createComponent(HostComponent); component = fixture.componentInstance; compiled = fixture.nativeElement as HTMLElement; + + const listLayoutDebugElement = fixture.debugElement.query( + By.directive(ListLayoutComponent) + ); + listLayoutComponentInstance = + listLayoutDebugElement.componentInstance as ListLayoutComponent; + fixture.detectChanges(); }); @@ -146,5 +160,46 @@ describe('ListLayoutComponent', () => { expect(listItemComponent.length).toEqual(2); }); + + it('clearSearch() should reset searchText to an empty string and clear input', fakeAsync(() => { + const searchInputElement = compiled.querySelector( + '.search-field input' + ) as HTMLInputElement; + expect(searchInputElement).toBeTruthy(); + + searchInputElement.value = 'testing'; + searchInputElement.dispatchEvent(new Event('input')); + fixture.detectChanges(); + tick(); + + // Verify ListLayoutComponent's internal searchText is updated + expect(listLayoutComponentInstance.searchText()).toBe('testing'); + + const buttonClearSearch = compiled.querySelector( + '.clear-search-button' + ) as HTMLButtonElement; + expect(buttonClearSearch).toBeTruthy(); + + buttonClearSearch.click(); + fixture.detectChanges(); + tick(); + + // Verify ListLayoutComponent's internal searchText is cleared + expect(listLayoutComponentInstance.searchText()).toBe(''); + + // Verify the input field in the DOM is also cleared + expect(searchInputElement.value).toBe(''); + + // Verify the clear button is gone and search icon is back + const clearButtonAfterClear = compiled.querySelector( + '.clear-search-button' + ); + expect(clearButtonAfterClear).toBeNull(); + const searchIcon = compiled.querySelector( + '.search-field mat-icon:not(button mat-icon)' + ); + expect(searchIcon).toBeTruthy(); + expect(searchIcon?.textContent?.trim()).toBe('search'); + })); }); }); diff --git a/modules/ui/src/app/components/list-layout/list-layout.component.ts b/modules/ui/src/app/components/list-layout/list-layout.component.ts index a89412897..b8647a4f7 100644 --- a/modules/ui/src/app/components/list-layout/list-layout.component.ts +++ b/modules/ui/src/app/components/list-layout/list-layout.component.ts @@ -82,6 +82,10 @@ export class ListLayoutComponent { return this.actions(); }; + clearSearch(): void { + this.searchText.set(''); + } + updateQuery(e: Event) { const input = e.target as HTMLInputElement; const value = input.value; From d40a37cfd196a834244b21b3beaa6b8d059ab8eb Mon Sep 17 00:00:00 2001 From: Sofia Kurilova Date: Thu, 22 May 2025 11:12:00 +0200 Subject: [PATCH 05/84] Calculate tests count for first page (#1306) * Calculate tests count for first page * refactor first page calculation --------- Co-authored-by: Aliaksandr Nikitsin --- framework/python/src/common/testreport.py | 32 +++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/framework/python/src/common/testreport.py b/framework/python/src/common/testreport.py index 8118c5db9..32d043234 100644 --- a/framework/python/src/common/testreport.py +++ b/framework/python/src/common/testreport.py @@ -284,7 +284,12 @@ def to_html(self): module_reports = self._module_reports env_module = Environment(loader=BaseLoader()) - pages_num = self._pages_num(json_data) + manufacturer_length = len(json_data['device']['manufacturer']) + device_name_length = len(json_data['device']['model']) + title_length = manufacturer_length + device_name_length +1 + tests_first_page = self._calculate_tests_first_page(title_length) + pages_num = self._pages_num(json_data, tests_first_page) + module_templates = [ env_module.from_string(s).render( name=current_test_pack.name, @@ -310,11 +315,28 @@ def to_html(self): steps_to_resolve=steps_to_resolve_, module_reports=module_reports, pages_num=pages_num, - tests_first_page=TESTS_FIRST_PAGE, + tests_first_page=tests_first_page, tests_per_page=TESTS_PER_PAGE, module_templates=module_templates )) + def _calculate_tests_first_page(self, title_length): + # Calculation of test results lines at first page + + # Average chars per line is 25 + estimated_lines = title_length // 25 + if title_length % 25 > 0: + estimated_lines += 1 + + if estimated_lines > 1: + # Line height is 60 px + title_px = (estimated_lines - 1) * 60 + available_space_px = 445 - title_px + estimated_tests_first_page = available_space_px // 39 + return min(estimated_tests_first_page, TESTS_FIRST_PAGE) + else: + return TESTS_FIRST_PAGE + def _add_page_counter(self, html): # Add page nums and total page soup = BeautifulSoup(html, features='html5lib') @@ -324,18 +346,18 @@ def _add_page_counter(self, html): div.string = f'Page {index+1}/{total_pages}' return str(soup) - def _pages_num(self, json_data): + def _pages_num(self, json_data, tests_first_page=TESTS_FIRST_PAGE): # Calculate pages test_count = len(json_data['tests']['results']) # Multiple pages required - if test_count > TESTS_FIRST_PAGE: + if test_count > tests_first_page: # First page pages = 1 # Remaining testsgenerate - test_count -= TESTS_FIRST_PAGE + test_count -= tests_first_page pages += (int)(test_count / TESTS_PER_PAGE) pages = pages + 1 if test_count % TESTS_PER_PAGE > 0 else pages From c03385a54bb2fef336e51b13cf49fad180066d21 Mon Sep 17 00:00:00 2001 From: Olga Mardvilko Date: Thu, 22 May 2025 12:33:00 +0200 Subject: [PATCH 06/84] 418729718: (fix) change error message view for the same port selected (#1308) --- .../general-settings/general-settings.component.html | 12 +++++++----- .../general-settings/general-settings.component.scss | 12 ++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/ui/src/app/pages/general-settings/general-settings.component.html b/modules/ui/src/app/pages/general-settings/general-settings.component.html index 9b95aab53..ee48802d0 100644 --- a/modules/ui/src/app/pages/general-settings/general-settings.component.html +++ b/modules/ui/src/app/pages/general-settings/general-settings.component.html @@ -95,11 +95,13 @@ ">
- - Both interfaces must have different values - +
+ + Both interfaces must have different values + +