Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-131364 / 25.04 / NAS-131364:: Move more components to standalone #10737

Merged
merged 6 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ module.exports = {
{
"name": "@angular/material/icon",
"importNames": ["MatIconModule"],
"message": "Use IxIconModule instead."
"message": "Use IxIconComponent instead."
},
{
"name": "@angular/core",
Expand Down
10 changes: 6 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NgModule, ErrorHandler } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatNativeDateModule } from '@angular/material/core';
import { MatDialogModule } from '@angular/material/dialog';
import { MatIconRegistry } from '@angular/material/icon';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Expand All @@ -29,8 +30,8 @@ import { createTranslateLoader } from 'app/core/classes/icu-translations-loader'
import { MockEnclosureWebsocketService } from 'app/core/testing/mock-enclosure/mock-enclosure-websocket.service';
import { getWindow, WINDOW } from 'app/helpers/window.helper';
import { FeedbackModule } from 'app/modules/feedback/feedback.module';
import { IxIconRegistry } from 'app/modules/ix-icon/ix-icon.service';
import { SnackbarModule } from 'app/modules/snackbar/snackbar.module';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TwoFactorGuardService } from 'app/services/auth/two-factor-guard.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { NavigationService } from 'app/services/navigation/navigation.service';
Expand All @@ -39,7 +40,6 @@ import { WebSocketService } from 'app/services/ws.service';
import { rootEffects, rootReducers } from 'app/store';
import { CustomRouterStateSerializer } from 'app/store/router/custom-router-serializer';
import { AppComponent } from './app.component';
import { AppLoaderModule } from './modules/loader/app-loader.module';
import { AuthGuardService } from './services/auth/auth-guard.service';

@NgModule({
Expand All @@ -52,7 +52,6 @@ import { AuthGuardService } from './services/auth/auth-guard.service';
imports: [
BrowserModule,
BrowserAnimationsModule,
AppLoaderModule,
MatNativeDateModule,
MatNativeDateModule,
TranslateModule.forRoot({
Expand Down Expand Up @@ -107,7 +106,6 @@ import { AuthGuardService } from './services/auth/auth-guard.service';
},
}),
MatButtonModule,
TestIdModule,
MarkdownModule.forRoot({ loader: HttpClient }),
FeedbackModule,
],
Expand All @@ -126,6 +124,10 @@ import { AuthGuardService } from './services/auth/auth-guard.service';
provide: WINDOW,
useFactory: getWindow,
},
{
provide: MatIconRegistry,
useClass: IxIconRegistry,
},
{
provide: WebSocketService,
deps: [Router, WebSocketConnectionService, TranslateService],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import { MatTooltip } from '@angular/material/tooltip';
import { TranslateModule } from '@ngx-translate/core';
import { DisableFocusableElementsDirective } from 'app/directives/disable-focusable-elements/disable-focusable-elements.directive';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';

@Component({
selector: 'ix-missing-access-wrapper',
Expand All @@ -17,8 +17,8 @@ import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
DisableFocusableElementsDirective,
MatTooltip,
NgTemplateOutlet,
IxIconModule,
TranslateModule,
IxIconComponent,
],
})
export class MissingAccessWrapperComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
import { NgxPopperjsModule } from 'ngx-popperjs';
import { NewFeatureIndicator } from 'app/directives/new-feature-indicator/new-feature-indicator.interface';
import { NewFeatureIndicatorService } from 'app/directives/new-feature-indicator/new-feature-indicator.service';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { CastPipe } from 'app/modules/pipes/cast/cast.pipe';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';

@Component({
selector: 'ix-new-feature-indicator-wrapper',
Expand All @@ -28,10 +28,10 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
standalone: true,
imports: [
NgxPopperjsModule,
TestIdModule,
NgTemplateOutlet,
IxIconModule,
IxIconComponent,
CastPipe,
TestDirective,
],
})
export class NewFeatureIndicatorWrapperComponent {
Expand Down
8 changes: 4 additions & 4 deletions src/app/modules/alerts/alerts.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { AlertsPanelComponent } from 'app/modules/alerts/components/alerts-panel
import { AlertEffects } from 'app/modules/alerts/store/alert.effects';
import { alertReducer } from 'app/modules/alerts/store/alert.reducer';
import { alertStateKey } from 'app/modules/alerts/store/alert.selectors';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { FormatDateTimePipe } from 'app/modules/pipes/format-date-time/format-datetime.pipe';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';

@NgModule({
imports: [
Expand All @@ -29,18 +29,18 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
TranslateModule,
MatButtonModule,
MatMenuModule,
IxIconModule,
IxIconComponent,
RouterModule,
MatCheckboxModule,
MatProgressBarModule,
MatListModule,
MatTooltipModule,
MatRippleModule,
TestIdModule,
FormatDateTimePipe,
AsyncPipe,
NavigateAndInteractDirective,
LetDirective,
TestDirective,
],
declarations: [
AlertsPanelComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { MatIconButton } from '@angular/material/button';
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
import { MatTooltip } from '@angular/material/tooltip';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { SnackbarService } from 'app/modules/snackbar/services/snackbar.service';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';

@Component({
selector: 'ix-copy-button',
Expand All @@ -18,12 +18,12 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
imports: [
MatIconButton,
MatTooltip,
TestIdModule,
TranslateModule,
IxIconModule,
IxIconComponent,
MatMenuTrigger,
MatMenu,
MatMenuItem,
TestDirective,
],
})
export class CopyButtonComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { DialogService } from 'app/modules/dialog/dialog.service';
import { AdvancedSearchQuery, SearchQuery } from 'app/modules/forms/search-input/types/search-query.interface';
import { SortDirection } from 'app/modules/ix-table/enums/sort-direction.enum';
import { TableSort } from 'app/modules/ix-table/interfaces/table-sort.interface';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { DownloadService } from 'app/services/download.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { WebSocketService } from 'app/services/ws.service';
Expand All @@ -34,10 +34,10 @@ import { selectIsHaLicensed } from 'app/store/ha-info/ha-info.selectors';
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
TestIdModule,
MatProgressBar,
MatButton,
TranslateModule,
TestDirective,
],
})
export class ExportButtonComponent<T, M extends ApiJobMethod> {
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/buttons/oauth-button/oauth-button.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { TranslateModule } from '@ngx-translate/core';
import { OauthButtonComponent } from 'app/modules/buttons/oauth-button/components/oauth-button/oauth-button.component';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';

@NgModule({
declarations: [
Expand All @@ -11,7 +11,7 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
imports: [
TranslateModule,
MatButtonModule,
TestIdModule,
TestDirective,
],
exports: [
OauthButtonComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { TranslateService, TranslateModule } from '@ngx-translate/core';
import { ConfirmOptions, ConfirmOptionsWithSecondaryCheckbox, DialogWithSecondaryCheckboxResult } from 'app/interfaces/dialog.interface';
import { FormActionsComponent } from 'app/modules/forms/ix-forms/components/form-actions/form-actions.component';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';

@Component({
selector: 'ix-confirm-dialog',
Expand All @@ -25,13 +25,13 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
CdkScrollable,
MatDialogContent,
MatCheckbox,
TestIdModule,
ReactiveFormsModule,
FormsModule,
FormActionsComponent,
MatDialogActions,
MatButton,
TranslateModule,
TestDirective,
],
})
export class ConfirmDialogComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { TranslateModule } from '@ngx-translate/core';
import { Job } from 'app/interfaces/job.interface';
import { CopyButtonComponent } from 'app/modules/buttons/copy-button/copy-button.component';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { DownloadService } from 'app/services/download.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { WebSocketService } from 'app/services/ws.service';
Expand All @@ -27,14 +27,14 @@ import { WebSocketService } from 'app/services/ws.service';
standalone: true,
imports: [
MatDialogTitle,
IxIconModule,
IxIconComponent,
CdkScrollable,
MatDialogContent,
CopyButtonComponent,
MatDialogActions,
MatButton,
TestIdModule,
TranslateModule,
TestDirective,
],
})
export class ErrorDialogComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
import { MatButton } from '@angular/material/button';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { TranslateModule } from '@ngx-translate/core';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';

@Component({
selector: 'ix-full-screen-dialog',
Expand All @@ -12,8 +12,8 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
standalone: true,
imports: [
MatButton,
TestIdModule,
TranslateModule,
TestDirective,
],
})
export class FullScreenDialogComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions,
} from '@angular/material/dialog';
import { TranslateModule } from '@ngx-translate/core';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestDirective } from 'app/modules/test-id/test.directive';

export interface GeneralDialogConfig {
title?: string;
Expand All @@ -33,13 +33,13 @@ export interface GeneralDialogConfig {
standalone: true,
imports: [
MatDialogTitle,
IxIconModule,
IxIconComponent,
CdkScrollable,
MatDialogContent,
MatDialogActions,
MatButton,
TestIdModule,
TranslateModule,
TestDirective,
],
})
export class GeneralDialogComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions,
} from '@angular/material/dialog';
import { TranslateModule } from '@ngx-translate/core';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestDirective } from 'app/modules/test-id/test.directive';

@Component({
selector: 'ix-info-dialog',
Expand All @@ -16,13 +16,13 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
standalone: true,
imports: [
MatDialogTitle,
IxIconModule,
IxIconComponent,
CdkScrollable,
MatDialogContent,
MatDialogActions,
MatButton,
TestIdModule,
TranslateModule,
TestDirective,
],
})
export class InfoDialogComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { TranslateModule } from '@ngx-translate/core';
import { Observable, Subscription, map } from 'rxjs';
import { JobState } from 'app/enums/job-state.enum';
import { Job, JobProgress } from 'app/interfaces/job.interface';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { WebSocketService } from 'app/services/ws.service';

Expand Down Expand Up @@ -58,12 +58,13 @@ export interface JobProgressDialogConfig<Result> {
MatProgressBar,
MatDialogActions,
MatButton,
TestIdModule,
MatIconButton,
MatDialogClose,
IxIconModule,
IxIconComponent,
TranslateModule,
DecimalPipe,
TestDirective,
TestDirective,
],
})
export class JobProgressDialogComponent<T> implements OnInit, AfterViewChecked {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateModule } from '@ngx-translate/core';
import { Job } from 'app/interfaces/job.interface';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { IxIconModule } from 'app/modules/ix-icon/ix-icon.module';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { DownloadService } from 'app/services/download.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { WebSocketService } from 'app/services/ws.service';
Expand All @@ -23,10 +23,10 @@ import { WebSocketService } from 'app/services/ws.service';
standalone: true,
imports: [
MatDialogTitle,
IxIconModule,
IxIconComponent,
MatButton,
TestIdModule,
TranslateModule,
TestDirective,
],
})
export class ErrorTemplateComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MatDivider } from '@angular/material/divider';
import { TranslateModule } from '@ngx-translate/core';
import { ErrorReport } from 'app/interfaces/error-report.interface';
import { ErrorTemplateComponent } from 'app/modules/dialog/components/multi-error-dialog/error-template/error-template.component';
import { TestIdModule } from 'app/modules/test-id/test-id.module';
import { TestDirective } from 'app/modules/test-id/test.directive';

@Component({
selector: 'ix-multi-error-dialog',
Expand All @@ -24,8 +24,8 @@ import { TestIdModule } from 'app/modules/test-id/test-id.module';
MatDivider,
MatDialogActions,
MatButton,
TestIdModule,
TranslateModule,
TestDirective,
],
})
export class MultiErrorDialogComponent {
Expand Down
Loading
Loading