Move services to folder.

This commit is contained in:
Chris Witterholt 2024-10-29 04:16:29 +00:00
parent 182ae621b5
commit 56b35a3845
24 changed files with 47 additions and 49 deletions

View File

@ -4,15 +4,15 @@ import { MatBottomSheet } from '@angular/material/bottom-sheet';
import { TranslateService } from '@ngx-translate/core';
import { State, Display, DisplayMode } from './responses';
import { OpenLPService, WebSocketStatus } from './openlp.service';
import { WindowRef } from './window-ref.service';
import { PageTitleService } from './page-title.service';
import { OpenLPService, WebSocketStatus } from './services/openlp.service';
import { WindowRef } from './services/window-ref.service';
import { PageTitleService } from './services/page-title.service';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { DisplayModeSelectorComponent } from './components/display-mode-selector/display-mode-selector.component';
import { Shortcuts, ShortcutsService } from './shortcuts.service';
import { Shortcuts, ShortcutsService } from './services/shortcuts.service';
import { ShortcutPipe } from './components/pipes/shortcut.pipe';
import { SettingsService } from './settings.service';
import { SettingsService } from './services/settings.service';
import * as supportedBrowsers from '../assets/supportedBrowsers';
@Component({

View File

@ -27,10 +27,11 @@ import { MatSliderModule } from '@angular/material/slider';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { AppComponent } from './app.component';
import { PageTitleService } from './page-title.service';
import { OpenLPService } from './openlp.service';
import { TranslationService } from './translation.service';
import { WindowRef } from './window-ref.service';
import { OpenLPService } from './services/openlp.service';
import { PageTitleService } from './services/page-title.service';
import { SettingsService } from './services/settings.service';
import { ShortcutsService } from './services/shortcuts.service';
import { TranslationService } from './services/translation.service';
import { AppRoutingModule } from './app.routing';
import { ServiceComponent } from './components/service/service.component';
import { AlertComponent } from './components/alert/alert.component';
@ -114,13 +115,14 @@ import { StageChordPreviewComponent } from './components/settings/stage-chord-pr
})
],
providers: [
PageTitleService,
OpenLPService,
TranslationService,
PageTitleService,
SentenceCasePipe,
SettingsService,
ShortcutsService,
Title,
TitleCasePipe,
WindowRef,
TranslationService,
provideHttpClient(withInterceptorsFromDi()),
],
bootstrap: [AppComponent]

View File

@ -3,8 +3,8 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { TitleCasePipe } from '@angular/common';
import { TranslateService } from '@ngx-translate/core';
import { PageTitleService } from '../../page-title.service';
import { OpenLPService } from '../../openlp.service';
import { PageTitleService } from '../../services/page-title.service';
import { OpenLPService } from '../../services/openlp.service';
@Component({
selector: 'openlp-alert',

View File

@ -4,7 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { TitleCasePipe } from '@angular/common';
import { TranslateService } from '@ngx-translate/core';
import { OpenLPService } from '../../openlp.service';
import { OpenLPService } from '../../services/openlp.service';
@Component({
selector: 'app-login',

View File

@ -1,8 +1,8 @@
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { SettingsService } from 'src/app/settings.service';
import { OpenLPService } from '../../openlp.service';
import { SettingsService } from '../../services/settings.service';
import { OpenLPService } from '../../services/openlp.service';
import { ServiceItem, Slide } from '../../responses';
@Component({

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { OpenLPService } from '../../openlp.service';
import { OpenLPService } from '../../services/openlp.service';
@Component({
selector: 'app-main-view',

View File

@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { TitleCasePipe } from '@angular/common';
import { TranslateService } from '@ngx-translate/core';
import { OpenLPService } from '../../../openlp.service';
import { OpenLPService } from '../../../services/openlp.service';
@Component({
selector: 'openlp-search-options',

View File

@ -1,8 +1,8 @@
import { AfterViewInit, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { OpenLPService } from '../../openlp.service';
import { PageTitleService } from '../../page-title.service';
import { OpenLPService } from '../../services/openlp.service';
import { PageTitleService } from '../../services/page-title.service';
import { PluginDescription } from '../../responses';
import { SearchOptionsComponent } from './search-options/search-options.component';

View File

@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
import { MatDialog } from '@angular/material/dialog';
import { DeleteConfirmationComponent } from './delete-confirmation/delete-confirmation.component';
import { OpenLPService } from '../../../openlp.service';
import { OpenLPService } from '../../../services/openlp.service';
import { ServiceItem } from '../../../responses';
@Component({

View File

@ -1,7 +1,7 @@
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
import { Subscription } from 'rxjs';
import { OpenLPService } from '../../../openlp.service';
import { OpenLPService } from '../../../services/openlp.service';
import { ServiceItem } from '../../../responses';
@Component({

View File

@ -2,8 +2,8 @@ import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { OpenLPService } from '../../openlp.service';
import { PageTitleService } from '../../page-title.service';
import { OpenLPService } from '../../services/openlp.service';
import { PageTitleService } from '../../services/page-title.service';
import { ServiceItem } from '../../responses';
@Component({

View File

@ -1,9 +1,9 @@
import { Component, OnDestroy } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Subscription } from 'rxjs';
import { OpenLPService } from '../../openlp.service';
import { PageTitleService } from '../../page-title.service';
import { SettingsProperties, SettingsPropertiesItem, SettingsService } from '../../settings.service';
import { OpenLPService } from '../../services/openlp.service';
import { PageTitleService } from '../../services/page-title.service';
import { SettingsProperties, SettingsPropertiesItem, SettingsService } from '../../services/settings.service';
@Component({
selector: 'openlp-settings',

View File

@ -12,7 +12,7 @@ import {
} from '@angular/core';
import { fromEvent, Subscription } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { SettingsProperties, SettingsService } from 'src/app/settings.service';
import { SettingsProperties, SettingsService } from '../../../services/settings.service';
@Component({
selector: 'openlp-stage-chord-preview',

View File

@ -2,7 +2,7 @@ import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/cor
import { Subscription } from 'rxjs';
import { Slide } from '../../../responses';
import { OpenLPService } from '../../../openlp.service';
import { OpenLPService } from '../../../services/openlp.service';
@Component({
selector: 'openlp-slide-list',

View File

@ -1,8 +1,8 @@
import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { OpenLPService } from '../../openlp.service';
import { PageTitleService } from '../../page-title.service';
import { OpenLPService } from '../../services/openlp.service';
import { PageTitleService } from '../../services/page-title.service';
import { SlideListItem } from './slide-list/slide-list.component';
@Component({

View File

@ -1,8 +1,8 @@
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { SettingsProperties, SettingsService } from 'src/app/settings.service';
import { OpenLPService } from '../../openlp.service';
import { SettingsProperties, SettingsService } from '../../services/settings.service';
import { OpenLPService } from '../../services/openlp.service';
import { ServiceItem, Slide } from '../../responses';
interface Tag {

View File

@ -1,8 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { OpenLPService } from '../../openlp.service';
import { PageTitleService } from '../../page-title.service';
import { OpenLPService } from '../../services/openlp.service';
import { PageTitleService } from '../../services/page-title.service';
import { Theme } from '../../responses';
@Component({

View File

@ -6,8 +6,8 @@ import { TitleCasePipe } from '@angular/common';
import { TranslateService } from '@ngx-translate/core';
import { Observable, of, Subscription } from 'rxjs';
import { catchError, finalize, shareReplay, tap } from 'rxjs/operators';
import { SentenceCasePipe } from './components/pipes/sentence-case.pipe';
import { LoginComponent } from './components/login/login.component';
import { SentenceCasePipe } from '../components/pipes/sentence-case.pipe';
import { LoginComponent } from '../components/login/login.component';
import {
PluginDescription,
@ -23,10 +23,10 @@ import {
AuthToken,
Message,
MessageType
} from './responses';
import { environment } from '../environments/environment';
import { createWebSocket } from './openlp-websocket';
import { deserialize } from './utils';
} from '../responses';
import { environment } from '../../environments/environment';
import { createWebSocket } from '../openlp-websocket';
import { deserialize } from '../utils';
const httpOptions = {
headers: new HttpHeaders({

View File

@ -16,7 +16,7 @@ export interface SettingsPropertiesItem<SP extends keyof SettingsProperties, SV
const LOCAL_STORAGE_PREFIX = 'OpenLP-';
@Injectable({providedIn: 'root'})
@Injectable()
export class SettingsService {
constructor() {
window.addEventListener('storage', this._handleStorageEvent);

View File

@ -20,7 +20,7 @@ interface Options {
keys: string;
}
@Injectable({ providedIn: 'root' })
@Injectable()
export class ShortcutsService {
defaults: Partial<Options> = {
element: this.document

View File

@ -3,9 +3,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
@Injectable()
export class TranslationService implements TranslateLoader {
constructor(private http: HttpClient) {}

View File

@ -4,10 +4,8 @@ function _window(): any {
return window;
}
@Injectable({providedIn: 'root'})
export class WindowRef {
get nativeWindow(): any {
return _window();
}