From de28040df2bbada65616ff68056a89ce64b82b8a Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 22 Nov 2022 17:26:14 +0100 Subject: [PATCH 1/4] MOBILE-4059 user: Fix disabled support for guests --- .../features/user/classes/support/guest-support-config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/features/user/classes/support/guest-support-config.ts b/src/core/features/user/classes/support/guest-support-config.ts index 2c4462478..bfc921e12 100644 --- a/src/core/features/user/classes/support/guest-support-config.ts +++ b/src/core/features/user/classes/support/guest-support-config.ts @@ -13,6 +13,7 @@ // limitations under the License. import { CoreSiteConfigSupportAvailability, CoreSitePublicConfigResponse } from '@classes/site'; +import { CoreLoginHelper } from '@features/login/services/login-helper'; import { CoreUserNullSupportConfig } from '@features/user/classes/support/null-support-config'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; @@ -51,6 +52,10 @@ export class CoreUserGuestSupportConfig extends CoreUserSupportConfig { * @inheritdoc */ canContactSupport(): boolean { + if (CoreLoginHelper.isFeatureDisabled('NoDelegate_CoreUserSupport', this.config)) { + return false; + } + // This config was introduced in 4.1, if it's missing we can assume the site is 4.0 or lower. if ('supportavailability' in this.config) { return this.config.supportavailability === CoreSiteConfigSupportAvailability.Anyone; From e08d5e06c3af51b069289a4926124edecefbd7e8 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 22 Nov 2022 17:27:10 +0100 Subject: [PATCH 2/4] MOBILE-4059 core: Fix error-info for long errors --- .../components/error-info/error-info.scss | 37 ++++++------------- src/core/components/error-info/error-info.ts | 10 ++--- src/core/lang.json | 2 +- 3 files changed, 18 insertions(+), 31 deletions(-) diff --git a/src/core/components/error-info/error-info.scss b/src/core/components/error-info/error-info.scss index 784457cf1..97922518f 100644 --- a/src/core/components/error-info/error-info.scss +++ b/src/core/components/error-info/error-info.scss @@ -12,24 +12,22 @@ margin-bottom: 0; } - .core-error-info--content { + .core-error-info--code { padding: var(--spacing-2) var(--spacing-2) 0 var(--spacing-2); + font-size: var(--font-size-normal); + } - .core-error-info--code { - font-size: var(--font-size-normal); - } - - .core-error-info--details { - color: var(--gray-500); - } - + .core-error-info--details p { + padding: var(--spacing-2) var(--spacing-2) 0 var(--spacing-2); + color: var(--gray-500); } .core-error-info--checkbox { display: none; - & + .core-error-info--content { - max-height: calc(var(--font-size-sm) + 2 * var(--spacing-2)); + & + .core-error-info--details, + & + .core-error-info--code + .core-error-info--details { + max-height: 0; overflow: hidden; transition: max-height 600ms ease-in-out; @@ -58,8 +56,9 @@ } - &:checked + .core-error-info--content { - max-height: 150px; + &:checked + .core-error-info--details, + &:checked + .core-error-info--code + .core-error-info--details { + max-height: 110px; & + .core-error-info--toggle .core-error-info--hide-content { display: flex; @@ -73,16 +72,4 @@ } - &.has-error-code .core-error-info--checkbox { - - & + .core-error-info--content { - max-height: calc(var(--font-size-normal) + 2 * var(--spacing-2)); - } - - &:checked + .core-error-info--content { - max-height: 170px; - } - - } - } diff --git a/src/core/components/error-info/error-info.ts b/src/core/components/error-info/error-info.ts index 6584653d9..948d27eb1 100644 --- a/src/core/components/error-info/error-info.ts +++ b/src/core/components/error-info/error-info.ts @@ -40,16 +40,16 @@ export class CoreErrorInfoComponent implements OnInit, OnChanges { */ static render(errorDetails: string, errorCode?: string): string { const toggleId = CoreForms.uniqueId('error-info-toggle'); - const errorCodeLabel = Translate.instant('core.errorcode'); + const errorCodeLabel = Translate.instant('core.errorcode', { errorCode }); const hideDetailsLabel = Translate.instant('core.errordetailshide'); const showDetailsLabel = Translate.instant('core.errordetailsshow'); return ` -
+
-
- ${errorCode ? `

${errorCodeLabel}: ${errorCode}

` : ''} -

${errorDetails}

+ ${errorCode ? `
${errorCodeLabel}
` : ''} +
+

${errorDetails}