From: Tiago Melo Date: Tue, 16 Jun 2020 08:50:20 +0000 (+0000) Subject: mgr/dashboard: Provide all services in root X-Git-Tag: v17.0.0~2041^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0f8ac5c1563790a79a1acde63359f64ea84c29e4;p=ceph.git mgr/dashboard: Provide all services in root Fixes: https://tracker.ceph.com/issues/46030 Signed-off-by: Tiago Melo --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.spec.ts index f7760157c05f5..1890601651434 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-form/rbd-namespace-form-modal.component.spec.ts @@ -7,7 +7,6 @@ import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; -import { ApiModule } from '../../../shared/api/api.module'; import { ComponentsModule } from '../../../shared/components/components.module'; import { AuthStorageService } from '../../../shared/services/auth-storage.service'; import { RbdNamespaceFormModalComponent } from './rbd-namespace-form-modal.component'; @@ -21,7 +20,6 @@ describe('RbdNamespaceFormModalComponent', () => { ReactiveFormsModule, ComponentsModule, HttpClientTestingModule, - ApiModule, ToastrModule.forRoot(), RouterTestingModule ], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts index 8feb20ae343eb..6523562e08782 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.spec.ts @@ -7,7 +7,6 @@ import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; -import { ApiModule } from '../../../shared/api/api.module'; import { ComponentsModule } from '../../../shared/components/components.module'; import { PipesModule } from '../../../shared/pipes/pipes.module'; import { AuthStorageService } from '../../../shared/services/auth-storage.service'; @@ -23,7 +22,6 @@ describe('RbdSnapshotFormModalComponent', () => { ComponentsModule, PipesModule, HttpClientTestingModule, - ApiModule, ToastrModule.forRoot(), RouterTestingModule ], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts index 25f4ba3b83e51..f1603d6364ab7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts @@ -15,7 +15,6 @@ import { i18nProviders, PermissionHelper } from '../../../../testing/unit-test-helper'; -import { ApiModule } from '../../../shared/api/api.module'; import { RbdService } from '../../../shared/api/rbd.service'; import { ComponentsModule } from '../../../shared/components/components.module'; import { ActionLabelsI18n } from '../../../shared/constants/app.constants'; @@ -50,7 +49,6 @@ describe('RbdSnapshotListComponent', () => { configureTestBed({ declarations: [RbdSnapshotListComponent, RbdTabsComponent], imports: [ - ApiModule, BrowserAnimationsModule, ComponentsModule, DataTableModule, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api.module.ts deleted file mode 100644 index 4066a30420b54..0000000000000 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api.module.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -@NgModule({ - imports: [CommonModule] -}) -export class ApiModule {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.ts index c8ac216f78b91..b8bf955832387 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/auth.service.ts @@ -8,10 +8,9 @@ import { tap } from 'rxjs/operators'; import { Credentials } from '../models/credentials'; import { LoginResponse } from '../models/login-response'; import { AuthStorageService } from '../services/auth-storage.service'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class AuthService { constructor( diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts index f1e4003b11b93..87d67d8cd4900 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts @@ -5,10 +5,9 @@ import { Observable } from 'rxjs'; import { Daemon } from '../models/daemon.interface'; import { CephServiceSpec } from '../models/service.interface'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class CephServiceService { private url = 'api/service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts index 246b5213fe510..7f071900ec25a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts @@ -6,11 +6,10 @@ import { Observable } from 'rxjs'; import { cdEncode } from '../decorators/cd-encode'; import { CephfsDir, CephfsQuotas } from '../models/cephfs-directory-models'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class CephfsService { baseURL = 'api/cephfs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.ts index 68be515101db1..44284d7342750 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/configuration.service.ts @@ -2,10 +2,9 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { ConfigFormCreateRequestModel } from '../../ceph/cluster/configuration/configuration-form/configuration-form-create-request.model'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class ConfigurationService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/crush-rule.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/crush-rule.service.ts index 506fa23d4e62f..74d061a020512 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/crush-rule.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/crush-rule.service.ts @@ -4,10 +4,9 @@ import { Injectable } from '@angular/core'; import { I18n } from '@ngx-translate/i18n-polyfill'; import { CrushRuleConfig } from '../models/crush-rule'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class CrushRuleService { apiPath = 'api/crush_rule'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.ts index c452779c683a5..f99841250f591 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/erasure-code-profile.service.ts @@ -5,10 +5,9 @@ import { I18n } from '@ngx-translate/i18n-polyfill'; import { Observable } from 'rxjs'; import { ErasureCodeProfile } from '../models/erasure-code-profile'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class ErasureCodeProfileService { apiPath = 'api/erasure_code_profile'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/health.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/health.service.ts index e3ac39342e518..a8f7c467a0ca7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/health.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/health.service.ts @@ -1,10 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class HealthService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts index 60e1d3e97ea5d..fef43950cc70b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts @@ -8,10 +8,9 @@ import { Daemon } from '../models/daemon.interface'; import { CdDevice } from '../models/devices'; import { SmartDataResponseV1 } from '../models/smart'; import { DeviceService } from '../services/device.service'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class HostService { baseURL = 'api/host'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/iscsi.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/iscsi.service.ts index 991b7e2e06206..9ef0310c7ccf6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/iscsi.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/iscsi.service.ts @@ -2,11 +2,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { cdEncode } from '../decorators/cd-encode'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class IscsiService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logging.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logging.service.ts index 7c3bdc586ec05..85846946b6c79 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logging.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logging.service.ts @@ -1,10 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class LoggingService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.ts index 4571c37dfeb07..252769dbd0141 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/logs.service.ts @@ -1,10 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class LogsService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/mgr-module.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/mgr-module.service.ts index ef937d8d159fd..3942a1a44780e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/mgr-module.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/mgr-module.service.ts @@ -3,10 +3,8 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class MgrModuleService { private url = 'api/mgr/module'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.ts index 115d1ca378835..42ca9a7af1585 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/monitor.service.ts @@ -1,10 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class MonitorService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.ts index 1a53047ecdce0..f5de5bd412b3d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.ts @@ -3,10 +3,8 @@ import { Injectable } from '@angular/core'; import { I18n } from '@ngx-translate/i18n-polyfill'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class NfsService { apiPath = 'api/nfs-ganesha'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts index cea8d4bccd93b..df05ff9c69500 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts @@ -7,10 +7,9 @@ import { mergeMap } from 'rxjs/operators'; import { InventoryDevice } from '../../ceph/cluster/inventory/inventory-devices/inventory-device.model'; import { InventoryHost } from '../../ceph/cluster/inventory/inventory-host.model'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class OrchestratorService { private url = 'api/orchestrator'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts index f35fad2748a70..fd0e6bf606e37 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts @@ -8,10 +8,9 @@ import { map } from 'rxjs/operators'; import { CdDevice } from '../models/devices'; import { SmartDataResponseV1 } from '../models/smart'; import { DeviceService } from '../services/device.service'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class OsdService { private path = 'api/osd'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-counter.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-counter.service.ts index 49c6816faee0f..36be6f3831583 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-counter.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/performance-counter.service.ts @@ -5,11 +5,10 @@ import { of as observableOf } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; import { cdEncode } from '../decorators/cd-encode'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class PerformanceCounterService { private url = 'api/perf_counters'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts index d4382a631e5d2..78d5819ec8dee 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/pool.service.ts @@ -7,11 +7,10 @@ import { map } from 'rxjs/operators'; import { cdEncode } from '../decorators/cd-encode'; import { RbdConfigurationEntry } from '../models/configuration'; import { RbdConfigurationService } from '../services/rbd-configuration.service'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class PoolService { apiPath = 'api/pool'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts index 7b56161d4cfba..58191721953d5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/prometheus.service.ts @@ -10,11 +10,10 @@ import { AlertmanagerNotification, PrometheusRuleGroup } from '../models/prometheus-alerts'; -import { ApiModule } from './api.module'; import { SettingsService } from './settings.service'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class PrometheusService { private baseURL = 'api/prometheus'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts index 6a378b359971a..4958382e27982 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.ts @@ -7,11 +7,10 @@ import { filter } from 'rxjs/operators'; import { cdEncode, cdEncodeNot } from '../decorators/cd-encode'; import { MirroringSummary } from '../models/mirroring-summary'; import { TimerService } from '../services/timer.service'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class RbdMirroringService { readonly REFRESH_INTERVAL = 30000; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts index 5a3a8747e9a3e..38c02bd0557bd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts @@ -7,12 +7,11 @@ import { map } from 'rxjs/operators'; import { cdEncode, cdEncodeNot } from '../decorators/cd-encode'; import { ImageSpec } from '../models/image-spec'; import { RbdConfigurationService } from '../services/rbd-configuration.service'; -import { ApiModule } from './api.module'; import { RbdPool } from './rbd.model'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class RbdService { constructor(private http: HttpClient, private rbdConfigurationService: RbdConfigurationService) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts index 71907497d701f..f939a55c104dd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts @@ -6,11 +6,10 @@ import { forkJoin as observableForkJoin, of as observableOf } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; import { cdEncode } from '../decorators/cd-encode'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class RgwBucketService { private url = 'api/rgw/bucket'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.ts index 9dde8ea75e0db..ae2a5d697595e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.ts @@ -2,11 +2,10 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { cdEncode } from '../decorators/cd-encode'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class RgwDaemonService { private url = 'api/rgw/daemon'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts index a0bd328c70443..8c761668831ff 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts @@ -2,11 +2,10 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { cdEncode } from '../decorators/cd-encode'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class RgwSiteService { private url = 'api/rgw/site'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts index aff3d803ce877..6adc55dda4a82 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts @@ -6,11 +6,10 @@ import { forkJoin as observableForkJoin, Observable, of as observableOf } from ' import { mergeMap } from 'rxjs/operators'; import { cdEncode } from '../decorators/cd-encode'; -import { ApiModule } from './api.module'; @cdEncode @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class RgwUserService { private url = 'api/rgw/user'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/role.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/role.service.ts index 08c1097115d46..fada767e42ae8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/role.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/role.service.ts @@ -5,10 +5,9 @@ import { Observable, of as observableOf } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; import { RoleFormModel } from '../../core/auth/role-form/role-form.model'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class RoleService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/scope.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/scope.service.ts index 8808f21251e45..11e5da80a03ab 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/scope.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/scope.service.ts @@ -1,10 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class ScopeService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts index 05a46caec610a..52433a8a419d0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts @@ -5,8 +5,6 @@ import * as _ from 'lodash'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiModule } from './api.module'; - class SettingResponse { name: string; default: any; @@ -15,7 +13,7 @@ class SettingResponse { } @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class SettingsService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts index 60365c1494b96..8a175f66d1e31 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts @@ -1,10 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { ApiModule } from './api.module'; - @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class TelemetryService { private url = 'api/telemetry'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts index ba35c06142937..f68250c022571 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/user.service.ts @@ -5,10 +5,9 @@ import { Observable, of as observableOf } from 'rxjs'; import { catchError, mapTo } from 'rxjs/operators'; import { UserFormModel } from '../../core/auth/user-form/user-form.model'; -import { ApiModule } from './api.module'; @Injectable({ - providedIn: ApiModule + providedIn: 'root' }) export class UserService { constructor(private http: HttpClient) {} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts index ae3a1c08358ad..0bffcf749e5cb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/shared.module.ts @@ -1,7 +1,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ApiModule } from './api/api.module'; import { ComponentsModule } from './components/components.module'; import { DataTableModule } from './datatable/datatable.module'; import { DirectivesModule } from './directives/directives.module'; @@ -11,16 +10,9 @@ import { AuthStorageService } from './services/auth-storage.service'; import { FormatterService } from './services/formatter.service'; @NgModule({ - imports: [ - CommonModule, - PipesModule, - ComponentsModule, - DataTableModule, - ApiModule, - DirectivesModule - ], + imports: [CommonModule, PipesModule, ComponentsModule, DataTableModule, DirectivesModule], declarations: [], - exports: [ComponentsModule, PipesModule, DataTableModule, ApiModule, DirectivesModule], + exports: [ComponentsModule, PipesModule, DataTableModule, DirectivesModule], providers: [AuthStorageService, AuthGuardService, FormatterService] }) export class SharedModule {}