Skip to content

Commit

Permalink
migrate shared module to be standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
Pop John committed Jul 12, 2024
1 parent 1d15379 commit 55a0529
Show file tree
Hide file tree
Showing 16 changed files with 184 additions and 152 deletions.
7 changes: 2 additions & 5 deletions frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import { Component, OnInit } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { UntilDestroy } from '@ngneat/until-destroy';
import { BannerService } from './modules/core/services';

@UntilDestroy()
@Component({
Expand All @@ -30,9 +29,7 @@ import { BannerService } from './modules/core/services';
export class AppComponent implements OnInit {
title = 'modelsmith';

constructor(private bannerService: BannerService) {}
constructor() {}

ngOnInit(): void {
this.bannerService.showSuccess('test');
}
ngOnInit(): void {}
}
4 changes: 2 additions & 2 deletions frontend/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { routes } from './app.routes';
import { CoreModule } from './modules/core/core.module';
import { MaterialModule } from './modules/shared/modules/material.module';
import { provideCustomMaterial } from './modules/shared/material.providers';
import { metaReducers } from './state/app.metareducers';

export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
provideCustomMaterial(),
importProvidersFrom(
CoreModule,
MaterialModule,
StoreModule.forRoot({}, { metaReducers }),
StoreDevtoolsModule.instrument({
maxAge: 25,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,24 @@ import { StoreModule } from '@ngrx/store';
import { NgxColorsModule } from 'ngx-colors';
import { runRecordsReducers } from '../../state/run-records';
import { RecordsEffects } from '../../state/run-records/records';
import { SharedModule } from '../shared/shared.module';
import { EllipsisDirective } from '../shared/standalone/ellipsis.directive';
import { DrawerService, MsDrawerComponent } from '../shared/standalone/ms-drawer';
import { MsEmptyStateComponent } from '../shared/standalone/ms-empty-state/ms-empty-state.component';
import { MsLineChartComponent } from '../shared/standalone/ms-line-chart/ms-line-chart.component';
import { ChartToolsGlobalSignalsService } from '../shared/standalone/ms-line-chart/services/chart-tools-global-signals.service';

import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatDividerModule } from '@angular/material/divider';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatTableModule } from '@angular/material/table';
import { AdaptiveFileSizePipe } from '../shared/pipes/adaptive-file-size.pipe';
import { EmptyTableFieldPipe } from '../shared/pipes/empty-table-field.pipe';
import { HasKeysPipe } from '../shared/pipes/has-keys.pipe';
Expand Down Expand Up @@ -58,7 +69,6 @@ import { RecordsFacadeService } from './services/records-facade.service';
AlgorithmComparisonRoutingModule,
MsDrawerComponent,
NgxColorsModule,
SharedModule,
StoreModule.forFeature('runRecords', runRecordsReducers),
EffectsModule.forFeature([RecordsEffects]),
MsLineChartComponent,
Expand All @@ -69,7 +79,20 @@ import { RecordsFacadeService } from './services/records-facade.service';
EllipsisDirective,
EmptyTableFieldPipe,
AdaptiveFileSizePipe,
HasKeysPipe
HasKeysPipe,
MatExpansionModule,
FormsModule,
ReactiveFormsModule,
MatFormFieldModule,
MatSelectModule,
MatDividerModule,
MatProgressSpinnerModule,
MatIconModule,
MatCardModule,
MatTableModule,
MatSlideToggleModule,
MatButtonModule,
MatInputModule
],
providers: [DrawerService, RecordsFacadeService, RecordsDataService, ChartToolsGlobalSignalsService]
})
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/app/modules/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MsBackgroundGradientComponent } from '../shared/standalone/ms-background-gradient/ms-background-gradient.component';
import { MsFooterComponent } from '../shared/standalone/ms-footer/ms-footer.component';
import { PasswordToggleDirective } from '../shared/standalone/password-toggle.directive';
Expand All @@ -27,11 +30,15 @@ import { LoginComponent } from './components/login/login.component';
declarations: [LoginComponent],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
AuthRoutingModule,
SharedModule,
PasswordToggleDirective,
MsBackgroundGradientComponent,
MsFooterComponent
MsFooterComponent,
MatButtonModule
]
})
export class AuthModule {}
40 changes: 38 additions & 2 deletions frontend/src/app/modules/demo/demo.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,22 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
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 { MatDividerModule } from '@angular/material/divider';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatMenuModule } from '@angular/material/menu';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatStepperModule } from '@angular/material/stepper';
import { MatTableModule } from '@angular/material/table';
import { RouterModule } from '@angular/router';
import { SharedModule } from '../shared/shared.module';
import { MsCardSelectorComponent } from '../shared/standalone/ms-card-selector/ms-card-selector.component';
import { DrawerService, MsDrawerComponent } from '../shared/standalone/ms-drawer';
import { ButtonsDemoComponent } from './components/buttons-demo/buttons-demo.component';
Expand Down Expand Up @@ -67,7 +81,29 @@ import { DemoRoutingModule } from './demo-routing.module';
DrawerWithButtonsActionsComponent,
DrawerWithCustomizableWidthComponent
],
imports: [RouterModule, CommonModule, SharedModule, DemoRoutingModule, MsCardSelectorComponent, MsDrawerComponent],
imports: [
RouterModule,
CommonModule,
DemoRoutingModule,
MsCardSelectorComponent,
MsDrawerComponent,
MatIconModule,
MatStepperModule,
MatDividerModule,
FormsModule,
ReactiveFormsModule,
MatButtonModule,
MatTableModule,
MatCardModule,
MatMenuModule,
MatFormFieldModule,
MatInputModule,
MatSelectModule,
MatButtonToggleModule,
MatChipsModule,
MatCheckboxModule,
MatSlideToggleModule
],
providers: [DrawerService]
})
export class DemoModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,25 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MsPanelModelComponent } from '../shared/standalone/ms-panel-model/ms-panel-model.component';
import { MsPanelParametersComponent } from '../shared/standalone/ms-panel-parameters/ms-panel-parameters.component';
import { MsTerminalComponent } from '../shared/standalone/ms-terminal/ms-terminal.component';
import { LlmQuantizationRoutingModule } from './llm-quantization-routing.module';
import { LlmQuantizationComponent } from './components/llm-quantization/llm-quantization.component';
import { LlmQuantizationRoutingModule } from './llm-quantization-routing.module';

@NgModule({
declarations: [LlmQuantizationComponent],
imports: [
CommonModule,
SharedModule,
LlmQuantizationRoutingModule,
MsPanelModelComponent,
MsPanelParametersComponent,
MsTerminalComponent
MsTerminalComponent,
ReactiveFormsModule,
FormsModule,
MatButtonModule
]
})
export class LlmQuantizationModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MsPanelModelComponent } from '../shared/standalone/ms-panel-model/ms-panel-model.component';
import { MsPanelParametersComponent } from '../shared/standalone/ms-panel-parameters/ms-panel-parameters.component';
import { MsTerminalComponent } from '../shared/standalone/ms-terminal/ms-terminal.component';
Expand All @@ -27,11 +28,13 @@ import { MachineUnlearningRoutingModule } from './machine-unlearning-routing.mod
declarations: [MachineUnlearningComponent],
imports: [
CommonModule,
SharedModule,
MachineUnlearningRoutingModule,
MsTerminalComponent,
MsPanelParametersComponent,
MsPanelModelComponent
MsPanelModelComponent,
MatButtonModule,
FormsModule,
ReactiveFormsModule
]
})
export class MachineUnlearningModule {}
8 changes: 5 additions & 3 deletions frontend/src/app/modules/mode-select/mode-select.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { MatButtonModule } from '@angular/material/button';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MsBackgroundGradientComponent } from '../shared/standalone/ms-background-gradient/ms-background-gradient.component';
import { MsFooterComponent } from '../shared/standalone/ms-footer/ms-footer.component';
import { MsHeaderComponent } from '../shared/standalone/ms-header/ms-header.component';
Expand All @@ -27,11 +28,12 @@ import { ModeSelectRoutingModule } from './mode-select-routing.module';
declarations: [ModeSelectComponent],
imports: [
ModeSelectRoutingModule,
SharedModule,
CommonModule,
MsBackgroundGradientComponent,
MsFooterComponent,
MsHeaderComponent
MsHeaderComponent,
MatCheckboxModule,
MatButtonModule
]
})
export class ModeSelectModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MsPanelModelComponent } from '../shared/standalone/ms-panel-model/ms-panel-model.component';
import { MsPanelParametersComponent } from '../shared/standalone/ms-panel-parameters/ms-panel-parameters.component';
import { MsTerminalComponent } from '../shared/standalone/ms-terminal/ms-terminal.component';
Expand All @@ -28,11 +32,16 @@ import { ModelCompressionRoutingModule } from './model-compression-routing.modul
declarations: [ProjectSettingsComponent, PanelAlgorithmComponent],
imports: [
CommonModule,
SharedModule,
ModelCompressionRoutingModule,
MsTerminalComponent,
MsPanelModelComponent,
MsPanelParametersComponent
MsPanelParametersComponent,
MatCardModule,
MatFormFieldModule,
MatSelectModule,
FormsModule,
ReactiveFormsModule,
MatButtonModule
]
})
export class ModelCompressionModule {}
19 changes: 16 additions & 3 deletions frontend/src/app/modules/model-training/model-training.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatDividerModule } from '@angular/material/divider';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatSelectModule } from '@angular/material/select';
import { AdaptiveFileSizePipe } from '../shared/pipes/adaptive-file-size.pipe';
import { ParametersLabelPipe } from '../shared/pipes/parameters-label.pipe';
import { ReadableDurationPipe } from '../shared/pipes/readable-duration.pipe';
import { SharedModule } from '../shared/shared.module';
import { MsEmptyStateComponent } from '../shared/standalone/ms-empty-state/ms-empty-state.component';
import { MsPanelModelTrainingComponent } from '../shared/standalone/ms-panel-model-training/ms-panel-model-training.component';
import { MsPanelParametersComponent } from '../shared/standalone/ms-panel-parameters/ms-panel-parameters.component';
Expand All @@ -33,15 +39,22 @@ import { ModelTrainingRoutingModule } from './model-training-routing.module';
declarations: [ModelTrainingComponent, PanelAlgorithmTypeForTrainingComponent, PanelModelMetadataComponent],
imports: [
CommonModule,
SharedModule,
ModelTrainingRoutingModule,
MsTerminalComponent,
MsPanelModelTrainingComponent,
MsPanelParametersComponent,
AdaptiveFileSizePipe,
ReadableDurationPipe,
ParametersLabelPipe,
MsEmptyStateComponent
MsEmptyStateComponent,
MatCardModule,
MatDividerModule,
MatSelectModule,
MatFormFieldModule,
FormsModule,
ReactiveFormsModule,
MatIconModule,
MatButtonModule
]
})
export class ModelTrainingModule {}
13 changes: 11 additions & 2 deletions frontend/src/app/modules/multi-modal/multi-modal.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MsPanelParametersComponent } from '../shared/standalone/ms-panel-parameters/ms-panel-parameters.component';
import { MsTerminalComponent } from '../shared/standalone/ms-terminal/ms-terminal.component';
import { MultiModalComponent } from './components/multi-modal/multi-modal.component';
import { MultiModalRoutingModule } from './multi-modal-routing.module';

@NgModule({
declarations: [MultiModalComponent],
imports: [CommonModule, SharedModule, MsPanelParametersComponent, MsTerminalComponent, MultiModalRoutingModule]
imports: [
CommonModule,
MsPanelParametersComponent,
MsTerminalComponent,
MultiModalRoutingModule,
FormsModule,
ReactiveFormsModule,
MatButtonModule
]
})
export class MultiModalModule {}
21 changes: 19 additions & 2 deletions frontend/src/app/modules/running/running.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MsFormsModule } from '../shared/modules/ms-forms/ms-forms.module';
import { MsEmptyStateComponent } from '../shared/standalone/ms-empty-state/ms-empty-state.component';
import { MsLineChartComponent } from '../shared/standalone/ms-line-chart/ms-line-chart.component';
import { ChartToolsGlobalSignalsService } from '../shared/standalone/ms-line-chart/services/chart-tools-global-signals.service';
Expand All @@ -41,7 +46,19 @@ import { RunningRoutingModule } from './running-routing.module';
ReadableStatisticsLabelPipe,
RunningStatusBarComponent
],
imports: [RunningRoutingModule, CommonModule, SharedModule, MsEmptyStateComponent, MsLineChartComponent],
imports: [
CommonModule,
RunningRoutingModule,
MsEmptyStateComponent,
MsLineChartComponent,
MatIconModule,
MatButtonModule,
MatCardModule,
FormsModule,
ReactiveFormsModule,
MatSlideToggleModule,
MsFormsModule
],
providers: [ChartToolsGlobalSignalsService]
})
export class RunningModule {}
Loading

0 comments on commit 55a0529

Please sign in to comment.