From b26ed5a25e6679f2ea6e620551e07219c5a9ee0e Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 2 May 2024 11:59:13 +0200 Subject: [PATCH 1/3] MOBILE-4470 contentlinks: Ignore errors calling getActions --- .../services/contentlinks-delegate.ts | 5 ++++- .../courses/services/handlers/section-link.ts | 20 +++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/core/features/contentlinks/services/contentlinks-delegate.ts b/src/core/features/contentlinks/services/contentlinks-delegate.ts index fdad022f5..0c2fa6e22 100644 --- a/src/core/features/contentlinks/services/contentlinks-delegate.ts +++ b/src/core/features/contentlinks/services/contentlinks-delegate.ts @@ -194,7 +194,10 @@ export class CoreContentLinksDelegateService { return; } - const actions = await handler.getActions(siteIds, relativeUrl, params, courseId, data); + const actions = await CoreUtils.ignoreErrors( + Promise.resolve(handler.getActions(siteIds, relativeUrl, params, courseId, data)), + [], + ); if (actions && actions.length) { // Set default values if any value isn't supplied. diff --git a/src/core/features/courses/services/handlers/section-link.ts b/src/core/features/courses/services/handlers/section-link.ts index 8efa10b0d..4a86ffe1a 100644 --- a/src/core/features/courses/services/handlers/section-link.ts +++ b/src/core/features/courses/services/handlers/section-link.ts @@ -47,22 +47,16 @@ export class CoreCoursesSectionLinkHandlerService extends CoreCoursesLinksHandle url: string, params: Record, ): Promise { - try { - const siteId = siteIds[0] ?? false; - const sectionId = params.id ? Number(params.id) : false; - const siteHomeId = await CoreSites.getSiteHomeId(siteId); - const course = await this.getSectionCourse(sectionId, siteId); - - if (!sectionId || !course || course.id === siteHomeId) { - return []; - } - - return this.getCourseActions(url, course.id, { sectionId }); - } catch (error) { - this.logger.error(`Failed getting actions for url: '${url}'`, error); + const siteId = siteIds[0] ?? false; + const sectionId = params.id ? Number(params.id) : false; + const siteHomeId = await CoreSites.getSiteHomeId(siteId); + const course = await this.getSectionCourse(sectionId, siteId); + if (!sectionId || !course || course.id === siteHomeId) { return []; } + + return this.getCourseActions(url, course.id, { sectionId }); } /** From 9c5ef4be1fe4e1ad14f0efa26377e73e91d3639b Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 2 May 2024 13:04:11 +0200 Subject: [PATCH 2/3] MOBILE-4470 qtype_match: Fix correct icons position --- src/addons/qtype/match/component/addon-qtype-match.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/addons/qtype/match/component/addon-qtype-match.html b/src/addons/qtype/match/component/addon-qtype-match.html index d03327294..13c88457a 100644 --- a/src/addons/qtype/match/component/addon-qtype-match.html +++ b/src/addons/qtype/match/component/addon-qtype-match.html @@ -18,11 +18,11 @@ - - + + {{option.label}} From 770b182ed62e162784c81b26cac772873b1dbd59 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 2 May 2024 13:04:42 +0200 Subject: [PATCH 3/3] MOBILE-4470 ui: Fix opacity of disabled inputs --- src/theme/components/ion-checkbox.scss | 5 +++++ src/theme/components/ion-input.scss | 5 +++++ src/theme/components/ion-radio.scss | 5 +++++ src/theme/components/ion-select.scss | 3 +++ src/theme/theme.scss | 3 +++ 5 files changed, 21 insertions(+) create mode 100644 src/theme/components/ion-checkbox.scss create mode 100644 src/theme/components/ion-input.scss create mode 100644 src/theme/components/ion-radio.scss diff --git a/src/theme/components/ion-checkbox.scss b/src/theme/components/ion-checkbox.scss new file mode 100644 index 000000000..bff03e79d --- /dev/null +++ b/src/theme/components/ion-checkbox.scss @@ -0,0 +1,5 @@ +ion-checkbox { + &.checkbox-disabled::part(label) { + opacity: 0.8; + } +} diff --git a/src/theme/components/ion-input.scss b/src/theme/components/ion-input.scss new file mode 100644 index 000000000..da82c4ec4 --- /dev/null +++ b/src/theme/components/ion-input.scss @@ -0,0 +1,5 @@ +ion-input { + &.input-disabled.md, &.input-disabled.ios { + opacity: 0.8; + } +} diff --git a/src/theme/components/ion-radio.scss b/src/theme/components/ion-radio.scss new file mode 100644 index 000000000..ef14fe5aa --- /dev/null +++ b/src/theme/components/ion-radio.scss @@ -0,0 +1,5 @@ +ion-radio { + &.radio-disabled::part(label) { + opacity: 0.8; + } +} diff --git a/src/theme/components/ion-select.scss b/src/theme/components/ion-select.scss index 1123bf14f..43a07803c 100644 --- a/src/theme/components/ion-select.scss +++ b/src/theme/components/ion-select.scss @@ -6,6 +6,9 @@ ion-select { &::part(icon) { opacity: 1; } + &.select-disabled { + opacity: 0.8; + } } ion-select-popover { diff --git a/src/theme/theme.scss b/src/theme/theme.scss index 5e67ed220..04e068e5c 100644 --- a/src/theme/theme.scss +++ b/src/theme/theme.scss @@ -32,15 +32,18 @@ html { @import "components/ion-back-button.scss"; @import "components/ion-button.scss"; @import "components/ion-card.scss"; + @import "components/ion-checkbox.scss"; @import "components/ion-chip.scss"; @import "components/ion-content.scss"; @import "components/ion-header.scss"; @import "components/ion-icon.scss"; + @import "components/ion-input.scss"; @import "components/ion-item.scss"; @import "components/ion-item-divider.scss"; @import "components/ion-loading.scss"; @import "components/ion-note.scss"; @import "components/ion-popover.scss"; + @import "components/ion-radio.scss"; @import "components/ion-searchbar.scss"; @import "components/ion-select.scss"; @import "components/ion-spinner.scss";