From 09b95dbd97f1960798a819a10d064b72da48c623 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Thu, 30 May 2019 11:12:36 +0200 Subject: [PATCH 1/5] MOBILE-3039 data: Fix required textarea fields offline --- src/addon/mod/data/fields/textarea/providers/handler.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/addon/mod/data/fields/textarea/providers/handler.ts b/src/addon/mod/data/fields/textarea/providers/handler.ts index 1c1a0bc0d..28ad00b9a 100644 --- a/src/addon/mod/data/fields/textarea/providers/handler.ts +++ b/src/addon/mod/data/fields/textarea/providers/handler.ts @@ -103,11 +103,9 @@ export class AddonModDataFieldTextareaHandler extends AddonModDataFieldTextHandl return this.translate.instant('addon.mod_data.errormustsupplyvalue'); } - const found = inputData.some((input) => { - return !input.subfield && this.textUtils.htmlIsBlank(input.value); - }); + const value = inputData.find((value) => value.subfield == ''); - if (!found) { + if (!value || this.textUtils.htmlIsBlank(value.value)) { return this.translate.instant('addon.mod_data.errormustsupplyvalue'); } } From b7088b6886de096c4bdda8b0e7c066c5348a27c5 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Thu, 30 May 2019 11:44:47 +0200 Subject: [PATCH 2/5] MOBILE-3039 data: Don't display error when comments are disabled --- src/addon/mod/data/pages/entry/entry.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addon/mod/data/pages/entry/entry.html b/src/addon/mod/data/pages/entry/entry.html index ebbc2e2fa..4bc24c4a6 100644 --- a/src/addon/mod/data/pages/entry/entry.html +++ b/src/addon/mod/data/pages/entry/entry.html @@ -31,7 +31,7 @@ - + From 5143897570b51ebd3641e4a06871c453ddea4da5 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Thu, 30 May 2019 14:44:41 +0200 Subject: [PATCH 3/5] MOBILE-3039 workshop: Hide save button if user can't edit assessment --- src/addon/mod/workshop/pages/submission/submission.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addon/mod/workshop/pages/submission/submission.html b/src/addon/mod/workshop/pages/submission/submission.html index 7a77c3f44..70fdbb714 100644 --- a/src/addon/mod/workshop/pages/submission/submission.html +++ b/src/addon/mod/workshop/pages/submission/submission.html @@ -2,7 +2,7 @@ -