diff --git a/client/package.json b/client/package.json index 404b1357c..7d63012e4 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "ng serve --proxy-config proxy.conf.json --host=0.0.0.0", + "start": "ng serve --proxy-config proxy.conf.json --host=0.0.0.0 --aot", "build": "ng build", "test": "ng test", "lint": "ng lint", diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index e5f086d33..7481f849d 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts @@ -1,30 +1,15 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; - import { LoginComponent } from './site/login/login.component'; -import { ProjectorComponent } from './projector-container/projector/projector.component'; -import { ProjectorContainerComponent } from './projector-container/projector-container.component'; -import { SiteComponent } from './site/site.component'; -import { StartComponent } from './site/start/start.component'; -import { AgendaComponent } from './site/agenda/agenda.component'; -import { MotionsComponent } from './site/motions/motions.component'; - import { AuthGuard } from './core/services/auth-guard.service'; +/** + * Global app routing + */ const routes: Routes = [ - { path: 'projector/:id', component: ProjectorComponent }, - { path: 'real-projector/:id', component: ProjectorContainerComponent }, { path: 'login', component: LoginComponent }, - { - path: '', - component: SiteComponent, - canActivate: [AuthGuard], - children: [ - { path: '', component: StartComponent }, - { path: 'agenda', component: AgendaComponent }, - { path: 'motions', component: MotionsComponent } - ] - }, + { path: 'projector', loadChildren: './projector-container/projector-container.module#ProjectorContainerModule' }, + { path: '', loadChildren: './site/site.module#SiteModule', canActivate: [AuthGuard] }, { path: '**', redirectTo: '' } ]; diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 5b5d43df2..ecddb29a0 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -1,7 +1,5 @@ import { Component, OnInit } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { AutoupdateService } from 'app/core/services/autoupdate.service'; -import { OperatorService } from 'app/core/services/operator.service'; /** * Angular's global App Component @@ -18,11 +16,7 @@ export class AppComponent { * @param autoupdate * @param translate */ - constructor( - private operator: OperatorService, - private autoupdate: AutoupdateService, - private translate: TranslateService - ) { + constructor(private translate: TranslateService) { // manually add the supported languages translate.addLangs(['en', 'de', 'fr']); // this language will be used as a fallback when a translation isn't found in the current language diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index e78c2199d..22e7c49f5 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -1,54 +1,18 @@ // angular modules -import { BrowserModule, Title } from '@angular/platform-browser'; +import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { HttpClientModule, HttpClient, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http'; +import { HttpClientModule, HttpClient, HttpClientXsrfModule } from '@angular/common/http'; -// MaterialUI modules -import { - MatButtonModule, - MatCheckboxModule, - MatToolbarModule, - MatCardModule, - MatInputModule, - MatProgressSpinnerModule, - MatSidenavModule, - MatSnackBarModule -} from '@angular/material'; -import { MatListModule } from '@angular/material/list'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { MatMenuModule } from '@angular/material/menu'; - -// FontAwesome modules -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { library } from '@fortawesome/fontawesome-svg-core'; -import { fas } from '@fortawesome/free-solid-svg-icons'; - -// App components and services -import { AppComponent } from './app.component'; -import { LoginComponent } from './site/login/login.component'; +// Elementary App Components import { AppRoutingModule } from './app-routing.module'; -import { ProjectorComponent } from './projector-container/projector/projector.component'; -import { MotionsComponent } from './site/motions/motions.component'; -import { AgendaComponent } from './site/agenda/agenda.component'; -import { SiteComponent } from './site/site.component'; -import { StartComponent } from './site/start/start.component'; -import { AddHeaderInterceptor } from './core/http-interceptor'; -import { ProjectorContainerComponent } from './projector-container/projector-container.component'; - -// Root Services -import { AuthGuard } from './core/services/auth-guard.service'; -import { AuthService } from './core/services/auth.service'; -import { AutoupdateService } from './core/services/autoupdate.service'; -import { DataStoreService } from './core/services/dataStore.service'; -import { OperatorService } from './core/services/operator.service'; -import { WebsocketService } from './core/services/websocket.service'; +import { AppComponent } from './app.component'; +import { CoreModule } from './core/core.module'; // translation module. import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { PruningTranslationLoader } from './core/pruning-loader'; -import { OsPermsDirective } from './core/directives/os-perms.directive'; +import { LoginModule } from './site/login/login.module'; /** * For the translation module. Loads a Custom 'translation loader' and provides it as loader. @@ -57,23 +21,11 @@ import { OsPermsDirective } from './core/directives/os-perms.directive'; export function HttpLoaderFactory(http: HttpClient) { return new PruningTranslationLoader(http); } - -//add font-awesome icons to library. -//will blow up the code. -library.add(fas); - +/** + * Global App Module. Keep it as clean as possible. + */ @NgModule({ - declarations: [ - AppComponent, - LoginComponent, - ProjectorComponent, - MotionsComponent, - AgendaComponent, - SiteComponent, - StartComponent, - ProjectorContainerComponent, - OsPermsDirective - ], + declarations: [AppComponent], imports: [ BrowserModule, HttpClientModule, @@ -81,20 +33,7 @@ library.add(fas); cookieName: 'OpenSlidesCsrfToken', headerName: 'X-CSRFToken' }), - FormsModule, - BrowserAnimationsModule, - MatButtonModule, - MatCheckboxModule, - MatToolbarModule, - MatCardModule, - MatInputModule, - MatProgressSpinnerModule, - MatSidenavModule, - MatListModule, - MatExpansionModule, - MatMenuModule, - MatSnackBarModule, - FontAwesomeModule, + BrowserAnimationsModule, //TODO TranslateModule.forRoot({ loader: { provide: TranslateLoader, @@ -102,21 +41,9 @@ library.add(fas); deps: [HttpClient] } }), - AppRoutingModule - ], - providers: [ - Title, - AuthGuard, - AuthService, - AutoupdateService, - DataStoreService, - OperatorService, - WebsocketService, - { - provide: HTTP_INTERCEPTORS, - useClass: AddHeaderInterceptor, - multi: true - } + AppRoutingModule, + CoreModule, + LoginModule ], bootstrap: [AppComponent] }) diff --git a/client/src/app/core/core.module.spec.ts b/client/src/app/core/core.module.spec.ts new file mode 100644 index 000000000..825067d7f --- /dev/null +++ b/client/src/app/core/core.module.spec.ts @@ -0,0 +1,13 @@ +import { CoreModule } from './core.module'; + +describe('CoreModule', () => { + let coreModule: CoreModule; + + beforeEach(() => { + coreModule = new CoreModule(parent); + }); + + it('should create an instance', () => { + expect(coreModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts new file mode 100644 index 000000000..48e5c9661 --- /dev/null +++ b/client/src/app/core/core.module.ts @@ -0,0 +1,46 @@ +import { NgModule, Optional, SkipSelf } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { Title } from '@angular/platform-browser'; +import { HTTP_INTERCEPTORS } from '@angular/common/http'; + +// 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/dataStore.service'; +import { OperatorService } from './services/operator.service'; +import { WebsocketService } from './services/websocket.service'; +import { AddHeaderInterceptor } from './http-interceptor'; + +/** Global Core Module. Contains all global (singleton) services + * + */ +@NgModule({ + imports: [CommonModule], + providers: [ + Title, + AuthGuard, + AuthService, + AutoupdateService, + DataStoreService, + OperatorService, + WebsocketService, + { + provide: HTTP_INTERCEPTORS, + useClass: AddHeaderInterceptor, + multi: true + } + ] +}) +export class CoreModule { + /** make sure CoreModule is imported only by one NgModule, the AppModule */ + constructor( + @Optional() + @SkipSelf() + parentModule: CoreModule + ) { + if (parentModule) { + throw new Error('CoreModule is already loaded. Import only in AppModule'); + } + } +} diff --git a/client/src/app/core/services/autoupdate.service.ts b/client/src/app/core/services/autoupdate.service.ts index 3e48adf0a..60d5bf363 100644 --- a/client/src/app/core/services/autoupdate.service.ts +++ b/client/src/app/core/services/autoupdate.service.ts @@ -3,24 +3,24 @@ import { Injectable } from '@angular/core'; import { OpenSlidesComponent } from 'app/openslides.component'; import { WebsocketService } from './websocket.service'; // the Models -import { Item } from 'app/core/models/agenda/item'; -import { Assignment } from 'app/core/models/assignments/assignment'; -import { ChatMessage } from 'app/core/models/core/chat-message'; -import { Config } from 'app/core/models/core/config'; -import { Countdown } from 'app/core/models/core/countdown'; -import { ProjectorMessage } from 'app/core/models/core/projector-message'; -import { Projector } from 'app/core/models/core/projector'; -import { Tag } from 'app/core/models/core/tag'; -import { Mediafile } from 'app/core/models/mediafiles/mediafile'; -import { Category } from 'app/core/models/motions/category'; -import { MotionBlock } from 'app/core/models/motions/motion-block'; -import { MotionChangeReco } from 'app/core/models/motions/motion-change-reco'; -import { Motion } from 'app/core/models/motions/motion'; -import { Workflow } from 'app/core/models/motions/workflow'; -import { Topic } from 'app/core/models/topics/topic'; -import { Group } from 'app/core/models/users/group'; -import { PersonalNote } from 'app/core/models/users/personal-note'; -import { User } from 'app/core/models/users/user'; +import { Item } from 'app/shared/models/agenda/item'; +import { Assignment } from 'app/shared/models/assignments/assignment'; +import { ChatMessage } from 'app/shared/models/core/chat-message'; +import { Config } from 'app/shared/models/core/config'; +import { Countdown } from 'app/shared/models/core/countdown'; +import { ProjectorMessage } from 'app/shared/models/core/projector-message'; +import { Projector } from 'app/shared/models/core/projector'; +import { Tag } from 'app/shared/models/core/tag'; +import { Mediafile } from 'app/shared/models/mediafiles/mediafile'; +import { Category } from 'app/shared/models/motions/category'; +import { MotionBlock } from 'app/shared/models/motions/motion-block'; +import { MotionChangeReco } from 'app/shared/models/motions/motion-change-reco'; +import { Motion } from 'app/shared/models/motions/motion'; +import { Workflow } from 'app/shared/models/motions/workflow'; +import { Topic } from 'app/shared/models/topics/topic'; +import { Group } from 'app/shared/models/users/group'; +import { PersonalNote } from 'app/shared/models/users/personal-note'; +import { User } from 'app/shared/models/users/user'; /** * Handles the initial update and automatic updates using the {@link WebsocketService} diff --git a/client/src/app/core/services/dataStore.service.ts b/client/src/app/core/services/dataStore.service.ts index 02f1bf610..3183a5be2 100644 --- a/client/src/app/core/services/dataStore.service.ts +++ b/client/src/app/core/services/dataStore.service.ts @@ -4,7 +4,7 @@ import { Observable, of, BehaviorSubject } from 'rxjs'; import { tap, map } from 'rxjs/operators'; import { ImproperlyConfiguredError } from 'app/core/exceptions'; -import { BaseModel, ModelId } from 'app/core/models/base-model'; +import { BaseModel, ModelId } from 'app/shared/models/base.model'; /** * represents a collection on the Django server, uses an ID to access a {@link BaseModel}. diff --git a/client/src/app/core/services/operator.service.ts b/client/src/app/core/services/operator.service.ts index e44c02857..9655a8b17 100644 --- a/client/src/app/core/services/operator.service.ts +++ b/client/src/app/core/services/operator.service.ts @@ -3,7 +3,7 @@ import { Observable, BehaviorSubject } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { tap, catchError, share } from 'rxjs/operators'; import { OpenSlidesComponent } from 'app/openslides.component'; -import { Group } from 'app/core/models/users/group'; +import { Group } from 'app/shared/models/users/group'; /** * The operator represents the user who is using OpenSlides. diff --git a/client/src/app/projector-container/projector-container.module.spec.ts b/client/src/app/projector-container/projector-container.module.spec.ts new file mode 100644 index 000000000..8c33ae21c --- /dev/null +++ b/client/src/app/projector-container/projector-container.module.spec.ts @@ -0,0 +1,13 @@ +import { ProjectorContainerModule } from './projector-container.module'; + +describe('ProjectorContainerModule', () => { + let projectorContainerModule: ProjectorContainerModule; + + beforeEach(() => { + projectorContainerModule = new ProjectorContainerModule(); + }); + + it('should create an instance', () => { + expect(projectorContainerModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/projector-container/projector-container.module.ts b/client/src/app/projector-container/projector-container.module.ts new file mode 100644 index 000000000..444277914 --- /dev/null +++ b/client/src/app/projector-container/projector-container.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { ProjectorContainerComponent } from './projector-container.component'; +import { SharedModule } from 'app/shared/shared.module'; +import { ProjectorComponent } from './projector/projector.component'; +import { ProjectorContainerRoutingModule } from './projector/projector-container.routing.module'; + +@NgModule({ + imports: [CommonModule, ProjectorContainerRoutingModule, SharedModule], + declarations: [ProjectorContainerComponent, ProjectorComponent] +}) +export class ProjectorContainerModule {} diff --git a/client/src/app/projector-container/projector/projector-container.routing.module.ts b/client/src/app/projector-container/projector/projector-container.routing.module.ts new file mode 100644 index 000000000..4d5148b58 --- /dev/null +++ b/client/src/app/projector-container/projector/projector-container.routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule, Component } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { ProjectorContainerComponent } from '../projector-container.component'; +import { ProjectorComponent } from './projector.component'; + +const routes: Routes = [ + { path: '', component: ProjectorContainerComponent }, + { path: 'real', component: ProjectorComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class ProjectorContainerRoutingModule {} diff --git a/client/src/app/core/directives/os-perms.directive.spec.ts b/client/src/app/shared/directives/os-perms.directive.spec.ts similarity index 100% rename from client/src/app/core/directives/os-perms.directive.spec.ts rename to client/src/app/shared/directives/os-perms.directive.spec.ts diff --git a/client/src/app/core/directives/os-perms.directive.ts b/client/src/app/shared/directives/os-perms.directive.ts similarity index 96% rename from client/src/app/core/directives/os-perms.directive.ts rename to client/src/app/shared/directives/os-perms.directive.ts index 644f8943e..c69f1bd08 100644 --- a/client/src/app/core/directives/os-perms.directive.ts +++ b/client/src/app/shared/directives/os-perms.directive.ts @@ -1,8 +1,8 @@ import { Directive, Input, ElementRef, TemplateRef, ViewContainerRef, OnInit } from '@angular/core'; import { OperatorService } from 'app/core/services/operator.service'; -import { OpenSlidesComponent } from '../../openslides.component'; -import { Group } from 'app/core/models/users/group'; +import { OpenSlidesComponent } from 'app/openslides.component'; +import { Group } from 'app/shared/models/users/group'; /** * Directive to check if the {@link OperatorService} has the correct permissions to access certain functions diff --git a/client/src/app/core/models/agenda/content-object.ts b/client/src/app/shared/models/agenda/content-object.ts similarity index 81% rename from client/src/app/core/models/agenda/content-object.ts rename to client/src/app/shared/models/agenda/content-object.ts index 5c2ce07b8..fdc890621 100644 --- a/client/src/app/core/models/agenda/content-object.ts +++ b/client/src/app/shared/models/agenda/content-object.ts @@ -1,5 +1,4 @@ -// import { Serializable } from 'app/core/models/serializable'; -import { Deserializable } from 'app/core/models/deserializable.model'; +import { Deserializable } from '../deserializable.model'; /** * Representation of the content object in agenda item diff --git a/client/src/app/core/models/agenda/item.ts b/client/src/app/shared/models/agenda/item.ts similarity index 97% rename from client/src/app/core/models/agenda/item.ts rename to client/src/app/shared/models/agenda/item.ts index ab3acfed2..a9d8204e3 100644 --- a/client/src/app/core/models/agenda/item.ts +++ b/client/src/app/shared/models/agenda/item.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; import { Speaker } from './speaker'; import { ContentObject } from './content-object'; diff --git a/client/src/app/core/models/agenda/speaker.ts b/client/src/app/shared/models/agenda/speaker.ts similarity index 94% rename from client/src/app/core/models/agenda/speaker.ts rename to client/src/app/shared/models/agenda/speaker.ts index 95ba3e370..8d59ae74b 100644 --- a/client/src/app/core/models/agenda/speaker.ts +++ b/client/src/app/shared/models/agenda/speaker.ts @@ -1,4 +1,4 @@ -import { Deserializable } from 'app/core/models/deserializable.model'; +import { Deserializable } from '../deserializable.model'; /** * Representation of a speaker in an agenda item diff --git a/client/src/app/core/models/assignments/assignment-user.ts b/client/src/app/shared/models/assignments/assignment-user.ts similarity index 100% rename from client/src/app/core/models/assignments/assignment-user.ts rename to client/src/app/shared/models/assignments/assignment-user.ts diff --git a/client/src/app/core/models/assignments/assignment.ts b/client/src/app/shared/models/assignments/assignment.ts similarity index 98% rename from client/src/app/core/models/assignments/assignment.ts rename to client/src/app/shared/models/assignments/assignment.ts index 41a953dfa..359b23f9b 100644 --- a/client/src/app/core/models/assignments/assignment.ts +++ b/client/src/app/shared/models/assignments/assignment.ts @@ -1,4 +1,4 @@ -import { BaseModel } from '../base-model'; +import { BaseModel } from '../base.model'; import { AssignmentUser } from './assignment-user'; import { Poll } from './poll'; diff --git a/client/src/app/core/models/assignments/poll-option.ts b/client/src/app/shared/models/assignments/poll-option.ts similarity index 100% rename from client/src/app/core/models/assignments/poll-option.ts rename to client/src/app/shared/models/assignments/poll-option.ts diff --git a/client/src/app/core/models/assignments/poll.ts b/client/src/app/shared/models/assignments/poll.ts similarity index 100% rename from client/src/app/core/models/assignments/poll.ts rename to client/src/app/shared/models/assignments/poll.ts diff --git a/client/src/app/core/models/base-model.ts b/client/src/app/shared/models/base.model.ts similarity index 100% rename from client/src/app/core/models/base-model.ts rename to client/src/app/shared/models/base.model.ts diff --git a/client/src/app/core/models/core/chat-message.ts b/client/src/app/shared/models/core/chat-message.ts similarity index 93% rename from client/src/app/core/models/core/chat-message.ts rename to client/src/app/shared/models/core/chat-message.ts index ed021c877..46a97e0c7 100644 --- a/client/src/app/core/models/core/chat-message.ts +++ b/client/src/app/shared/models/core/chat-message.ts @@ -1,4 +1,4 @@ -import { BaseModel } from '../base-model'; +import { BaseModel } from '../base.model'; /** * Representation of chat messages. diff --git a/client/src/app/core/models/core/config.ts b/client/src/app/shared/models/core/config.ts similarity index 90% rename from client/src/app/core/models/core/config.ts rename to client/src/app/shared/models/core/config.ts index bb16e38f2..a18dad19f 100644 --- a/client/src/app/core/models/core/config.ts +++ b/client/src/app/shared/models/core/config.ts @@ -1,4 +1,4 @@ -import { BaseModel } from '../base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a config variable diff --git a/client/src/app/core/models/core/countdown.ts b/client/src/app/shared/models/core/countdown.ts similarity index 91% rename from client/src/app/core/models/core/countdown.ts rename to client/src/app/shared/models/core/countdown.ts index 15e1104d5..026b6bc0a 100644 --- a/client/src/app/core/models/core/countdown.ts +++ b/client/src/app/shared/models/core/countdown.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a countdown diff --git a/client/src/app/core/models/core/projector-message.ts b/client/src/app/shared/models/core/projector-message.ts similarity index 87% rename from client/src/app/core/models/core/projector-message.ts rename to client/src/app/shared/models/core/projector-message.ts index bf59ce9d5..1b51aca55 100644 --- a/client/src/app/core/models/core/projector-message.ts +++ b/client/src/app/shared/models/core/projector-message.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a projector message. diff --git a/client/src/app/core/models/core/projector.ts b/client/src/app/shared/models/core/projector.ts similarity index 94% rename from client/src/app/core/models/core/projector.ts rename to client/src/app/shared/models/core/projector.ts index e18feb9aa..79902c39b 100644 --- a/client/src/app/core/models/core/projector.ts +++ b/client/src/app/shared/models/core/projector.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a projector. Has the nested property "projectiondefaults" diff --git a/client/src/app/core/models/core/tag.ts b/client/src/app/shared/models/core/tag.ts similarity index 85% rename from client/src/app/core/models/core/tag.ts rename to client/src/app/shared/models/core/tag.ts index 8afd99ba0..1aee65108 100644 --- a/client/src/app/core/models/core/tag.ts +++ b/client/src/app/shared/models/core/tag.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a tag. diff --git a/client/src/app/core/models/deserializable.model.ts b/client/src/app/shared/models/deserializable.model.ts similarity index 100% rename from client/src/app/core/models/deserializable.model.ts rename to client/src/app/shared/models/deserializable.model.ts diff --git a/client/src/app/core/models/mediafiles/file.ts b/client/src/app/shared/models/mediafiles/file.ts similarity index 100% rename from client/src/app/core/models/mediafiles/file.ts rename to client/src/app/shared/models/mediafiles/file.ts diff --git a/client/src/app/core/models/mediafiles/mediafile.ts b/client/src/app/shared/models/mediafiles/mediafile.ts similarity index 95% rename from client/src/app/core/models/mediafiles/mediafile.ts rename to client/src/app/shared/models/mediafiles/mediafile.ts index 11565357e..082477154 100644 --- a/client/src/app/core/models/mediafiles/mediafile.ts +++ b/client/src/app/shared/models/mediafiles/mediafile.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; import { File } from './file'; /** diff --git a/client/src/app/core/models/motions/category.ts b/client/src/app/shared/models/motions/category.ts similarity index 88% rename from client/src/app/core/models/motions/category.ts rename to client/src/app/shared/models/motions/category.ts index 6f1a5f85b..529f6053f 100644 --- a/client/src/app/core/models/motions/category.ts +++ b/client/src/app/shared/models/motions/category.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a motion category. Has the nested property "File" diff --git a/client/src/app/core/models/motions/motion-block.ts b/client/src/app/shared/models/motions/motion-block.ts similarity index 91% rename from client/src/app/core/models/motions/motion-block.ts rename to client/src/app/shared/models/motions/motion-block.ts index b65c88037..13261b9d0 100644 --- a/client/src/app/core/models/motions/motion-block.ts +++ b/client/src/app/shared/models/motions/motion-block.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a motion block. diff --git a/client/src/app/core/models/motions/motion-change-reco.ts b/client/src/app/shared/models/motions/motion-change-reco.ts similarity index 95% rename from client/src/app/core/models/motions/motion-change-reco.ts rename to client/src/app/shared/models/motions/motion-change-reco.ts index 246e77461..41a694003 100644 --- a/client/src/app/core/models/motions/motion-change-reco.ts +++ b/client/src/app/shared/models/motions/motion-change-reco.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a motion change recommendation. diff --git a/client/src/app/core/models/motions/motion.ts b/client/src/app/shared/models/motions/motion.ts similarity index 97% rename from client/src/app/core/models/motions/motion.ts rename to client/src/app/shared/models/motions/motion.ts index 0b57a9a6b..ec910af07 100644 --- a/client/src/app/core/models/motions/motion.ts +++ b/client/src/app/shared/models/motions/motion.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of Motion. diff --git a/client/src/app/core/models/motions/workflow-state.ts b/client/src/app/shared/models/motions/workflow-state.ts similarity index 100% rename from client/src/app/core/models/motions/workflow-state.ts rename to client/src/app/shared/models/motions/workflow-state.ts diff --git a/client/src/app/core/models/motions/workflow.ts b/client/src/app/shared/models/motions/workflow.ts similarity index 94% rename from client/src/app/core/models/motions/workflow.ts rename to client/src/app/shared/models/motions/workflow.ts index 67d736e50..c26cfe179 100644 --- a/client/src/app/core/models/motions/workflow.ts +++ b/client/src/app/shared/models/motions/workflow.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; import { WorkflowState } from './workflow-state'; /** diff --git a/client/src/app/core/models/topics/topic.ts b/client/src/app/shared/models/topics/topic.ts similarity index 93% rename from client/src/app/core/models/topics/topic.ts rename to client/src/app/shared/models/topics/topic.ts index 8233b51ea..50570bf6e 100644 --- a/client/src/app/core/models/topics/topic.ts +++ b/client/src/app/shared/models/topics/topic.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a topic. diff --git a/client/src/app/core/models/users/group.ts b/client/src/app/shared/models/users/group.ts similarity index 88% rename from client/src/app/core/models/users/group.ts rename to client/src/app/shared/models/users/group.ts index b472209a8..98e9bd8d0 100644 --- a/client/src/app/core/models/users/group.ts +++ b/client/src/app/shared/models/users/group.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of user group. diff --git a/client/src/app/core/models/users/personal-note.ts b/client/src/app/shared/models/users/personal-note.ts similarity index 90% rename from client/src/app/core/models/users/personal-note.ts rename to client/src/app/shared/models/users/personal-note.ts index 6995feb56..bbbb83300 100644 --- a/client/src/app/core/models/users/personal-note.ts +++ b/client/src/app/shared/models/users/personal-note.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of users personal note. diff --git a/client/src/app/core/models/users/user.ts b/client/src/app/shared/models/users/user.ts similarity index 96% rename from client/src/app/core/models/users/user.ts rename to client/src/app/shared/models/users/user.ts index 426bd215d..31240e015 100644 --- a/client/src/app/core/models/users/user.ts +++ b/client/src/app/shared/models/users/user.ts @@ -1,4 +1,4 @@ -import { BaseModel } from 'app/core/models/base-model'; +import { BaseModel } from '../base.model'; /** * Representation of a user in contrast to the operator. diff --git a/client/src/app/shared/shared.module.spec.ts b/client/src/app/shared/shared.module.spec.ts new file mode 100644 index 000000000..471db0a9d --- /dev/null +++ b/client/src/app/shared/shared.module.spec.ts @@ -0,0 +1,13 @@ +import { SharedModule } from './shared.module'; + +describe('SharedModule', () => { + let sharedModule: SharedModule; + + beforeEach(() => { + sharedModule = new SharedModule(); + }); + + it('should create an instance', () => { + expect(sharedModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts new file mode 100644 index 000000000..afdba7331 --- /dev/null +++ b/client/src/app/shared/shared.module.ts @@ -0,0 +1,78 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +// MaterialUI modules +import { + MatButtonModule, + MatCheckboxModule, + MatToolbarModule, + MatCardModule, + MatInputModule, + MatProgressSpinnerModule, + MatSidenavModule, + MatSnackBarModule +} from '@angular/material'; +import { MatListModule } from '@angular/material/list'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatMenuModule } from '@angular/material/menu'; + +// FontAwesome modules +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { library } from '@fortawesome/fontawesome-svg-core'; +import { fas } from '@fortawesome/free-solid-svg-icons'; + +// ngx-translate +import { TranslateModule } from '@ngx-translate/core'; + +// directives +import { OsPermsDirective } from './directives/os-perms.directive'; + +library.add(fas); + +/** + * Share Module for all "dumb" components and pipes. + * + * These components don not import and inject services from core or other features + * in their constructors. + * + * Should receive all data though attributes in the template of the component using them. + * No dependency to the rest of our application. + */ +@NgModule({ + imports: [ + CommonModule, + FormsModule, + MatButtonModule, + MatCheckboxModule, + MatToolbarModule, + MatCardModule, + MatInputModule, + MatProgressSpinnerModule, + MatSidenavModule, + MatListModule, + MatExpansionModule, + MatMenuModule, + MatSnackBarModule, + FontAwesomeModule + ], + exports: [ + FormsModule, + MatButtonModule, + MatCheckboxModule, + MatToolbarModule, + MatCardModule, + MatInputModule, + MatProgressSpinnerModule, + MatSidenavModule, + MatListModule, + MatExpansionModule, + MatMenuModule, + MatSnackBarModule, + FontAwesomeModule, + TranslateModule, + OsPermsDirective + ], + declarations: [OsPermsDirective] +}) +export class SharedModule {} diff --git a/client/src/app/site/agenda/agenda.component.css b/client/src/app/site/agenda/agenda-list/agenda-list.component.css similarity index 100% rename from client/src/app/site/agenda/agenda.component.css rename to client/src/app/site/agenda/agenda-list/agenda-list.component.css diff --git a/client/src/app/site/agenda/agenda.component.html b/client/src/app/site/agenda/agenda-list/agenda-list.component.html similarity index 89% rename from client/src/app/site/agenda/agenda.component.html rename to client/src/app/site/agenda/agenda-list/agenda-list.component.html index cc8d3a64b..216353a0f 100644 --- a/client/src/app/site/agenda/agenda.component.html +++ b/client/src/app/site/agenda/agenda-list/agenda-list.component.html @@ -8,7 +8,7 @@ - @@ -24,4 +24,4 @@
Only permitted users should see this
- + \ No newline at end of file diff --git a/client/src/app/site/motions/motions.component.spec.ts b/client/src/app/site/agenda/agenda-list/agenda-list.component.spec.ts similarity index 55% rename from client/src/app/site/motions/motions.component.spec.ts rename to client/src/app/site/agenda/agenda-list/agenda-list.component.spec.ts index f72a43864..414e6722e 100644 --- a/client/src/app/site/motions/motions.component.spec.ts +++ b/client/src/app/site/agenda/agenda-list/agenda-list.component.spec.ts @@ -1,19 +1,19 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { MotionsComponent } from './motions.component'; +import { AgendaListComponent } from './agenda-list.component'; -describe('MotionsComponent', () => { - let component: MotionsComponent; - let fixture: ComponentFixture; +describe('AgendaListComponent', () => { + let component: AgendaListComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [MotionsComponent] + declarations: [AgendaListComponent] }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(MotionsComponent); + fixture = TestBed.createComponent(AgendaListComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/client/src/app/site/agenda/agenda.component.ts b/client/src/app/site/agenda/agenda-list/agenda-list.component.ts similarity index 53% rename from client/src/app/site/agenda/agenda.component.ts rename to client/src/app/site/agenda/agenda-list/agenda-list.component.ts index 47dbe594b..75ea40afc 100644 --- a/client/src/app/site/agenda/agenda.component.ts +++ b/client/src/app/site/agenda/agenda-list/agenda-list.component.ts @@ -3,11 +3,11 @@ import { Title } from '@angular/platform-browser'; import { BaseComponent } from 'app/base.component'; @Component({ - selector: 'app-agenda', - templateUrl: './agenda.component.html', - styleUrls: ['./agenda.component.css'] + selector: 'app-agenda-list', + templateUrl: './agenda-list.component.html', + styleUrls: ['./agenda-list.component.css'] }) -export class AgendaComponent extends BaseComponent implements OnInit { +export class AgendaListComponent extends BaseComponent implements OnInit { constructor(titleService: Title) { super(titleService); } @@ -16,4 +16,8 @@ export class AgendaComponent extends BaseComponent implements OnInit { //TODO translate super.setTitle('Agenda'); } + + downloadAgendaButton() { + console.log('Clock Download Button'); + } } diff --git a/client/src/app/site/agenda/agenda-routing.module.ts b/client/src/app/site/agenda/agenda-routing.module.ts new file mode 100644 index 000000000..92d540953 --- /dev/null +++ b/client/src/app/site/agenda/agenda-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { AgendaListComponent } from './agenda-list/agenda-list.component'; + +const routes: Routes = [{ path: '', component: AgendaListComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class AgendaRoutingModule {} diff --git a/client/src/app/site/agenda/agenda.module.spec.ts b/client/src/app/site/agenda/agenda.module.spec.ts new file mode 100644 index 000000000..f183764e4 --- /dev/null +++ b/client/src/app/site/agenda/agenda.module.spec.ts @@ -0,0 +1,13 @@ +import { AgendaModule } from './agenda.module'; + +describe('AgendaModule', () => { + let agendaModule: AgendaModule; + + beforeEach(() => { + agendaModule = new AgendaModule(); + }); + + it('should create an instance', () => { + expect(agendaModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/agenda/agenda.module.ts b/client/src/app/site/agenda/agenda.module.ts new file mode 100644 index 000000000..723439c93 --- /dev/null +++ b/client/src/app/site/agenda/agenda.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { AgendaRoutingModule } from './agenda-routing.module'; +import { SharedModule } from '../../shared/shared.module'; +import { AgendaListComponent } from './agenda-list/agenda-list.component'; + +@NgModule({ + imports: [CommonModule, AgendaRoutingModule, SharedModule], + declarations: [AgendaListComponent] +}) +export class AgendaModule {} diff --git a/client/src/app/site/motions/motions.component.css b/client/src/app/site/assignments/assignment-list/assignment-list.component.css similarity index 100% rename from client/src/app/site/motions/motions.component.css rename to client/src/app/site/assignments/assignment-list/assignment-list.component.css diff --git a/client/src/app/site/assignments/assignment-list/assignment-list.component.html b/client/src/app/site/assignments/assignment-list/assignment-list.component.html new file mode 100644 index 000000000..e5e8fb045 --- /dev/null +++ b/client/src/app/site/assignments/assignment-list/assignment-list.component.html @@ -0,0 +1,3 @@ +

+ assignment-list works! +

diff --git a/client/src/app/site/assignments/assignment-list/assignment-list.component.spec.ts b/client/src/app/site/assignments/assignment-list/assignment-list.component.spec.ts new file mode 100644 index 000000000..d750fef2c --- /dev/null +++ b/client/src/app/site/assignments/assignment-list/assignment-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AssignmentListComponent } from './assignment-list.component'; + +describe('AssignmentListComponent', () => { + let component: AssignmentListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AssignmentListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AssignmentListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/assignments/assignment-list/assignment-list.component.ts b/client/src/app/site/assignments/assignment-list/assignment-list.component.ts new file mode 100644 index 000000000..86e8ea3fd --- /dev/null +++ b/client/src/app/site/assignments/assignment-list/assignment-list.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-assignment-list', + templateUrl: './assignment-list.component.html', + styleUrls: ['./assignment-list.component.css'] +}) +export class AssignmentListComponent implements OnInit { + constructor() {} + + ngOnInit() {} +} diff --git a/client/src/app/site/assignments/assignments-routing.module.ts b/client/src/app/site/assignments/assignments-routing.module.ts new file mode 100644 index 000000000..9aef9d8a6 --- /dev/null +++ b/client/src/app/site/assignments/assignments-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { AssignmentListComponent } from './assignment-list/assignment-list.component'; + +const routes: Routes = [{ path: '', component: AssignmentListComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class AssignmentsRoutingModule {} diff --git a/client/src/app/site/assignments/assignments.module.spec.ts b/client/src/app/site/assignments/assignments.module.spec.ts new file mode 100644 index 000000000..1fa6d47df --- /dev/null +++ b/client/src/app/site/assignments/assignments.module.spec.ts @@ -0,0 +1,13 @@ +import { AssignmentsModule } from './assignments.module'; + +describe('AssignmentsModule', () => { + let assignmentsModule: AssignmentsModule; + + beforeEach(() => { + assignmentsModule = new AssignmentsModule(); + }); + + it('should create an instance', () => { + expect(assignmentsModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/assignments/assignments.module.ts b/client/src/app/site/assignments/assignments.module.ts new file mode 100644 index 000000000..4b3f4751f --- /dev/null +++ b/client/src/app/site/assignments/assignments.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { AssignmentsRoutingModule } from './assignments-routing.module'; +import { SharedModule } from '../../shared/shared.module'; +import { AssignmentListComponent } from './assignment-list/assignment-list.component'; + +@NgModule({ + imports: [CommonModule, AssignmentsRoutingModule, SharedModule], + declarations: [AssignmentListComponent] +}) +export class AssignmentsModule {} diff --git a/client/src/app/site/login/login.component.html b/client/src/app/site/login/login.component.html index 1ee56e81d..ed2658763 100644 --- a/client/src/app/site/login/login.component.html +++ b/client/src/app/site/login/login.component.html @@ -1,29 +1,29 @@ + + OpenSides 3 - Login + + + + + + + + + \ No newline at end of file diff --git a/client/src/app/site/login/login.module.spec.ts b/client/src/app/site/login/login.module.spec.ts new file mode 100644 index 000000000..abd766545 --- /dev/null +++ b/client/src/app/site/login/login.module.spec.ts @@ -0,0 +1,13 @@ +import { LoginModule } from './login.module'; + +describe('LoginModule', () => { + let loginModule: LoginModule; + + beforeEach(() => { + loginModule = new LoginModule(); + }); + + it('should create an instance', () => { + expect(loginModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/login/login.module.ts b/client/src/app/site/login/login.module.ts new file mode 100644 index 000000000..6abe6295c --- /dev/null +++ b/client/src/app/site/login/login.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { LoginComponent } from './login.component'; +import { SharedModule } from '../../shared/shared.module'; + +@NgModule({ + imports: [CommonModule, SharedModule], + declarations: [LoginComponent] +}) +export class LoginModule {} diff --git a/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.css b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.html b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.html new file mode 100644 index 000000000..cace13f49 --- /dev/null +++ b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.html @@ -0,0 +1,3 @@ +

+ mediafile-list works! +

diff --git a/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.spec.ts b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.spec.ts new file mode 100644 index 000000000..16975b598 --- /dev/null +++ b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MediafileListComponent } from './mediafile-list.component'; + +describe('MediafileListComponent', () => { + let component: MediafileListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [MediafileListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MediafileListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.ts b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.ts new file mode 100644 index 000000000..e73d86e7c --- /dev/null +++ b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-mediafile-list', + templateUrl: './mediafile-list.component.html', + styleUrls: ['./mediafile-list.component.css'] +}) +export class MediafileListComponent implements OnInit { + constructor() {} + + ngOnInit() {} +} diff --git a/client/src/app/site/mediafiles/mediafiles-routing.module.ts b/client/src/app/site/mediafiles/mediafiles-routing.module.ts new file mode 100644 index 000000000..e400c56f5 --- /dev/null +++ b/client/src/app/site/mediafiles/mediafiles-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule, Component } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { MediafileListComponent } from './mediafile-list/mediafile-list.component'; + +const routes: Routes = [{ path: '', component: MediafileListComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class MediafilesRoutingModule {} diff --git a/client/src/app/site/mediafiles/mediafiles.module.spec.ts b/client/src/app/site/mediafiles/mediafiles.module.spec.ts new file mode 100644 index 000000000..80c559f7f --- /dev/null +++ b/client/src/app/site/mediafiles/mediafiles.module.spec.ts @@ -0,0 +1,13 @@ +import { MediafilesModule } from './mediafiles.module'; + +describe('MediafilesModule', () => { + let mediafilesModule: MediafilesModule; + + beforeEach(() => { + mediafilesModule = new MediafilesModule(); + }); + + it('should create an instance', () => { + expect(mediafilesModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/mediafiles/mediafiles.module.ts b/client/src/app/site/mediafiles/mediafiles.module.ts new file mode 100644 index 000000000..cb645cf69 --- /dev/null +++ b/client/src/app/site/mediafiles/mediafiles.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { MediafilesRoutingModule } from './mediafiles-routing.module'; +import { SharedModule } from '../../shared/shared.module'; +import { MediafileListComponent } from './mediafile-list/mediafile-list.component'; + +@NgModule({ + imports: [CommonModule, MediafilesRoutingModule, SharedModule], + declarations: [MediafileListComponent] +}) +export class MediafilesModule {} diff --git a/client/src/app/site/motions/motion-list/motion-list.component.css b/client/src/app/site/motions/motion-list/motion-list.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/client/src/app/site/motions/motions.component.html b/client/src/app/site/motions/motion-list/motion-list.component.html similarity index 85% rename from client/src/app/site/motions/motions.component.html rename to client/src/app/site/motions/motion-list/motion-list.component.html index c1de00957..278778eeb 100644 --- a/client/src/app/site/motions/motions.component.html +++ b/client/src/app/site/motions/motion-list/motion-list.component.html @@ -9,7 +9,7 @@ - diff --git a/client/src/app/site/motions/motion-list/motion-list.component.spec.ts b/client/src/app/site/motions/motion-list/motion-list.component.spec.ts new file mode 100644 index 000000000..368685d3c --- /dev/null +++ b/client/src/app/site/motions/motion-list/motion-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MotionListComponent } from './motion-list.component'; + +describe('MotionListComponent', () => { + let component: MotionListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [MotionListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MotionListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/motions/motions.component.ts b/client/src/app/site/motions/motion-list/motion-list.component.ts similarity index 51% rename from client/src/app/site/motions/motions.component.ts rename to client/src/app/site/motions/motion-list/motion-list.component.ts index 1f4861f4d..7eada3d5d 100644 --- a/client/src/app/site/motions/motions.component.ts +++ b/client/src/app/site/motions/motion-list/motion-list.component.ts @@ -3,11 +3,11 @@ import { Title } from '@angular/platform-browser'; import { BaseComponent } from 'app/base.component'; @Component({ - selector: 'app-motions', - templateUrl: './motions.component.html', - styleUrls: ['./motions.component.css'] + selector: 'app-motion-list', + templateUrl: './motion-list.component.html', + styleUrls: ['./motion-list.component.css'] }) -export class MotionsComponent extends BaseComponent implements OnInit { +export class MotionListComponent extends BaseComponent implements OnInit { constructor(titleService: Title) { super(titleService); } @@ -15,4 +15,8 @@ export class MotionsComponent extends BaseComponent implements OnInit { ngOnInit() { super.setTitle('Motions'); } + + downloadMotionsButton() { + console.log('Download Motions Button'); + } } diff --git a/client/src/app/site/motions/motions-routing.module.ts b/client/src/app/site/motions/motions-routing.module.ts new file mode 100644 index 000000000..1f851c308 --- /dev/null +++ b/client/src/app/site/motions/motions-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { MotionListComponent } from './motion-list/motion-list.component'; + +const routes: Routes = [{ path: '', component: MotionListComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class MotionsRoutingModule {} diff --git a/client/src/app/site/motions/motions.module.spec.ts b/client/src/app/site/motions/motions.module.spec.ts new file mode 100644 index 000000000..90e65b249 --- /dev/null +++ b/client/src/app/site/motions/motions.module.spec.ts @@ -0,0 +1,13 @@ +import { MotionsModule } from './motions.module'; + +describe('MotionsModule', () => { + let motionsModule: MotionsModule; + + beforeEach(() => { + motionsModule = new MotionsModule(); + }); + + it('should create an instance', () => { + expect(motionsModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/motions/motions.module.ts b/client/src/app/site/motions/motions.module.ts new file mode 100644 index 000000000..4a21934d6 --- /dev/null +++ b/client/src/app/site/motions/motions.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { MotionsRoutingModule } from './motions-routing.module'; +import { SharedModule } from '../../shared/shared.module'; +import { MotionListComponent } from './motion-list/motion-list.component'; + +@NgModule({ + imports: [CommonModule, MotionsRoutingModule, SharedModule], + declarations: [MotionListComponent] +}) +export class MotionsModule {} diff --git a/client/src/app/site/settings/settings-list/settings-list.component.css b/client/src/app/site/settings/settings-list/settings-list.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/client/src/app/site/settings/settings-list/settings-list.component.html b/client/src/app/site/settings/settings-list/settings-list.component.html new file mode 100644 index 000000000..20e005b5d --- /dev/null +++ b/client/src/app/site/settings/settings-list/settings-list.component.html @@ -0,0 +1,3 @@ +

+ settings-list works! +

diff --git a/client/src/app/site/settings/settings-list/settings-list.component.spec.ts b/client/src/app/site/settings/settings-list/settings-list.component.spec.ts new file mode 100644 index 000000000..279e70968 --- /dev/null +++ b/client/src/app/site/settings/settings-list/settings-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SettingsListComponent } from './settings-list.component'; + +describe('SettingsListComponent', () => { + let component: SettingsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SettingsListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SettingsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/settings/settings-list/settings-list.component.ts b/client/src/app/site/settings/settings-list/settings-list.component.ts new file mode 100644 index 000000000..b54e437ae --- /dev/null +++ b/client/src/app/site/settings/settings-list/settings-list.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-settings-list', + templateUrl: './settings-list.component.html', + styleUrls: ['./settings-list.component.css'] +}) +export class SettingsListComponent implements OnInit { + constructor() {} + + ngOnInit() {} +} diff --git a/client/src/app/site/settings/settings-routing.module.ts b/client/src/app/site/settings/settings-routing.module.ts new file mode 100644 index 000000000..f90d7c927 --- /dev/null +++ b/client/src/app/site/settings/settings-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { SettingsListComponent } from './settings-list/settings-list.component'; + +const routes: Routes = [{ path: '', component: SettingsListComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class SettingsRoutingModule {} diff --git a/client/src/app/site/settings/settings.module.spec.ts b/client/src/app/site/settings/settings.module.spec.ts new file mode 100644 index 000000000..70c27cf6d --- /dev/null +++ b/client/src/app/site/settings/settings.module.spec.ts @@ -0,0 +1,13 @@ +import { SettingsModule } from './settings.module'; + +describe('SettingsModule', () => { + let settingsModule: SettingsModule; + + beforeEach(() => { + settingsModule = new SettingsModule(); + }); + + it('should create an instance', () => { + expect(settingsModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/settings/settings.module.ts b/client/src/app/site/settings/settings.module.ts new file mode 100644 index 000000000..38027d5be --- /dev/null +++ b/client/src/app/site/settings/settings.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { SharedModule } from '../../shared/shared.module'; +import { SettingsRoutingModule } from './settings-routing.module'; +import { SettingsListComponent } from './settings-list/settings-list.component'; + +@NgModule({ + imports: [CommonModule, SettingsRoutingModule, SharedModule], + declarations: [SettingsListComponent] +}) +export class SettingsModule {} diff --git a/client/src/app/site/site-routing.module.ts b/client/src/app/site/site-routing.module.ts new file mode 100644 index 000000000..5833a55f9 --- /dev/null +++ b/client/src/app/site/site-routing.module.ts @@ -0,0 +1,35 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { SiteComponent } from './site.component'; + +import { StartComponent } from './start/start.component'; +// import { LoginComponent } from './login/login.component'; + +/** + * Routung to all OpenSlides apps + * + * TODO: Plugins will have to append to the Routes-Array + */ +const routes: Routes = [ + // { path: 'login', component: LoginComponent }, + { + path: '', + component: SiteComponent, + children: [ + { path: '', component: StartComponent }, + { path: 'agenda', loadChildren: './agenda/agenda.module#AgendaModule' }, + { path: 'assignments', loadChildren: './assignments/assignments.module#AssignmentsModule' }, + { path: 'mediafiles', loadChildren: './mediafiles/mediafiles.module#MediafilesModule' }, + { path: 'motions', loadChildren: './motions/motions.module#MotionsModule' }, + { path: 'settings', loadChildren: './settings/settings.module#SettingsModule' }, + { path: 'users', loadChildren: './users/users.module#UsersModule' } + ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class SiteRoutingModule {} diff --git a/client/src/app/site/site.component.html b/client/src/app/site/site.component.html index 7aab83d7c..e0c9cc706 100644 --- a/client/src/app/site/site.component.html +++ b/client/src/app/site/site.component.html @@ -21,18 +21,34 @@ - + Home - + Agenda - + Motions + + + Assignments + + + + Participants + + + + Files + + + + Settings + diff --git a/client/src/app/site/site.component.ts b/client/src/app/site/site.component.ts index 0ef0e9889..2c2aecad4 100644 --- a/client/src/app/site/site.component.ts +++ b/client/src/app/site/site.component.ts @@ -5,8 +5,6 @@ import { BreakpointObserver, Breakpoints, BreakpointState } from '@angular/cdk/l import { AuthService } from 'app/core/services/auth.service'; import { AutoupdateService } from 'app/core/services/autoupdate.service'; import { OperatorService } from 'app/core/services/operator.service'; -import { Subject } from 'rxjs'; -import { tap } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; //showcase import { BaseComponent } from 'app/base.component'; diff --git a/client/src/app/site/site.module.spec.ts b/client/src/app/site/site.module.spec.ts new file mode 100644 index 000000000..94f6f47d9 --- /dev/null +++ b/client/src/app/site/site.module.spec.ts @@ -0,0 +1,13 @@ +import { SiteModule } from './site.module'; + +describe('SiteModule', () => { + let siteModule: SiteModule; + + beforeEach(() => { + siteModule = new SiteModule(); + }); + + it('should create an instance', () => { + expect(siteModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/site.module.ts b/client/src/app/site/site.module.ts new file mode 100644 index 000000000..01be6fafa --- /dev/null +++ b/client/src/app/site/site.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { SiteRoutingModule } from './site-routing.module'; +import { SharedModule } from 'app/shared/shared.module'; +import { TranslateModule } from '@ngx-translate/core'; + +import { SiteComponent } from './site.component'; +import { StartComponent } from './start/start.component'; + +@NgModule({ + imports: [CommonModule, SharedModule, SiteRoutingModule, TranslateModule.forChild()], + declarations: [SiteComponent, StartComponent] +}) +export class SiteModule {} diff --git a/client/src/app/site/start/start.component.ts b/client/src/app/site/start/start.component.ts index 3df840fac..bf35b97a7 100644 --- a/client/src/app/site/start/start.component.ts +++ b/client/src/app/site/start/start.component.ts @@ -6,8 +6,7 @@ import { TranslateService } from '@ngx-translate/core'; //showcase // for testing the DS and BaseModel import { OperatorService } from 'app/core/services/operator.service'; -import { User } from 'app/core/models/users/user'; -import { Group } from 'app/core/models/users/group'; +import { User } from 'app/shared/models/users/user'; @Component({ selector: 'app-start', diff --git a/client/src/app/site/users/user-list/user-list.component.css b/client/src/app/site/users/user-list/user-list.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/client/src/app/site/users/user-list/user-list.component.html b/client/src/app/site/users/user-list/user-list.component.html new file mode 100644 index 000000000..fea7a8dcc --- /dev/null +++ b/client/src/app/site/users/user-list/user-list.component.html @@ -0,0 +1,3 @@ +

+ user-list works! +

diff --git a/client/src/app/site/agenda/agenda.component.spec.ts b/client/src/app/site/users/user-list/user-list.component.spec.ts similarity index 56% rename from client/src/app/site/agenda/agenda.component.spec.ts rename to client/src/app/site/users/user-list/user-list.component.spec.ts index 259cb1312..1cfa35f1b 100644 --- a/client/src/app/site/agenda/agenda.component.spec.ts +++ b/client/src/app/site/users/user-list/user-list.component.spec.ts @@ -1,19 +1,19 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { AgendaComponent } from './agenda.component'; +import { UserListComponent } from './user-list.component'; -describe('AgendaComponent', () => { - let component: AgendaComponent; - let fixture: ComponentFixture; +describe('UserListComponent', () => { + let component: UserListComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [AgendaComponent] + declarations: [UserListComponent] }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(AgendaComponent); + fixture = TestBed.createComponent(UserListComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/client/src/app/site/users/user-list/user-list.component.ts b/client/src/app/site/users/user-list/user-list.component.ts new file mode 100644 index 000000000..acde5c7c3 --- /dev/null +++ b/client/src/app/site/users/user-list/user-list.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-user-list', + templateUrl: './user-list.component.html', + styleUrls: ['./user-list.component.css'] +}) +export class UserListComponent implements OnInit { + constructor() {} + + ngOnInit() {} +} diff --git a/client/src/app/site/users/users-routing.module.ts b/client/src/app/site/users/users-routing.module.ts new file mode 100644 index 000000000..a7a2ad989 --- /dev/null +++ b/client/src/app/site/users/users-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { UserListComponent } from './user-list/user-list.component'; + +const routes: Routes = [{ path: '', component: UserListComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class UsersRoutingModule {} diff --git a/client/src/app/site/users/users.module.spec.ts b/client/src/app/site/users/users.module.spec.ts new file mode 100644 index 000000000..a187e5f83 --- /dev/null +++ b/client/src/app/site/users/users.module.spec.ts @@ -0,0 +1,13 @@ +import { UsersModule } from './users.module'; + +describe('UsersModule', () => { + let usersModule: UsersModule; + + beforeEach(() => { + usersModule = new UsersModule(); + }); + + it('should create an instance', () => { + expect(usersModule).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/users/users.module.ts b/client/src/app/site/users/users.module.ts new file mode 100644 index 000000000..fd25bf9d2 --- /dev/null +++ b/client/src/app/site/users/users.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { UsersRoutingModule } from './users-routing.module'; +import { SharedModule } from '../../shared/shared.module'; +import { UserListComponent } from './user-list/user-list.component'; + +@NgModule({ + imports: [CommonModule, UsersRoutingModule, SharedModule], + declarations: [UserListComponent] +}) +export class UsersModule {}