diff --git a/web/src/app/common/common.module.ts b/web/src/app/common/common.module.ts index 10f67f7..fa9ea1d 100644 --- a/web/src/app/common/common.module.ts +++ b/web/src/app/common/common.module.ts @@ -23,25 +23,14 @@ import { FirstOrUndefined } from './first-or-null.pipe'; import { ParsePathPipe } from './parse-path.pipe'; import { RainbowPipe } from './rainbow.pipe'; import { SidePaneComponent } from './components/side-pane.component'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatIconModule } from '@angular/material/icon'; import { ResolveTextPipe } from './resolve-text.pipe'; import { MetaTableRowComponent } from './components/meta-table-row.component'; -import { ClipboardModule } from '@angular/cdk/clipboard'; -import { MatTooltipModule } from '@angular/material/tooltip'; import { CssClassFormatPipe } from './css-class-format.pipe'; import { BreaklinePipe } from './breakline.pipe'; import { CaptureShiftKeyDirective } from './capture-shiftkey.directive'; @NgModule({ - declarations: [ - - ], imports: [ - MatToolbarModule, - MatIconModule, - ClipboardModule, - MatTooltipModule, TimestampFormatPipe, LongTimestampFormatPipe, FirstOrUndefined, diff --git a/web/src/app/dialogs/dialogs.module.ts b/web/src/app/dialogs/dialogs.module.ts deleted file mode 100644 index 8e3e912..0000000 --- a/web/src/app/dialogs/dialogs.module.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { ProgressDialogComponent } from './progress/progress.component'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatDialogModule } from '@angular/material/dialog'; -import { NewInspectionDialogComponent } from './new-inspection/new-inspection.component'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatOptionModule } from '@angular/material/core'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { InspectionMetadataDialogComponent } from './inspection-metadata/inspection-metadata.component'; -import { MatIconModule } from '@angular/material/icon'; -import { MatButtonModule } from '@angular/material/button'; -import { MatInputModule } from '@angular/material/input'; -import { MatStepperModule } from '@angular/material/stepper'; -import { MatCardModule } from '@angular/material/card'; - -import { MatSelectModule } from '@angular/material/select'; -import { KHICommonModule } from '../common/common.module'; -import { StartupDialogComponent } from './startup/startup.component'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -@NgModule({ - imports: [ - CommonModule, - KHICommonModule, - MatInputModule, - MatProgressBarModule, - MatDialogModule, - MatStepperModule, - MatSelectModule, - MatFormFieldModule, - ReactiveFormsModule, - FormsModule, - MatAutocompleteModule, - MatOptionModule, - MatCheckboxModule, - MatIconModule, - MatButtonModule, - MatCardModule, - MatTooltipModule, - StartupDialogComponent, - ProgressDialogComponent, - NewInspectionDialogComponent, - InspectionMetadataDialogComponent, - ], - exports: [ - ProgressDialogComponent, - NewInspectionDialogComponent, - InspectionMetadataDialogComponent, - ], -}) -export class DialogsModule {} diff --git a/web/src/app/diff/diff.module.ts b/web/src/app/diff/diff.module.ts deleted file mode 100644 index 0d1e02e..0000000 --- a/web/src/app/diff/diff.module.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { NgModule } from '@angular/core'; -import { DiffViewComponent } from './diff-view.component'; -import { LogModule } from '../log/log.module'; -import { ParsePrincipalPipe } from './diff-view-pipes'; -import { MatIconModule } from '@angular/material/icon'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { ClipboardModule } from '@angular/cdk/clipboard'; -import { KHICommonModule } from '../common/common.module'; -import { MatButtonModule } from '@angular/material/button'; -import { CommonModule } from '@angular/common'; -import { DiffComponent } from '../pages/diff/diff.component'; -import { HeaderModule } from '../header/header.module'; -import { HighlightModule, provideHighlightOptions } from 'ngx-highlightjs'; -import { ScrollingModule } from '@angular/cdk/scrolling'; -import { UnifiedDiffComponent, SideBySideDiffComponent } from 'ngx-diff'; -import { TIMELINE_ANNOTATOR_RESOLVER } from '../annotator/timeline/resolver'; -import { getDefaultTimelineAnnotatorResolver } from '../annotator/timeline/default'; -import { - CHANGE_PAIR_TOOL_ANNOTATOR_FOR_FLOATING_PAGE_RESOLVER, - CHANGE_PAIR_TOOL_ANNOTATOR_RESOLVER, -} from '../annotator/change-pair-tool/resolver'; -import { - getDefaultChangePairToolAnnotatorResolver, - getDefaultChangePairToolAnnotatorResolverForFloatingPage, -} from '../annotator/change-pair-tool/default'; -import { CHANGE_PAIR_ANNOTATOR_RESOLVER } from '../annotator/change-pair/resolver'; -import { getDefaultChangePairAnnotatorResolver } from '../annotator/change-pair/default'; - -@NgModule({ - imports: [ - UnifiedDiffComponent, - SideBySideDiffComponent, - CommonModule, - KHICommonModule, - LogModule, - MatIconModule, - MatToolbarModule, - ClipboardModule, - MatButtonModule, - HeaderModule, - HighlightModule, - ScrollingModule, - DiffViewComponent, - ParsePrincipalPipe, - DiffComponent - ], - providers: [ - provideHighlightOptions({ - coreLibraryLoader: () => import('highlight.js/lib/core'), - lineNumbersLoader: () => import('ngx-highlightjs/line-numbers'), - languages: { - yaml: () => import('highlight.js/lib/languages/yaml'), - }, - }), - { - provide: TIMELINE_ANNOTATOR_RESOLVER, - useValue: getDefaultTimelineAnnotatorResolver(), - }, - { - provide: CHANGE_PAIR_TOOL_ANNOTATOR_RESOLVER, - useValue: getDefaultChangePairToolAnnotatorResolver(), - }, - { - provide: CHANGE_PAIR_TOOL_ANNOTATOR_FOR_FLOATING_PAGE_RESOLVER, - useValue: getDefaultChangePairToolAnnotatorResolverForFloatingPage(), - }, - { - provide: CHANGE_PAIR_ANNOTATOR_RESOLVER, - useValue: getDefaultChangePairAnnotatorResolver(), - }, - ], - exports: [DiffViewComponent], -}) -export class DiffModule { } diff --git a/web/src/app/header/header.module.ts b/web/src/app/header/header.module.ts deleted file mode 100644 index 770820c..0000000 --- a/web/src/app/header/header.module.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { NgModule } from '@angular/core'; -import { MatIconModule } from '@angular/material/icon'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { HeaderComponent } from './header.component'; -import { ToolbarComponent } from './toolbar.component'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { RegexInputComponent } from './regex-input.component'; -import { SetInputComponent } from './set-input.component'; -import { OverlayModule } from '@angular/cdk/overlay'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatChipsModule } from '@angular/material/chips'; -import { MatInputModule } from '@angular/material/input'; -import { MatButtonModule } from '@angular/material/button'; -import { KHICommonModule } from '../common/common.module'; -import { CommonModule } from '@angular/common'; -import { TitleBarComponent } from './titlebar.component'; -import { MatMenuModule } from '@angular/material/menu'; -import { MainMenuComponent } from './main-menu.component'; -import { GraphMenuComponent } from './graph-menu.component'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; - -@NgModule({ - imports: [ - CommonModule, - KHICommonModule, - MatButtonModule, - MatIconModule, - MatToolbarModule, - MatFormFieldModule, - MatAutocompleteModule, - MatChipsModule, - MatInputModule, - MatMenuModule, - ReactiveFormsModule, - FormsModule, - OverlayModule, - MatTooltipModule, - MatButtonToggleModule, - HeaderComponent, - ToolbarComponent, - SetInputComponent, - RegexInputComponent, - TitleBarComponent, - MainMenuComponent, - GraphMenuComponent, - ], - exports: [HeaderComponent, TitleBarComponent, GraphMenuComponent], -}) -export class HeaderModule {} diff --git a/web/src/app/log/log.module.ts b/web/src/app/log/log.module.ts deleted file mode 100644 index 32ec89a..0000000 --- a/web/src/app/log/log.module.ts +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { NgModule } from '@angular/core'; -import { LogBodyComponent } from './body.component'; -import { LogHeaderComponent } from './header.component'; -import { LogViewComponent } from './log-view.component'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatIconModule } from '@angular/material/icon'; -import { MatButtonModule } from '@angular/material/button'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ClipboardModule } from '@angular/cdk/clipboard'; -import { ScrollingModule } from '@angular/cdk/scrolling'; -import { HighlightModule, provideHighlightOptions } from 'ngx-highlightjs'; -import { KHICommonModule } from '../common/common.module'; -import { CommonModule, NgComponentOutlet } from '@angular/common'; -import { IconToggleButtonComponent } from './icon-toggle-button.component'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { LOG_ANNOTATOR_RESOLVER } from '../annotator/log/resolver'; -import { HighlightLineNumbers } from 'ngx-highlightjs/line-numbers'; -import { getDefaultLogAnnotatorResolver } from '../annotator/log/default'; -import { LOG_TOOL_ANNOTATOR_RESOLVER } from '../annotator/log-tool/resolver'; -import { getDefaultLogToolAnnotatorResolver } from '../annotator/log-tool/default'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; -import { LogViewLogLineComponent } from './log-view-log-line.component'; - -@NgModule({ - imports: [ - CommonModule, - KHICommonModule, - MatToolbarModule, - MatIconModule, - MatButtonModule, - MatSlideToggleModule, - FormsModule, - ReactiveFormsModule, - ScrollingModule, - HighlightModule, - HighlightLineNumbers, - ClipboardModule, - MatTooltipModule, - NgComponentOutlet, - MatSnackBarModule, - LogBodyComponent, - LogHeaderComponent, - LogViewComponent, - LogViewLogLineComponent, - IconToggleButtonComponent, - ], - providers: [ - provideHighlightOptions({ - coreLibraryLoader: () => import('highlight.js/lib/core'), - lineNumbersLoader: () => import('ngx-highlightjs/line-numbers'), - languages: { - yaml: () => import('highlight.js/lib/languages/yaml'), - }, - }), - { - provide: LOG_ANNOTATOR_RESOLVER, - useValue: getDefaultLogAnnotatorResolver(), - }, - { - provide: LOG_TOOL_ANNOTATOR_RESOLVER, - useValue: getDefaultLogToolAnnotatorResolver(), - }, - ], - exports: [LogViewComponent, LogHeaderComponent], -}) -export class LogModule {} diff --git a/web/src/app/pages/graph/graph.module.ts b/web/src/app/pages/graph/graph.module.ts index e8d1f41..c02ef6f 100644 --- a/web/src/app/pages/graph/graph.module.ts +++ b/web/src/app/pages/graph/graph.module.ts @@ -15,26 +15,10 @@ */ import { NgModule } from '@angular/core'; - -import { GraphComponent } from './graph.component'; -import { ArchitectureGraphComponent } from './architecture-graph/architecture-graph.component'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; import { DownloadService } from './services/donwload-service'; -import { CommonModule } from '@angular/common'; -import { HeaderModule } from 'src/app/header/header.module'; import { GraphPageDataSource } from 'src/app/services/frame-connection/frames/graph-page-datasource.service'; @NgModule({ - imports: [ - CommonModule, - MatToolbarModule, - MatButtonModule, - MatIconModule, - HeaderModule, - GraphComponent, ArchitectureGraphComponent - ], providers: [GraphPageDataSource, DownloadService], }) export class GraphPageModule {} diff --git a/web/src/app/pages/main/main.component.spec.ts b/web/src/app/pages/main/main.component.spec.ts index 6c59216..7cc763a 100644 --- a/web/src/app/pages/main/main.component.spec.ts +++ b/web/src/app/pages/main/main.component.spec.ts @@ -18,11 +18,7 @@ import { TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { AppComponent } from './main.component'; -import { DiffModule } from '../../diff/diff.module'; -import { HeaderModule } from '../../header/header.module'; -import { LogModule } from '../../log/log.module'; import { InspectionDataLoaderService } from '../../services/data-loader.service'; -import { TimelineModule } from '../../timeline/timeline.module'; import { WINDOW_CONNECTION_PROVIDER, WindowConnectorService, @@ -51,10 +47,6 @@ describe('AppComponent', () => { declarations: [AppComponent], imports: [ MatDialogModule, - HeaderModule, - TimelineModule, - LogModule, - DiffModule, MatIconModule, MatSnackBarModule, ], diff --git a/web/src/app/pages/main/main.component.ts b/web/src/app/pages/main/main.component.ts index 0f073d3..a6917e2 100644 --- a/web/src/app/pages/main/main.component.ts +++ b/web/src/app/pages/main/main.component.ts @@ -42,19 +42,19 @@ import { ExtensionStore, } from 'src/app/extensions/extension-common/extension-store'; import { CommonModule } from '@angular/common'; -import { HeaderModule } from 'src/app/header/header.module'; import { TimelineComponent } from 'src/app/timeline/timeline.component'; import { SidePaneComponent } from 'src/app/common/components/side-pane.component'; import { LogViewComponent } from 'src/app/log/log-view.component'; import { DiffViewComponent } from 'src/app/diff/diff-view.component'; import { MatIconModule } from '@angular/material/icon'; +import { HeaderComponent } from 'src/app/header/header.component'; @Component({ templateUrl: './main.component.html', styleUrls: ['./main.component.sass'], imports:[ CommonModule, - HeaderModule, + HeaderComponent, TimelineComponent, SidePaneComponent, LogViewComponent, diff --git a/web/src/app/root.module.ts b/web/src/app/root.module.ts index 6dfce14..471d914 100644 --- a/web/src/app/root.module.ts +++ b/web/src/app/root.module.ts @@ -24,35 +24,23 @@ import { } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { AppComponent } from './pages/main/main.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { provideHighlightOptions } from 'ngx-highlightjs'; import { InspectionDataLoaderService } from './services/data-loader.service'; import { TimelineSelectionService } from './services/timeline-selection.service'; import { InspectionDataStoreService } from './services/inspection-data-store.service'; import { SelectionManagerService } from './services/selection-manager.service'; -import { HeaderModule } from './header/header.module'; -import { DialogsModule } from './dialogs/dialogs.module'; -import { LogModule } from './log/log.module'; -import { DiffModule } from './diff/diff.module'; -import { CommonModule } from '@angular/common'; -import { TimelineModule } from './timeline/timeline.module'; -import { MatSnackBarModule } from '@angular/material/snack-bar'; import { RouterModule, TitleStrategy } from '@angular/router'; import { KHIRoutes } from './app.route'; import { RootComponent } from './root.component'; -import { GraphPageModule } from './pages/graph/graph.module'; import { WINDOW_CONNECTION_PROVIDER, WindowConnectorService, } from './services/frame-connection/window-connector.service'; import { BroadcastChannelWindowConnectionProvider } from './services/frame-connection/window-connection-provider.service'; import { KHITitleStrategy } from './services/title-strategy.service'; -import { KHICommonModule } from './common/common.module'; -import { MatIconModule, MatIconRegistry } from '@angular/material/icon'; -import { MatButtonModule } from '@angular/material/button'; +import { MatIconRegistry } from '@angular/material/icon'; import { HttpClientModule } from '@angular/common/http'; -import { RequestUserActionPopupComponent } from './dialogs/request-user-action-popup/request-user-action-popup.component'; import { POPUP_MANAGER } from './services/popup/popup-manager'; import { PopupManagerImpl } from './services/popup/popup-manager-impl'; import { BACKEND_API } from './services/api/backend-api-interface'; @@ -84,28 +72,25 @@ import { MatTooltipDefaultOptions, } from '@angular/material/tooltip'; import { ViewStateService } from './services/view-state.service'; +import { LOG_ANNOTATOR_RESOLVER } from './annotator/log/resolver'; +import { getDefaultLogAnnotatorResolver } from './annotator/log/default'; +import { LOG_TOOL_ANNOTATOR_RESOLVER } from './annotator/log-tool/resolver'; +import { getDefaultLogToolAnnotatorResolver } from './annotator/log-tool/default'; +import { TIMELINE_ANNOTATOR_RESOLVER } from './annotator/timeline/resolver'; +import { getDefaultTimelineAnnotatorResolver } from './annotator/timeline/default'; +import { CHANGE_PAIR_TOOL_ANNOTATOR_FOR_FLOATING_PAGE_RESOLVER, CHANGE_PAIR_TOOL_ANNOTATOR_RESOLVER } from './annotator/change-pair-tool/resolver'; +import { getDefaultChangePairToolAnnotatorResolver, getDefaultChangePairToolAnnotatorResolverForFloatingPage } from './annotator/change-pair-tool/default'; +import { CHANGE_PAIR_ANNOTATOR_RESOLVER } from './annotator/change-pair/resolver'; +import { getDefaultChangePairAnnotatorResolver } from './annotator/change-pair/default'; @NgModule({ declarations: [ RootComponent, ], imports: [ - CommonModule, - KHICommonModule, BrowserModule, BrowserAnimationsModule, - HeaderModule, - DialogsModule, - LogModule, - DiffModule, - GraphPageModule, - TimelineModule, - AppComponent, - MatSnackBarModule, RouterModule.forRoot(KHIRoutes), - MatIconModule, - MatButtonModule, // Standoalone components - RequestUserActionPopupComponent, environment.pluginModules, ], providers: [ @@ -128,6 +113,30 @@ import { ViewStateService } from './services/view-state.service'; InspectionDataStoreService, SelectionManagerService, WindowConnectorService, + { + provide: LOG_ANNOTATOR_RESOLVER, + useValue: getDefaultLogAnnotatorResolver(), + }, + { + provide: LOG_TOOL_ANNOTATOR_RESOLVER, + useValue: getDefaultLogToolAnnotatorResolver(), + }, + { + provide: TIMELINE_ANNOTATOR_RESOLVER, + useValue: getDefaultTimelineAnnotatorResolver(), + }, + { + provide: CHANGE_PAIR_TOOL_ANNOTATOR_RESOLVER, + useValue: getDefaultChangePairToolAnnotatorResolver(), + }, + { + provide: CHANGE_PAIR_TOOL_ANNOTATOR_FOR_FLOATING_PAGE_RESOLVER, + useValue: getDefaultChangePairToolAnnotatorResolverForFloatingPage(), + }, + { + provide: CHANGE_PAIR_ANNOTATOR_RESOLVER, + useValue: getDefaultChangePairAnnotatorResolver(), + }, { provide: WINDOW_CONNECTION_PROVIDER, useValue: new BroadcastChannelWindowConnectionProvider(), diff --git a/web/src/app/timeline/timeline.module.ts b/web/src/app/timeline/timeline.module.ts deleted file mode 100644 index 81e360a..0000000 --- a/web/src/app/timeline/timeline.module.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { TimelineComponent } from './timeline.component'; -import { ScrollingModule } from '@angular/cdk/scrolling'; -import { OverlayModule } from '@angular/cdk/overlay'; -import { MatIconModule } from '@angular/material/icon'; -import { KHICommonModule } from '../common/common.module'; -import { MatButtonModule } from '@angular/material/button'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { NavigatorComponent } from './navigator/navigator.component'; - -@NgModule({ - declarations: [], - imports: [ - CommonModule, - KHICommonModule, - ScrollingModule, - OverlayModule, - MatIconModule, - MatButtonModule, - MatTooltipModule, - TimelineComponent, - NavigatorComponent - ], - exports: [TimelineComponent], -}) -export class TimelineModule {}