From 2c4a0e30288051ff03fbc98d07029d10be9e7496 Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Mon, 10 Oct 2022 15:09:58 +0100 Subject: [PATCH 01/11] fix(questionsPage): auto next enabled bug --- .../pages/questions/containers/questions-page.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/pages/questions/containers/questions-page.component.ts b/src/app/pages/questions/containers/questions-page.component.ts index 3373a692e..5ebd2eaf1 100644 --- a/src/app/pages/questions/containers/questions-page.component.ts +++ b/src/app/pages/questions/containers/questions-page.component.ts @@ -206,15 +206,16 @@ export class QuestionsPageComponent implements OnInit { } nextAction(event) { - if (event == NextButtonEventType.AUTO) return this.nextQuestion() + if (event == NextButtonEventType.AUTO) + return setTimeout(() => this.nextQuestion(true), 100) if (event == NextButtonEventType.ENABLE) return setTimeout(() => this.updateToolbarButtons(), 100) if (event == NextButtonEventType.DISABLE) return (this.isRightButtonDisabled = true) } - nextQuestion() { - if (this.isRightButtonDisabled) return + nextQuestion(force?: boolean) { + if (this.isRightButtonDisabled && !force) return const questionPosition = this.questionsService.getNextQuestion( this.groupedQuestions, From b810aca5fd9bd65fb6a29c34339fcc2a5c253710 Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Mon, 10 Oct 2022 15:10:12 +0100 Subject: [PATCH 02/11] fix: reset questionnaires on protocol change --- src/app/core/services/config/config.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/core/services/config/config.service.ts b/src/app/core/services/config/config.service.ts index 810980585..4d7a46aae 100755 --- a/src/app/core/services/config/config.service.ts +++ b/src/app/core/services/config/config.service.ts @@ -206,6 +206,7 @@ export class ConfigService { } updateConfigStateOnProtocolChange(protocol) { + this.questionnaire.reset() const assessments = protocol.protocols this.logger.log(assessments) return this.questionnaire From fa4bd273e387650a5419403025b944449fbc156c Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Mon, 10 Oct 2022 15:10:44 +0100 Subject: [PATCH 03/11] fix(taskCalendar): task calendar config name incorrect --- src/app/pages/home/containers/home-page.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index 0b2ef6607..3ec873239 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -84,7 +84,7 @@ (task)="startQuestionnaire($event)" [tasks]="sortedTasks | async" [currentDate]="currentDate.getTime()" - [isTaskNameShown]="isTaskNameShown" + [isTaskNameShown]="isTaskCalendarTaskNameShown" > From 9f74a1466b9c1dce216060abaa89a207b616954e Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Mon, 10 Oct 2022 17:04:31 +0100 Subject: [PATCH 04/11] fix(questionsPage): undo forcing next question and remove check for rightbuttondisabled since this is automatically done --- .../pages/questions/containers/questions-page.component.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/pages/questions/containers/questions-page.component.ts b/src/app/pages/questions/containers/questions-page.component.ts index 5ebd2eaf1..6ddd7f413 100644 --- a/src/app/pages/questions/containers/questions-page.component.ts +++ b/src/app/pages/questions/containers/questions-page.component.ts @@ -207,16 +207,14 @@ export class QuestionsPageComponent implements OnInit { nextAction(event) { if (event == NextButtonEventType.AUTO) - return setTimeout(() => this.nextQuestion(true), 100) + return setTimeout(() => this.nextQuestion(), 100) if (event == NextButtonEventType.ENABLE) return setTimeout(() => this.updateToolbarButtons(), 100) if (event == NextButtonEventType.DISABLE) return (this.isRightButtonDisabled = true) } - nextQuestion(force?: boolean) { - if (this.isRightButtonDisabled && !force) return - + nextQuestion() { const questionPosition = this.questionsService.getNextQuestion( this.groupedQuestions, this.currentQuestionGroupId From d5ac9a903b4fe5bd57a8a340557ce65a94abd1f7 Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Mon, 10 Oct 2022 18:02:17 +0100 Subject: [PATCH 05/11] chore: bump versions --- config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.xml b/config.xml index dd3233eef..2085d7fb7 100755 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + RADAR Questionnaire An application that collects active data for research. RADAR-Base From 8ecbc8c803c239d69538777ce8d457f01511a722 Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Mon, 10 Oct 2022 23:25:08 +0100 Subject: [PATCH 06/11] fix: use promise/async for remote config params --- .../home/containers/home-page.component.html | 4 ++-- .../home/containers/home-page.component.ts | 10 ++-------- .../containers/questions-page.component.html | 2 +- .../containers/questions-page.component.ts | 2 +- .../questions/services/questions.service.ts | 18 ++++++++++-------- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index 3ec873239..08e8b1d04 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -79,12 +79,12 @@
diff --git a/src/app/pages/home/containers/home-page.component.ts b/src/app/pages/home/containers/home-page.component.ts index d00ced3d6..7eace3e06 100755 --- a/src/app/pages/home/containers/home-page.component.ts +++ b/src/app/pages/home/containers/home-page.component.ts @@ -42,7 +42,7 @@ export class HomePageComponent implements OnDestroy { taskIsNow = false checkTaskInterval showMiscTasksButton: Promise - isTaskCalendarTaskNameShown = false + isTaskCalendarTaskNameShown: Promise APP_CREDITS = '© RADAR-Base' HTML_BREAK = '
' @@ -62,7 +62,6 @@ export class HomePageComponent implements OnDestroy { this.navCtrl.setRoot(HomePageComponent) } ) - this.getisTaskCalendarTaskNameShown() } getIsLoadingSpinnerShown() { @@ -72,12 +71,6 @@ export class HomePageComponent implements OnDestroy { ) } - getisTaskCalendarTaskNameShown() { - this.tasksService - .getIsTaskCalendarTaskNameShown() - .then(res => (this.isTaskCalendarTaskNameShown = res)) - } - getIsStartButtonShown() { return ( this.taskIsNow && @@ -114,6 +107,7 @@ export class HomePageComponent implements OnDestroy { this.hasOnDemandTasks = this.tasksService.getHasOnDemandTasks() this.hasClinicalTasks = this.tasksService.getHasClinicalTasks() this.title = this.tasksService.getPlatformInstanceName() + this.isTaskCalendarTaskNameShown = this.tasksService.getIsTaskCalendarTaskNameShown() this.onDemandIcon = this.tasksService.getOnDemandAssessmentIcon() this.showMiscTasksButton = this.getShowMiscTasksButton() } diff --git a/src/app/pages/questions/containers/questions-page.component.html b/src/app/pages/questions/containers/questions-page.component.html index 804e15cdd..0fbb9e8f0 100755 --- a/src/app/pages/questions/containers/questions-page.component.html +++ b/src/app/pages/questions/containers/questions-page.component.html @@ -74,6 +74,6 @@ [isRightButtonDisabled]="isRightButtonDisabled" [currentQuestionId]="currentQuestionGroupId" [totalQuestions]="groupedQuestions?.size" - [isProgressCountShown]="showProgressCount" + [isProgressCountShown]="showProgressCount | async" > diff --git a/src/app/pages/questions/containers/questions-page.component.ts b/src/app/pages/questions/containers/questions-page.component.ts index 6ddd7f413..44ba4e6b5 100644 --- a/src/app/pages/questions/containers/questions-page.component.ts +++ b/src/app/pages/questions/containers/questions-page.component.ts @@ -64,7 +64,7 @@ export class QuestionsPageComponent implements OnInit { ShowIntroductionType.ONCE ]) MATRIX_FIELD_NAME = 'matrix' - showProgressCount = false + showProgressCount: Promise constructor( public navCtrl: NavController, diff --git a/src/app/pages/questions/services/questions.service.ts b/src/app/pages/questions/services/questions.service.ts index 77fec8a1c..f9694b7cc 100644 --- a/src/app/pages/questions/services/questions.service.ts +++ b/src/app/pages/questions/services/questions.service.ts @@ -61,16 +61,10 @@ export class QuestionsService { config.getOrDefault( ConfigKeys.SKIPPABLE_QUESTIONNAIRE_TYPES, DefaultSkippableQuestionnaireTypes.toString() - ), - config.getOrDefault( - ConfigKeys.SHOW_TASK_PROGRESS_COUNT, - DefaultShowTaskProgressCount.toString() ) ]) ) - .then(([autoNextSet, skippableSet, showTaskProgressCount]) => { - if (showTaskProgressCount.length) - this.isProgressCountShown = JSON.parse(showTaskProgressCount) + .then(([autoNextSet, skippableSet]) => { if (autoNextSet.length) this.NEXT_BUTTON_AUTOMATIC_SET = new Set( this.stringToArray(autoNextSet, this.DELIMITER) @@ -270,6 +264,14 @@ export class QuestionsService { } getIsProgressCountShown() { - return this.isProgressCountShown + return this.remoteConfig + .read() + .then(config => + config.getOrDefault( + ConfigKeys.SHOW_TASK_PROGRESS_COUNT, + DefaultShowTaskProgressCount + ) + ) + .then(res => JSON.parse(res)) } } From 5a762b4ea9596fdac84e0fc7dfda9a7408703c27 Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Tue, 11 Oct 2022 12:20:02 +0100 Subject: [PATCH 07/11] fix: add null check for task calendar config --- src/app/pages/home/containers/home-page.component.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index 08e8b1d04..a96191f13 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -79,7 +79,10 @@
Date: Wed, 12 Oct 2022 11:48:36 +0100 Subject: [PATCH 08/11] fix(toolbar): make task progress counter start from 1 instead of 0 --- .../pages/questions/components/toolbar/toolbar.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/questions/components/toolbar/toolbar.component.html b/src/app/pages/questions/components/toolbar/toolbar.component.html index f1176bf4e..36a0fb96f 100644 --- a/src/app/pages/questions/components/toolbar/toolbar.component.html +++ b/src/app/pages/questions/components/toolbar/toolbar.component.html @@ -3,7 +3,7 @@
- {{ currentQuestionId + '/' + totalQuestions }} + {{ currentQuestionId + 1 + '/' + totalQuestions }}