Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
arsnova-click-v2-frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
ARSnova
arsnova-click-v2-frontend
Commits
c05fd33b
Commit
c05fd33b
authored
Nov 17, 2019
by
Christopher Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes database closed error
parent
c657e811
Pipeline
#33612
passed with stages
in 14 minutes and 54 seconds
Changes
9
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
30 deletions
+34
-30
app.db.ts
src/app/lib/db/app.db.ts
+1
-1
ITrackClickEvent.ts
src/app/lib/interfaces/tracking/ITrackClickEvent.ts
+6
-0
ITrackConversionEvent.ts
src/app/lib/interfaces/tracking/ITrackConversionEvent.ts
+4
-0
ITrackEvent.ts
src/app/lib/interfaces/tracking/ITrackEvent.ts
+9
-0
home.component.ts
src/app/root/home/home.component.ts
+2
-1
footer-bar.service.ts
src/app/service/footer-bar/footer-bar.service.ts
+0
-1
storage.service.ts
src/app/service/storage/storage.service.ts
+2
-2
tracking.service.ts
src/app/service/tracking/tracking.service.ts
+6
-22
user.service.ts
src/app/service/user/user.service.ts
+4
-3
No files found.
src/app/lib/db/app.db.ts
View file @
c05fd33b
...
...
@@ -36,7 +36,7 @@ export class AppDb extends Dexie {
};
sessionStorage
.
setItem
(
StorageKey
.
PrivateKey
,
privateKey
.
value
);
this
.
Config
.
put
(
privateKey
).
then
(()
=>
this
.
initialized
.
next
());
});
})
.
catch
(()
=>
{})
;
}
...
...
src/app/lib/interfaces/tracking/ITrackClickEvent.ts
0 → 100644
View file @
c05fd33b
export
interface
ITrackClickEvent
{
action
:
string
;
label
:
string
;
value
?:
number
;
customDimensions
?:
any
;
}
src/app/lib/interfaces/tracking/ITrackConversionEvent.ts
0 → 100644
View file @
c05fd33b
export
interface
ITrackConversionEvent
{
action
:
string
;
label
?:
string
;
}
src/app/lib/interfaces/tracking/ITrackEvent.ts
0 → 100644
View file @
c05fd33b
import
{
TrackingCategoryType
}
from
'
../../enums/enums
'
;
export
interface
ITrackEvent
{
action
:
string
;
category
:
TrackingCategoryType
;
label
:
string
;
value
?:
number
;
customDimensions
?:
any
;
}
src/app/root/home/home.component.ts
View file @
c05fd33b
...
...
@@ -17,6 +17,7 @@ import { MessageProtocol, StatusProtocol } from '../../lib/enums/Message';
import
{
QuestionType
}
from
'
../../lib/enums/QuestionType
'
;
import
{
QuizState
}
from
'
../../lib/enums/QuizState
'
;
import
{
UserRole
}
from
'
../../lib/enums/UserRole
'
;
import
{
ITrackClickEvent
}
from
'
../../lib/interfaces/tracking/ITrackClickEvent
'
;
import
{
AvailableQuizzesComponent
}
from
'
../../modals/available-quizzes/available-quizzes.component
'
;
import
{
MemberApiService
}
from
'
../../service/api/member/member-api.service
'
;
import
{
QuizApiService
}
from
'
../../service/api/quiz/quiz-api.service
'
;
...
...
@@ -31,7 +32,7 @@ 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
{
ITrackClickEvent
,
TrackingService
}
from
'
../../service/tracking/tracking.service
'
;
import
{
TrackingService
}
from
'
../../service/tracking/tracking.service
'
;
import
{
UserService
}
from
'
../../service/user/user.service
'
;
@
Component
({
...
...
src/app/service/footer-bar/footer-bar.service.ts
View file @
c05fd33b
...
...
@@ -379,7 +379,6 @@ export class FooterBarService {
logout
:
true
,
},
},
()
=>
{
this
.
userService
.
logout
();
});
public
footerElemEditI18n
:
IFooterBarElement
=
new
FooterbarElement
({
id
:
'
edit-i18n
'
,
...
...
src/app/service/storage/storage.service.ts
View file @
c05fd33b
...
...
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import
{
Observable
,
ReplaySubject
,
Subject
}
from
'
rxjs
'
;
import
{
takeUntil
}
from
'
rxjs/operators
'
;
import
{
AppDb
}
from
'
../../lib/db/app.db
'
;
import
{
Db
Name
,
Db
State
,
StorageKey
}
from
'
../../lib/enums/enums
'
;
import
{
DbState
,
StorageKey
}
from
'
../../lib/enums/enums
'
;
@
Injectable
({
providedIn
:
'
root
'
,
...
...
@@ -24,7 +24,7 @@ export class StorageService {
return
this
.
_db
.
initialized
;
}
return
this
.
initDb
(
username
||
DbName
.
Default
);
return
this
.
initDb
(
username
);
}
private
initDb
(
dbName
):
Observable
<
void
>
{
...
...
src/app/service/tracking/tracking.service.ts
View file @
c05fd33b
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Angulartics2
}
from
'
angulartics2
'
;
import
{
TrackingCategoryType
}
from
'
../../lib/enums/enums
'
;
import
{
ITrackClickEvent
}
from
'
../../lib/interfaces/tracking/ITrackClickEvent
'
;
import
{
ITrackConversionEvent
}
from
'
../../lib/interfaces/tracking/ITrackConversionEvent
'
;
import
{
ITrackEvent
}
from
'
../../lib/interfaces/tracking/ITrackEvent
'
;
import
{
ArsnovaClickAngulartics2Piwik
}
from
'
../../shared/tracking/ArsnovaClickAngulartics2Piwik
'
;
interface
ITrackEvent
{
action
:
string
;
category
:
TrackingCategoryType
;
label
:
string
;
value
?:
number
;
customDimensions
?:
any
;
}
export
interface
ITrackClickEvent
{
action
:
string
;
label
:
string
;
value
?:
number
;
customDimensions
?:
any
;
}
export
interface
ITrackConversionEvent
{
action
:
string
;
label
?:
string
;
}
@
Injectable
({
providedIn
:
'
root
'
,
})
...
...
@@ -44,7 +26,9 @@ export class TrackingService {
},
});
}
catch
(
ex
)
{
console
.
error
(
ex
.
message
);
if
(
!
(
ex
instanceof
ReferenceError
))
{
console
.
error
(
ex
.
message
);
}
}
}
...
...
src/app/service/user/user.service.ts
View file @
c05fd33b
...
...
@@ -4,7 +4,7 @@ import { JwtHelperService } from '@auth0/angular-jwt';
import
{
ReplaySubject
,
Subject
}
from
'
rxjs
'
;
import
{
filter
,
takeUntil
}
from
'
rxjs/operators
'
;
import
{
QuizEntity
}
from
'
../../lib/entities/QuizEntity
'
;
import
{
DbState
,
StorageKey
}
from
'
../../lib/enums/enums
'
;
import
{
Db
Name
,
Db
State
,
StorageKey
}
from
'
../../lib/enums/enums
'
;
import
{
StatusProtocol
}
from
'
../../lib/enums/Message
'
;
import
{
UserRole
}
from
'
../../lib/enums/UserRole
'
;
import
{
ILoginSerialized
}
from
'
../../lib/interfaces/ILoginSerialized
'
;
...
...
@@ -27,7 +27,7 @@ export class UserService {
this
.
_casTicket
=
null
;
this
.
_staticLoginToken
=
null
;
this
.
_staticLoginTokenContent
=
null
;
this
.
_username
=
null
;
this
.
_username
=
DbName
.
Default
;
this
.
deleteTokens
();
}
else
{
this
.
_staticLoginTokenContent
=
this
.
decodeToken
();
...
...
@@ -88,7 +88,8 @@ export class UserService {
private
quizService
:
QuizService
,
)
{
this
.
storageService
.
stateNotifier
.
pipe
(
filter
(
type
=>
this
.
username
&&
type
!==
null
&&
type
!==
DbState
.
Destroy
)).
subscribe
((
type
)
=>
{
this
.
storageService
.
stateNotifier
.
pipe
(
filter
(
type
=>
this
.
username
!==
DbName
.
Default
&&
type
!==
null
&&
type
!==
DbState
.
Destroy
))
.
subscribe
(()
=>
{
if
(
this
.
_staticLoginTokenContent
&&
this
.
_staticLoginTokenContent
.
privateKey
)
{
console
.
log
(
'
UserService: having static token content with private key
'
);
...
...
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