* added watcher slide type to the slideshow
* auto reloading fixed on revision change * added shortening pipe to the comment field in watcher view
This commit is contained in:
parent
79227258e8
commit
ad8f5491b5
@ -18,20 +18,28 @@ export class SlideShowService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public nextSlide() {
|
public nextSlide() {
|
||||||
if (this.currentSlideIndex === this.slides.length - 1) {
|
switch (this.currentSlideIndex) {
|
||||||
|
case this.slides.length - 1:
|
||||||
this.currentSlideIndex++;
|
this.currentSlideIndex++;
|
||||||
this.router.navigate(['/kanban']);
|
this.router.navigate(['/kanban']);
|
||||||
} else if (this.currentSlideIndex === this.slides.length) {
|
break;
|
||||||
|
case this.slides.length:
|
||||||
|
this.currentSlideIndex++;
|
||||||
|
this.router.navigate(['/commit-tracker']);
|
||||||
|
break;
|
||||||
|
case this.slides.length + 1:
|
||||||
this.currentSlideIndex = -1;
|
this.currentSlideIndex = -1;
|
||||||
this.reloadSlides();
|
this.reloadSlides();
|
||||||
this.router.navigate(['/commit-tracker']);
|
this.router.navigate(['/watchers-fixed']);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
this.oddEven = !this.oddEven;
|
this.oddEven = !this.oddEven;
|
||||||
this.currentSlideIndex++;
|
this.currentSlideIndex++;
|
||||||
this.router.navigate([
|
this.router.navigate([
|
||||||
this.oddEven ? '/slideshow-odd' : '/slideshow-even',
|
this.oddEven ? '/slideshow-odd' : '/slideshow-even',
|
||||||
this.slides[this.currentSlideIndex].id
|
this.slides[this.currentSlideIndex].id
|
||||||
]);
|
]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<span class="author">{{issue.comment.name}}</span>
|
<span class="author">{{issue.comment.name}}</span>
|
||||||
<div class="metadata"><span class="date">{{issue.comment.date}}</span></div>
|
<div class="metadata"><span class="date">{{issue.comment.date}}</span></div>
|
||||||
<div class="text">{{issue.comment.content}}</div>
|
<div class="text">{{issue.comment.content|shortenText:500}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SelfUpdaterService {
|
export class SelfUpdaterService {
|
||||||
|
|
||||||
private appRevision: number = 0;
|
private appRevision = 0;
|
||||||
private initFailed = false;
|
private initFailed = false;
|
||||||
|
|
||||||
constructor(private httpClient: HttpClient,
|
constructor(private httpClient: HttpClient,
|
||||||
@ -16,7 +16,7 @@ export class SelfUpdaterService {
|
|||||||
() => {
|
() => {
|
||||||
console.log(
|
console.log(
|
||||||
'%c Couldn\'t load initial revision data from server. Self update disabled.',
|
'%c Couldn\'t load initial revision data from server. Self update disabled.',
|
||||||
'background: #222; color: #bada55;'
|
'background: #222; color: #FFC300;'
|
||||||
);
|
);
|
||||||
this.initFailed = true;
|
this.initFailed = true;
|
||||||
}
|
}
|
||||||
@ -31,7 +31,11 @@ export class SelfUpdaterService {
|
|||||||
if (!this.initFailed) {
|
if (!this.initFailed) {
|
||||||
this.getDeployedRevision().subscribe(revision => {
|
this.getDeployedRevision().subscribe(revision => {
|
||||||
if (revision > this.appRevision) {
|
if (revision > this.appRevision) {
|
||||||
this.locationService.go('/');
|
console.log(
|
||||||
|
`%c Version change detected (${this.appRevision}=>${revision}), reloading app.`,
|
||||||
|
'background: #222; color: #BADA55;'
|
||||||
|
);
|
||||||
|
window.location.reload(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user