generated from maximegris/angular-electron
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Action Selection Dialog: Hover Border * Recipe Command Blocks: OBS Source Visibility * Show UI Warning if Twitch Auth (soon) is invalid * Recipe Command Blocks: OBS Source Mute * update GH action to add the version to electron builds
- Loading branch information
Showing
15 changed files
with
336 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...i/src/lib/command-setting-dialog/obs-source-selection/obs-source-selection.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="two-columns"> | ||
<div class="column"> | ||
<mat-form-field> | ||
<mat-label>Select Source</mat-label> | ||
<input | ||
matInput | ||
[formControl]="sourceFormControl" | ||
[matAutocomplete]="sourceAutocomplete"> | ||
<mat-autocomplete #sourceAutocomplete="matAutocomplete" | ||
(optionSelected)="payloadChanged.next($event.option.value)"> | ||
<mat-option *ngFor="let source of filteredSourceList$ | async" | ||
[value]="source"> | ||
{{source}} | ||
</mat-option> | ||
</mat-autocomplete> | ||
</mat-form-field> | ||
</div> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
...i/src/lib/command-setting-dialog/obs-source-selection/obs-source-selection.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.column { | ||
margin: 0 0.5rem; | ||
} |
80 changes: 80 additions & 0 deletions
80
...-ui/src/lib/command-setting-dialog/obs-source-selection/obs-source-selection.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import {Component, Input, OnInit, Output} from '@angular/core'; | ||
import {combineLatest, from, Subject} from "rxjs"; | ||
import {FormControl} from "@angular/forms"; | ||
import {map, startWith} from "rxjs/operators"; | ||
import {ENDPOINTS, ObsSourceEntry} from "@memebox/contracts"; | ||
import {Scene} from "obs-websocket-js"; | ||
import {MemeboxApiService} from "@memebox/app-state"; | ||
|
||
@Component({ | ||
selector: 'app-obs-source-selection', | ||
templateUrl: './obs-source-selection.component.html', | ||
styleUrls: ['./obs-source-selection.component.scss'] | ||
}) | ||
export class ObsSourceSelectionComponent implements OnInit { | ||
private _destroy$ = new Subject<void>(); | ||
|
||
public sourceFormControl = new FormControl(); | ||
|
||
@Output() | ||
public readonly payloadChanged = new Subject<string>(); | ||
|
||
@Input() | ||
public payload: string|null = null; | ||
|
||
public allSourceListAsync = this.memeboxApi.get<ObsSourceEntry[]>( | ||
`${ENDPOINTS.OBS_DATA.PREFIX}${ENDPOINTS.OBS_DATA.SOURCE_LIST}` | ||
); | ||
|
||
public allSceneListAsync = this.memeboxApi.get<Scene[]>( | ||
`${ENDPOINTS.OBS_DATA.PREFIX}${ENDPOINTS.OBS_DATA.SCENE_LIST}` | ||
); | ||
|
||
|
||
public filteredSourceList$ = combineLatest([ | ||
this.sourceFormControl.valueChanges.pipe( | ||
startWith(''), | ||
), | ||
from(this.allSourceListAsync), | ||
from(this.allSceneListAsync) | ||
]).pipe( | ||
map(([enteredText, allSources, allScenes]) => { | ||
const completeList = [ | ||
...(allSources?.map(s => s.name) ?? []), | ||
...(allScenes?.map(s => s.name) ?? []) | ||
]; | ||
|
||
if (!enteredText) { | ||
return completeList; | ||
} | ||
|
||
enteredText = enteredText.toLowerCase(); | ||
|
||
return completeList?.filter(s => s.toLowerCase().includes(enteredText)); | ||
}) | ||
); | ||
|
||
constructor( | ||
private memeboxApi: MemeboxApiService, | ||
) { | ||
// Load State once | ||
|
||
} | ||
|
||
ngOnInit(): void { | ||
if (this.payload) { | ||
this.sourceFormControl.patchValue(this.payload); | ||
|
||
setTimeout(() => { | ||
if (this.payload) { | ||
this.payloadChanged.next(this.payload); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this._destroy$.next(); | ||
this._destroy$.complete(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.