Skip to content
Snippets Groups Projects
Commit a35d61df authored by jojohoch's avatar jojohoch
Browse files

[player] Add `responseProgress` to `vopStateChangedNotification`

When form changes the `responseProgress` is determined and sent
parent 07396efe
No related branches found
No related tags found
No related merge requests found
...@@ -118,11 +118,20 @@ export class FormComponent implements OnInit, OnDestroy { ...@@ -118,11 +118,20 @@ export class FormComponent implements OnInit, OnDestroy {
dataParts: { dataParts: {
pages: JSON.stringify(formModel.pages) pages: JSON.stringify(formModel.pages)
}, },
responseProgress: this.calculateResponseProgress(),
unitStateDataType: this.metaDataService.playerMetadata.supportedUnitStateDataTypes unitStateDataType: this.metaDataService.playerMetadata.supportedUnitStateDataTypes
}; };
this.veronaPostService.sendVopStateChangedNotification({ unitState }); this.veronaPostService.sendVopStateChangedNotification({ unitState });
} }
private calculateResponseProgress(): 'complete' | 'some' | 'none' {
if (this.form.valid) {
return 'complete';
}
const pages: FormArray = this.form.get('pages') as FormArray;
return (pages.controls.some(p => p.value)) ? 'some' : 'none';
}
onPresentedPageAdded(pagePresented: number): void { onPresentedPageAdded(pagePresented: number): void {
if (!this.presentedPages.includes(pagePresented)) { if (!this.presentedPages.includes(pagePresented)) {
this.presentedPages.push(pagePresented); this.presentedPages.push(pagePresented);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment