Merge branch 'valid' into 'master'

Block requesting invalid Service items from UI.

See merge request openlp/web-remote!20
This commit is contained in:
Raoul Snyman 2020-05-20 17:04:53 +00:00
commit 24c74ab3c9
3 changed files with 16 additions and 11 deletions

2
.gitignore vendored
View File

@ -21,7 +21,7 @@
.vscode/* .vscode/*
!.vscode/settings.json !.vscode/settings.json
!.vscode/tasks.json !.vscode/tasks.json
!.vscode/launch.json .vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
# misc # misc

View File

@ -20,9 +20,11 @@ export class ServiceComponent implements OnInit {
} }
onItemSelected(item) { onItemSelected(item) {
if (item.is_valid) {
this.openlpService.setServiceItem(item.id).subscribe(); this.openlpService.setServiceItem(item.id).subscribe();
this.router.navigate(['slides']); this.router.navigate(['slides']);
} }
}
getServiceItems() { getServiceItems() {
this.openlpService.getServiceItems().subscribe(items => this.items = items); this.openlpService.getServiceItems().subscribe(items => this.items = items);
@ -35,7 +37,9 @@ export class ServiceComponent implements OnInit {
} }
getIcon(item: ServiceItem): string { getIcon(item: ServiceItem): string {
if (item.plugin === 'songs') { if (!item.is_valid) {
return 'delete';
} else if (item.plugin === 'songs') {
return 'queue_music'; return 'queue_music';
} else if (item.plugin === 'images') { } else if (item.plugin === 'images') {
return 'image'; return 'image';

View File

@ -32,6 +32,7 @@ export interface ServiceItem {
plugin: string; plugin: string;
selected: boolean; selected: boolean;
title: string; title: string;
is_valid: boolean;
} }
export interface Theme { export interface Theme {