diff --git a/cypress/e2e/debug/custom-editor.cy.ts b/cypress/e2e/debug/custom-editor.cy.ts index 1de15635..4e9441e7 100644 --- a/cypress/e2e/debug/custom-editor.cy.ts +++ b/cypress/e2e/debug/custom-editor.cy.ts @@ -10,7 +10,7 @@ describe('Tests for custom editor in debug tab', () => { it('should set xml as available view if editor content is xml file', () => { cy.clickRowInTable(0); - cy.clickFirstFileInFileTree(); + cy.clickRootNodeInFileTree(); cy.get('[data-cy-editor="viewDropDown"]').as('viewDropDown').find('option:selected').should('contain.text', 'Raw'); // eslint-disable-next-line sonarjs/no-duplicate-string cy.get('@viewDropDown').find('option').should('have.length', 2); @@ -21,7 +21,7 @@ describe('Tests for custom editor in debug tab', () => { it('should apply effect based on selected view', () => { cy.clickRowInTable(0); - cy.clickFirstFileInFileTree(); + cy.clickRootNodeInFileTree(); cy.get('[data-cy-editor="viewDropDown"]').as('viewDropDown'); let numberOfLines = 0; cy.get('div.line-numbers').then((elements) => { diff --git a/cypress/e2e/debug/transformation.cy.ts b/cypress/e2e/debug/transformation.cy.ts index d99bbee2..73e4ae32 100644 --- a/cypress/e2e/debug/transformation.cy.ts +++ b/cypress/e2e/debug/transformation.cy.ts @@ -25,8 +25,7 @@ describe('Tests for report transformation', () => { cy.get('[data-cy-debug="refresh"]').click(); cy.assertDebugTableLength(1).click(); cy.checkFileTreeLength(1); - // We test that the top node was not selected before. - // cy.get('[data-cy-debug-tree="root"] .jqx-tree-dropdown-root > li > div').click(); + cy.clickRootNodeInFileTree(); cy.get('[data-cy-open-metadata-table]').click(); cy.get('[data-cy-element-name="editor"]').contains('Name="IGNORED"'); // The transformation should not affect the report table, only the XML in the Monaco editor diff --git a/cypress/e2e/transformation.cy.ts b/cypress/e2e/transformation.cy.ts deleted file mode 100644 index 4bf23d3a..00000000 --- a/cypress/e2e/transformation.cy.ts +++ /dev/null @@ -1,35 +0,0 @@ -describe('Report transformation', () => { - before(() => cy.resetApp()); - - afterEach(() => cy.resetApp()); - - afterEach(() => { - cy.clearDebugStore(); - cy.get('[data-cy-debug="openSettings"]').click(); - // Factory reset in settings dialog. Resets - // transformation to factory value. - cy.get('[data-cy-settings="factoryReset"]').click(); - cy.get('[data-cy-settings="saveChanges"]').click(); - }); - - it('Update transformation', () => { - cy.visit(''); - cy.get('[data-cy-debug="openSettings"]').click(); - cy.get('textarea[formcontrolname=transformation]').type('{selectAll}{del}'); - cy.get('textarea[formcontrolname=transformation]').within((textArea) => { - cy.fixture('ignoreName.xslt').then((newText) => cy.wrap(textArea).type(newText)); - }); - cy.get('input[type=checkbox][formcontrolname=transformationEnabled]').check(); - cy.get('[data-cy-settings="saveChanges"]').click(); - cy.createOtherReport(); - cy.get('[data-cy-debug="refresh"]').click(); - cy.assertDebugTableLength(1).click(); - cy.checkFileTreeLength(1); - // We test that the top node was not selected before. - // cy.get('[data-cy-debug-tree="root"] .jqx-tree-dropdown-root > li > div').click(); - cy.get('[data-cy-open-metadata-table]').click(); - cy.get('[data-cy-element-name="editor"]').contains('Name="IGNORED"'); - // The transformation should not affect the report table, only the XML in the Monaco editor - cy.get('[data-cy-metadata-table="reportname"]').should('have.text', 'Another simple report'); - }); -}); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 57347cda..e912448b 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -17,30 +17,55 @@ declare global { namespace Cypress { interface Chainable { initializeApp(): Chainable; + resetApp(): Chainable; + clearTestReports(): Chainable; + navigateToTestTabAndWait(): Chainable; + navigateToDebugTabAndWait(): Chainable; + createReport(): Chainable; + createOtherReport(): Chainable; + createRunningReport(): Chainable; + createReportWithLabelNull(): Chainable; + createReportWithLabelEmpty(): Chainable; + createReportWithInfopoint(): Chainable; + createReportWithMultipleStartpoints(): Chainable; + clearDebugStore(): Chainable; + clearReportsInProgress(): Chainable; + selectIfNotSelected(): Chainable; + enableShowMultipleInDebugTree(): Chainable; + checkTestTableNumRows(length: number): Chainable; + checkTestTableReportsAre(reportNames: string[]): Chainable; + debugTreeGuardedCopyReport(reportName: string, numExpandedNodes: number, aliasSuffix: string): Chainable; - clickFirstFileInFileTree(): Chainable; + + clickRootNodeInFileTree(): Chainable; + clickRowInTable(index: number): Chainable; + checkFileTreeLength(length: number): Chainable; + refreshApp(): Chainable; + getDebugTableRows(): Chainable; + getTestTableRows(): Chainable + assertDebugTableLength(length: number): Chainable; } } @@ -61,7 +86,7 @@ Cypress.Commands.add('resetApp' as keyof Chainable, (): void => { }); Cypress.Commands.add('clearTestReports' as keyof Chainable, (): void => { - cy.request({ method: 'DELETE', url: '/api/report/all/Test' }).then((resp: Cypress.Response) => { + cy.request({method: 'DELETE', url: '/api/report/all/Test'}).then((resp: Cypress.Response) => { expect(resp.status).equal(200); }); }); @@ -140,7 +165,7 @@ Cypress.Commands.add('clearReportsInProgress' as keyof Chainable, (): void => { }); }); -Cypress.Commands.add('selectIfNotSelected' as keyof Chainable, { prevSubject: 'element' }, (node: JQueryWithSelector): void => { +Cypress.Commands.add('selectIfNotSelected' as keyof Chainable, {prevSubject: 'element'}, (node: JQueryWithSelector): void => { if (!node[0].classList.contains("selected")) { cy.wrap(node).click() } @@ -185,9 +210,9 @@ Cypress.Commands.add('debugTreeGuardedCopyReport' as keyof Chainable, (reportNam }); }); -Cypress.Commands.add('clickFirstFileInFileTree' as keyof Chainable, (): void => { - cy.get('[data-cy-debug-tree="root"] > app-tree-item').eq(0).find('app-tree-item').eq(0).click(); -}); +Cypress.Commands.add('clickRootNodeInFileTree' as keyof Chainable, (): void => { + cy.get('[data-cy-debug-tree="root"] > app-tree-item').eq(0).find('.sft-item').eq(0).click() +}) Cypress.Commands.add('clickRowInTable' as keyof Chainable, (index: number): void => { cy.getDebugTableRows().eq(index).click(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7fe30346..b84175af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3587,8 +3587,8 @@ packages: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} - http-proxy-middleware@2.0.6: - resolution: {integrity: sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==} + http-proxy-middleware@2.0.7: + resolution: {integrity: sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/express': ^4.17.13 @@ -9961,7 +9961,7 @@ snapshots: transitivePeerDependencies: - supports-color - http-proxy-middleware@2.0.6(@types/express@4.17.21): + http-proxy-middleware@2.0.7(@types/express@4.17.21): dependencies: '@types/http-proxy': 1.17.14 http-proxy: 1.18.1(debug@4.3.7) @@ -11950,7 +11950,7 @@ snapshots: express: 4.21.0 graceful-fs: 4.2.11 html-entities: 2.5.2 - http-proxy-middleware: 2.0.6(@types/express@4.17.21) + http-proxy-middleware: 2.0.7(@types/express@4.17.21) ipaddr.js: 2.2.0 launch-editor: 2.8.0 open: 10.1.0 diff --git a/src/app/compare/compare-tree/compare-tree.component.ts b/src/app/compare/compare-tree/compare-tree.component.ts index 7617b522..d4882199 100644 --- a/src/app/compare/compare-tree/compare-tree.component.ts +++ b/src/app/compare/compare-tree/compare-tree.component.ts @@ -116,7 +116,9 @@ export class CompareTreeComponent { if (item.children) { for (const child of item.children) { const checkpoint = child.originalValue as Checkpoint; - if (this.getCheckpointId(checkpoint.uid) === this.getCheckpointId(checkpointToMatch.uid)) { + if ( + ReportUtil.getCheckpointIdFromUid(checkpoint.uid) === ReportUtil.getCheckpointIdFromUid(checkpointToMatch.uid) + ) { tree.selectItem(child.path); return; } else { @@ -142,7 +144,7 @@ export class CompareTreeComponent { for (let checkpoint of checkpoints) { if ( ReportUtil.isCheckPoint(itemToMatch) && - this.getCheckpointId(checkpoint.uid) === this.getCheckpointId(itemToMatch.uid) + ReportUtil.getCheckpointIdFromUid(checkpoint.uid) === ReportUtil.getCheckpointIdFromUid(itemToMatch.uid) ) { return checkpoint; } @@ -153,8 +155,4 @@ export class CompareTreeComponent { } return null; } - - getCheckpointId(uid: string): string { - return uid.split('#')[1]; - } } diff --git a/src/app/debug/active-filters/active-filters.component.css b/src/app/debug/active-filters/active-filters.component.css index 4dcaf95e..bcb04f91 100644 --- a/src/app/debug/active-filters/active-filters.component.css +++ b/src/app/debug/active-filters/active-filters.component.css @@ -1,3 +1,7 @@ .filter-container { - background-color: rgba(26, 179,148); + background-color: rgba(26, 179, 148); +} + +div:hover { + cursor: pointer; } diff --git a/src/app/debug/debug-tree/debug-tree.component.ts b/src/app/debug/debug-tree/debug-tree.component.ts index 6fdc4a7c..6b84bdbd 100644 --- a/src/app/debug/debug-tree/debug-tree.component.ts +++ b/src/app/debug/debug-tree/debug-tree.component.ts @@ -17,7 +17,6 @@ import { NgbDropdownMenu, NgbDropdownToggle, } from '@ng-bootstrap/ng-bootstrap'; -import { ButtonComponent } from '../../shared/components/button/button.component'; import { ReportHierarchyTransformer } from '../../shared/classes/report-hierarchy-transformer'; import { SimpleFileTreeUtil } from '../../shared/util/simple-file-tree-util'; import { View } from '../../shared/interfaces/view'; @@ -31,7 +30,6 @@ import { RefreshCondition } from '../../shared/interfaces/refresh-condition'; styleUrls: ['./debug-tree.component.css'], standalone: true, imports: [ - ButtonComponent, NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, @@ -152,13 +150,24 @@ export class DebugTreeComponent implements OnDestroy { this.tree.clearItems(); } const newReport: CreateTreeItem = new ReportHierarchyTransformer().transform(report); - const path: string = this.tree.addItem(newReport); - this.tree.selectItem(path); + const rootNodePath: string = this.tree.addItem(newReport); + this.selectFirstCheckpoint(rootNodePath); if (this._currentView) { this.hideOrShowCheckpointsBasedOnView(this._currentView); } } + private selectFirstCheckpoint(rootNodePath: string) { + const last = this.tree.items.length - 1; + const lastAdded = this.tree.items[last]; + if (lastAdded.children) { + const firstCheckpoint = lastAdded.children[0]; + this.tree.selectItem(firstCheckpoint.path); + } else { + this.tree.selectItem(rootNodePath); + } + } + closeEntireTree(): void { this.closeEntireTreeEvent.emit(); this.tree.clearItems(); diff --git a/src/app/debug/filter-side-drawer/filter.service.ts b/src/app/debug/filter-side-drawer/filter.service.ts index 9e537edf..ebc76125 100644 --- a/src/app/debug/filter-side-drawer/filter.service.ts +++ b/src/app/debug/filter-side-drawer/filter.service.ts @@ -28,10 +28,7 @@ export class FilterService { this.filterErrors.clear(); for (let [key, value] of context) { const metadataType: string | undefined = this.metadataTypes.get(key); - if ( - (this.isTimestamp(metadataType) && !this.isValidTimestamp(value)) || - (this.isNumber(metadataType) && !this.isValidNumber(value)) - ) { + if (this.isNumber(metadataType) && !this.isValidNumber(value)) { this.filterErrors.set(this.metadataTypes.get(key), value); errorFound = true; } @@ -104,19 +101,10 @@ export class FilterService { this.filterErrorSubject.next([true, this.filterErrors]); } - isTimestamp(metadataType: string | undefined): boolean { - return metadataType === 'timestamp'; - } - isNumber(metadataType: string | undefined): boolean { return metadataType === 'int' || metadataType === 'long'; } - isValidTimestamp(userInput: string): boolean { - const regex: RegExp = /^(\*|[\d :\-]*\*?)+$/; - return regex.test(userInput) && length < 20; - } - isValidNumber(userInput: string): boolean { const regex: RegExp = /^\*?-?\d*(\.\d*)?\*?$/; return regex.test(userInput); diff --git a/src/app/debug/table/table.component.ts b/src/app/debug/table/table.component.ts index 9267afda..6130d86c 100644 --- a/src/app/debug/table/table.component.ts +++ b/src/app/debug/table/table.component.ts @@ -3,7 +3,7 @@ import { HelperService } from '../../shared/services/helper.service'; import { HttpService } from '../../shared/services/http.service'; import { TableSettingsModalComponent } from './table-settings-modal/table-settings-modal.component'; import { TableSettings } from '../../shared/interfaces/table-settings'; -import { catchError, Subject, Subscription, tap } from 'rxjs'; +import { catchError, Subject, Subscription } from 'rxjs'; import { Report } from '../../shared/interfaces/report'; import { SettingsService } from '../../shared/services/settings.service'; import { ToastService } from '../../shared/services/toast.service'; @@ -23,7 +23,6 @@ import { NgbDropdownMenu, NgbDropdownToggle, } from '@ng-bootstrap/ng-bootstrap'; -import { ButtonComponent } from '../../shared/components/button/button.component'; import { FilterSideDrawerComponent } from '../filter-side-drawer/filter-side-drawer.component'; import { KeyValuePipe, NgClass } from '@angular/common'; import { MatTableDataSource, MatTableModule } from '@angular/material/table'; @@ -43,7 +42,6 @@ import { RefreshCondition } from '../../shared/interfaces/refresh-condition'; standalone: true, imports: [ FilterSideDrawerComponent, - ButtonComponent, NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, @@ -190,6 +188,10 @@ export class TableComponent implements OnInit, OnDestroy { this.refresh(condition), ); this.subscriptions.add(refreshTable); + const amountOfRecordsInTableSubscription = this.settingsService.amountOfRecordsInTableObservable.subscribe( + (value) => (this.tableSettings.displayAmount = value), + ); + this.subscriptions.add(amountOfRecordsInTableSubscription); } setTableSpacing(value: number): void { @@ -465,19 +467,21 @@ export class TableComponent implements OnInit, OnDestroy { } changeTableLimit(event: any): void { - this.tableSettings.displayAmount = event.target.value === '' ? 0 : event.target.value; - this.retrieveRecords(); + const value = event.target.value === '' ? 0 : event.target.value; + if (this.tableSettings.displayAmount !== value) { + this.settingsService.setAmountOfRecordsInTable(value); + this.retrieveRecords(); + } } refresh(refreshCondition?: RefreshCondition): void { - this.tableSettings.displayAmount = 10; if (refreshCondition) { this.loadData(refreshCondition.displayToast); } else { this.loadData(); } } - + openReport(storageId: number): void { this.httpService .getReport(storageId, this.currentView.storageName) diff --git a/src/app/custom-editor/custom-editor.component.css b/src/app/editor/editor.component.css similarity index 100% rename from src/app/custom-editor/custom-editor.component.css rename to src/app/editor/editor.component.css diff --git a/src/app/custom-editor/custom-editor.component.html b/src/app/editor/editor.component.html similarity index 100% rename from src/app/custom-editor/custom-editor.component.html rename to src/app/editor/editor.component.html diff --git a/src/app/custom-editor/custom-editor.component.spec.ts b/src/app/editor/editor.component.spec.ts similarity index 58% rename from src/app/custom-editor/custom-editor.component.spec.ts rename to src/app/editor/editor.component.spec.ts index 07d165c0..8f8314eb 100644 --- a/src/app/custom-editor/custom-editor.component.spec.ts +++ b/src/app/editor/editor.component.spec.ts @@ -1,17 +1,17 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CustomEditorComponent } from './custom-editor.component'; +import { EditorComponent } from './editor.component'; describe('CustomEditorComponent', () => { - let component: CustomEditorComponent; - let fixture: ComponentFixture; + let component: EditorComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [CustomEditorComponent], + imports: [EditorComponent], }).compileComponents(); - fixture = TestBed.createComponent(CustomEditorComponent); + fixture = TestBed.createComponent(EditorComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/custom-editor/custom-editor.component.ts b/src/app/editor/editor.component.ts similarity index 97% rename from src/app/custom-editor/custom-editor.component.ts rename to src/app/editor/editor.component.ts index ab21d393..dd6b1174 100644 --- a/src/app/custom-editor/custom-editor.component.ts +++ b/src/app/editor/editor.component.ts @@ -29,13 +29,13 @@ export const editorViewsConst = [...basicContentTypes, ...prettyContentTypes] as export type EditorView = (typeof editorViewsConst)[number]; @Component({ - selector: 'app-custom-editor', - templateUrl: './custom-editor.component.html', - styleUrl: './custom-editor.component.css', + selector: 'app-editor', + templateUrl: './editor.component.html', + styleUrl: './editor.component.css', standalone: true, imports: [MonacoEditorModule, ReactiveFormsModule, FormsModule, TitleCasePipe], }) -export class CustomEditorComponent implements OnInit, OnDestroy, OnChanges { +export class EditorComponent implements OnInit, OnDestroy, OnChanges { @Input() height!: number; @Input() readOnlyMode: boolean = true; @Output() saveReport: Subject = new Subject(); @@ -106,6 +106,7 @@ export class CustomEditorComponent implements OnInit, OnDestroy, OnChanges { this.save(); } } + calculateHeight() { if (this.statusBar) { this.calculatedHeight = this.height - this.statusBar.nativeElement.offsetHeight; diff --git a/src/app/report/edit-display/edit-display.component.html b/src/app/report/edit-display/edit-display.component.html index 7b0950c7..04219617 100644 --- a/src/app/report/edit-display/edit-display.component.html +++ b/src/app/report/edit-display/edit-display.component.html @@ -45,16 +45,14 @@ > | - @if (ReportUtil.isReport(selectedNode)) { - - } + @if (editingEnabled) { diff --git a/src/app/shared/components/button/button.component.spec.ts b/src/app/shared/components/button/button.component.spec.ts deleted file mode 100644 index e5bc97ff..00000000 --- a/src/app/shared/components/button/button.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ButtonComponent } from './button.component'; - -describe('ButtonComponent', () => { - let component: ButtonComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ButtonComponent], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ButtonComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/shared/components/button/button.component.ts b/src/app/shared/components/button/button.component.ts deleted file mode 100644 index 3537da02..00000000 --- a/src/app/shared/components/button/button.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Component, Input } from '@angular/core'; - -@Component({ - selector: 'app-button', - templateUrl: './button.component.html', - styleUrls: ['./button.component.css'], - standalone: true, -}) -export class ButtonComponent { - @Input() - get icon(): string { - return this._icon; - } - set icon(icon: string) { - this._icon = icon; - } - private _icon = ''; - - @Input() - get title(): string { - return this._title; - } - set title(title: string) { - this._title = title; - } - private _title = ''; - - @Input() - get text(): string { - return this._text; - } - set text(text: string) { - this._text = text; - } - private _text = ''; - - id: string = ''; - - getId() { - return this._title.replaceAll(/\s/g, ''); - } -} diff --git a/src/app/shared/components/button/toggle-button/toggle-button.component.css b/src/app/shared/components/toggle-button/toggle-button.component.css similarity index 100% rename from src/app/shared/components/button/toggle-button/toggle-button.component.css rename to src/app/shared/components/toggle-button/toggle-button.component.css diff --git a/src/app/shared/components/button/toggle-button/toggle-button.component.html b/src/app/shared/components/toggle-button/toggle-button.component.html similarity index 100% rename from src/app/shared/components/button/toggle-button/toggle-button.component.html rename to src/app/shared/components/toggle-button/toggle-button.component.html diff --git a/src/app/shared/components/button/toggle-button/toggle-button.component.spec.ts b/src/app/shared/components/toggle-button/toggle-button.component.spec.ts similarity index 100% rename from src/app/shared/components/button/toggle-button/toggle-button.component.spec.ts rename to src/app/shared/components/toggle-button/toggle-button.component.spec.ts diff --git a/src/app/shared/components/button/toggle-button/toggle-button.component.ts b/src/app/shared/components/toggle-button/toggle-button.component.ts similarity index 100% rename from src/app/shared/components/button/toggle-button/toggle-button.component.ts rename to src/app/shared/components/toggle-button/toggle-button.component.ts diff --git a/src/app/shared/interfaces/icon-data.ts b/src/app/shared/interfaces/icon-data.ts deleted file mode 100644 index 1cd6c1d2..00000000 --- a/src/app/shared/interfaces/icon-data.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IconData { - path: string; - cssClasses: string; -} diff --git a/src/app/shared/interfaces/report-difference.ts b/src/app/shared/interfaces/report-difference.ts index 2f17f27d..5259d1f4 100644 --- a/src/app/shared/interfaces/report-difference.ts +++ b/src/app/shared/interfaces/report-difference.ts @@ -1,5 +1,7 @@ +import DiffMatchPatch from 'diff-match-patch'; + export interface ReportDifference { name: string; originalValue: string; - difference: (number | string)[][] | string; + difference: DiffMatchPatch.Diff[] | string; } diff --git a/src/app/shared/interfaces/test-tree-node.ts b/src/app/shared/interfaces/test-tree-node.ts deleted file mode 100644 index b46ea3c8..00000000 --- a/src/app/shared/interfaces/test-tree-node.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface TestTreeNode { - text: string; - filter: string; - nodes: TestTreeNode[]; - state: { - expanded: boolean; - selected?: boolean; - }; - nodeId?: number; -} diff --git a/src/app/shared/services/settings.service.ts b/src/app/shared/services/settings.service.ts index 34efeeb8..21b8e60e 100644 --- a/src/app/shared/services/settings.service.ts +++ b/src/app/shared/services/settings.service.ts @@ -18,6 +18,8 @@ export class SettingsService { this.setTableSpacing(cappedTableSpacing); this.setShowSearchWindowOnLoad(localStorage.getItem(this.showSearchWindowOnLoadKey) === 'true'); this.setPrettifyOnLoad(localStorage.getItem(this.prettifyOnLoadKey) === 'true'); + const amountOfRecordsInTable = localStorage.getItem(this.amountOfRecordsInTableKey) ?? this.amountOfRecordsInTable; + this.setAmountOfRecordsInTable(+amountOfRecordsInTable); } //Show multiple files in debug tree @@ -66,4 +68,16 @@ export class SettingsService { this.prettifyOnLoadSubject.next(value); localStorage.setItem(this.prettifyOnLoadKey, String(this.prettifyOnLoad)); } + + //Table settings + private amountOfRecordsInTableKey: string = 'amountOfRecordsInTable'; + private amountOfRecordsInTable: number = 10; + private amountOfRecordsInTableSubject: Subject = new ReplaySubject(1); + public amountOfRecordsInTableObservable: Observable = this.amountOfRecordsInTableSubject.asObservable(); + + public setAmountOfRecordsInTable(value: number): void { + this.amountOfRecordsInTable = value; + this.amountOfRecordsInTableSubject.next(value); + localStorage.setItem(this.amountOfRecordsInTableKey, String(this.amountOfRecordsInTable)); + } } diff --git a/src/app/shared/util/report-util.ts b/src/app/shared/util/report-util.ts index acf298f5..2a1a558f 100644 --- a/src/app/shared/util/report-util.ts +++ b/src/app/shared/util/report-util.ts @@ -25,4 +25,10 @@ export const ReportUtil = { hasValidUid(uid: string) { return !uid.includes('null'); }, + getCheckpointIdFromUid(uid: string): number { + return +uid.split('#')[1]; + }, + getStorageIdFromUid(uid: string): number { + return +uid.split('#')[0]; + }, }; diff --git a/src/app/test/test.component.ts b/src/app/test/test.component.ts index 34c18898..4bac08bc 100644 --- a/src/app/test/test.component.ts +++ b/src/app/test/test.component.ts @@ -12,7 +12,6 @@ import { UpdatePathSettings } from '../shared/interfaces/update-path-settings'; import { TestFolderTreeComponent } from './test-folder-tree/test-folder-tree.component'; import { ToastComponent } from '../shared/components/toast/toast.component'; import { FormsModule, NgModel, ReactiveFormsModule } from '@angular/forms'; -import { ButtonComponent } from '../shared/components/button/button.component'; import { TestListItem } from '../shared/interfaces/test-list-item'; import { OptionsSettings } from '../shared/interfaces/options-settings'; import { ErrorHandling } from '../shared/classes/error-handling.service'; @@ -32,7 +31,6 @@ export type UpdatePathAction = (typeof updatePathActionConst)[number]; standalone: true, imports: [ TestFolderTreeComponent, - ButtonComponent, ReactiveFormsModule, FormsModule, ToastComponent, @@ -139,6 +137,7 @@ export class TestComponent implements OnInit, OnDestroy { for (const report of this.reports) { report.reranReport = null; } + this.matches(); } run(report: TestListItem): void {