Restructure the client, register Repositories and map to collection
strings.
This commit is contained in:
parent
dbe452f976
commit
97f60c1e6c
@ -10,6 +10,7 @@
|
||||
"README": "https://github.com/OpenSlides/OpenSlides/blob/master/client/README.md",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"ng-high-memory": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng",
|
||||
"start": "ng serve --proxy-config proxy.conf.json --host=0.0.0.0",
|
||||
"build": "ng build --prod --aot",
|
||||
"test": "ng test",
|
||||
@ -77,6 +78,7 @@
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^1.16.2",
|
||||
"protractor": "^5.4.2",
|
||||
"source-map-explorer": "^1.6.0",
|
||||
"ts-node": "~8.0.2",
|
||||
"tslint": "~5.12.1",
|
||||
"tsutils": "^3.7.0",
|
||||
|
@ -7,7 +7,6 @@ import { LoginLegalNoticeComponent } from './site/login/components/login-legal-n
|
||||
import { LoginPrivacyPolicyComponent } from './site/login/components/login-privacy-policy/login-privacy-policy.component';
|
||||
import { ResetPasswordComponent } from './site/login/components/reset-password/reset-password.component';
|
||||
import { ResetPasswordConfirmComponent } from './site/login/components/reset-password-confirm/reset-password-confirm.component';
|
||||
import { FullscreenProjectorComponent } from './site/projector/components/fullscreen-projector/fullscreen-projector.component';
|
||||
|
||||
/**
|
||||
* Global app routing
|
||||
@ -24,8 +23,7 @@ const routes: Routes = [
|
||||
{ path: 'privacypolicy', component: LoginPrivacyPolicyComponent }
|
||||
]
|
||||
},
|
||||
{ path: 'projector', component: FullscreenProjectorComponent },
|
||||
{ path: 'projector/:id', component: FullscreenProjectorComponent },
|
||||
{ path: 'projector', loadChildren: './fullscreen-projector/fullscreen-projector.module#FullscreenProjectorModule' },
|
||||
{ path: '', loadChildren: './site/site.module#SiteModule' },
|
||||
{ path: '**', redirectTo: '' }
|
||||
];
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { TestBed, async } from '@angular/core/testing';
|
||||
import { AppComponent } from './app.component';
|
||||
import { E2EImportsModule } from './../e2e-imports.module';
|
||||
import { ServertimeService } from './core/services/servertime.service';
|
||||
import { ServertimeService } from './core/core-services/servertime.service';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
let servertimeService;
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { OperatorService } from './core/services/operator.service';
|
||||
import { LoginDataService } from './core/services/login-data.service';
|
||||
import { ConfigService } from './core/services/config.service';
|
||||
import { ConstantsService } from './core/services/constants.service';
|
||||
import { ServertimeService } from './core/services/servertime.service';
|
||||
import { ThemeService } from './core/services/theme.service';
|
||||
import { OperatorService } from './core/core-services/operator.service';
|
||||
import { LoginDataService } from './core/ui-services/login-data.service';
|
||||
import { ConfigService } from './core/ui-services/config.service';
|
||||
import { ConstantsService } from './core/ui-services/constants.service';
|
||||
import { ServertimeService } from './core/core-services/servertime.service';
|
||||
import { ThemeService } from './core/ui-services/theme.service';
|
||||
|
||||
/**
|
||||
* Angular's global App Component
|
||||
|
@ -9,11 +9,8 @@ import { PapaParseModule } from 'ngx-papaparse';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { CoreModule } from './core/core.module';
|
||||
|
||||
// translation module.
|
||||
import { LoginModule } from './site/login/login.module';
|
||||
import { AppLoadService } from './core/services/app-load.service';
|
||||
import { ProjectorModule } from './site/projector/projector.module';
|
||||
import { AppLoadService } from './core/core-services/app-load.service';
|
||||
import { SlidesModule } from './slides/slides.module';
|
||||
import { OpenSlidesTranslateModule } from './core/translate/openslides-translate-module';
|
||||
|
||||
@ -48,7 +45,6 @@ export function AppLoaderFactory(appLoadService: AppLoadService): () => Promise<
|
||||
LoginModule,
|
||||
PapaParseModule,
|
||||
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
||||
ProjectorModule,
|
||||
SlidesModule.forRoot()
|
||||
],
|
||||
providers: [{ provide: APP_INITIALIZER, useFactory: AppLoaderFactory, deps: [AppLoadService], multi: true }],
|
||||
|
39
client/src/app/core/app-config.ts
Normal file
39
client/src/app/core/app-config.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { ModelConstructor, BaseModel } from '../shared/models/base/base-model';
|
||||
import { MainMenuEntry } from './core-services/main-menu.service';
|
||||
import { Searchable } from '../shared/models/base/searchable';
|
||||
import { Type } from '@angular/core';
|
||||
import { BaseRepository } from './repositories/base-repository';
|
||||
|
||||
interface BaseModelEntry {
|
||||
collectionString: string;
|
||||
repository: Type<BaseRepository<any, any>>;
|
||||
}
|
||||
|
||||
export interface ModelEntry extends BaseModelEntry {
|
||||
model: ModelConstructor<BaseModel>;
|
||||
}
|
||||
|
||||
export interface SearchableModelEntry extends BaseModelEntry {
|
||||
model: new (...args: any[]) => BaseModel & Searchable;
|
||||
searchOrder: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The configuration of an app.
|
||||
*/
|
||||
export interface AppConfig {
|
||||
/**
|
||||
* The name.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* All models, that should be registered.
|
||||
*/
|
||||
models?: (ModelEntry | SearchableModelEntry)[];
|
||||
|
||||
/**
|
||||
* Main menu entries.
|
||||
*/
|
||||
mainMenuEntries?: MainMenuEntry[];
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
|
||||
import { plugins } from '../../../plugins';
|
||||
import { CommonAppConfig } from '../../site/common/common.config';
|
||||
import { AppConfig, SearchableModelEntry, ModelEntry } from '../../site/base/app-config';
|
||||
import { CollectionStringModelMapperService } from './collectionStringModelMapper.service';
|
||||
import { AppConfig, SearchableModelEntry, ModelEntry } from '../app-config';
|
||||
import { CollectionStringMapperService } from './collectionStringMapper.service';
|
||||
import { MediafileAppConfig } from '../../site/mediafiles/mediafile.config';
|
||||
import { MotionsAppConfig } from '../../site/motions/motions.config';
|
||||
import { ConfigAppConfig } from '../../site/config/config.config';
|
||||
@ -12,9 +13,10 @@ import { UsersAppConfig } from '../../site/users/users.config';
|
||||
import { TagAppConfig } from '../../site/tags/tag.config';
|
||||
import { MainMenuService } from './main-menu.service';
|
||||
import { HistoryAppConfig } from 'app/site/history/history.config';
|
||||
import { SearchService } from './search.service';
|
||||
import { SearchService } from '../ui-services/search.service';
|
||||
import { isSearchable } from '../../shared/models/base/searchable';
|
||||
import { ProjectorAppConfig } from 'app/site/projector/projector.config';
|
||||
import { BaseRepository } from 'app/core/repositories/base-repository';
|
||||
|
||||
/**
|
||||
* A list of all app configurations of all delivered apps.
|
||||
@ -47,9 +49,10 @@ export class AppLoadService {
|
||||
* @param searchService
|
||||
*/
|
||||
public constructor(
|
||||
private modelMapper: CollectionStringModelMapperService,
|
||||
private modelMapper: CollectionStringMapperService,
|
||||
private mainMenuService: MainMenuService,
|
||||
private searchService: SearchService
|
||||
private searchService: SearchService,
|
||||
private injector: Injector
|
||||
) {}
|
||||
|
||||
public async loadApps(): Promise<void> {
|
||||
@ -63,7 +66,11 @@ export class AppLoadService {
|
||||
appConfigs.forEach((config: AppConfig) => {
|
||||
if (config.models) {
|
||||
config.models.forEach(entry => {
|
||||
this.modelMapper.registerCollectionElement(entry.collectionString, entry.model);
|
||||
let repository: BaseRepository<any, any> = null;
|
||||
if (entry.repository) {
|
||||
repository = this.injector.get(entry.repository);
|
||||
}
|
||||
this.modelMapper.registerCollectionElement(entry.collectionString, entry.model, repository);
|
||||
if (this.isSearchableModelEntry(entry)) {
|
||||
this.searchService.registerModel(entry.collectionString, entry.model, entry.searchOrder);
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { OperatorService } from 'app/core/services/operator.service';
|
||||
import { OperatorService } from 'app/core/core-services/operator.service';
|
||||
import { OpenSlidesComponent } from '../../openslides.component';
|
||||
import { environment } from 'environments/environment';
|
||||
import { User } from '../../shared/models/users/user';
|
||||
import { OpenSlidesService } from './openslides.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { HttpService } from './http.service';
|
||||
|
||||
/**
|
@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
|
||||
import { OpenSlidesComponent } from 'app/openslides.component';
|
||||
import { WebsocketService } from './websocket.service';
|
||||
|
||||
import { CollectionStringModelMapperService } from './collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from './collectionStringMapper.service';
|
||||
import { DataStoreService } from './data-store.service';
|
||||
import { BaseModel } from '../../shared/models/base/base-model';
|
||||
|
||||
@ -58,7 +58,7 @@ export class AutoupdateService extends OpenSlidesComponent {
|
||||
public constructor(
|
||||
private websocketService: WebsocketService,
|
||||
private DS: DataStoreService,
|
||||
private modelMapper: CollectionStringModelMapperService
|
||||
private modelMapper: CollectionStringMapperService
|
||||
) {
|
||||
super();
|
||||
this.websocketService.getOberservable<AutoupdateFormat>('autoupdate').subscribe(response => {
|
@ -1,5 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { ModelConstructor, BaseModel } from '../../shared/models/base/base-model';
|
||||
import { BaseRepository } from 'app/core/repositories/base-repository';
|
||||
|
||||
/**
|
||||
* Registeres the mapping of collection strings <--> actual types. Every Model should register itself here.
|
||||
@ -7,12 +9,14 @@ import { ModelConstructor, BaseModel } from '../../shared/models/base/base-model
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CollectionStringModelMapperService {
|
||||
export class CollectionStringMapperService {
|
||||
/**
|
||||
* Mapps collection strings to model constructors. Accessed by {@method registerCollectionElement} and
|
||||
* {@method getCollectionStringType}.
|
||||
*/
|
||||
private collectionStringsTypeMapping: { [collectionString: string]: ModelConstructor<BaseModel> } = {};
|
||||
private collectionStringsTypeMapping: {
|
||||
[collectionString: string]: [ModelConstructor<BaseModel>, BaseRepository<any, any>];
|
||||
} = {};
|
||||
|
||||
/**
|
||||
* Constructor to create the NotifyService. Registers itself to the WebsocketService.
|
||||
@ -23,10 +27,14 @@ export class CollectionStringModelMapperService {
|
||||
/**
|
||||
* Registers the type to the collection string
|
||||
* @param collectionString
|
||||
* @param type
|
||||
* @param model
|
||||
*/
|
||||
public registerCollectionElement(collectionString: string, type: ModelConstructor<BaseModel>): void {
|
||||
this.collectionStringsTypeMapping[collectionString] = type;
|
||||
public registerCollectionElement(
|
||||
collectionString: string,
|
||||
model: ModelConstructor<BaseModel>,
|
||||
repository: BaseRepository<any, any>
|
||||
): void {
|
||||
this.collectionStringsTypeMapping[collectionString] = [model, repository];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -34,7 +42,15 @@ export class CollectionStringModelMapperService {
|
||||
* @param collectionString the requested collection
|
||||
*/
|
||||
public getModelConstructor(collectionString: string): ModelConstructor<BaseModel> {
|
||||
return this.collectionStringsTypeMapping[collectionString];
|
||||
return this.collectionStringsTypeMapping[collectionString][0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the repository of the requested collection or undefined, if it is not registered.
|
||||
* @param collectionString the requested collection
|
||||
*/
|
||||
public getRepository(collectionString: string): BaseRepository<any, any> {
|
||||
return this.collectionStringsTypeMapping[collectionString][1];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -43,7 +59,7 @@ export class CollectionStringModelMapperService {
|
||||
*/
|
||||
public getCollectionString(ctor: ModelConstructor<BaseModel>): string {
|
||||
return Object.keys(this.collectionStringsTypeMapping).find((collectionString: string) => {
|
||||
return ctor === this.collectionStringsTypeMapping[collectionString];
|
||||
return ctor === this.collectionStringsTypeMapping[collectionString][0];
|
||||
});
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { BaseModel } from '../../shared/models/base/base-model';
|
||||
import { HttpService } from './http.service';
|
||||
import { Identifiable } from '../../shared/models/base/identifiable';
|
@ -1,9 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
|
||||
import { BaseModel, ModelConstructor } from '../../shared/models/base/base-model';
|
||||
import { StorageService } from './storage.service';
|
||||
import { CollectionStringModelMapperService } from './collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from './collectionStringMapper.service';
|
||||
|
||||
/**
|
||||
* Represents information about a deleted model.
|
||||
@ -126,10 +127,7 @@ export class DataStoreService {
|
||||
* @param storageService use StorageService to preserve the DataStore.
|
||||
* @param modelMapper
|
||||
*/
|
||||
public constructor(
|
||||
private storageService: StorageService,
|
||||
private modelMapper: CollectionStringModelMapperService
|
||||
) {}
|
||||
public constructor(private storageService: StorageService, private modelMapper: CollectionStringMapperService) {}
|
||||
|
||||
/**
|
||||
* Gets the DataStore from cache and instantiate all models out of the serialized version.
|
@ -1,6 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
|
||||
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { formatQueryParams, QueryParams } from '../query-params';
|
||||
import { OpenSlidesStatusService } from './openslides-status.service';
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
/**
|
@ -1,4 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Subject, Observable } from 'rxjs';
|
||||
|
||||
import { OpenSlidesComponent } from 'app/openslides.component';
|
@ -1,6 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
|
||||
import { OpenSlidesComponent } from 'app/openslides.component';
|
||||
import { Group } from 'app/shared/models/users/group';
|
||||
import { User } from '../../shared/models/users/user';
|
@ -1,9 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
import { OpenSlidesComponent } from 'app/openslides.component';
|
||||
import { HttpService } from './http.service';
|
||||
import { environment } from 'environments/environment.prod';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* This service provides the timeoffset to the server and a user of this service
|
@ -1,5 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { LocalStorage } from '@ngx-pwa/local-storage';
|
||||
|
||||
import { OpenSlidesStatusService } from './openslides-status.service';
|
||||
|
||||
/**
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
import { CollectionStringModelMapperService } from './collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from './collectionStringMapper.service';
|
||||
import { History } from 'app/shared/models/core/history';
|
||||
import { DataStoreService } from './data-store.service';
|
||||
import { WebsocketService } from './websocket.service';
|
||||
@ -48,7 +48,7 @@ export class TimeTravelService {
|
||||
public constructor(
|
||||
private httpService: HttpService,
|
||||
private webSocketService: WebsocketService,
|
||||
private modelMapperService: CollectionStringModelMapperService,
|
||||
private modelMapperService: CollectionStringMapperService,
|
||||
private DS: DataStoreService,
|
||||
private OSStatus: OpenSlidesStatusService,
|
||||
private OpenSlides: OpenSlidesService
|
@ -1,7 +1,9 @@
|
||||
import { Injectable, NgZone, EventEmitter } from '@angular/core';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material';
|
||||
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { formatQueryParams, QueryParams } from '../query-params';
|
||||
|
||||
/**
|
@ -2,37 +2,17 @@ import { NgModule, Optional, SkipSelf } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
|
||||
// Core Services, Directives
|
||||
import { AuthGuard } from './services/auth-guard.service';
|
||||
import { AuthService } from './services/auth.service';
|
||||
import { AutoupdateService } from './services/autoupdate.service';
|
||||
import { DataStoreService } from './services/data-store.service';
|
||||
import { OperatorService } from './services/operator.service';
|
||||
import { WebsocketService } from './services/websocket.service';
|
||||
import { DataSendService } from './services/data-send.service';
|
||||
import { ViewportService } from './services/viewport.service';
|
||||
// Shared Components
|
||||
import { PromptDialogComponent } from '../shared/components/prompt-dialog/prompt-dialog.component';
|
||||
import { HttpService } from './services/http.service';
|
||||
import { ChoiceDialogComponent } from '../shared/components/choice-dialog/choice-dialog.component';
|
||||
import { ProjectionDialogComponent } from 'app/shared/components/projection-dialog/projection-dialog.component';
|
||||
|
||||
/** Global Core Module. Contains all global (singleton) services
|
||||
*
|
||||
/**
|
||||
* Global Core Module.
|
||||
*/
|
||||
@NgModule({
|
||||
imports: [CommonModule],
|
||||
providers: [
|
||||
Title,
|
||||
AuthGuard,
|
||||
AuthService,
|
||||
AutoupdateService,
|
||||
DataStoreService,
|
||||
DataSendService,
|
||||
HttpService,
|
||||
OperatorService,
|
||||
ViewportService,
|
||||
WebsocketService
|
||||
],
|
||||
providers: [Title],
|
||||
entryComponents: [PromptDialogComponent, ChoiceDialogComponent, ProjectionDialogComponent]
|
||||
})
|
||||
export class CoreModule {
|
||||
|
@ -2,22 +2,22 @@ import { Injectable } from '@angular/core';
|
||||
import { tap, map } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { AgendaBaseModel } from '../../../shared/models/base/agenda-base-model';
|
||||
import { BaseModel } from '../../../shared/models/base/base-model';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { ConfigService } from 'app/core/services/config.service';
|
||||
import { DataSendService } from 'app/core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { ConfigService } from 'app/core/ui-services/config.service';
|
||||
import { DataSendService } from 'app/core/core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { Item } from '../../../shared/models/agenda/item';
|
||||
import { OSTreeSortEvent } from 'app/shared/components/sorting-tree/sorting-tree.component';
|
||||
import { Speaker } from 'app/shared/models/agenda/speaker';
|
||||
import { User } from 'app/shared/models/users/user';
|
||||
import { ViewItem } from '../models/view-item';
|
||||
import { ViewSpeaker } from '../models/view-speaker';
|
||||
import { TreeService } from 'app/core/services/tree.service';
|
||||
import { ViewItem } from '../../../site/agenda/models/view-item';
|
||||
import { ViewSpeaker } from '../../../site/agenda/models/view-speaker';
|
||||
import { TreeService } from 'app/core/ui-services/tree.service';
|
||||
|
||||
/**
|
||||
* Repository service for users
|
||||
@ -41,7 +41,7 @@ export class AgendaRepositoryService extends BaseRepository<ViewItem, Item> {
|
||||
public constructor(
|
||||
protected DS: DataStoreService,
|
||||
private httpService: HttpService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private config: ConfigService,
|
||||
private dataSend: DataSendService,
|
||||
private treeService: TreeService
|
@ -1,15 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Topic } from 'app/shared/models/topics/topic';
|
||||
import { BaseRepository } from 'app/site/base/base-repository';
|
||||
import { BaseRepository } from 'app/core/repositories/base-repository';
|
||||
import { Mediafile } from 'app/shared/models/mediafiles/mediafile';
|
||||
import { Item } from 'app/shared/models/agenda/item';
|
||||
import { DataStoreService } from 'app/core/services/data-store.service';
|
||||
import { DataSendService } from 'app/core/services/data-send.service';
|
||||
import { ViewTopic } from '../models/view-topic';
|
||||
import { DataStoreService } from 'app/core/core-services/data-store.service';
|
||||
import { DataSendService } from 'app/core/core-services/data-send.service';
|
||||
import { ViewTopic } from '../../../site/agenda/models/view-topic';
|
||||
import { Identifiable } from 'app/shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from 'app/core/services/collectionStringModelMapper.service';
|
||||
import { CreateTopic } from '../models/create-topic';
|
||||
import { CollectionStringMapperService } from 'app/core/core-services/collectionStringMapper.service';
|
||||
import { CreateTopic } from '../../../site/agenda/models/create-topic';
|
||||
|
||||
/**
|
||||
* Repository for topics
|
||||
@ -27,7 +27,7 @@ export class TopicRepositoryService extends BaseRepository<ViewTopic, Topic> {
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService
|
||||
) {
|
||||
super(DS, mapperService, Topic, [Mediafile, Item]);
|
@ -1,13 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ViewAssignment } from '../models/view-assignment';
|
||||
import { ViewAssignment } from '../../../site/assignments/models/view-assignment';
|
||||
import { Assignment } from '../../../shared/models/assignments/assignment';
|
||||
import { User } from '../../../shared/models/users/user';
|
||||
import { Tag } from '../../../shared/models/core/tag';
|
||||
import { Item } from '../../../shared/models/agenda/item';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
|
||||
/**
|
||||
* Repository Service for Assignments.
|
||||
@ -24,7 +24,7 @@ export class AssignmentRepositoryService extends BaseRepository<ViewAssignment,
|
||||
* @param DS The DataStore
|
||||
* @param mapperService Maps collection strings to classes
|
||||
*/
|
||||
public constructor(DS: DataStoreService, mapperService: CollectionStringModelMapperService) {
|
||||
public constructor(DS: DataStoreService, mapperService: CollectionStringMapperService) {
|
||||
super(DS, mapperService, Assignment, [User, Item, Tag]);
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
||||
|
||||
import { OpenSlidesComponent } from '../../openslides.component';
|
||||
import { BaseViewModel } from './base-view-model';
|
||||
import { BaseViewModel } from '../../site/base/base-view-model';
|
||||
import { BaseModel, ModelConstructor } from '../../shared/models/base/base-model';
|
||||
import { CollectionStringModelMapperService } from '../../core/services/collectionStringModelMapper.service';
|
||||
import { DataStoreService } from '../../core/services/data-store.service';
|
||||
import { CollectionStringMapperService } from '../core-services/collectionStringMapper.service';
|
||||
import { DataStoreService } from '../core-services/data-store.service';
|
||||
import { Identifiable } from '../../shared/models/base/identifiable';
|
||||
import { auditTime } from 'rxjs/operators';
|
||||
|
||||
@ -40,7 +40,7 @@ export abstract class BaseRepository<V extends BaseViewModel, M extends BaseMode
|
||||
*/
|
||||
public constructor(
|
||||
protected DS: DataStoreService,
|
||||
protected collectionStringModelMapperService: CollectionStringModelMapperService,
|
||||
protected collectionStringModelMapperService: CollectionStringMapperService,
|
||||
protected baseModelCtor: ModelConstructor<M>,
|
||||
protected depsModelCtors?: ModelConstructor<BaseModel>[]
|
||||
) {
|
@ -0,0 +1,17 @@
|
||||
import { TestBed, inject } from '@angular/core/testing';
|
||||
|
||||
import { E2EImportsModule } from 'e2e-imports.module';
|
||||
import { ChatMessageRepositoryService } from './chatmessage-repository.service';
|
||||
|
||||
describe('ChatMessageRepositoryService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [E2EImportsModule],
|
||||
providers: [ChatMessageRepositoryService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([ChatMessageRepositoryService], (service: ChatMessageRepositoryService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
@ -0,0 +1,32 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { ChatMessage } from 'app/shared/models/core/chat-message';
|
||||
import { ViewChatMessage } from 'app/site/common/models/view-chatmessage';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ChatMessageRepositoryService extends BaseRepository<ViewChatMessage, ChatMessage> {
|
||||
public constructor(DS: DataStoreService, mapperService: CollectionStringMapperService) {
|
||||
super(DS, mapperService, ChatMessage);
|
||||
}
|
||||
|
||||
protected createViewModel(message: ChatMessage): ViewChatMessage {
|
||||
return new ViewChatMessage(message);
|
||||
}
|
||||
|
||||
public async create(message: ChatMessage): Promise<Identifiable> {
|
||||
throw new Error('TODO');
|
||||
}
|
||||
|
||||
public async update(message: Partial<ChatMessage>, viewMessage: ViewChatMessage): Promise<void> {
|
||||
throw new Error('TODO');
|
||||
}
|
||||
|
||||
public async delete(viewMessage: ViewChatMessage): Promise<void> {
|
||||
throw new Error('TODO');
|
||||
}
|
||||
}
|
@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { CollectionStringModelMapperService } from 'app/core/services/collectionStringModelMapper.service';
|
||||
import { DataStoreService } from 'app/core/services/data-store.service';
|
||||
import { BaseRepository } from 'app/site/base/base-repository';
|
||||
import { CollectionStringMapperService } from 'app/core/core-services/collectionStringMapper.service';
|
||||
import { DataStoreService } from 'app/core/core-services/data-store.service';
|
||||
import { BaseRepository } from 'app/core/repositories/base-repository';
|
||||
import { History } from 'app/shared/models/core/history';
|
||||
import { User } from 'app/shared/models/users/user';
|
||||
import { Identifiable } from 'app/shared/models/base/identifiable';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { ViewHistory } from '../models/view-history';
|
||||
import { TimeTravelService } from 'app/core/services/time-travel.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
import { ViewHistory } from '../../../site/history/models/view-history';
|
||||
import { TimeTravelService } from 'app/core/core-services/time-travel.service';
|
||||
import { BaseModel } from 'app/shared/models/base/base-model';
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@ export class HistoryRepositoryService extends BaseRepository<ViewHistory, Histor
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private httpService: HttpService,
|
||||
private timeTravel: TimeTravelService
|
||||
) {
|
@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { ViewMediafile } from '../models/view-mediafile';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { ViewMediafile } from '../../../site/mediafiles/models/view-mediafile';
|
||||
import { Mediafile } from '../../../shared/models/mediafiles/mediafile';
|
||||
import { User } from '../../../shared/models/users/user';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { DataSendService } from 'app/core/services/data-send.service';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { DataSendService } from 'app/core/core-services/data-send.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
import { HttpHeaders } from '@angular/common/http';
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@ export class MediafileRepositoryService extends BaseRepository<ViewMediafile, Me
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService,
|
||||
private httpService: HttpService
|
||||
) {
|
@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Category } from '../../../shared/models/motions/category';
|
||||
import { ViewCategory } from '../models/view-category';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { ViewCategory } from '../../../site/motions/models/view-category';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { Motion } from '../../../shared/models/motions/motion';
|
||||
import { HttpService } from '../../../core/services/http.service';
|
||||
import { HttpService } from '../../core-services/http.service';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
|
||||
/**
|
||||
* Repository Services for Categories
|
||||
@ -36,7 +36,7 @@ export class CategoryRepositoryService extends BaseRepository<ViewCategory, Cate
|
||||
*/
|
||||
public constructor(
|
||||
protected DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService,
|
||||
private httpService: HttpService
|
||||
) {
|
@ -1,17 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { User } from '../../../shared/models/users/user';
|
||||
import { Category } from '../../../shared/models/motions/category';
|
||||
import { Workflow } from '../../../shared/models/motions/workflow';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { MotionChangeReco } from '../../../shared/models/motions/motion-change-reco';
|
||||
import { ViewChangeReco } from '../models/view-change-reco';
|
||||
import { ViewChangeReco } from '../../../site/motions/models/view-change-reco';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
|
||||
/**
|
||||
* Repository Services for change recommendations
|
||||
@ -39,7 +40,7 @@ export class ChangeRecommendationRepositoryService extends BaseRepository<ViewCh
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService
|
||||
) {
|
||||
super(DS, mapperService, MotionChangeReco, [Category, User, Workflow]);
|
@ -1,18 +1,19 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { BaseRepository } from 'app/site/base/base-repository';
|
||||
import { CollectionStringModelMapperService } from 'app/core/services/collectionStringModelMapper.service';
|
||||
import { DataSendService } from 'app/core/services/data-send.service';
|
||||
import { DataStoreService } from 'app/core/services/data-store.service';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { BaseRepository } from 'app/core/repositories/base-repository';
|
||||
import { CollectionStringMapperService } from 'app/core/core-services/collectionStringMapper.service';
|
||||
import { DataSendService } from 'app/core/core-services/data-send.service';
|
||||
import { DataStoreService } from 'app/core/core-services/data-store.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
import { Identifiable } from 'app/shared/models/base/identifiable';
|
||||
import { Motion } from 'app/shared/models/motions/motion';
|
||||
import { MotionBlock } from 'app/shared/models/motions/motion-block';
|
||||
import { MotionRepositoryService } from './motion-repository.service';
|
||||
import { ViewMotion } from '../models/view-motion';
|
||||
import { ViewMotionBlock } from '../models/view-motion-block';
|
||||
import { ViewMotion } from '../../../site/motions/models/view-motion';
|
||||
import { ViewMotionBlock } from '../../../site/motions/models/view-motion-block';
|
||||
|
||||
/**
|
||||
* Repository service for motion blocks
|
||||
@ -32,7 +33,7 @@ export class MotionBlockRepositoryService extends BaseRepository<ViewMotionBlock
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService,
|
||||
private motionRepo: MotionRepositoryService,
|
||||
private httpService: HttpService
|
@ -1,13 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { ViewMotionCommentSection } from '../models/view-motion-comment-section';
|
||||
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { ViewMotionCommentSection } from '../../../site/motions/models/view-motion-comment-section';
|
||||
import { MotionCommentSection } from '../../../shared/models/motions/motion-comment-section';
|
||||
import { Group } from '../../../shared/models/users/group';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
|
||||
/**
|
||||
* Repository Services for Categories
|
||||
@ -37,7 +38,7 @@ export class MotionCommentSectionRepositoryService extends BaseRepository<
|
||||
* @param http Service to handle direct http-communication
|
||||
*/
|
||||
public constructor(
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
protected DS: DataStoreService,
|
||||
private dataSend: DataSendService,
|
||||
private http: HttpService
|
@ -1,34 +1,34 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { tap, map } from 'rxjs/operators';
|
||||
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { Category } from '../../../shared/models/motions/category';
|
||||
import { ChangeRecoMode, ViewMotion } from '../models/view-motion';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CreateMotion } from '../models/create-motion';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { DiffLinesInParagraph, DiffService, LineRange, ModificationType } from './diff.service';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { ChangeRecoMode, ViewMotion } from '../../../site/motions/models/view-motion';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { CreateMotion } from '../../../site/motions/models/create-motion';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { DiffLinesInParagraph, DiffService, LineRange, ModificationType } from '../../ui-services/diff.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { Item } from 'app/shared/models/agenda/item';
|
||||
import { LinenumberingService } from './linenumbering.service';
|
||||
import { LinenumberingService } from '../../ui-services/linenumbering.service';
|
||||
import { Mediafile } from 'app/shared/models/mediafiles/mediafile';
|
||||
import { Motion } from '../../../shared/models/motions/motion';
|
||||
import { MotionBlock } from 'app/shared/models/motions/motion-block';
|
||||
import { MotionChangeReco } from '../../../shared/models/motions/motion-change-reco';
|
||||
import { MotionPoll } from 'app/shared/models/motions/motion-poll';
|
||||
import { OSTreeSortEvent } from 'app/shared/components/sorting-tree/sorting-tree.component';
|
||||
import { PersonalNoteService } from './personal-note.service';
|
||||
import { TreeService } from 'app/core/services/tree.service';
|
||||
import { PersonalNoteService } from '../../ui-services/personal-note.service';
|
||||
import { TreeService } from 'app/core/ui-services/tree.service';
|
||||
import { User } from '../../../shared/models/users/user';
|
||||
import { ViewChangeReco } from '../models/view-change-reco';
|
||||
import { ViewMotionAmendedParagraph } from '../models/view-motion-amended-paragraph';
|
||||
import { ViewUnifiedChange } from '../models/view-unified-change';
|
||||
import { ViewStatuteParagraph } from '../models/view-statute-paragraph';
|
||||
import { ViewChangeReco } from '../../../site/motions/models/view-change-reco';
|
||||
import { ViewMotionAmendedParagraph } from '../../../site/motions/models/view-motion-amended-paragraph';
|
||||
import { ViewUnifiedChange } from '../../../site/motions/models/view-unified-change';
|
||||
import { ViewStatuteParagraph } from '../../../site/motions/models/view-statute-paragraph';
|
||||
import { Workflow } from '../../../shared/models/motions/workflow';
|
||||
import { WorkflowState } from '../../../shared/models/motions/workflow-state';
|
||||
|
||||
@ -62,7 +62,7 @@ export class MotionRepositoryService extends BaseRepository<ViewMotion, Motion>
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService,
|
||||
private httpService: HttpService,
|
||||
private readonly lineNumbering: LinenumberingService,
|
@ -1,11 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { ViewStatuteParagraph } from '../models/view-statute-paragraph';
|
||||
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { ViewStatuteParagraph } from '../../../site/motions/models/view-statute-paragraph';
|
||||
import { StatuteParagraph } from '../../../shared/models/motions/statute-paragraph';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
|
||||
/**
|
||||
* Repository Services for statute paragraphs
|
||||
@ -29,7 +30,7 @@ export class StatuteParagraphRepositoryService extends BaseRepository<ViewStatut
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService
|
||||
) {
|
||||
super(DS, mapperService, StatuteParagraph);
|
@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Workflow } from '../../../shared/models/motions/workflow';
|
||||
import { ViewWorkflow } from '../models/view-workflow';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { ViewWorkflow } from '../../../site/motions/models/view-workflow';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { WorkflowState } from 'app/shared/models/motions/workflow-state';
|
||||
import { ViewMotion } from '../models/view-motion';
|
||||
import { ViewMotion } from '../../../site/motions/models/view-motion';
|
||||
|
||||
/**
|
||||
* Repository Services for Categories
|
||||
@ -32,7 +32,7 @@ export class WorkflowRepositoryService extends BaseRepository<ViewWorkflow, Work
|
||||
*/
|
||||
public constructor(
|
||||
protected DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService
|
||||
) {
|
||||
super(DS, mapperService, Workflow);
|
@ -1,10 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { ViewCountdown } from '../models/view-countdown';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { ViewCountdown } from '../../../site/projector/models/view-countdown';
|
||||
import { Countdown } from '../../../shared/models/core/countdown';
|
||||
|
||||
@Injectable({
|
||||
@ -13,7 +13,7 @@ import { Countdown } from '../../../shared/models/core/countdown';
|
||||
export class CountdownRepositoryService extends BaseRepository<ViewCountdown, Countdown> {
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService
|
||||
) {
|
||||
super(DS, mapperService, Countdown);
|
@ -1,13 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { ViewProjector } from '../models/view-projector';
|
||||
import { ViewProjector } from '../../../site/projector/models/view-projector';
|
||||
import { Projector } from '../../../shared/models/core/projector';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
|
||||
/**
|
||||
* Directions for scale and scroll requests.
|
||||
@ -35,7 +35,7 @@ export class ProjectorRepositoryService extends BaseRepository<ViewProjector, Pr
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService,
|
||||
private http: HttpService
|
||||
) {
|
@ -1,16 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { ProjectorMessage } from 'app/shared/models/core/projector-message';
|
||||
import { ViewProjectorMessage } from '../models/view-projectormessage';
|
||||
import { ViewProjectorMessage } from '../../../site/projector/models/view-projectormessage';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProjectorMessageRepositoryService extends BaseRepository<ViewProjectorMessage, ProjectorMessage> {
|
||||
public constructor(DS: DataStoreService, mapperService: CollectionStringModelMapperService) {
|
||||
public constructor(DS: DataStoreService, mapperService: CollectionStringMapperService) {
|
||||
super(DS, mapperService, ProjectorMessage);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Tag } from '../../../shared/models/core/tag';
|
||||
import { ViewTag } from '../models/view-tag';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { ViewTag } from '../../../site/tags/models/view-tag';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
|
||||
/**
|
||||
* Repository Services for Tags
|
||||
@ -33,7 +33,7 @@ export class TagRepositoryService extends BaseRepository<ViewTag, Tag> {
|
||||
*/
|
||||
public constructor(
|
||||
protected DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService
|
||||
) {
|
||||
super(DS, mapperService, Tag);
|
@ -1,13 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { ConstantsService } from '../../../core/services/constants.service';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { ConstantsService } from '../../ui-services/constants.service';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { Group } from '../../../shared/models/users/group';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { ViewGroup } from '../models/view-group';
|
||||
import { ViewGroup } from '../../../site/users/models/view-group';
|
||||
|
||||
/**
|
||||
* Shape of a permission
|
||||
@ -48,7 +48,7 @@ export class GroupRepositoryService extends BaseRepository<ViewGroup, Group> {
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService,
|
||||
private constants: ConstantsService
|
||||
) {
|
@ -0,0 +1,17 @@
|
||||
import { TestBed, inject } from '@angular/core/testing';
|
||||
|
||||
import { E2EImportsModule } from '../../../../e2e-imports.module';
|
||||
import { PersonalNoteRepositoryService } from './personal-note-repository.service';
|
||||
|
||||
describe('PersonalNoteRepositoryService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [E2EImportsModule],
|
||||
providers: [PersonalNoteRepositoryService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([PersonalNoteRepositoryService], (service: PersonalNoteRepositoryService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
@ -0,0 +1,38 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { PersonalNote } from 'app/shared/models/users/personal-note';
|
||||
import { Identifiable } from 'app/shared/models/base/identifiable';
|
||||
|
||||
/**
|
||||
*/
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PersonalNoteRepositoryService extends BaseRepository<any, PersonalNote> {
|
||||
/**
|
||||
* @param DS The DataStore
|
||||
* @param mapperService Maps collection strings to classes
|
||||
*/
|
||||
public constructor(protected DS: DataStoreService, mapperService: CollectionStringMapperService) {
|
||||
super(DS, mapperService, PersonalNote);
|
||||
}
|
||||
|
||||
protected createViewModel(personalNote: PersonalNote): any {
|
||||
return {};
|
||||
}
|
||||
|
||||
public async create(personalNote: PersonalNote): Promise<Identifiable> {
|
||||
throw new Error('TODO');
|
||||
}
|
||||
|
||||
public async update(personalNote: Partial<PersonalNote>, viewPersonalNote: any): Promise<void> {
|
||||
throw new Error('TODO');
|
||||
}
|
||||
|
||||
public async delete(viewPersonalNote: any): Promise<void> {
|
||||
throw new Error('TODO');
|
||||
}
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { BaseRepository } from '../../base/base-repository';
|
||||
import { ViewUser } from '../models/view-user';
|
||||
import { BaseRepository } from '../base-repository';
|
||||
import { ViewUser } from '../../../site/users/models/view-user';
|
||||
import { User } from '../../../shared/models/users/user';
|
||||
import { Group } from '../../../shared/models/users/group';
|
||||
import { DataStoreService } from '../../../core/services/data-store.service';
|
||||
import { DataSendService } from '../../../core/services/data-send.service';
|
||||
import { DataStoreService } from '../../core-services/data-store.service';
|
||||
import { DataSendService } from '../../core-services/data-send.service';
|
||||
import { Identifiable } from '../../../shared/models/base/identifiable';
|
||||
import { CollectionStringModelMapperService } from '../../../core/services/collectionStringModelMapper.service';
|
||||
import { ConfigService } from 'app/core/services/config.service';
|
||||
import { HttpService } from 'app/core/services/http.service';
|
||||
import { CollectionStringMapperService } from '../../core-services/collectionStringMapper.service';
|
||||
import { ConfigService } from 'app/core/ui-services/config.service';
|
||||
import { HttpService } from 'app/core/core-services/http.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
|
||||
@ -37,7 +37,7 @@ export class UserRepositoryService extends BaseRepository<ViewUser, User> {
|
||||
*/
|
||||
public constructor(
|
||||
DS: DataStoreService,
|
||||
mapperService: CollectionStringModelMapperService,
|
||||
mapperService: CollectionStringMapperService,
|
||||
private dataSend: DataSendService,
|
||||
private translate: TranslateService,
|
||||
private httpService: HttpService,
|
@ -1,5 +1,5 @@
|
||||
import { TranslateDefaultParser, TranslateStore } from '@ngx-translate/core';
|
||||
import { ConfigService } from '../services/config.service';
|
||||
import { ConfigService } from '../ui-services/config.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface CustomTranslation {
|
||||
|
@ -1,17 +1,17 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FilterListService } from './filter-list.service';
|
||||
import { BaseFilterListService } from './base-filter-list.service';
|
||||
import { E2EImportsModule } from '../../../e2e-imports.module';
|
||||
|
||||
describe('FilterListService', () => {
|
||||
describe('BaseFilterListService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [E2EImportsModule],
|
||||
providers: [FilterListService]
|
||||
providers: [BaseFilterListService]
|
||||
});
|
||||
});
|
||||
|
||||
// TODO testing needs a BaseViewComponent
|
||||
// TODO testing needs an actual service..
|
||||
// it('should be created', inject([FilterListService], (service: FilterListService) => {
|
||||
// expect(service).toBeTruthy();
|
||||
// }));
|
@ -3,7 +3,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
import { BaseModel } from '../../shared/models/base/base-model';
|
||||
import { BaseViewModel } from '../../site/base/base-view-model';
|
||||
import { StorageService } from './storage.service';
|
||||
import { StorageService } from '../core-services/storage.service';
|
||||
|
||||
/**
|
||||
* Describes the available filters for a listView.
|
||||
@ -39,7 +39,7 @@ export interface OsFilterOption {
|
||||
* and will receive their filtered data as observable
|
||||
*/
|
||||
|
||||
export abstract class FilterListService<M extends BaseModel, V extends BaseViewModel> {
|
||||
export abstract class BaseFilterListService<M extends BaseModel, V extends BaseViewModel> {
|
||||
/**
|
||||
* stores the currently used raw data to be used for the filter
|
||||
*/
|
@ -1,13 +1,13 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SortListService } from './sort-list.service';
|
||||
import { BaseSortListService } from './base-sort-list.service';
|
||||
import { E2EImportsModule } from '../../../e2e-imports.module';
|
||||
|
||||
describe('SortListService', () => {
|
||||
describe('BaseSortListService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [E2EImportsModule],
|
||||
providers: [SortListService]
|
||||
providers: [BaseSortListService]
|
||||
});
|
||||
});
|
||||
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { BaseViewModel } from '../../site/base/base-view-model';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { StorageService } from './storage.service';
|
||||
import { StorageService } from '../core-services/storage.service';
|
||||
|
||||
/**
|
||||
* Describes the sorting columns of an associated ListView, and their state.
|
||||
@ -25,7 +25,7 @@ export interface OsSortingItem<V> {
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export abstract class SortListService<V extends BaseViewModel> {
|
||||
export abstract class BaseSortListService<V extends BaseViewModel> {
|
||||
/**
|
||||
* Observable output that submits the newly sorted data each time a sorting has been done
|
||||
*/
|
@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
|
||||
import { OpenSlidesComponent } from 'app/openslides.component';
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
import { Config } from '../../shared/models/core/config';
|
||||
import { DataStoreService } from './data-store.service';
|
||||
import { DataStoreService } from '../core-services/data-store.service';
|
||||
|
||||
/**
|
||||
* Handler for config variables.
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { OpenSlidesComponent } from 'app/openslides.component';
|
||||
import { WebsocketService } from './websocket.service';
|
||||
import { WebsocketService } from '../core-services/websocket.service';
|
||||
import { Observable, of, Subject } from 'rxjs';
|
||||
|
||||
/**
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user