From c22e5e5268223b9d5aabcd76cfa45a14751cc011 Mon Sep 17 00:00:00 2001 From: Matthijs Smets <matthijs.smets@hotmail.com> Date: Tue, 22 Oct 2024 15:43:08 +0200 Subject: [PATCH] refactor: remove unused components and classes --- .../debug/debug-tree/debug-tree.component.ts | 2 - src/app/debug/table/table.component.ts | 4 +- .../edit-display/edit-display.component.ts | 4 +- .../components/button/button.component.css | 0 .../components/button/button.component.html | 5 --- .../button/button.component.spec.ts | 24 ----------- .../components/button/button.component.ts | 42 ------------------- .../toggle-button/toggle-button.component.css | 0 .../toggle-button.component.html | 0 .../toggle-button.component.spec.ts | 0 .../toggle-button/toggle-button.component.ts | 0 src/app/shared/interfaces/icon-data.ts | 4 -- src/app/shared/interfaces/test-tree-node.ts | 10 ----- src/app/test/test.component.ts | 2 - 14 files changed, 2 insertions(+), 95 deletions(-) delete mode 100644 src/app/shared/components/button/button.component.css delete mode 100644 src/app/shared/components/button/button.component.html delete mode 100644 src/app/shared/components/button/button.component.spec.ts delete mode 100644 src/app/shared/components/button/button.component.ts rename src/app/shared/components/{button => }/toggle-button/toggle-button.component.css (100%) rename src/app/shared/components/{button => }/toggle-button/toggle-button.component.html (100%) rename src/app/shared/components/{button => }/toggle-button/toggle-button.component.spec.ts (100%) rename src/app/shared/components/{button => }/toggle-button/toggle-button.component.ts (100%) delete mode 100644 src/app/shared/interfaces/icon-data.ts delete mode 100644 src/app/shared/interfaces/test-tree-node.ts diff --git a/src/app/debug/debug-tree/debug-tree.component.ts b/src/app/debug/debug-tree/debug-tree.component.ts index 356e5a55..c4798fb6 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'; @@ -30,7 +29,6 @@ import { ErrorHandling } from '../../shared/classes/error-handling.service'; styleUrls: ['./debug-tree.component.css'], standalone: true, imports: [ - ButtonComponent, NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, diff --git a/src/app/debug/table/table.component.ts b/src/app/debug/table/table.component.ts index eaef647d..0e4ac12d 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'; @@ -42,7 +41,6 @@ import { DeleteModalComponent } from '../../shared/components/delete-modal/delet standalone: true, imports: [ FilterSideDrawerComponent, - ButtonComponent, NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, diff --git a/src/app/report/edit-display/edit-display.component.ts b/src/app/report/edit-display/edit-display.component.ts index c3adaea7..a2770fc0 100644 --- a/src/app/report/edit-display/edit-display.component.ts +++ b/src/app/report/edit-display/edit-display.component.ts @@ -15,14 +15,13 @@ import { CustomEditorComponent } from '../../custom-editor/custom-editor.compone import { Report } from '../../shared/interfaces/report'; import { MetadataTableComponent } from '../../shared/components/metadata-table/metadata-table.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ButtonComponent } from '../../shared/components/button/button.component'; import { NgClass, NgStyle, TitleCasePipe } from '@angular/common'; import { BooleanToStringPipe } from '../../shared/pipes/boolean-to-string.pipe'; import { catchError } from 'rxjs'; import { ClipboardModule } from '@angular/cdk/clipboard'; import { EditFormComponent } from '../edit-form/edit-form.component'; import { ChangesAction, DifferenceModalComponent } from '../difference-modal/difference-modal.component'; -import { ToggleButtonComponent } from '../../shared/components/button/toggle-button/toggle-button.component'; +import { ToggleButtonComponent } from '../../shared/components/toggle-button/toggle-button.component'; import { ToastService } from '../../shared/services/toast.service'; import { TestResult } from '../../shared/interfaces/test-result'; import { MatTooltipModule } from '@angular/material/tooltip'; @@ -45,7 +44,6 @@ import { ReportAlertMessageComponent } from '../report-alert-message/report-aler styleUrls: ['./edit-display.component.css'], standalone: true, imports: [ - ButtonComponent, NgbDropdown, NgbDropdownToggle, NgbDropdownMenu, diff --git a/src/app/shared/components/button/button.component.css b/src/app/shared/components/button/button.component.css deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/shared/components/button/button.component.html b/src/app/shared/components/button/button.component.html deleted file mode 100644 index 8913321c..00000000 --- a/src/app/shared/components/button/button.component.html +++ /dev/null @@ -1,5 +0,0 @@ -<button type="button" class="btn btn-info my-2 mx-1 px-3" [id]="getId() + 'Button'" - [title]="title"> - <i [class]="icon"></i> - {{ text }} -</button> 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<ButtonComponent>; - - 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/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/test/test.component.ts b/src/app/test/test.component.ts index 34c18898..97028190 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,