Commit 8884d87f authored by Christopher Mark Fullarton's avatar Christopher Mark Fullarton
Browse files

Migrates db and tries to apply ivy

parent 5b76c53c
......@@ -26,6 +26,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"extractCss": true,
"outputPath": "dist/browser",
"index": "src/index.html",
......@@ -43,6 +44,7 @@
"src/assets/imageDerivates.json",
"src/assets/themeData.json",
"src/assets/piwik/piwik.js",
"src/assets/dbmigrate.html",
{
"glob": "robots.txt",
"input": "src/assets",
......
......@@ -46,6 +46,7 @@
},
"private": true,
"dependencies": {
"@angular-devkit/build-angular": "~0.800.0-beta.7",
"@angular/animations": "^8.2.13",
"@angular/common": "^8.2.13",
"@angular/compiler": "^8.2.13",
......@@ -71,6 +72,7 @@
"bootstrap": "^4.3.1",
"classlist.js": "^1.1.20150312",
"cors": "^2.8.5",
"dexie": "^2.0.4",
"highlight.js": "^9.16.2",
"marked": "git+https://github.com/trayhem/marked.git",
"messageformat": "^2.3.0",
......@@ -85,18 +87,15 @@
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.0",
"@angular/cli": "^8.3.17",
"@angular/compiler-cli": "^8.2.13",
"@angular/language-service": "^8.2.13",
"@types/intro.js": "^2.4.5",
"@types/jasmine": "^3.3.16",
"@types/jasminewd2": "^2.0.8",
"@types/modernizr": "^3.5.3",
"@types/node": "^10.17.3",
"@types/webpack": "^4.39.8",
"angular-http-server": "^1.9.0",
"arsnova-click-v2-types": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git",
"chrome-launcher": "^0.10.7",
"chrome-remote-interface": "^0.27.2",
"codelyzer": "^5.2.0",
......
......@@ -13,7 +13,6 @@ import { QuizMockService } from '../../service/quiz/quiz-mock.service';
import { QuizService } from '../../service/quiz/quiz.service';
import { SettingsService } from '../../service/settings/settings.service';
import { SharedService } from '../../service/shared/shared.service';
import { IndexedDbService } from '../../service/storage/indexed.db.service';
import { StorageService } from '../../service/storage/storage.service';
import { StorageServiceMock } from '../../service/storage/storage.service.mock';
import { ThemesService } from '../../service/themes/themes.service';
......@@ -36,8 +35,7 @@ describe('AdminOverviewComponent', () => {
{
provide: TranslateService,
useClass: TranslateServiceMock,
},
I18nService, IndexedDbService, {
}, I18nService, {
provide: StorageService,
useClass: StorageServiceMock,
}, HeaderLabelService, ThemesService, {
......
......@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtHelperService, JwtModule } from '@auth0/angular-jwt';
import { TranslateService } from '@ngx-translate/core';
import { TranslateServiceMock } from '../../../_mocks/TranslateServiceMock';
import { jwtOptionsFactory } from '../../../lib/jwt.factory';
import { jwtOptionsFactory } from '../../lib/jwt.factory';
import { ConnectionMockService } from '../../service/connection/connection.mock.service';
import { ConnectionService } from '../../service/connection/connection.service';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
......@@ -16,7 +16,6 @@ import { QuizMockService } from '../../service/quiz/quiz-mock.service';
import { QuizService } from '../../service/quiz/quiz.service';
import { SettingsService } from '../../service/settings/settings.service';
import { SharedService } from '../../service/shared/shared.service';
import { IndexedDbService } from '../../service/storage/indexed.db.service';
import { StorageService } from '../../service/storage/storage.service';
import { StorageServiceMock } from '../../service/storage/storage.service.mock';
import { ThemesService } from '../../service/themes/themes.service';
......@@ -55,7 +54,7 @@ describe('QuizAdminComponent', () => {
{
provide: TranslateService,
useClass: TranslateServiceMock,
}, I18nService, IndexedDbService, {
}, I18nService, {
provide: StorageService,
useClass: StorageServiceMock,
}, HeaderLabelService, ThemesService, {
......
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { QuizState } from '../../../lib/enums/QuizState';
import { IAdminQuiz } from '../../../lib/interfaces/quizzes/IAdminQuiz';
import { QuizState } from '../../lib/enums/QuizState';
import { IAdminQuiz } from '../../lib/interfaces/quizzes/IAdminQuiz';
import { AdminApiService } from '../../service/api/admin/admin-api.service';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
......
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { QuizEntity } from '../../../lib/entities/QuizEntity';
import { QuizEntity } from '../../lib/entities/QuizEntity';
import { AdminApiService } from '../../service/api/admin/admin-api.service';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
......
......@@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtHelperService, JwtModule } from '@auth0/angular-jwt';
import { TranslateService } from '@ngx-translate/core';
import { TranslateServiceMock } from '../../../_mocks/TranslateServiceMock';
import { jwtOptionsFactory } from '../../../lib/jwt.factory';
import { jwtOptionsFactory } from '../../lib/jwt.factory';
import { ConnectionMockService } from '../../service/connection/connection.mock.service';
import { ConnectionService } from '../../service/connection/connection.service';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
......@@ -16,7 +16,6 @@ import { QuizMockService } from '../../service/quiz/quiz-mock.service';
import { QuizService } from '../../service/quiz/quiz.service';
import { SettingsService } from '../../service/settings/settings.service';
import { SharedService } from '../../service/shared/shared.service';
import { IndexedDbService } from '../../service/storage/indexed.db.service';
import { StorageService } from '../../service/storage/storage.service';
import { StorageServiceMock } from '../../service/storage/storage.service.mock';
import { ThemesService } from '../../service/themes/themes.service';
......@@ -46,7 +45,7 @@ describe('UserAdminComponent', () => {
{
provide: TranslateService,
useClass: TranslateServiceMock,
}, I18nService, IndexedDbService, {
}, I18nService, {
provide: StorageService,
useClass: StorageServiceMock,
}, HeaderLabelService, ThemesService, {
......
import { Component, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { UserEntity } from '../../../lib/entities/UserEntity';
import { DbTable, StorageKey } from '../../../lib/enums/enums';
import { UserEntity } from '../../lib/entities/UserEntity';
import { StorageKey } from '../../lib/enums/enums';
import { AddUserComponent } from '../../modals/add-user/add-user.component';
import { AdminApiService } from '../../service/api/admin/admin-api.service';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
......@@ -82,7 +82,10 @@ export class UserAdminComponent implements OnInit {
if (value.name === this.userService.staticLoginTokenContent.name) {
sessionStorage.setItem(StorageKey.PrivateKey, value.privateKey);
this.storageService.create(DbTable.Config, StorageKey.PrivateKey, value.privateKey).subscribe();
this.storageService.db.Config.put({
value: value.privateKey,
type: StorageKey.PrivateKey,
});
}
});
}).catch(() => {});
......
......@@ -13,7 +13,6 @@ import { QuizMockService } from '../../service/quiz/quiz-mock.service';
import { QuizService } from '../../service/quiz/quiz.service';
import { SettingsService } from '../../service/settings/settings.service';
import { SharedService } from '../../service/shared/shared.service';
import { IndexedDbService } from '../../service/storage/indexed.db.service';
import { StorageService } from '../../service/storage/storage.service';
import { StorageServiceMock } from '../../service/storage/storage.service.mock';
import { TrackingMockService } from '../../service/tracking/tracking.mock.service';
......@@ -32,7 +31,7 @@ describe('FooterBarComponent', () => {
SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, NgbModule,
],
providers: [
IndexedDbService, {
{
provide: StorageService,
useClass: StorageServiceMock,
}, FooterBarService, SharedService, {
......
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { IFooterBarElement } from '../../../lib/footerbar-element/interfaces';
import { INamedType } from '../../../lib/interfaces/interfaces';
import { ConfidenceRateComponent } from '../../quiz/quiz-flow/confidence-rate/confidence-rate.component';
import { LeaderboardComponent } from '../../quiz/quiz-flow/leaderboard/leaderboard.component';
import { QuizLobbyComponent } from '../../quiz/quiz-flow/quiz-lobby/quiz-lobby.component';
import { QuestionDetailsComponent } from '../../quiz/quiz-flow/quiz-results/question-details/question-details.component';
import { QuizResultsComponent } from '../../quiz/quiz-flow/quiz-results/quiz-results.component';
import { ReadingConfirmationComponent } from '../../quiz/quiz-flow/reading-confirmation/reading-confirmation.component';
import { VotingComponent } from '../../quiz/quiz-flow/voting/voting.component';
import { IFooterBarElement } from '../../lib/footerbar-element/interfaces';
import { INamedType } from '../../lib/interfaces/interfaces';
import { FileUploadService } from '../../service/file-upload/file-upload.service';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
import { QuizService } from '../../service/quiz/quiz.service';
......@@ -46,7 +39,7 @@ export class FooterBarComponent implements OnInit {
}
public toggleSetting(elem: IFooterBarElement): void {
this.quizService.toggleSetting(elem);
this.footerBarService.toggleSetting(elem);
elem.onClickCallback(elem);
this.trackingService.trackClickEvent({
......@@ -84,13 +77,13 @@ export class FooterBarComponent implements OnInit {
private detectCurrentRoute(): void {
const currentComponent = this.fetchChildComponent(this.activatedRoute);
this.collapsedNavbar = [
QuizLobbyComponent.TYPE,
QuizResultsComponent.TYPE,
VotingComponent.TYPE,
LeaderboardComponent.TYPE,
ReadingConfirmationComponent.TYPE,
ConfidenceRateComponent.TYPE,
QuestionDetailsComponent.TYPE,
'QuizLobbyComponent',
'QuizResultsComponent',
'VotingComponent',
'LeaderboardComponent',
'ReadingConfirmationComponent',
'ConfidenceRateComponent',
'QuestionDetailsComponent',
].includes(currentComponent ? currentComponent.TYPE : null);
}
......
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { AdditionalDataComponent } from './additional-data/additional-data.component';
import { FooterBarComponent } from './footer-bar/footer-bar.component';
@NgModule({
imports: [
SharedModule,
],
declarations: [FooterBarComponent, AdditionalDataComponent],
providers: [SharedModule],
bootstrap: [FooterBarComponent],
exports: [
FooterBarComponent,
AdditionalDataComponent,
],
exports: [FooterBarComponent, AdditionalDataComponent],
})
export class FooterModule {
}
......@@ -14,7 +14,6 @@ import { ConnectionService } from '../../service/connection/connection.service';
import { HeaderLabelService } from '../../service/header-label/header-label.service';
import { I18nService } from '../../service/i18n/i18n.service';
import { SharedService } from '../../service/shared/shared.service';
import { IndexedDbService } from '../../service/storage/indexed.db.service';
import { TrackingMockService } from '../../service/tracking/tracking.mock.service';
import { TrackingService } from '../../service/tracking/tracking.service';
import { SharedModule } from '../../shared/shared.module';
......@@ -36,7 +35,7 @@ describe('HeaderComponent', () => {
}, {
provide: TrackingService,
useClass: TrackingMockService,
}, SharedService, IndexedDbService, I18nService, {
}, SharedService, I18nService, {
provide: TranslateService,
useClass: TranslateServiceMock,
}, {
......
......@@ -8,13 +8,12 @@ import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { TranslateServiceMock } from '../../../_mocks/TranslateServiceMock';
import { jwtOptionsFactory } from '../../../lib/jwt.factory';
import { jwtOptionsFactory } from '../../lib/jwt.factory';
import { PipesModule } from '../../pipes/pipes.module';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
import { HeaderLabelService } from '../../service/header-label/header-label.service';
import { CasLoginService } from '../../service/login/cas-login.service';
import { ModalOrganizerService } from '../../service/modal-organizer/modal-organizer.service';
import { IndexedDbService } from '../../service/storage/indexed.db.service';
import { StorageService } from '../../service/storage/storage.service';
import { StorageServiceMock } from '../../service/storage/storage.service.mock';
import { UserService } from '../../service/user/user.service';
......@@ -42,7 +41,7 @@ describe('I18nManagerOverviewComponent', () => {
{
provide: TranslateService,
useClass: TranslateServiceMock,
}, IndexedDbService, {
}, {
provide: StorageService,
useClass: StorageServiceMock,
}, {
......
import { isPlatformBrowser } from '@angular/common';
import { Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core';
import { Observable, of } from 'rxjs';
import { Filter, Language, Project } from '../../../lib/enums/enums';
import { Filter, Language, Project } from '../../lib/enums/enums';
import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
import { HeaderLabelService } from '../../service/header-label/header-label.service';
import { LanguageLoaderService } from '../../service/language-loader/language-loader.service';
......
......@@ -2,9 +2,6 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { PipesModule } from '../pipes/pipes.module';
import { LanguageLoaderService } from '../service/language-loader/language-loader.service';
import { ModalOrganizerService } from '../service/modal-organizer/modal-organizer.service';
import { ProjectLoaderService } from '../service/project-loader/project-loader.service';
import { SharedModule } from '../shared/shared.module';
import { I18nManagerOverviewComponent } from './i18n-manager-overview/i18n-manager-overview.component';
import { KeyOutputComponent } from './key-output/key-output.component';
......@@ -21,9 +18,7 @@ const i18nManagerRoutes: Routes = [
SharedModule, PipesModule, RouterModule.forChild(i18nManagerRoutes), InfiniteScrollModule,
],
declarations: [I18nManagerOverviewComponent, KeyOutputComponent],
providers: [
LanguageLoaderService, ProjectLoaderService, ModalOrganizerService,
],
providers: [],
})
export class I18nManagerModule {
}
......@@ -4,9 +4,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { jwtOptionsFactory } from '../../../lib/jwt.factory';
import { jwtOptionsFactory } from '../../lib/jwt.factory';
import { CasLoginService } from '../../service/login/cas-login.service';
import { IndexedDbService } from '../../service/storage/indexed.db.service';
import { StorageService } from '../../service/storage/storage.service';
import { StorageServiceMock } from '../../service/storage/storage.service.mock';
import { UserService } from '../../service/user/user.service';
......@@ -74,7 +73,7 @@ describe('KeyOutputComponent', () => {
],
declarations: [KeyOutputComponent, UnusedKeyFilterMockPipe, FilterKeysMockPipe, JustafewMockPipe, SearchFilterMockPipe, SortMockPipe],
providers: [
IndexedDbService, {
{
provide: StorageService,
useClass: StorageServiceMock,
}, CasLoginService, {
......
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { Filter } from '../../../lib/enums/enums';
import { Filter } from '../../lib/enums/enums';
import { LanguageLoaderService } from '../../service/language-loader/language-loader.service';
import { ProjectLoaderService } from '../../service/project-loader/project-loader.service';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment