From 97915ddb90d06930b1d09058ea261903bcc503a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 21 Feb 2022 15:40:31 +0100 Subject: [PATCH 1/8] MOBILE-3833 styles: Fix warning cards icon colors on buttons --- src/theme/theme.base.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index ff9231e33..0b950dde8 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -740,7 +740,7 @@ body.core-iframe-fullscreen ion-router-outlet { ion-label { white-space: normal !important; } - ion-icon { + ion-item > ion-icon { color: var(--color-shade); @include margin-horizontal(null, 16px); } From 42e368140746fa1c735701635c4529db551c7385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 15:34:42 +0100 Subject: [PATCH 2/8] MOBILE-3833 assign: Invalidate submission component before is null --- src/addons/mod/assign/components/index/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/addons/mod/assign/components/index/index.ts b/src/addons/mod/assign/components/index/index.ts index c78728728..226d5e28a 100644 --- a/src/addons/mod/assign/components/index/index.ts +++ b/src/addons/mod/assign/components/index/index.ts @@ -109,7 +109,7 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo AddonModAssignProvider.SUBMISSION_SAVED_EVENT, (data) => { if (this.assign && data.assignmentId == this.assign.id && data.userId == this.currentUserId) { - // Assignment submission saved, refresh data. + // Assignment submission saved, refresh data. this.showLoadingAndRefresh(true, false); } }, @@ -326,6 +326,8 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo const promises: Promise[] = []; promises.push(AddonModAssign.invalidateAssignmentData(this.courseId)); + // Invalidate before component becomes null. + promises.push(this.submissionComponent?.invalidateAndRefresh(true) || Promise.resolve()); if (this.assign) { promises.push(AddonModAssign.invalidateAllSubmissionData(this.assign.id)); @@ -335,9 +337,7 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo } } - await Promise.all(promises).finally(() => { - this.submissionComponent?.invalidateAndRefresh(true); - }); + await Promise.all(promises); } /** From befee634ff62e9a3e36b666f8095f0d6f6764469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 17:03:41 +0100 Subject: [PATCH 3/8] MOBILE-3833 forum: Fix hasOffline flag on index page. --- src/addons/mod/forum/components/index/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/addons/mod/forum/components/index/index.ts b/src/addons/mod/forum/components/index/index.ts index 40fda05ae..55ac9daaa 100644 --- a/src/addons/mod/forum/components/index/index.ts +++ b/src/addons/mod/forum/components/index/index.ts @@ -174,7 +174,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom // Check if there are replies for discussions stored in offline. const hasOffline = await AddonModForumOffline.hasForumReplies(this.forum.id); - this.hasOffline = this.hasOffline || hasOffline; + this.hasOffline = this.hasOffline || hasOffline || this.hasOfflineRatings; if (hasOffline) { // Only update new fetched discussions. @@ -258,6 +258,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom if (this.forum && data.component == 'mod_forum' && data.ratingArea == 'post' && data.contextLevel == ContextLevel.MODULE && data.instanceId == this.forum.cmid) { this.hasOfflineRatings = true; + this.hasOffline = true; } }); @@ -266,6 +267,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom data.contextLevel == ContextLevel.MODULE && data.instanceId == this.forum.cmid) { this.hasOfflineRatings = await CoreRatingOffline.hasRatings('mod_forum', 'post', ContextLevel.MODULE, this.forum.cmid); + this.hasOffline = this.hasOffline || this.hasOfflineRatings; } }); } From 3d2d99fb7dfa38ab31a9f7f3b676c169f67f8d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 22:50:00 +0100 Subject: [PATCH 4/8] MOBILE-3833 assign: Fix duplicated id --- .../assign/pages/submission-list/submission-list.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/addons/mod/assign/pages/submission-list/submission-list.html b/src/addons/mod/assign/pages/submission-list/submission-list.html index 40ad93441..09beab4e9 100644 --- a/src/addons/mod/assign/pages/submission-list/submission-list.html +++ b/src/addons/mod/assign/pages/submission-list/submission-list.html @@ -26,13 +26,11 @@ - - {{ 'core.groupsseparate' | translate }} + + {{'core.groupsseparate' | translate }} + {{'core.groupsvisible' | translate }} - - {{ 'core.groupsvisible' | translate }} - - {{groupOpt.name}} From d4a9bd2ec59402c1a9c806d03355a8d2809ff385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 23:03:40 +0100 Subject: [PATCH 5/8] MOBILE-3833 course: Do not display course displayname on course page --- .../services/handlers/singleactivity-format.ts | 8 +------- .../features/course/services/handlers/default-format.ts | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/core/features/course/format/singleactivity/services/handlers/singleactivity-format.ts b/src/core/features/course/format/singleactivity/services/handlers/singleactivity-format.ts index 8e4b1f6d3..999a1c08c 100644 --- a/src/core/features/course/format/singleactivity/services/handlers/singleactivity-format.ts +++ b/src/core/features/course/format/singleactivity/services/handlers/singleactivity-format.ts @@ -59,13 +59,7 @@ export class CoreCourseFormatSingleActivityHandlerService implements CoreCourseF return sections[0].modules[0].name; } - if (course.displayname) { - return course.displayname; - } else if (course.fullname) { - return course.fullname; - } - - return ''; + return course.fullname || ''; } /** diff --git a/src/core/features/course/services/handlers/default-format.ts b/src/core/features/course/services/handlers/default-format.ts index 5a4833f15..ff60f6c39 100644 --- a/src/core/features/course/services/handlers/default-format.ts +++ b/src/core/features/course/services/handlers/default-format.ts @@ -40,13 +40,7 @@ export class CoreCourseFormatDefaultHandler implements CoreCourseFormatHandler { * @inheritdoc */ getCourseTitle(course: CoreCourseAnyCourseData): string { - if (course.displayname) { - return course.displayname; - } else if (course.fullname) { - return course.fullname; - } - - return ''; + return course.fullname || ''; } /** From 55e2e5f3a1cc36397ecdc2db52499a4e353bec85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 23:10:11 +0100 Subject: [PATCH 6/8] MOBILE-3833 assign: Add text wrap to badges --- .../components/submission/addon-mod-assign-submission.html | 4 ++-- src/addons/mod/assign/components/submission/submission.scss | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html index 506fea6e4..7b0f32cf6 100644 --- a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html +++ b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html @@ -391,10 +391,10 @@

- + {{ statusTranslated }} - + {{ gradingStatusTranslationId | translate }}

diff --git a/src/addons/mod/assign/components/submission/submission.scss b/src/addons/mod/assign/components/submission/submission.scss index 51e8c8838..935b96fe7 100644 --- a/src/addons/mod/assign/components/submission/submission.scss +++ b/src/addons/mod/assign/components/submission/submission.scss @@ -21,6 +21,11 @@ .core-grading-summary .advancedgrade { display: none; } + + ion-badge { + margin-left: 2px; + margin-right: 2px; + } } :host-context(body.dark) ::ng-deep { From 0c167326ab9f4bba87ad280405e032c8c42a9bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 23:15:08 +0100 Subject: [PATCH 7/8] MOBILE-3833 survey: Improve survey success card look'n'feel --- .../components/index/addon-mod-survey-index.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/addons/mod/survey/components/index/addon-mod-survey-index.html b/src/addons/mod/survey/components/index/addon-mod-survey-index.html index 6f08add31..acafdf331 100644 --- a/src/addons/mod/survey/components/index/addon-mod-survey-index.html +++ b/src/addons/mod/survey/components/index/addon-mod-survey-index.html @@ -14,9 +14,14 @@ - -

{{ 'addon.mod_survey.surveycompletednograph' | translate }}

- + + + + + {{ 'addon.mod_survey.surveycompletednograph' | translate }} + + + {{ 'addon.mod_survey.results' | translate }} From 9d4c12083dcca4e1a10eb552fe56956e086e0d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 23:25:05 +0100 Subject: [PATCH 8/8] MOBILE-3833 chore: Improve toast grid --- src/theme/theme.base.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index 0b950dde8..064a3dcee 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -483,6 +483,16 @@ ion-loading { } } +// Toasts. +ion-toast { + --button-color: var(--primary-tint); + @include media-breakpoint-down(sm) { + &::part(container) { + flex-direction: column; + } + } +} + // Ionic list. ion-list { padding: 0 !important;