Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arsnova-lite
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
arsnova-lite
Commits
95d07b15
Commit
95d07b15
authored
5 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Add update notification
parent
b137d0f3
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!188
Add update notification
Pipeline
#26508
failed with stages
in 2 minutes and 17 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ngsw-config.json
+1
-0
1 addition, 0 deletions
ngsw-config.json
src/app/app.component.ts
+25
-5
25 additions, 5 deletions
src/app/app.component.ts
src/assets/i18n/home/de.json
+3
-1
3 additions, 1 deletion
src/assets/i18n/home/de.json
src/assets/i18n/home/en.json
+3
-1
3 additions, 1 deletion
src/assets/i18n/home/en.json
with
32 additions
and
7 deletions
ngsw-config.json
+
1
−
0
View file @
95d07b15
...
...
@@ -17,6 +17,7 @@
{
"name"
:
"app"
,
"installMode"
:
"prefetch"
,
"updateMode"
:
"prefetch"
,
"resources"
:
{
"files"
:
[
"/favicon.ico"
,
...
...
This diff is collapsed.
Click to expand it.
src/app/app.component.ts
+
25
−
5
View file @
95d07b15
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
ThemeService
}
from
'
../theme/theme.service
'
;
import
{
SwUpdate
}
from
'
@angular/service-worker
'
;
import
{
NotificationService
}
from
'
./services/util/notification.service
'
;
@
Component
({
selector
:
'
app-root
'
,
templateUrl
:
'
./app.component.html
'
,
styleUrls
:
[
'
./app.component.scss
'
]
})
export
class
AppComponent
{
export
class
AppComponent
implements
OnInit
{
constructor
(
private
translationService
:
TranslateService
,
private
themeService
:
ThemeService
)
{
private
update
:
SwUpdate
,
public
notification
:
NotificationService
)
{
translationService
.
setDefaultLang
(
this
.
translationService
.
getBrowserLang
());
sessionStorage
.
setItem
(
'
currentLang
'
,
this
.
translationService
.
getBrowserLang
());
}
title
=
'
ARSnova
'
;
ngOnInit
():
void
{
this
.
update
.
available
.
subscribe
(
update
=>
{
let
install
:
string
;
this
.
translationService
.
get
(
'
home-page.install
'
).
subscribe
(
msg
=>
{
install
=
msg
;
});
this
.
translationService
.
get
(
'
home-page.update-available
'
).
subscribe
(
msg
=>
{
this
.
notification
.
show
(
msg
,
install
,
{
duration
:
10000
});
});
this
.
notification
.
snackRef
.
afterDismissed
().
subscribe
(
info
=>
{
if
(
info
.
dismissedByAction
===
true
)
{
window
.
location
.
reload
();
}
});
});
}
}
This diff is collapsed.
Click to expand it.
src/assets/i18n/home/de.json
+
3
−
1
View file @
95d07b15
...
...
@@ -29,7 +29,9 @@
"no-empty-name"
:
"Bitte geben Sie einen Namen ein"
,
"created-1"
:
"Session '"
,
"created-2"
:
"' erfolgreich erstellt"
,
"only-numbers"
:
"Eine Session-ID besteht aus Ziffern"
"only-numbers"
:
"Eine Session-ID besteht aus Ziffern"
,
"update-available"
:
"Eine neue Version ist verfügbar."
,
"install"
:
"Installieren"
},
"login"
:
{
"email"
:
"E-mail"
,
...
...
This diff is collapsed.
Click to expand it.
src/assets/i18n/home/en.json
+
3
−
1
View file @
95d07b15
...
...
@@ -29,7 +29,9 @@
"no-empty-name"
:
"Please enter a name."
,
"created-1"
:
"Session '"
,
"created-2"
:
"' successfully created"
,
"only-numbers"
:
"A session-ID only contains digits"
"only-numbers"
:
"A session-ID only contains digits"
,
"update-available"
:
"A newer version is available."
,
"install"
:
"Install"
},
"login"
:
{
"email"
:
"E-mail"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment