Fixes tests

parent 874a5de7
...@@ -102,7 +102,8 @@ ...@@ -102,7 +102,8 @@
"tslib": "^1.7.1", "tslib": "^1.7.1",
"tslint": "~5.10.0", "tslint": "~5.10.0",
"typescript": "^2.7", "typescript": "^2.7",
"webpack-cli": "^2.1.4" "webpack-cli": "^2.1.4",
"webpack-node-externals": "^1.7.2"
}, },
"keywords": [ "keywords": [
"arsnova", "arsnova",
......
...@@ -3,7 +3,7 @@ import { enableProdMode } from '@angular/core'; ...@@ -3,7 +3,7 @@ import { enableProdMode } from '@angular/core';
import { ngExpressEngine } from '@nguniversal/express-engine'; import { ngExpressEngine } from '@nguniversal/express-engine';
// Import module map for lazy loading // Import module map for lazy loading
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader'; import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import * as bodyParser from 'body-parser'; import * as bodyParser from 'body-parser';
import * as child_process from 'child_process'; import * as child_process from 'child_process';
import * as compress from 'compression'; import * as compress from 'compression';
......
import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { IQuestionChoice } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestionChoice } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { DEVICE_TYPES, LIVE_PREVIEW_ENVIRONMENT } from '../../../environments/environment'; import { DEVICE_TYPES, LIVE_PREVIEW_ENVIRONMENT } from '../../../environments/environment';
import { ActiveQuestionGroupService } from '../../service/active-question-group/active-question-group.service'; import { ActiveQuestionGroupService } from '../../service/active-question-group/active-question-group.service';
...@@ -24,8 +24,7 @@ export class LivePreviewComponent implements OnInit, OnDestroy { ...@@ -24,8 +24,7 @@ export class LivePreviewComponent implements OnInit, OnDestroy {
return this._targetEnvironment; return this._targetEnvironment;
} }
@Input() @Input() set targetEnvironment(value: LIVE_PREVIEW_ENVIRONMENT) {
set targetEnvironment(value: LIVE_PREVIEW_ENVIRONMENT) {
this._targetEnvironment = value; this._targetEnvironment = value;
} }
...@@ -35,8 +34,7 @@ export class LivePreviewComponent implements OnInit, OnDestroy { ...@@ -35,8 +34,7 @@ export class LivePreviewComponent implements OnInit, OnDestroy {
return this._targetDevice; return this._targetDevice;
} }
@Input() @Input() set targetDevice(value: DEVICE_TYPES) {
set targetDevice(value: DEVICE_TYPES) {
this._targetDevice = value; this._targetDevice = value;
} }
...@@ -104,11 +102,9 @@ export class LivePreviewComponent implements OnInit, OnDestroy { ...@@ -104,11 +102,9 @@ export class LivePreviewComponent implements OnInit, OnDestroy {
} }
public ngOnInit(): void { public ngOnInit(): void {
this._subscription = this.questionTextService.eventEmitter.subscribe( this._subscription = this.questionTextService.eventEmitter.subscribe(value => {
value => { this.dataSource = value;
this.dataSource = value; });
},
);
switch (this.targetEnvironment) { switch (this.targetEnvironment) {
case this.ENVIRONMENT_TYPE.ANSWEROPTIONS: case this.ENVIRONMENT_TYPE.ANSWEROPTIONS:
this._routerSubscription = this.route.params.subscribe(params => { this._routerSubscription = this.route.params.subscribe(params => {
......
import { Component, Inject, PLATFORM_ID } from '@angular/core'; import { Component, Inject, PLATFORM_ID } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { IModal } from 'arsnova-click-v2-types/src/modals/interfaces'; import { IModal } from 'arsnova-click-v2-types/dist/modals/interfaces';
import { IQuestionGroup } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestionGroup } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { questionGroupReflection } from 'arsnova-click-v2-types/src/questions/questionGroup_reflection'; import { questionGroupReflection } from 'arsnova-click-v2-types/dist/questions/questionGroup_reflection';
import { ActiveQuestionGroupService } from '../../service/active-question-group/active-question-group.service'; import { ActiveQuestionGroupService } from '../../service/active-question-group/active-question-group.service';
import { LobbyApiService } from '../../service/api/lobby/lobby-api.service'; import { LobbyApiService } from '../../service/api/lobby/lobby-api.service';
import { QuizApiService } from '../../service/api/quiz/quiz-api.service'; import { QuizApiService } from '../../service/api/quiz/quiz-api.service';
......
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core'; import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { IMessage } from 'arsnova-click-v2-types/src/common'; import { IMessage } from 'arsnova-click-v2-types/dist/common';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { Subscription } from 'rxjs/index'; import { Subscription } from 'rxjs/index';
import { MemberApiService } from '../../../service/api/member/member-api.service'; import { MemberApiService } from '../../../service/api/member/member-api.service';
import { AttendeeService } from '../../../service/attendee/attendee.service'; import { AttendeeService } from '../../../service/attendee/attendee.service';
......
import { Component, OnInit, SecurityContext } from '@angular/core'; import { Component, OnInit, SecurityContext } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { ILeaderBoardItem, IMessage } from 'arsnova-click-v2-types/src/common'; import { ILeaderBoardItem, IMessage } from 'arsnova-click-v2-types/dist/common';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { parseGithubFlavoredMarkdown } from '../../../../lib/markdown/markdown'; import { parseGithubFlavoredMarkdown } from '../../../../lib/markdown/markdown';
import { LeaderboardApiService } from '../../../service/api/leaderboard/leaderboard-api.service'; import { LeaderboardApiService } from '../../../service/api/leaderboard/leaderboard-api.service';
......
...@@ -3,9 +3,9 @@ import { Component, Inject, OnDestroy, PLATFORM_ID, SecurityContext } from '@ang ...@@ -3,9 +3,9 @@ import { Component, Inject, OnDestroy, PLATFORM_ID, SecurityContext } from '@ang
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { IMessage, INickname } from 'arsnova-click-v2-types/src/common'; import { IMessage, INickname } from 'arsnova-click-v2-types/dist/common';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { questionGroupReflection } from 'arsnova-click-v2-types/src/questions/questionGroup_reflection'; import { questionGroupReflection } from 'arsnova-click-v2-types/dist/questions/questionGroup_reflection';
import { parseGithubFlavoredMarkdown } from '../../../../lib/markdown/markdown'; import { parseGithubFlavoredMarkdown } from '../../../../lib/markdown/markdown';
import { ActiveQuestionGroupService } from '../../../service/active-question-group/active-question-group.service'; import { ActiveQuestionGroupService } from '../../../service/active-question-group/active-question-group.service';
import { MemberApiService } from '../../../service/api/member/member-api.service'; import { MemberApiService } from '../../../service/api/member/member-api.service';
......
...@@ -4,7 +4,7 @@ import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing' ...@@ -4,7 +4,7 @@ import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { IQuestionChoice } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestionChoice } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
import { Attendee } from '../../../../../lib/attendee/attendee'; import { Attendee } from '../../../../../lib/attendee/attendee';
import { createTranslateLoader } from '../../../../../lib/translation.factory'; import { createTranslateLoader } from '../../../../../lib/translation.factory';
......
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { IFreetextAnswerOption } from 'arsnova-click-v2-types/src/answeroptions/interfaces'; import { IFreetextAnswerOption } from 'arsnova-click-v2-types/dist/answeroptions/interfaces';
import { IQuestion } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestion } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { FreeTextQuestion } from 'arsnova-click-v2-types/src/questions/question_freetext'; import { FreeTextQuestion } from 'arsnova-click-v2-types/dist/questions/question_freetext';
import { RangedQuestion } from 'arsnova-click-v2-types/src/questions/question_ranged'; import { RangedQuestion } from 'arsnova-click-v2-types/dist/questions/question_ranged';
import { AttendeeService } from '../../../../service/attendee/attendee.service'; import { AttendeeService } from '../../../../service/attendee/attendee.service';
import { CurrentQuizService } from '../../../../service/current-quiz/current-quiz.service'; import { CurrentQuizService } from '../../../../service/current-quiz/current-quiz.service';
import { I18nService } from '../../../../service/i18n/i18n.service'; import { I18nService } from '../../../../service/i18n/i18n.service';
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { IMessage, INickname } from 'arsnova-click-v2-types/src/common'; import { IMessage, INickname } from 'arsnova-click-v2-types/dist/common';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { IQuestion } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestion } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { AttendeeService } from '../../../../service/attendee/attendee.service'; import { AttendeeService } from '../../../../service/attendee/attendee.service';
import { ConnectionService } from '../../../../service/connection/connection.service'; import { ConnectionService } from '../../../../service/connection/connection.service';
import { CurrentQuizService } from '../../../../service/current-quiz/current-quiz.service'; import { CurrentQuizService } from '../../../../service/current-quiz/current-quiz.service';
......
...@@ -3,7 +3,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; ...@@ -3,7 +3,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { TranslateCompiler, TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; import { TranslateCompiler, TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { SurveyQuestion } from 'arsnova-click-v2-types/src/questions/question_survey'; import { SurveyQuestion } from 'arsnova-click-v2-types/dist/questions/question_survey';
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
import { Attendee } from '../../../../lib/attendee/attendee'; import { Attendee } from '../../../../lib/attendee/attendee';
import { Countdown } from '../../../../lib/countdown/countdown'; import { Countdown } from '../../../../lib/countdown/countdown';
...@@ -112,42 +112,45 @@ describe('QuizResultsComponent', () => { ...@@ -112,42 +112,45 @@ describe('QuizResultsComponent', () => {
expect(component.showLeaderBoardButton(currentQuizService.questionIndex)).toBeTruthy(); expect(component.showLeaderBoardButton(currentQuizService.questionIndex)).toBeTruthy();
})); }));
it(`#showStopQuizButton`, inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => { it(`#showStopQuizButton`,
currentQuizService['_isOwner'] = true; inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => {
currentQuizService.currentQuestion().timer = 0; currentQuizService['_isOwner'] = true;
attendeeService.addMember(new Attendee({ currentQuizService.currentQuestion().timer = 0;
id: 0, attendeeService.addMember(new Attendee({
name: 'testNickname', id: 0,
groupName: 'Default', name: 'testNickname',
colorCode: '#00000', groupName: 'Default',
responses: [], colorCode: '#00000',
responses: [],
}));
expect(component.showStopQuizButton()).toBeTruthy();
})); }));
expect(component.showStopQuizButton()).toBeTruthy(); it(`#showStopCountdownButton`,
})); inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => {
currentQuizService.currentQuestion().timer = 10;
currentQuizService['_isOwner'] = true;
attendeeService.addMember(new Attendee({
id: 0,
name: 'testNickname',
groupName: 'Default',
colorCode: '#00000',
responses: [],
}));
component.countdown = new Countdown(currentQuizService.currentQuestion(), new Date().getTime());
it(`#showStopCountdownButton`, inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => { expect(component.countdown.isRunning).toBeTruthy();
currentQuizService.currentQuestion().timer = 10; expect(component.showStopCountdownButton()).toBeTruthy();
currentQuizService['_isOwner'] = true;
attendeeService.addMember(new Attendee({
id: 0,
name: 'testNickname',
groupName: 'Default',
colorCode: '#00000',
responses: [],
})); }));
component.countdown = new Countdown(currentQuizService.currentQuestion(), new Date().getTime());
expect(component.countdown.isRunning).toBeTruthy(); it(`#showStartQuizButton`,
expect(component.showStopCountdownButton()).toBeTruthy(); inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => {
})); currentQuizService['_isOwner'] = true;
currentQuizService.readingConfirmationRequested = true;
it(`#showStartQuizButton`, inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => { expect(component.showStartQuizButton()).toBeTruthy();
currentQuizService['_isOwner'] = true; }));
currentQuizService.readingConfirmationRequested = true;
expect(component.showStartQuizButton()).toBeTruthy();
}));
it(`#hideProgressbarCssStyle`, inject([CurrentQuizService], (currentQuizService: CurrentQuizService) => { it(`#hideProgressbarCssStyle`, inject([CurrentQuizService], (currentQuizService: CurrentQuizService) => {
currentQuizService.readingConfirmationRequested = false; currentQuizService.readingConfirmationRequested = false;
...@@ -155,25 +158,26 @@ describe('QuizResultsComponent', () => { ...@@ -155,25 +158,26 @@ describe('QuizResultsComponent', () => {
expect(component.hideProgressbarCssStyle()).toBeTruthy(); expect(component.hideProgressbarCssStyle()).toBeTruthy();
})); }));
it(`#showConfidenceRate`, inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => { it(`#showConfidenceRate`,
attendeeService.addMember(new Attendee({ inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => {
id: 0, attendeeService.addMember(new Attendee({
name: 'testNickname', id: 0,
groupName: 'Default', name: 'testNickname',
colorCode: '#00000', groupName: 'Default',
responses: [ colorCode: '#00000',
{ responses: [
value: 0, {
confidence: 20, value: 0,
readingConfirmation: true, confidence: 20,
responseTime: 10, readingConfirmation: true,
}, responseTime: 10,
], },
})); ],
currentQuizService.quiz.sessionConfig.confidenceSliderEnabled = true; }));
currentQuizService.quiz.sessionConfig.confidenceSliderEnabled = true;
expect(component.showConfidenceRate(component.selectedQuestionIndex)).toBeTruthy(); expect(component.showConfidenceRate(component.selectedQuestionIndex)).toBeTruthy();
})); }));
it(`#modifyVisibleQuestion`, inject([QuestionTextService], async (questionTextService: QuestionTextService) => { it(`#modifyVisibleQuestion`, inject([QuestionTextService], async (questionTextService: QuestionTextService) => {
spyOn(questionTextService, 'changeMultiple').and.callFake(() => {}); spyOn(questionTextService, 'changeMultiple').and.callFake(() => {});
...@@ -210,25 +214,26 @@ describe('QuizResultsComponent', () => { ...@@ -210,25 +214,26 @@ describe('QuizResultsComponent', () => {
} }
})); }));
it(`#showReadingConfirmation`, inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => { it(`#showReadingConfirmation`,
attendeeService.addMember(new Attendee({ inject([CurrentQuizService, AttendeeService], (currentQuizService: CurrentQuizService, attendeeService: AttendeeService) => {
id: 0, attendeeService.addMember(new Attendee({
name: 'testNickname', id: 0,
groupName: 'Default', name: 'testNickname',
colorCode: '#00000', groupName: 'Default',
responses: [ colorCode: '#00000',
{ responses: [
value: 0, {
confidence: 20, value: 0,
readingConfirmation: true, confidence: 20,
responseTime: 10, readingConfirmation: true,
}, responseTime: 10,
], },
})); ],
currentQuizService.quiz.sessionConfig.readingConfirmationEnabled = true; }));
currentQuizService.quiz.sessionConfig.readingConfirmationEnabled = true;
expect(component.showReadingConfirmation(component.selectedQuestionIndex)).toBeTruthy(); expect(component.showReadingConfirmation(component.selectedQuestionIndex)).toBeTruthy();
})); }));
it(`#showResponseProgress`, inject([CurrentQuizService], (currentQuizService: CurrentQuizService) => { it(`#showResponseProgress`, inject([CurrentQuizService], (currentQuizService: CurrentQuizService) => {
......
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { IMessage, INickname } from 'arsnova-click-v2-types/src/common'; import { IMessage, INickname } from 'arsnova-click-v2-types/dist/common';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { IQuestion } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestion } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { FreeTextQuestion } from 'arsnova-click-v2-types/src/questions/question_freetext'; import { FreeTextQuestion } from 'arsnova-click-v2-types/dist/questions/question_freetext';
import { RangedQuestion } from 'arsnova-click-v2-types/src/questions/question_ranged'; import { RangedQuestion } from 'arsnova-click-v2-types/dist/questions/question_ranged';
import { SurveyQuestion } from 'arsnova-click-v2-types/src/questions/question_survey'; import { SurveyQuestion } from 'arsnova-click-v2-types/dist/questions/question_survey';
import { Countdown } from '../../../../lib/countdown/countdown'; import { Countdown } from '../../../../lib/countdown/countdown';
import { QuizApiService } from '../../../service/api/quiz/quiz-api.service'; import { QuizApiService } from '../../../service/api/quiz/quiz-api.service';
import { AttendeeService } from '../../../service/attendee/attendee.service'; import { AttendeeService } from '../../../service/attendee/attendee.service';
......
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core'; import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { IMessage } from 'arsnova-click-v2-types/src/common'; import { IMessage } from 'arsnova-click-v2-types/dist/common';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { MemberApiService } from '../../../service/api/member/member-api.service'; import { MemberApiService } from '../../../service/api/member/member-api.service';
import { AttendeeService } from '../../../service/attendee/attendee.service'; import { AttendeeService } from '../../../service/attendee/attendee.service';
import { ConnectionService } from '../../../service/connection/connection.service'; import { ConnectionService } from '../../../service/connection/connection.service';
......
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { IMessage } from 'arsnova-click-v2-types/src/common'; import { IMessage } from 'arsnova-click-v2-types/dist/common';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { MultipleChoiceQuestion } from 'arsnova-click-v2-types/src/questions/question_choice_multiple'; import { MultipleChoiceQuestion } from 'arsnova-click-v2-types/dist/questions/question_choice_multiple';
import { SingleChoiceQuestion } from 'arsnova-click-v2-types/src/questions/question_choice_single'; import { SingleChoiceQuestion } from 'arsnova-click-v2-types/dist/questions/question_choice_single';
import { FreeTextQuestion } from 'arsnova-click-v2-types/src/questions/question_freetext'; import { FreeTextQuestion } from 'arsnova-click-v2-types/dist/questions/question_freetext';
import { RangedQuestion } from 'arsnova-click-v2-types/src/questions/question_ranged'; import { RangedQuestion } from 'arsnova-click-v2-types/dist/questions/question_ranged';
import { SurveyQuestion } from 'arsnova-click-v2-types/src/questions/question_survey'; import { SurveyQuestion } from 'arsnova-click-v2-types/dist/questions/question_survey';
import { Countdown } from '../../../../lib/countdown/countdown'; import { Countdown } from '../../../../lib/countdown/countdown';
import { MemberApiService } from '../../../service/api/member/member-api.service'; import { MemberApiService } from '../../../service/api/member/member-api.service';
import { QuizApiService } from '../../../service/api/quiz/quiz-api.service'; import { QuizApiService } from '../../../service/api/quiz/quiz-api.service';
......
...@@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router'; ...@@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
import { of } from 'rxjs/index'; import { of } from 'rxjs/index';
import { jwtOptionsFactory } from '../../../lib/jwt.factory'; import { jwtOptionsFactory } from '../../../lib/jwt.factory';
......
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core'; import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/src/communication_protocol'; import { COMMUNICATION_PROTOCOL } from 'arsnova-click-v2-types/dist/communication_protocol';
import { questionGroupReflection } from 'arsnova-click-v2-types/src/questions/questionGroup_reflection'; import { questionGroupReflection } from 'arsnova-click-v2-types/dist/questions/questionGroup_reflection';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { LobbyApiService } from '../../service/api/lobby/lobby-api.service'; import { LobbyApiService } from '../../service/api/lobby/lobby-api.service';
import { QuizApiService } from '../../service/api/quiz/quiz-api.service'; import { QuizApiService } from '../../service/api/quiz/quiz-api.service';
......
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { IAvailableNicks } from 'arsnova-click-v2-types/src/common'; import { IAvailableNicks } from 'arsnova-click-v2-types/dist/common';
import { parseGithubFlavoredMarkdown } from '../../../../lib/markdown/markdown'; import { parseGithubFlavoredMarkdown } from '../../../../lib/markdown/markdown';
import { ActiveQuestionGroupService } from '../../../service/active-question-group/active-question-group.service'; import { ActiveQuestionGroupService } from '../../../service/active-question-group/active-question-group.service';
import { NickApiService } from '../../../service/api/nick/nick-api.service'; import { NickApiService } from '../../../service/api/nick/nick-api.service';
...@@ -46,14 +46,14 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -46,14 +46,14 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
this.footerBarService.TYPE_REFERENCE = NicknameManagerComponent.TYPE; this.footerBarService.TYPE_REFERENCE = NicknameManagerComponent.TYPE;
this.footerBarService.replaceFooterElements([ this.footerBarService.replaceFooterElements([
this.footerBarService.footerElemBack, this.footerBarService.footerElemBack, this.footerBarService.footerElemBlockRudeNicknames, this.footerBarService.footerElemEnableCasLogin,
this.footerBarService.footerElemBlockRudeNicknames,
this.footerBarService.footerElemEnableCasLogin,
]); ]);
} }
public filterForKeyword(event: Event): void { public filterForKeyword(event: Event): void {
const searchValue = (<HTMLInputElement>event.target).value.toString().toLowerCase(); const searchValue = (
<HTMLInputElement>event.target
).value.toString().toLowerCase();
if (searchValue.length < this._previousSearchValue.length) { if (searchValue.length < this._previousSearchValue.length) {
this._availableNicks = Object.assign({}, this._availableNicksBackup); this._availableNicks = Object.assign({}, this._availableNicksBackup);
...@@ -164,14 +164,11 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -164,14 +164,11 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
} }
public ngOnInit(): void { public ngOnInit(): void {
this.nickApiService.getPredefinedNicks().subscribe( this.nickApiService.getPredefinedNicks().subscribe(data => {
data => { this.availableNicks = data;
this.availableNicks = data; }, error => {
}, console.log(error);
error => { });
console.log(error);
},
);
} }
public ngOnDestroy(): void { public ngOnDestroy(): void {
......
...@@ -5,8 +5,8 @@ import { ActivatedRoute } from '@angular/router'; ...@@ -5,8 +5,8 @@ import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { DefaultAnswerOption } from 'arsnova-click-v2-types/src/answeroptions/answeroption_default'; import { DefaultAnswerOption } from 'arsnova-click-v2-types/dist/answeroptions/answeroption_default';
import { IQuestionSurvey } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestionSurvey } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
import { createTranslateLoader } from '../../../../../../lib/translation.factory'; import { createTranslateLoader } from '../../../../../../lib/translation.factory';
import { HeaderComponent } from '../../../../../header/header/header.component'; import { HeaderComponent } from '../../../../../header/header/header.component';
......
import { Component, HostListener, OnDestroy, OnInit } from '@angular/core'; import { Component, HostListener, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { IQuestionChoice, IQuestionSurvey } from 'arsnova-click-v2-types/src/questions/interfaces'; import { IQuestionChoice, IQuestionSurvey } from 'arsnova-click-v2-types/dist/questions/interfaces';
import { DEVICE_TYPES, LIVE_PREVIEW_ENVIRONMENT } from '../../../../../../environments/environment'; import { DEVICE_TYPES, LIVE_PREVIEW_ENVIRONMENT } from '../../../../../../environments/environment';
import { ActiveQuestionGroupService } from '../../../../../service/active-question-group/active-question-group.service'; import { ActiveQuestionGroupService } from '../../../../../service/active-question-group/active-question-group.service';
import { HeaderLabelService } from '../../../../../service/header-label/header-label.service'; import { HeaderLabelService } from '../../../../../service/header-label/header-label.service';
...@@ -44,12 +44,18 @@ export class AnsweroptionsDefaultComponent implements OnInit, OnDestroy { ...@@ -44,12 +44,18 @@ export class AnsweroptionsDefaultComponent implements OnInit, OnDestroy {
} }
public updateAnswerValue(event: Event, index: number): void { public updateAnswerValue(event: Event, index: number): void {
this._question.answerOptionList[index].answerText = (<HTMLInputElement>event.target).value; this._question.answerOptionList[index].answerText = (
<HTMLInputElement>event.target
).value;
this.questionTextService.changeMultiple(this._question.answerOptionList.map(answer => answer.answerText)); this.questionTextService.changeMultiple(this._question.answerOptionList.map(answer => answer.answerText));
} }
public toggleMultipleSelectionSurvey(): void { public toggleMultipleSelectionSurvey(): void {
(<IQuestionSurvey>this._question).multipleSelectionEnabled = !(<IQuestionSurvey>this._question).multipleSelectionEnabled; (
<IQuestionSurvey>this._question
).multipleSelectionEnabled = !(
<IQuestionSurvey>this._question