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
2ce0dd56
Commit
2ce0dd56
authored
Nov 13, 2019
by
Christopher Mark Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes unnecessary providers in the root module. Fixes isActive state of the startQuiz button
parent
1b60a385
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
71 deletions
+23
-71
src/app/quiz/quiz-manager/quiz-manager/quiz-manager.component.ts
.../quiz/quiz-manager/quiz-manager/quiz-manager.component.ts
+1
-11
src/app/root.module.ts
src/app/root.module.ts
+7
-57
src/app/service/attendee/attendee.service.ts
src/app/service/attendee/attendee.service.ts
+1
-1
src/app/service/footer-bar/footer-bar.service.ts
src/app/service/footer-bar/footer-bar.service.ts
+13
-2
src/app/service/quiz/quiz.service.ts
src/app/service/quiz/quiz.service.ts
+1
-0
No files found.
src/app/quiz/quiz-manager/quiz-manager/quiz-manager.component.ts
View file @
2ce0dd56
...
...
@@ -3,7 +3,6 @@ import { Router } from '@angular/router';
import
{
NgbModal
}
from
'
@ng-bootstrap/ng-bootstrap
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
Subject
}
from
'
rxjs
'
;
import
{
takeUntil
}
from
'
rxjs/operators
'
;
import
{
environment
}
from
'
../../../../environments/environment
'
;
import
{
availableQuestionTypes
,
IAvailableQuestionType
}
from
'
../../../lib/available-question-types
'
;
import
{
DefaultAnswerEntity
}
from
'
../../../lib/entities/answer/DefaultAnswerEntity
'
;
...
...
@@ -71,6 +70,7 @@ export class QuizManagerComponent implements OnInit, OnDestroy {
}
self
.
isLoading
=
true
;
this
.
quizApiService
.
setQuiz
(
this
.
quizService
.
quiz
).
subscribe
(
updatedQuiz
=>
{
this
.
quizService
.
quiz
=
updatedQuiz
;
this
.
router
.
navigate
([
'
/quiz
'
,
'
flow
'
,
'
lobby
'
]);
self
.
isLoading
=
false
;
});
...
...
@@ -78,16 +78,6 @@ export class QuizManagerComponent implements OnInit, OnDestroy {
}
public
ngOnInit
():
void
{
this
.
quizService
.
quizUpdateEmitter
.
pipe
(
takeUntil
(
this
.
_destroy
)).
subscribe
(()
=>
{
this
.
footerBarService
.
footerElemStartQuiz
.
isActive
=
this
.
quizService
.
isValid
()
&&
this
.
connectionService
.
serverAvailable
;
});
this
.
connectionService
.
serverStatusEmitter
.
pipe
(
takeUntil
(
this
.
_destroy
)).
subscribe
(()
=>
{
this
.
footerBarService
.
footerElemStartQuiz
.
isActive
=
this
.
quizService
.
isValid
()
&&
this
.
connectionService
.
serverAvailable
;
this
.
footerBarService
.
footerElemNicknames
.
isActive
=
this
.
connectionService
.
serverAvailable
;
});
this
.
footerBarService
.
footerElemNicknames
.
isActive
=
this
.
connectionService
.
serverAvailable
;
this
.
quizService
.
loadDataToEdit
(
sessionStorage
.
getItem
(
StorageKey
.
CurrentQuizName
));
}
...
...
src/app/root.module.ts
View file @
2ce0dd56
...
...
@@ -27,30 +27,8 @@ import { LoginComponent } from './root/login/login.component';
import
{
RootComponent
}
from
'
./root/root/root.component
'
;
import
{
ThemeSwitcherComponent
}
from
'
./root/theme-switcher/theme-switcher.component
'
;
import
rxStompConfig
from
'
./rx-stomp.config
'
;
import
{
AttendeeService
}
from
'
./service/attendee/attendee.service
'
;
import
{
ConnectionService
}
from
'
./service/connection/connection.service
'
;
import
{
CustomMarkdownService
}
from
'
./service/custom-markdown/custom-markdown.service
'
;
import
{
FileUploadService
}
from
'
./service/file-upload/file-upload.service
'
;
import
{
FooterBarService
}
from
'
./service/footer-bar/footer-bar.service
'
;
import
{
HeaderLabelService
}
from
'
./service/header-label/header-label.service
'
;
import
{
I18nService
}
from
'
./service/i18n/i18n.service
'
;
import
{
LanguageLoaderService
}
from
'
./service/language-loader/language-loader.service
'
;
import
{
CasLoginService
}
from
'
./service/login/cas-login.service
'
;
import
{
StaticLoginService
}
from
'
./service/login/static-login.service
'
;
import
{
ModalOrganizerService
}
from
'
./service/modal-organizer/modal-organizer.service
'
;
import
{
ProjectLoaderService
}
from
'
./service/project-loader/project-loader.service
'
;
import
{
QuestionTextService
}
from
'
./service/question-text/question-text.service
'
;
import
{
QuizService
}
from
'
./service/quiz/quiz.service
'
;
import
{
SettingsService
}
from
'
./service/settings/settings.service
'
;
import
{
SharedService
}
from
'
./service/shared/shared.service
'
;
import
{
StorageService
}
from
'
./service/storage/storage.service
'
;
import
{
ThemesService
}
from
'
./service/themes/themes.service
'
;
import
{
TrackingService
}
from
'
./service/tracking/tracking.service
'
;
import
{
UpdateCheckService
}
from
'
./service/update-check/update-check.service
'
;
import
{
UserRoleGuardService
}
from
'
./service/user-role-guard/user-role-guard.service
'
;
import
{
UserService
}
from
'
./service/user/user.service
'
;
import
{
SharedModule
}
from
'
./shared/shared.module
'
;
import
{
ArsnovaClickAngulartics2Piwik
}
from
'
./shared/tracking/ArsnovaClickAngulartics2Piwik
'
;
const
appRoutes
:
Routes
=
[
{
...
...
@@ -163,11 +141,6 @@ export function markedOptionsFactory(): MarkedOptions {
}),
],
providers
:
[
/* {
provide: ErrorHandler,
useClass: GlobalErrorHandler,
}, */
CustomMarkdownService
,
{
provide
:
InjectableRxStompConfig
,
useValue
:
rxStompConfig
,
...
...
@@ -178,44 +151,21 @@ export function markedOptionsFactory(): MarkedOptions {
deps
:
[
InjectableRxStompConfig
],
},
SimpleMQ
,
UserService
,
RoutePreloader
,
StorageService
,
I18nService
,
FooterBarService
,
ConnectionService
,
QuizService
,
CasLoginService
,
FileUploadService
,
SettingsService
,
NgbActiveModal
,
SharedService
,
AttendeeService
,
HeaderLabelService
,
QuestionTextService
,
ThemesService
,
ArsnovaClickAngulartics2Piwik
,
TrackingService
,
UpdateCheckService
,
UserRoleGuardService
,
LanguageLoaderService
,
ProjectLoaderService
,
ModalOrganizerService
,
],
bootstrap
:
[
RootComponent
],
})
export
class
RootModule
{
constructor
()
{
if
(
environment
.
production
)
{
const
console
:
any
=
{};
console
.
log
=
function
():
void
{};
// tslint:disable-next-line:no-console
console
.
info
=
function
():
void
{};
// tslint:disable-next-line:no-console
console
.
trace
=
function
():
void
{};
console
.
warn
=
function
():
void
{};
console
.
error
=
window
.
console
.
error
;
(
window
as
any
).
console
=
console
;
(
window
as
any
).
console
=
{
log
:
function
():
void
{},
info
:
function
():
void
{},
trace
:
function
():
void
{},
warn
:
function
():
void
{},
error
:
window
.
console
.
error
,
};
}
}
}
src/app/service/attendee/attendee.service.ts
View file @
2ce0dd56
...
...
@@ -123,9 +123,9 @@ export class AttendeeService {
return
;
}
if
(
quiz
.
state
===
QuizState
.
Inactive
)
{
this
.
footerBarService
.
footerElemStartQuiz
.
isActive
=
this
.
_attendees
.
length
>
0
;
return
;
}
this
.
footerBarService
.
footerElemStartQuiz
.
isActive
=
this
.
_attendees
.
length
>
0
;
console
.
log
(
'
AttendeeService#loadData
'
,
'
quiz set
'
,
quiz
);
this
.
restoreMembers
();
...
...
src/app/service/footer-bar/footer-bar.service.ts
View file @
2ce0dd56
...
...
@@ -410,6 +410,8 @@ export class FooterBarService {
return
this
.
_footerElements
;
}
private
_connectionState
:
RxStompState
;
constructor
(
@
Inject
(
PLATFORM_ID
)
private
platformId
:
Object
,
private
userService
:
UserService
,
...
...
@@ -420,7 +422,9 @@ export class FooterBarService {
)
{
this
.
rxStompService
.
connectionState$
.
subscribe
(
value
=>
{
this
.
_connectionState
=
value
;
this
.
toggleFooterElemState
(
value
===
RxStompState
.
OPEN
);
console
.
log
(
'
setting active state
'
,
value
===
RxStompState
.
OPEN
);
});
this
.
quizService
.
quizUpdateEmitter
.
pipe
(
filter
(
quiz
=>
!!
quiz
)).
subscribe
(()
=>
{
...
...
@@ -483,27 +487,34 @@ export class FooterBarService {
this
.
footerElemImport
.
isActive
=
isActive
;
this
.
footerElemLogin
.
isActive
=
isActive
;
this
.
footerElemAdmin
.
isActive
=
isActive
;
this
.
footerElemStartQuiz
.
isActive
=
this
.
quizService
.
isValid
()
&&
isActive
;
this
.
footerElemNicknames
.
isActive
=
isActive
;
}
private
updateFooterElementsState
():
void
{
this
.
footerElemReadingConfirmation
.
isActive
=
!!
this
.
quizService
.
quiz
.
sessionConfig
.
readingConfirmationEnabled
;
this
.
footerElemConfidenceSlider
.
isActive
=
!!
this
.
quizService
.
quiz
.
sessionConfig
.
confidenceSliderEnabled
;
this
.
footerElemStartQuiz
.
isActive
=
this
.
quizService
.
isValid
()
&&
this
.
_connectionState
===
RxStompState
.
OPEN
;
console
.
log
(
'
updating footer elements state
'
,
this
.
quizService
.
isValid
(),
this
.
_connectionState
===
RxStompState
.
OPEN
);
this
.
footerElemExport
.
restoreClickCallback
();
this
.
footerElemExport
.
onClickCallback
=
async
()
=>
{
const
link
=
`
${
DefaultSettings
.
httpApiEndpoint
}
/quiz/export/
${
this
.
quizService
.
quiz
.
name
}
/
${
sessionStorage
.
getItem
(
StorageKey
.
PrivateKey
)}
/
${
this
.
quizService
.
quiz
.
sessionConfig
.
theme
}
/
${
this
.
translateService
.
currentLang
}
`
;
window
.
open
(
link
);
};
this
.
footerElemEnableCasLogin
.
restoreClickCallback
();
this
.
footerElemEnableCasLogin
.
isActive
=
this
.
quizService
.
quiz
.
sessionConfig
.
nicks
.
restrictToCasLogin
;
this
.
footerElemBlockRudeNicknames
.
isActive
=
this
.
quizService
.
quiz
.
sessionConfig
.
nicks
.
blockIllegalNicks
;
this
.
footerElemEnableCasLogin
.
onClickCallback
=
()
=>
{
const
newState
=
!
this
.
footerElemEnableCasLogin
.
isActive
;
this
.
footerElemEnableCasLogin
.
isActive
=
newState
;
this
.
quizService
.
quiz
.
sessionConfig
.
nicks
.
restrictToCasLogin
=
newState
;
this
.
quizService
.
persist
();
};
this
.
footerElemBlockRudeNicknames
.
restoreClickCallback
();
this
.
footerElemBlockRudeNicknames
.
isActive
=
this
.
quizService
.
quiz
.
sessionConfig
.
nicks
.
blockIllegalNicks
;
this
.
footerElemBlockRudeNicknames
.
onClickCallback
=
()
=>
{
const
newState
=
!
this
.
footerElemBlockRudeNicknames
.
isActive
;
this
.
footerElemBlockRudeNicknames
.
isActive
=
newState
;
...
...
src/app/service/quiz/quiz.service.ts
View file @
2ce0dd56
...
...
@@ -83,6 +83,7 @@ export class QuizService {
if
(
this
.
_isInEditMode
)
{
this
.
quizApiService
.
putSavedQuiz
(
this
.
quiz
).
subscribe
();
this
.
quizUpdateEmitter
.
next
(
this
.
quiz
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment