Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the motionsensor value to string #1171

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-content" *ngIf="reportOfFire.motionSensor">
<div class="page-content" *ngIf="reportOfFire.motionSensor === 'yes'">
<div class="rof-text-primary-header">{{ title }}</div>
<div class="rof-text-secondary-header">{{ message }}</div>
<div id="compass-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ async getOrientation() {
handler(e, self) {
if (self.reportOfFire?.headingDetectionActive){
if (!e.alpha && !e.webkitCompassHeading){
this.reportOfFire.motionSensor = false;
this.reportOfFire.motionSensor = 'no';
this.skip()
}
else {
this.reportOfFire.motionSensor = true;
this.reportOfFire.motionSensor = 'yes';
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class RoFComplexQuestionPage extends RoFPage {
previousPage() {
if (this.id === 'distance-page'){
this.reportOfFire.headingDetectionActive = true;
if (this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'yes') {
this.previous();
} else{
this.reportOfFirePage.selectPage('callback-page',null,false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class RoFContactPage extends RoFPage {
}

nextPage() {
if (this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'yes') {
this.next();
} else{
this.reportOfFirePage.selectPage('distance-page',null,false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export class ReportOfFirePage implements OnInit, AfterContentInit {
skip () {
if (this.currentPage.instance.id === 'callback-page' || this.currentPage.instance.id === 'contact-page') {
this.reportOfFire.headingDetectionActive = true;
if (!this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'no') {
this.selectPage('distance-page',null,false);
} else {
this.currentPage.instance.skip();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ export class ReportOfFire {
public currentLocation: Array<number> = [0, 0];
public compassHeading: number = 0;
public headingDetectionActive: boolean;
public motionSensor: boolean;
public motionSensor: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class RoFPage {
public updateAttribute: string;
public showProgress: boolean;
public allowMultiSelect: boolean;
public motionSensor: boolean;

initialize (data: any, index: number, reportOfFire: ReportOfFire) {
this.allowExit = data.allowExit;
Expand All @@ -49,7 +48,6 @@ export class RoFPage {
this.previousId = data.previousId || null;
this.nextId = data.nextId || null;
this.skipId = data.skipId || null;
this.motionSensor = false;
}

previous () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class RoFSimpleQuestionPage extends RoFPage {
skipPage(){
if (this.id === 'callback-page') {
this.reportOfFire.headingDetectionActive = true;
if (this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'yes') {
this.skip();
} else {
this.reportOfFirePage.selectPage('distance-page',null,false);
Expand Down
Loading