Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
arsnova-click-v2-frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
12
Merge Requests
12
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ARSnova
arsnova-click-v2-frontend
Commits
62ddf1f0
Commit
62ddf1f0
authored
Nov 07, 2019
by
Christopher Mark Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switches database and fixes bug where a user was not shown after joining a quiz
parent
8884d87f
Changes
62
Hide whitespace changes
Inline
Side-by-side
Showing
62 changed files
with
530 additions
and
270 deletions
+530
-270
angular.json
angular.json
+0
-14
package.json
package.json
+10
-13
src/app/admin/admin-overview/admin-overview.component.spec.ts
...app/admin/admin-overview/admin-overview.component.spec.ts
+12
-1
src/app/admin/quiz-admin/quiz-admin.component.spec.ts
src/app/admin/quiz-admin/quiz-admin.component.spec.ts
+2
-0
src/app/admin/user-admin/user-admin.component.spec.ts
src/app/admin/user-admin/user-admin.component.spec.ts
+2
-0
src/app/footer/footer-bar/footer-bar.component.spec.ts
src/app/footer/footer-bar/footer-bar.component.spec.ts
+12
-1
src/app/footer/footer.module.ts
src/app/footer/footer.module.ts
+2
-0
src/app/i18n-manager/i18n-manager-overview/i18n-manager-overview.component.spec.ts
...-manager-overview/i18n-manager-overview.component.spec.ts
+2
-0
src/app/lib/db/app.db.ts
src/app/lib/db/app.db.ts
+12
-9
src/app/pipes/pipes.module.ts
src/app/pipes/pipes.module.ts
+0
-6
src/app/quiz/quiz-duplicate/quiz-duplicate.component.ts
src/app/quiz/quiz-duplicate/quiz-duplicate.component.ts
+1
-1
src/app/quiz/quiz-flow/confidence-rate/confidence-rate.component.spec.ts
...iz-flow/confidence-rate/confidence-rate.component.spec.ts
+12
-2
src/app/quiz/quiz-flow/leaderboard/leaderboard.component.spec.ts
.../quiz/quiz-flow/leaderboard/leaderboard.component.spec.ts
+12
-2
src/app/quiz/quiz-flow/quiz-lobby/quiz-lobby.component.spec.ts
...pp/quiz/quiz-flow/quiz-lobby/quiz-lobby.component.spec.ts
+2
-0
src/app/quiz/quiz-flow/quiz-lobby/quiz-lobby.component.ts
src/app/quiz/quiz-flow/quiz-lobby/quiz-lobby.component.ts
+3
-1
src/app/quiz/quiz-flow/quiz-results/question-details/question-details.component.spec.ts
...sults/question-details/question-details.component.spec.ts
+12
-2
src/app/quiz/quiz-flow/quiz-results/question-details/question-details.component.ts
...iz-results/question-details/question-details.component.ts
+2
-2
src/app/quiz/quiz-flow/quiz-results/quiz-results.component.spec.ts
...uiz/quiz-flow/quiz-results/quiz-results.component.spec.ts
+14
-3
src/app/quiz/quiz-flow/reading-confirmation/reading-confirmation.component.spec.ts
...ading-confirmation/reading-confirmation.component.spec.ts
+12
-2
src/app/quiz/quiz-flow/voting/voting.component.spec.ts
src/app/quiz/quiz-flow/voting/voting.component.spec.ts
+12
-1
src/app/quiz/quiz-join/quiz-join.component.ts
src/app/quiz/quiz-join/quiz-join.component.ts
+9
-11
src/app/quiz/quiz-manager/details/answeroptions/answeroptions-freetext/answeroptions-freetext.component.spec.ts
...options-freetext/answeroptions-freetext.component.spec.ts
+3
-2
src/app/quiz/quiz-manager/details/answeroptions/answeroptions.component.spec.ts
...ger/details/answeroptions/answeroptions.component.spec.ts
+12
-1
src/app/quiz/quiz-manager/details/countdown/countdown.component.spec.ts
...uiz-manager/details/countdown/countdown.component.spec.ts
+12
-1
src/app/quiz/quiz-manager/details/details-overview/quiz-manager-details-overview.component.spec.ts
...-overview/quiz-manager-details-overview.component.spec.ts
+12
-1
src/app/quiz/quiz-manager/details/questiontext/questiontext.component.spec.ts
...nager/details/questiontext/questiontext.component.spec.ts
+12
-1
src/app/quiz/quiz-manager/details/questiontype/questiontype.component.spec.ts
...nager/details/questiontype/questiontype.component.spec.ts
+12
-1
src/app/quiz/quiz-manager/member-group-manager/member-group-manager.component.spec.ts
...mber-group-manager/member-group-manager.component.spec.ts
+12
-1
src/app/quiz/quiz-manager/nickname-manager/nickname-manager.component.spec.ts
...nager/nickname-manager/nickname-manager.component.spec.ts
+12
-2
src/app/quiz/quiz-manager/quiz-manager/quiz-manager.component.spec.ts
.../quiz-manager/quiz-manager/quiz-manager.component.spec.ts
+2
-0
src/app/quiz/quiz-manager/sound-manager/sound-manager.component.spec.ts
...uiz-manager/sound-manager/sound-manager.component.spec.ts
+12
-1
src/app/quiz/quiz-overview/quiz-overview.component.spec.ts
src/app/quiz/quiz-overview/quiz-overview.component.spec.ts
+3
-7
src/app/quiz/quiz-public/quiz-public.component.spec.ts
src/app/quiz/quiz-public/quiz-public.component.spec.ts
+14
-1
src/app/quiz/quiz-rename/quiz-rename.component.spec.ts
src/app/quiz/quiz-rename/quiz-rename.component.spec.ts
+12
-1
src/app/root.module.ts
src/app/root.module.ts
+3
-5
src/app/root/home/home.component.spec.ts
src/app/root/home/home.component.spec.ts
+2
-0
src/app/root/home/home.component.ts
src/app/root/home/home.component.ts
+20
-30
src/app/root/info/info.component.spec.ts
src/app/root/info/info.component.spec.ts
+12
-1
src/app/root/language-switcher/language-switcher.component.spec.ts
...oot/language-switcher/language-switcher.component.spec.ts
+12
-1
src/app/root/login/login.component.spec.ts
src/app/root/login/login.component.spec.ts
+2
-0
src/app/root/nickname-chooser/member-group-select/member-group-select.component.spec.ts
...member-group-select/member-group-select.component.spec.ts
+2
-0
src/app/root/nickname-chooser/nickname-input/nickname-input.component.html
...name-chooser/nickname-input/nickname-input.component.html
+1
-1
src/app/root/nickname-chooser/nickname-input/nickname-input.component.spec.ts
...e-chooser/nickname-input/nickname-input.component.spec.ts
+4
-1
src/app/root/nickname-chooser/nickname-input/nickname-input.component.ts
...ckname-chooser/nickname-input/nickname-input.component.ts
+9
-11
src/app/root/nickname-chooser/nickname-select/nickname-select.component.spec.ts
...chooser/nickname-select/nickname-select.component.spec.ts
+2
-0
src/app/root/nickname-chooser/nickname-select/nickname-select.component.ts
...name-chooser/nickname-select/nickname-select.component.ts
+4
-9
src/app/root/root/root.component.ts
src/app/root/root/root.component.ts
+31
-26
src/app/root/theme-switcher/theme-switcher.component.spec.ts
src/app/root/theme-switcher/theme-switcher.component.spec.ts
+12
-1
src/app/service/attendee/attendee.service.spec.ts
src/app/service/attendee/attendee.service.spec.ts
+17
-3
src/app/service/attendee/attendee.service.ts
src/app/service/attendee/attendee.service.ts
+1
-0
src/app/service/file-upload/file-upload.service.ts
src/app/service/file-upload/file-upload.service.ts
+1
-1
src/app/service/footer-bar/footer-bar.service.spec.ts
src/app/service/footer-bar/footer-bar.service.spec.ts
+7
-0
src/app/service/i18n/i18n.service.ts
src/app/service/i18n/i18n.service.ts
+3
-4
src/app/service/quiz/quiz.service.spec.ts
src/app/service/quiz/quiz.service.spec.ts
+1
-1
src/app/service/quiz/quiz.service.ts
src/app/service/quiz/quiz.service.ts
+12
-21
src/app/service/storage/storage.service.mock.ts
src/app/service/storage/storage.service.mock.ts
+36
-10
src/app/service/storage/storage.service.ts
src/app/service/storage/storage.service.ts
+5
-0
src/app/service/themes/themes.service.ts
src/app/service/themes/themes.service.ts
+1
-1
src/app/shared/shared.module.ts
src/app/shared/shared.module.ts
+4
-19
src/polyfills.ts
src/polyfills.ts
+32
-18
src/tsconfig.app.json
src/tsconfig.app.json
+7
-5
tsconfig.json
tsconfig.json
+12
-10
No files found.
angular.json
View file @
62ddf1f0
...
...
@@ -10,19 +10,6 @@
"prefix"
:
"app"
,
"schematics"
:
{},
"architect"
:
{
"server"
:
{
"builder"
:
"@angular-devkit/build-angular:server"
,
"options"
:
{
"outputPath"
:
"dist/server"
,
"main"
:
"src/main.server.ts"
,
"tsConfig"
:
"src/tsconfig.server.json"
,
"stylePreprocessorOptions"
:
{
"includePaths"
:
[
"src/styles/themes"
]
}
}
},
"build"
:
{
"builder"
:
"@angular-devkit/build-angular:browser"
,
"options"
:
{
...
...
@@ -44,7 +31,6 @@
"src/assets/imageDerivates.json"
,
"src/assets/themeData.json"
,
"src/assets/piwik/piwik.js"
,
"src/assets/dbmigrate.html"
,
{
"glob"
:
"robots.txt"
,
"input"
:
"src/assets"
,
...
...
package.json
View file @
62ddf1f0
...
...
@@ -46,7 +46,7 @@
},
"private"
:
true
,
"dependencies"
:
{
"
@angular-devkit/build-angular
"
:
"
~0.80
0.0-beta.
7
"
,
"
@angular-devkit/build-angular
"
:
"
~0.80
3.1
7
"
,
"
@angular/animations
"
:
"
^8.2.13
"
,
"
@angular/common
"
:
"
^8.2.13
"
,
"
@angular/compiler
"
:
"
^8.2.13
"
,
...
...
@@ -70,7 +70,6 @@
"
angulartics2
"
:
"
^7.5.2
"
,
"
angularx-qrcode
"
:
"
^1.6.4
"
,
"
bootstrap
"
:
"
^4.3.1
"
,
"
classlist.js
"
:
"
^1.1.20150312
"
,
"
cors
"
:
"
^2.8.5
"
,
"
dexie
"
:
"
^2.0.4
"
,
"
highlight.js
"
:
"
^9.16.2
"
,
...
...
@@ -81,9 +80,10 @@
"
ngx-toastr
"
:
"
^10.2.0
"
,
"
ngx-translate-messageformat-compiler
"
:
"
^4.5.0
"
,
"
node-sass
"
:
"
^4.13.0
"
,
"
rxjs
"
:
"
^6.5.3
"
,
"
rxjs
"
:
"
~6.4.0
"
,
"
ts-loader
"
:
"
^6.2.1
"
,
"
web-animations-js
"
:
"
^2.3.2
"
,
"
tslib
"
:
"
^1.10.0
"
,
"
zone.js
"
:
"
~0.9.1
"
},
"devDependencies"
:
{
...
...
@@ -93,7 +93,7 @@
"
@types/jasmine
"
:
"
^3.3.16
"
,
"
@types/jasminewd2
"
:
"
^2.0.8
"
,
"
@types/modernizr
"
:
"
^3.5.3
"
,
"
@types/node
"
:
"
^10.17.3
"
,
"
@types/node
"
:
"
~8.9.4
"
,
"
@types/webpack
"
:
"
^4.39.8
"
,
"
angular-http-server
"
:
"
^1.9.0
"
,
"
chrome-launcher
"
:
"
^0.10.7
"
,
...
...
@@ -101,13 +101,13 @@
"
codelyzer
"
:
"
^5.2.0
"
,
"
imagemin
"
:
"
^6.1.0
"
,
"
imagemin-pngquant
"
:
"
^6.0.1
"
,
"
jasmine-core
"
:
"
~3.
3
.0
"
,
"
jasmine-core
"
:
"
~3.
4
.0
"
,
"
jasmine-spec-reporter
"
:
"
~4.2.1
"
,
"
karma
"
:
"
^3.1.4
"
,
"
karma
"
:
"
~4.1.0
"
,
"
karma-chrome-launcher
"
:
"
~2.2.0
"
,
"
karma-coverage-istanbul-reporter
"
:
"
^2.1.0
"
,
"
karma-coverage-istanbul-reporter
"
:
"
~2.0.1
"
,
"
karma-jasmine
"
:
"
~2.0.1
"
,
"
karma-jasmine-html-reporter
"
:
"
^1.4.
2
"
,
"
karma-jasmine-html-reporter
"
:
"
^1.4.
0
"
,
"
karma-mocha-reporter
"
:
"
^2.2.5
"
,
"
karma-phantomjs-launcher
"
:
"
^1.0.4
"
,
"
minimist
"
:
"
^1.2.0
"
,
...
...
@@ -117,12 +117,9 @@
"
purify-css
"
:
"
~1.2.5
"
,
"
rimraf
"
:
"
^3.0.0
"
,
"
sharp
"
:
"
^0.22.1
"
,
"
ts-node
"
:
"
~8.3.0
"
,
"
tslib
"
:
"
^1.10.0
"
,
"
ts-node
"
:
"
~7.0.0
"
,
"
tslint
"
:
"
~5.18.0
"
,
"
typescript
"
:
"
~3.5.3
"
,
"
webpack-cli
"
:
"
^3.3.10
"
,
"
webpack-node-externals
"
:
"
^1.7.2
"
"
typescript
"
:
"
~3.5.3
"
},
"keywords"
:
[
"arsnova"
,
...
...
src/app/admin/admin-overview/admin-overview.component.spec.ts
View file @
62ddf1f0
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;
import
{
HttpClientTestingModule
}
from
'
@angular/common/http/testing
'
;
import
{
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
TranslateServiceMock
}
from
'
../../../_mocks/TranslateServiceMock
'
;
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
'
;
...
...
@@ -29,9 +33,16 @@ describe('AdminOverviewComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
SharedModule
,
RouterTestingModule
,
HttpClientModule
,
HttpClientTestingModule
,
SharedModule
,
RouterTestingModule
,
HttpClientModule
,
HttpClientTestingModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
RxStompService
,
{
provide
:
TranslateService
,
useClass
:
TranslateServiceMock
,
...
...
src/app/admin/quiz-admin/quiz-admin.component.spec.ts
View file @
62ddf1f0
...
...
@@ -5,6 +5,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtHelperService
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
TranslateServiceMock
}
from
'
../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../lib/jwt.factory
'
;
import
{
ConnectionMockService
}
from
'
../../service/connection/connection.mock.service
'
;
...
...
@@ -51,6 +52,7 @@ describe('QuizAdminComponent', () => {
}),
],
providers
:
[
RxStompService
,
{
provide
:
TranslateService
,
useClass
:
TranslateServiceMock
,
...
...
src/app/admin/user-admin/user-admin.component.spec.ts
View file @
62ddf1f0
...
...
@@ -5,6 +5,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtHelperService
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
TranslateServiceMock
}
from
'
../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../lib/jwt.factory
'
;
import
{
ConnectionMockService
}
from
'
../../service/connection/connection.mock.service
'
;
...
...
@@ -42,6 +43,7 @@ describe('UserAdminComponent', () => {
}),
],
providers
:
[
RxStompService
,
{
provide
:
TranslateService
,
useClass
:
TranslateServiceMock
,
...
...
src/app/footer/footer-bar/footer-bar.component.spec.ts
View file @
62ddf1f0
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;
import
{
HttpClientTestingModule
}
from
'
@angular/common/http/testing
'
;
import
{
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
inject
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
NgbModule
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
TranslateServiceMock
}
from
'
../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../lib/jwt.factory
'
;
import
{
ConnectionMockService
}
from
'
../../service/connection/connection.mock.service
'
;
import
{
ConnectionService
}
from
'
../../service/connection/connection.service
'
;
import
{
FileUploadService
}
from
'
../../service/file-upload/file-upload.service
'
;
...
...
@@ -28,9 +32,16 @@ describe('FooterBarComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
SharedModule
,
RouterTestingModule
,
HttpClientModule
,
HttpClientTestingModule
,
NgbModule
,
SharedModule
,
RouterTestingModule
,
HttpClientModule
,
HttpClientTestingModule
,
NgbModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
RxStompService
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
...
...
src/app/footer/footer.module.ts
View file @
62ddf1f0
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
],
exports
:
[
FooterBarComponent
,
AdditionalDataComponent
],
})
...
...
src/app/i18n-manager/i18n-manager-overview/i18n-manager-overview.component.spec.ts
View file @
62ddf1f0
...
...
@@ -6,6 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing';
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
NgbModalModule
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
InfiniteScrollModule
}
from
'
ngx-infinite-scroll
'
;
import
{
TranslateServiceMock
}
from
'
../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../lib/jwt.factory
'
;
...
...
@@ -38,6 +39,7 @@ describe('I18nManagerOverviewComponent', () => {
}),
HttpClientTestingModule
,
NgbModalModule
,
SharedModule
,
PipesModule
,
RouterTestingModule
,
HttpClientModule
,
InfiniteScrollModule
,
],
providers
:
[
RxStompService
,
{
provide
:
TranslateService
,
useClass
:
TranslateServiceMock
,
...
...
src/app/lib/db/app.db.ts
View file @
62ddf1f0
...
...
@@ -5,7 +5,7 @@ import { DbName, DbTable, StorageKey } from '../enums/enums';
export
class
AppDb
extends
Dexie
{
public
readonly
initialized
:
ReplaySubject
<
void
>
=
new
ReplaySubject
<
void
>
(
1
);
public
readonly
[
DbTable
.
Config
]:
Dexie
.
Table
<
{
type
:
StorageKey
,
value
:
any
},
string
>
;
public
readonly
[
DbTable
.
Config
]:
Dexie
.
Table
<
{
type
:
StorageKey
,
value
:
any
},
StorageKey
>
;
public
readonly
[
DbTable
.
Quiz
]:
Dexie
.
Table
<
QuizEntity
,
string
>
;
constructor
(
dbName
:
DbName
)
{
...
...
@@ -15,15 +15,18 @@ export class AppDb extends Dexie {
[
DbTable
.
Quiz
]:
'
name
'
,
});
this
.
Config
.
get
(
DbTable
.
Config
).
then
(
privateKey
=>
{
if
(
!
privateKey
)
{
privateKey
=
{
value
:
AppDb
.
generatePrivateKey
(),
type
:
StorageKey
.
PrivateKey
,
};
sessionStorage
.
setItem
(
StorageKey
.
PrivateKey
,
privateKey
.
value
);
this
.
Config
.
put
(
privateKey
).
then
(()
=>
this
.
initialized
.
next
());
this
.
Config
.
get
(
StorageKey
.
PrivateKey
).
then
(
privateKey
=>
{
if
(
privateKey
)
{
this
.
initialized
.
next
();
return
;
}
privateKey
=
{
value
:
AppDb
.
generatePrivateKey
(),
type
:
StorageKey
.
PrivateKey
,
};
sessionStorage
.
setItem
(
StorageKey
.
PrivateKey
,
privateKey
.
value
);
this
.
Config
.
put
(
privateKey
).
then
(()
=>
this
.
initialized
.
next
());
});
}
...
...
src/app/pipes/pipes.module.ts
View file @
62ddf1f0
...
...
@@ -14,10 +14,4 @@ import { UnusedKeyFilterPipe } from './unused-key-filter/unused-key-filter.pipe'
declarations
:
[
JustAFewPipe
,
FilterKeysPipe
,
SearchFilterPipe
,
SortPipe
,
UnusedKeyFilterPipe
,
QuizAdminFilterPipe
,
GenericFilterPipe
],
})
export
class
PipesModule
{
public
static
forRoot
():
object
{
return
{
ngModule
:
PipesModule
,
providers
:
[],
};
}
}
src/app/quiz/quiz-duplicate/quiz-duplicate.component.ts
View file @
62ddf1f0
...
...
@@ -30,7 +30,7 @@ export class QuizDuplicateComponent implements OnInit, OnDestroy {
this
.
route
.
paramMap
.
pipe
(
map
(
params
=>
params
.
get
(
'
name
'
)),
filter
(()
=>
this
.
userService
.
isAuthorizedFor
(
UserRole
.
CreateQuiz
)),
distinctUntilChanged
(),
takeUntil
(
this
.
_destroy
),
switchMap
(
name
=>
this
.
quizApiService
.
initQuizInstance
(
name
)))
.
subscribe
(
data
=>
{
this
.
storageService
.
db
.
Quiz
.
add
(
data
.
payload
.
quiz
,
data
.
payload
.
quiz
.
name
);
this
.
storageService
.
db
.
Quiz
.
put
(
data
.
payload
.
quiz
);
this
.
quizService
.
quiz
=
new
QuizEntity
(
data
.
payload
.
quiz
);
this
.
quizService
.
isOwner
=
true
;
this
.
router
.
navigate
([
'
/quiz
'
,
'
flow
'
]);
...
...
src/app/quiz/quiz-flow/confidence-rate/confidence-rate.component.spec.ts
View file @
62ddf1f0
import
{
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
BrowserDynamicTestingModule
}
from
'
@angular/platform-browser-dynamic/testing
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
SimpleMQ
}
from
'
ng2-simple-mq
'
;
import
{
Subscription
}
from
'
rxjs
'
;
import
{
TranslateServiceMock
}
from
'
../../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../../lib/jwt.factory
'
;
import
{
ServerUnavailableModalComponent
}
from
'
../../../modals/server-unavailable-modal/server-unavailable-modal.component
'
;
import
{
MemberApiService
}
from
'
../../../service/api/member/member-api.service
'
;
import
{
AttendeeMockService
}
from
'
../../../service/attendee/attendee.mock.service
'
;
...
...
@@ -29,10 +33,16 @@ describe('QuizFlow: ConfidenceRateComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
SharedModule
,
RouterTestingModule
,
SharedModule
,
RouterTestingModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
SimpleMQ
,
{
RxStompService
,
SimpleMQ
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
},
{
...
...
src/app/quiz/quiz-flow/leaderboard/leaderboard.component.spec.ts
View file @
62ddf1f0
import
{
SecurityContext
}
from
'
@angular/core
'
;
import
{
PLATFORM_ID
,
SecurityContext
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
inject
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
DomSanitizer
,
SafeHtml
}
from
'
@angular/platform-browser
'
;
import
{
BrowserDynamicTestingModule
}
from
'
@angular/platform-browser-dynamic/testing
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
NgbActiveModal
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
SimpleMQ
}
from
'
ng2-simple-mq
'
;
import
{
TranslateServiceMock
}
from
'
../../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../../lib/jwt.factory
'
;
import
{
ServerUnavailableModalComponent
}
from
'
../../../modals/server-unavailable-modal/server-unavailable-modal.component
'
;
import
{
AttendeeMockService
}
from
'
../../../service/attendee/attendee.mock.service
'
;
import
{
AttendeeService
}
from
'
../../../service/attendee/attendee.service
'
;
...
...
@@ -34,9 +37,16 @@ describe('LeaderboardComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
SharedModule
,
RouterTestingModule
,
SharedModule
,
RouterTestingModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
RxStompService
,
SimpleMQ
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
...
...
src/app/quiz/quiz-flow/quiz-lobby/quiz-lobby.component.spec.ts
View file @
62ddf1f0
...
...
@@ -5,6 +5,7 @@ import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/t
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
NgbModal
,
NgbModalRef
,
NgbModule
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
QRCodeModule
}
from
'
angularx-qrcode
'
;
import
{
SimpleMQ
}
from
'
ng2-simple-mq
'
;
import
{
TranslateServiceMock
}
from
'
../../../../_mocks/TranslateServiceMock
'
;
...
...
@@ -43,6 +44,7 @@ describe('QuizLobbyComponent', () => {
RouterTestingModule
,
SharedModule
,
QRCodeModule
,
NgbModule
,
],
providers
:
[
RxStompService
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
...
...
src/app/quiz/quiz-flow/quiz-lobby/quiz-lobby.component.ts
View file @
62ddf1f0
...
...
@@ -85,6 +85,8 @@ export class QuizLobbyComponent implements OnInit, OnDestroy {
return
;
}
this
.
handleMessages
();
this
.
sharedService
.
isLoadingEmitter
.
next
(
false
);
if
(
this
.
quizService
.
isOwner
)
{
console
.
log
(
'
QuizLobbyComponent: quiz for owner initialized
'
,
this
.
quizService
.
quiz
);
...
...
@@ -95,7 +97,6 @@ export class QuizLobbyComponent implements OnInit, OnDestroy {
});
this
.
quizService
.
loadDataToPlay
(
sessionStorage
.
getItem
(
StorageKey
.
CurrentQuizName
)).
then
(()
=>
{
this
.
handleMessages
();
});
this
.
connectionService
.
serverStatusEmitter
.
pipe
(
takeUntil
(
this
.
_destroy
)).
subscribe
(
isConnected
=>
{
...
...
@@ -268,6 +269,7 @@ export class QuizLobbyComponent implements OnInit, OnDestroy {
}),
]);
this
.
quizService
.
isOwner
?
this
.
handleMessagesForOwner
()
:
this
.
handleMessagesForAttendee
();
console
.
log
(
'
QuizLobbyComponent: Message handler attached
'
);
}
private
handleMessagesForOwner
():
void
{
...
...
src/app/quiz/quiz-flow/quiz-results/question-details/question-details.component.spec.ts
View file @
62ddf1f0
import
{
SecurityContext
}
from
'
@angular/core
'
;
import
{
PLATFORM_ID
,
SecurityContext
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
inject
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
;
import
{
BrowserDynamicTestingModule
}
from
'
@angular/platform-browser-dynamic/testing
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
NgbActiveModal
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
SimpleMQ
}
from
'
ng2-simple-mq
'
;
import
{
TranslateServiceMock
}
from
'
../../../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../../../lib/jwt.factory
'
;
import
{
ServerUnavailableModalComponent
}
from
'
../../../../modals/server-unavailable-modal/server-unavailable-modal.component
'
;
import
{
AttendeeMockService
}
from
'
../../../../service/attendee/attendee.mock.service
'
;
import
{
AttendeeService
}
from
'
../../../../service/attendee/attendee.service
'
;
...
...
@@ -34,9 +37,16 @@ describe('QuestionDetailsComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
SharedModule
,
RouterTestingModule
,
SharedModule
,
RouterTestingModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
RxStompService
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
...
...
src/app/quiz/quiz-flow/quiz-results/question-details/question-details.component.ts
View file @
62ddf1f0
import
{
Component
,
OnDestroy
,
OnInit
,
SecurityContext
}
from
'
@angular/core
'
;
import
{
Component
,
OnDestroy
,
OnInit
}
from
'
@angular/core
'
;
import
{
DomSanitizer
,
SafeHtml
}
from
'
@angular/platform-browser
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
NgbModal
,
NgbModalRef
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
...
...
@@ -75,7 +75,7 @@ export class QuestionDetailsComponent implements OnInit, OnDestroy {
}
public
sanitizeHTML
(
value
:
string
):
SafeHtml
{
return
this
.
sanitizer
.
sanitize
(
SecurityContext
.
HTML
,
`
${
value
}
`
);
return
this
.
sanitizer
.
bypassSecurityTrustHtml
(
`
${
value
}
`
);
}
public
normalizeAnswerIndex
(
index
:
number
):
string
{
...
...
src/app/quiz/quiz-flow/quiz-results/quiz-results.component.spec.ts
View file @
62ddf1f0
import
{
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
inject
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
BrowserDynamicTestingModule
}
from
'
@angular/platform-browser-dynamic/testing
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
SimpleMQ
}
from
'
ng2-simple-mq
'
;
import
{
TranslateServiceMock
}
from
'
../../../../_mocks/TranslateServiceMock
'
;
import
{
Attendee
}
from
'
../../../lib/attendee/attendee
'
;
import
{
SurveyQuestionEntity
}
from
'
../../../lib/entities/question/SurveyQuestionEntity
'
;
import
{
Language
}
from
'
../../../lib/enums/enums
'
;
import
{
jwtOptionsFactory
}
from
'
../../../lib/jwt.factory
'
;
import
{
ServerUnavailableModalComponent
}
from
'
../../../modals/server-unavailable-modal/server-unavailable-modal.component
'
;
import
{
AttendeeMockService
}
from
'
../../../service/attendee/attendee.mock.service
'
;
import
{
AttendeeService
}
from
'
../../../service/attendee/attendee.service
'
;
...
...
@@ -42,10 +47,16 @@ describe('QuizResultsComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
SharedModule
,
RouterTestingModule
,
SharedModule
,
RouterTestingModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
{
RxStompService
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
},
TranslateService
,
FooterBarService
,
SettingsService
,
{
...
...
@@ -93,7 +104,7 @@ describe('QuizResultsComponent', () => {
});
it
(
`#showLeaderBoardButton`
,
inject
([
QuizService
],
(
quizService
:
QuizService
)
=>
{
expect
(
quizService
.
quiz
[
quizService
.
quiz
.
currentQuestionIndex
].
TYPE
===
'
SurveyQuestion
'
).
toBeFalsy
();
expect
(
quizService
.
quiz
.
questionList
[
quizService
.
quiz
.
currentQuestionIndex
]
instanceof
SurveyQuestionEntity
).
toBeFalsy
();
expect
(
component
.
showLeaderBoardButton
(
quizService
.
quiz
.
currentQuestionIndex
)).
toBeTruthy
();
}));
...
...
src/app/quiz/quiz-flow/reading-confirmation/reading-confirmation.component.spec.ts
View file @
62ddf1f0
import
{
SecurityContext
}
from
'
@angular/core
'
;
import
{
PLATFORM_ID
,
SecurityContext
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
inject
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
;
import
{
BrowserDynamicTestingModule
}
from
'
@angular/platform-browser-dynamic/testing
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
SimpleMQ
}
from
'
ng2-simple-mq
'
;
import
{
TranslateServiceMock
}
from
'
../../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../../lib/jwt.factory
'
;
import
{
ServerUnavailableModalComponent
}
from
'
../../../modals/server-unavailable-modal/server-unavailable-modal.component
'
;
import
{
AttendeeMockService
}
from
'
../../../service/attendee/attendee.mock.service
'
;
import
{
AttendeeService
}
from
'
../../../service/attendee/attendee.service
'
;
...
...
@@ -31,9 +34,16 @@ describe('QuizFlow: ReadingConfirmationComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
SharedModule
,
RouterTestingModule
,
SharedModule
,
RouterTestingModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
RxStompService
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
...
...
src/app/quiz/quiz-flow/voting/voting.component.spec.ts
View file @
62ddf1f0
import
{
HttpClientTestingModule
}
from
'
@angular/common/http/testing
'
;
import
{
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
BrowserDynamicTestingModule
}
from
'
@angular/platform-browser-dynamic/testing
'
;
import
{
RouterTestingModule
}
from
'
@angular/router/testing
'
;
import
{
JWT_OPTIONS
,
JwtModule
}
from
'
@auth0/angular-jwt
'
;
import
{
FontAwesomeModule
}
from
'
@fortawesome/angular-fontawesome
'
;
import
{
NgbModalModule
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
RxStompService
}
from
'
@stomp/ng2-stompjs
'
;
import
{
SimpleMQ
}
from
'
ng2-simple-mq
'
;
import
{
TranslatePipeMock
}
from
'
../../../../_mocks/TranslatePipeMock
'
;
import
{
TranslateServiceMock
}
from
'
../../../../_mocks/TranslateServiceMock
'
;
import
{
jwtOptionsFactory
}
from
'
../../../lib/jwt.factory
'
;
import
{
ServerUnavailableModalComponent
}
from
'
../../../modals/server-unavailable-modal/server-unavailable-modal.component
'
;
import
{
MemberApiService
}
from
'
../../../service/api/member/member-api.service
'
;
import
{
QuizApiService
}
from
'
../../../service/api/quiz/quiz-api.service
'
;
...
...
@@ -33,9 +37,16 @@ describe('VotingComponent', () => {
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
imports
:
[
RouterTestingModule
,
FontAwesomeModule
,
HttpClientTestingModule
,
NgbModalModule
,
RouterTestingModule
,
FontAwesomeModule
,
HttpClientTestingModule
,
NgbModalModule
,
JwtModule
.
forRoot
({
jwtOptionsProvider
:
{
provide
:
JWT_OPTIONS
,
useFactory
:
jwtOptionsFactory
,
deps
:
[
PLATFORM_ID
],
},
}),
],
providers
:
[
RxStompService
,
{
provide
:
StorageService
,
useClass
:
StorageServiceMock
,
...
...
src/app/quiz/quiz-join/quiz-join.component.ts
View file @
62ddf1f0
...
...
@@ -2,7 +2,6 @@ import { Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
Subject
}
from
'
rxjs
'
;
import
{
takeUntil
}
from
'
rxjs/operators
'
;
import
{
StorageKey
}
from
'
../../lib/enums/enums
'
;
import
{
MessageProtocol
,
StatusProtocol
}
from
'
../../lib/enums/Message
'
;
import
{
QuizApiService
}
from
'
../../service/api/quiz/quiz-api.service
'
;
import
{
CasLoginService
}
from
'
../../service/login/cas-login.service
'
;
...
...
@@ -19,13 +18,15 @@ export class QuizJoinComponent implements OnInit, OnDestroy {
public
static
TYPE
=
'
QuizJoinComponent
'
;
private
readonly
_destroy
=
new
Subject
();
constructor
(
public
quizService
:
QuizService
,
@
Inject
(
PLATFORM_ID
)
private
platformId
:
Object
,
private
route
:
ActivatedRoute
,
private
router
:
Router
,
private
casService
:
CasLoginService
,