Skip to content

Commit

Permalink
NAS-133357: Reorganize location of some services (#11271)
Browse files Browse the repository at this point in the history
  • Loading branch information
undsoft authored Jan 2, 2025
1 parent 450f13b commit c076bae
Show file tree
Hide file tree
Showing 817 changed files with 942 additions and 942 deletions.
8 changes: 4 additions & 4 deletions src/app/admin.routes.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Routes } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslationsLoadedGuard } from 'app/core/guards/translations-loaded.guard';
import { WebSocketConnectionGuard } from 'app/core/guards/websocket-connection.guard';
import { AuthGuardService } from 'app/modules/auth/auth-guard.service';
import { TwoFactorGuardService } from 'app/modules/auth/two-factor-guard.service';
import { TranslationsLoadedGuard } from 'app/modules/language/translations/translations-loaded.guard';
import { AdminLayoutComponent } from 'app/modules/layout/admin-layout/admin-layout.component';
import { WebSocketConnectionGuard } from 'app/modules/websocket/websocket-connection.guard';
import { PlotterService } from 'app/pages/reports-dashboard/services/plotter.service';
import { SmoothPlotterService } from 'app/pages/reports-dashboard/services/smooth-plotter.service';
import { AuthGuardService } from 'app/services/auth/auth-guard.service';
import { TwoFactorGuardService } from 'app/services/auth/two-factor-guard.service';

export const adminRoutes: Routes = [
{
Expand Down
6 changes: 3 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { Router, NavigationEnd, RouterOutlet } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { filter, tap } from 'rxjs';
import { WINDOW } from 'app/helpers/window.helper';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';
import { LayoutService } from 'app/modules/layout/layout.service';
import { PingService } from 'app/modules/websocket/ping.service';
import { DetectBrowserService } from 'app/services/detect-browser.service';
import { LayoutService } from 'app/services/layout.service';
import { PingService } from 'app/services/websocket/ping.service';

@UntilDestroy()
@Component({
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Routes } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { TranslationsLoadedGuard } from 'app/core/guards/translations-loaded.guard';
import { WebSocketConnectionGuard } from 'app/core/guards/websocket-connection.guard';
import { TranslationsLoadedGuard } from 'app/modules/language/translations/translations-loaded.guard';
import { BlankLayoutComponent } from 'app/modules/layout/blank-layout/blank-layout.component';
import { WebSocketConnectionGuard } from 'app/modules/websocket/websocket-connection.guard';
import { SigninComponent } from 'app/pages/signin/signin.component';

export const rootRoutes: Routes = [
Expand Down
6 changes: 3 additions & 3 deletions src/app/core/testing/classes/mock-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
} from 'app/interfaces/api/api-job-directory.interface';
import { ApiEventTyped } from 'app/interfaces/api-message.interface';
import { Job } from 'app/interfaces/job.interface';
import { ApiService } from 'app/services/websocket/api.service';
import { SubscriptionManagerService } from 'app/services/websocket/subscription-manager.service';
import { WebSocketHandlerService } from 'app/services/websocket/websocket-handler.service';
import { ApiService } from 'app/modules/websocket/api.service';
import { SubscriptionManagerService } from 'app/modules/websocket/subscription-manager.service';
import { WebSocketHandlerService } from 'app/modules/websocket/websocket-handler.service';

/**
* Better than just expect.anything() because it allows null and undefined.
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/testing/classes/mock-auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { of } from 'rxjs';
import { Role } from 'app/enums/role.enum';
import { LoggedInUser } from 'app/interfaces/ds-cache.interface';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';

@Injectable()
export class MockAuthService extends AuthService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { MockEnclosureConfig } from 'app/core/testing/mock-enclosure/interfaces/
import { MockEnclosureGenerator } from 'app/core/testing/mock-enclosure/mock-enclosure-generator.utils';
import { ApiCallMethod, ApiCallParams, ApiCallResponse } from 'app/interfaces/api/api-call-directory.interface';
import { SystemInfo } from 'app/interfaces/system-info.interface';
import { ApiService } from 'app/services/websocket/api.service';
import { SubscriptionManagerService } from 'app/services/websocket/subscription-manager.service';
import { WebSocketHandlerService } from 'app/services/websocket/websocket-handler.service';
import { ApiService } from 'app/modules/websocket/api.service';
import { SubscriptionManagerService } from 'app/modules/websocket/subscription-manager.service';
import { WebSocketHandlerService } from 'app/modules/websocket/websocket-handler.service';

@Injectable({
providedIn: 'root',
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/testing/utils/empty-api.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getMissingInjectionErrorFactory, getMissingInjectionErrorObservable } from 'app/core/testing/utils/missing-injection-factories';
import { ApiService } from 'app/services/websocket/api.service';
import { ApiService } from 'app/modules/websocket/api.service';

export class EmptyApiService {
readonly clearSubscriptions$ = getMissingInjectionErrorObservable(ApiService.name);
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/testing/utils/empty-auth.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getMissingInjectionErrorFactory, getMissingInjectionErrorObservable } from 'app/core/testing/utils/missing-injection-factories';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';

export class EmptyAuthService {
readonly authToken$ = getMissingInjectionErrorObservable(AuthService.name);
Expand Down
6 changes: 3 additions & 3 deletions src/app/core/testing/utils/mock-api.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
import { ApiCallMethod } from 'app/interfaces/api/api-call-directory.interface';
import { ApiJobDirectory, ApiJobMethod } from 'app/interfaces/api/api-job-directory.interface';
import { Job } from 'app/interfaces/job.interface';
import { ApiService } from 'app/services/websocket/api.service';
import { SubscriptionManagerService } from 'app/services/websocket/subscription-manager.service';
import { WebSocketHandlerService } from 'app/services/websocket/websocket-handler.service';
import { ApiService } from 'app/modules/websocket/api.service';
import { SubscriptionManagerService } from 'app/modules/websocket/subscription-manager.service';
import { WebSocketHandlerService } from 'app/modules/websocket/websocket-handler.service';

/**
* This is a sugar syntax for creating simple api mocks.
Expand Down
6 changes: 3 additions & 3 deletions src/app/core/testing/utils/mock-auth.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { MockAuthService } from 'app/core/testing/classes/mock-auth.service';
import { AccountAttribute } from 'app/enums/account-attribute.enum';
import { Role } from 'app/enums/role.enum';
import { LoggedInUser } from 'app/interfaces/ds-cache.interface';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';
import { ApiService } from 'app/modules/websocket/api.service';
import { WebSocketHandlerService } from 'app/modules/websocket/websocket-handler.service';
import { TokenLastUsedService } from 'app/services/token-last-used.service';
import { ApiService } from 'app/services/websocket/api.service';
import { WebSocketHandlerService } from 'app/services/websocket/websocket-handler.service';

export const dummyUser = {
privilege: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { WINDOW } from 'app/helpers/window.helper';
import { IxSimpleChanges } from 'app/interfaces/simple-changes.interface';
import { headerHeight, footerHeight } from 'app/modules/layout/admin-layout/admin-layout.component.const';
import { LayoutService } from 'app/services/layout.service';
import { LayoutService } from 'app/modules/layout/layout.service';
import { AppState } from 'app/store';
import { waitForAdvancedConfig } from 'app/store/system-config/system-config.selectors';

Expand Down
2 changes: 1 addition & 1 deletion src/app/directives/has-role/has-role.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
import { BehaviorSubject } from 'rxjs';
import { HasRoleDirective } from 'app/directives/has-role/has-role.directive';
import { Role } from 'app/enums/role.enum';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';

describe('HasRolesDirective', () => {
let spectator: SpectatorHost<HasRoleDirective>;
Expand Down
2 changes: 1 addition & 1 deletion src/app/directives/has-role/has-role.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { distinctUntilChanged } from 'rxjs';
import { Role } from 'app/enums/role.enum';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';

@UntilDestroy()
@Directive({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isEqual } from 'lodash-es';
import { take } from 'rxjs';
import { HasAccessDirective } from 'app/directives/has-access/has-access.directive';
import { Role } from 'app/enums/role.enum';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';

@UntilDestroy()
@Directive({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { AlertEffects } from 'app/modules/alerts/store/alert.effects';
import { adapter, alertReducer, alertsInitialState } from 'app/modules/alerts/store/alert.reducer';
import { alertStateKey, selectAlerts } from 'app/modules/alerts/store/alert.selectors';
import { FormatDateTimePipe } from 'app/modules/dates/pipes/format-date-time/format-datetime.pipe';
import { ApiService } from 'app/services/websocket/api.service';
import { ApiService } from 'app/modules/websocket/api.service';
import { systemConfigReducer, SystemConfigState } from 'app/store/system-config/system-config.reducer';
import { systemConfigStateKey } from 'app/store/system-config/system-config.selectors';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { AlertsPanelPageObject } from 'app/modules/alerts/components/alerts-pane
import { AlertEffects } from 'app/modules/alerts/store/alert.effects';
import { adapter, alertReducer, alertsInitialState } from 'app/modules/alerts/store/alert.reducer';
import { alertStateKey } from 'app/modules/alerts/store/alert.selectors';
import { ApiService } from 'app/modules/websocket/api.service';
import { SystemGeneralService } from 'app/services/system-general.service';
import { ApiService } from 'app/services/websocket/api.service';
import { adminUiInitialized } from 'app/store/admin-panel/admin.actions';
import { haInfoReducer } from 'app/store/ha-info/ha-info.reducer';
import { haInfoStateKey } from 'app/store/ha-info/ha-info.selectors';
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/alerts/store/alert.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {
import {
AlertSlice, selectDismissedAlerts, selectIsAlertPanelOpen, selectUnreadAlerts,
} from 'app/modules/alerts/store/alert.selectors';
import { ApiService } from 'app/modules/websocket/api.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { ApiService } from 'app/services/websocket/api.service';
import { adminUiInitialized } from 'app/store/admin-panel/admin.actions';
import { alertIndicatorPressed } from 'app/store/topbar/topbar.actions';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
SpectatorService,
} from '@ngneat/spectator/jest';
import { BehaviorSubject } from 'rxjs';
import { AuthGuardService } from 'app/services/auth/auth-guard.service';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthGuardService } from 'app/modules/auth/auth-guard.service';
import { AuthService } from 'app/modules/auth/auth.service';

describe('AuthGuardService', () => {
const redirectUrl = 'storage/disks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Inject, Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { WINDOW } from 'app/helpers/window.helper';
import { AuthService } from 'app/services/auth/auth.service';
import { AuthService } from 'app/modules/auth/auth.service';

@UntilDestroy()
@Injectable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { LoginExMechanism, LoginExResponse, LoginExResponseType } from 'app/inte
import { DashConfigItem } from 'app/interfaces/dash-config-item.interface';
import { LoggedInUser } from 'app/interfaces/ds-cache.interface';
import { Preferences } from 'app/interfaces/preferences.interface';
import { AuthService } from 'app/services/auth/auth.service';
import { ApiService } from 'app/services/websocket/api.service';
import { WebSocketHandlerService } from 'app/services/websocket/websocket-handler.service';
import { AuthService } from 'app/modules/auth/auth.service';
import { ApiService } from 'app/modules/websocket/api.service';
import { WebSocketHandlerService } from 'app/modules/websocket/websocket-handler.service';

const authMeUser = {
pw_dir: 'dir',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { WINDOW } from 'app/helpers/window.helper';
import { LoginExMechanism, LoginExResponse, LoginExResponseType } from 'app/interfaces/auth.interface';
import { LoggedInUser } from 'app/interfaces/ds-cache.interface';
import { GlobalTwoFactorConfig } from 'app/interfaces/two-factor-config.interface';
import { ApiService } from 'app/modules/websocket/api.service';
import { WebSocketHandlerService } from 'app/modules/websocket/websocket-handler.service';
import { TokenLastUsedService } from 'app/services/token-last-used.service';
import { ApiService } from 'app/services/websocket/api.service';
import { WebSocketHandlerService } from 'app/services/websocket/websocket-handler.service';
import { AppState } from 'app/store';
import { adminUiInitialized } from 'app/store/admin-panel/admin.actions';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/ro
import { SpectatorService, createServiceFactory, mockProvider } from '@ngneat/spectator/jest';
import { BehaviorSubject, firstValueFrom, of } from 'rxjs';
import { GlobalTwoFactorConfig, UserTwoFactorConfig } from 'app/interfaces/two-factor-config.interface';
import { AuthService } from 'app/modules/auth/auth.service';
import { TwoFactorGuardService } from 'app/modules/auth/two-factor-guard.service';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { AuthService } from 'app/services/auth/auth.service';
import { TwoFactorGuardService } from 'app/services/auth/two-factor-guard.service';

describe('TwoFactorGuardService', () => {
let spectator: SpectatorService<TwoFactorGuardService>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
Observable, of, switchMap, take, forkJoin,
} from 'rxjs';
import { Role } from 'app/enums/role.enum';
import { AuthService } from 'app/modules/auth/auth.service';
import { DialogService } from 'app/modules/dialog/dialog.service';
import { AuthService } from 'app/services/auth/auth.service';

@UntilDestroy()
@Injectable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { AuditEntry } from 'app/interfaces/audit/audit.interface';
import { Job } from 'app/interfaces/job.interface';
import { ExportButtonComponent } from 'app/modules/buttons/export-button/export-button.component';
import { SortDirection } from 'app/modules/ix-table/enums/sort-direction.enum';
import { ApiService } from 'app/modules/websocket/api.service';
import { DownloadService } from 'app/services/download.service';
import { ApiService } from 'app/services/websocket/api.service';
import { selectIsHaLicensed } from 'app/store/ha-info/ha-info.selectors';

describe('ExportButtonComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { AdvancedSearchQuery, SearchQuery } from 'app/modules/forms/search-input
import { SortDirection } from 'app/modules/ix-table/enums/sort-direction.enum';
import { TableSort } from 'app/modules/ix-table/interfaces/table-sort.interface';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { ApiService } from 'app/modules/websocket/api.service';
import { DownloadService } from 'app/services/download.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { ApiService } from 'app/services/websocket/api.service';
import { AppState } from 'app/store';
import { selectIsHaLicensed } from 'app/store/ha-info/ha-info.selectors';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MockDirective } from 'ng-mocks';
import { BaseChartDirective } from 'ng2-charts';
import { Theme } from 'app/interfaces/theme.interface';
import { GaugeChartComponent } from 'app/modules/charts/gauge-chart/gauge-chart.component';
import { ThemeService } from 'app/services/theme/theme.service';
import { ThemeService } from 'app/modules/theme/theme.service';

describe('GaugeChartComponent', () => {
let spectator: Spectator<GaugeChartComponent>;
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/charts/gauge-chart/gauge-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
import { TinyColor } from '@ctrl/tinycolor';
import { ChartOptions } from 'chart.js';
import { BaseChartDirective } from 'ng2-charts';
import { ThemeUtils } from 'app/core/classes/theme-utils/theme-utils';
import { Theme } from 'app/interfaces/theme.interface';
import { ThemeService } from 'app/services/theme/theme.service';
import { ThemeService } from 'app/modules/theme/theme.service';
import { ThemeUtils } from 'app/modules/theme/utils/theme-utils';
import './rounded-doughnut.class';

const defaultHeight = 300;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/modules/dates/pipes/ix-date/ix-date.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MatTooltip } from '@angular/material/tooltip';
import { TranslateModule } from '@ngx-translate/core';
import { utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz';
import { FormatDateTimePipe } from 'app/modules/dates/pipes/format-date-time/format-datetime.pipe';
import { LocaleService } from 'app/services/locale.service';
import { LocaleService } from 'app/modules/language/locale.service';

@Component({
selector: 'ix-date',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
} from '@ngneat/spectator/jest';
import { Schedule } from 'app/interfaces/schedule.interface';
import { ScheduleDescriptionPipe } from 'app/modules/dates/pipes/schedule-description/schedule-description.pipe';
import { LanguageService } from 'app/services/language.service';
import { LocaleService } from 'app/services/locale.service';
import { LanguageService } from 'app/modules/language/language.service';
import { LocaleService } from 'app/modules/language/locale.service';

describe('ScheduleDescriptionPipe', () => {
let spectator: SpectatorService<ScheduleDescriptionPipe>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { TranslateService } from '@ngx-translate/core';
import cronstrue from 'cronstrue/i18n';
import { format, parse } from 'date-fns';
import { Schedule } from 'app/interfaces/schedule.interface';
import { LanguageService } from 'app/modules/language/language.service';
import { LocaleService } from 'app/modules/language/locale.service';
import { scheduleToCrontab } from 'app/modules/scheduler/utils/schedule-to-crontab.utils';
import { LanguageService } from 'app/services/language.service';
import { LocaleService } from 'app/services/locale.service';

@Pipe({
name: 'scheduleDescription',
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/dates/services/ix-date-adapter.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NativeDateAdapter } from '@angular/material/core';
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
import { FormatDateTimePipe } from 'app/modules/dates/pipes/format-date-time/format-datetime.pipe';
import { LocaleService } from 'app/services/locale.service';
import { LocaleService } from 'app/modules/language/locale.service';
import { IxDateAdapter } from './ix-date-adapter';

describe('IxDateAdapter', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/dates/services/ix-date-adapter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { NativeDateAdapter } from '@angular/material/core';
import { FormatDateTimePipe } from 'app/modules/dates/pipes/format-date-time/format-datetime.pipe';
import { LocaleService } from 'app/services/locale.service';
import { LocaleService } from 'app/modules/language/locale.service';

/**
* This is to be provided in components when we need to format and parse a date according
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { CopyButtonComponent } from 'app/modules/buttons/copy-button/copy-button
import { DialogService } from 'app/modules/dialog/dialog.service';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { ApiService } from 'app/modules/websocket/api.service';
import { DownloadService } from 'app/services/download.service';
import { ErrorHandlerService } from 'app/services/error-handler.service';
import { ApiService } from 'app/services/websocket/api.service';

@UntilDestroy()
@Component({
Expand Down
Loading

0 comments on commit c076bae

Please sign in to comment.