MOBILE-4059 core: Consolidate help modals
parent
e5fcf769f1
commit
9b0200c3bf
|
@ -1920,6 +1920,8 @@
|
||||||
"core.login.createaccount": "moodle",
|
"core.login.createaccount": "moodle",
|
||||||
"core.login.createuserandpass": "moodle",
|
"core.login.createuserandpass": "moodle",
|
||||||
"core.login.credentialsdescription": "local_moodlemobileapp",
|
"core.login.credentialsdescription": "local_moodlemobileapp",
|
||||||
|
"core.login.credentialshelp": "local_moodlemobileapp",
|
||||||
|
"core.login.credentialssupportsubject": "local_moodlemobileapp",
|
||||||
"core.login.emailconfirmsent": "moodle",
|
"core.login.emailconfirmsent": "moodle",
|
||||||
"core.login.emailconfirmsentnoemail": "local_moodlemobileapp",
|
"core.login.emailconfirmsentnoemail": "local_moodlemobileapp",
|
||||||
"core.login.emailconfirmsentsuccess": "moodle",
|
"core.login.emailconfirmsentsuccess": "moodle",
|
||||||
|
@ -1997,7 +1999,9 @@
|
||||||
"core.login.recaptchaexpired": "local_moodlemobileapp",
|
"core.login.recaptchaexpired": "local_moodlemobileapp",
|
||||||
"core.login.recaptchaincorrect": "local_moodlemobileapp",
|
"core.login.recaptchaincorrect": "local_moodlemobileapp",
|
||||||
"core.login.reconnect": "local_moodlemobileapp",
|
"core.login.reconnect": "local_moodlemobileapp",
|
||||||
|
"core.login.reconnecthelp": "local_moodlemobileapp",
|
||||||
"core.login.reconnectssodescription": "local_moodlemobileapp",
|
"core.login.reconnectssodescription": "local_moodlemobileapp",
|
||||||
|
"core.login.reconnectsupportsubject": "local_moodlemobileapp",
|
||||||
"core.login.reconnecttosite": "local_moodlemobileapp",
|
"core.login.reconnecttosite": "local_moodlemobileapp",
|
||||||
"core.login.removeaccount": "local_moodlemobileapp",
|
"core.login.removeaccount": "local_moodlemobileapp",
|
||||||
"core.login.resendemail": "moodle",
|
"core.login.resendemail": "moodle",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"changepassword": "Change password",
|
"changepassword": "Change password",
|
||||||
"changepasswordbutton": "Change password",
|
"changepasswordbutton": "Change password",
|
||||||
"changepasswordhelp": "If you have problems changing your password, please contact your school or learning provider.",
|
"changepasswordhelp": "If you have problems changing your password, try again later or contact your school or learning provider.",
|
||||||
"changepasswordreconnectinstructions": "If you didn't change your password correctly, you'll be asked to do it again.",
|
"changepasswordreconnectinstructions": "If you didn't change your password correctly, you'll be asked to do it again.",
|
||||||
"changepasswordsupportsubject": "Need help changing my password",
|
"changepasswordsupportsubject": "Need help changing my password",
|
||||||
"confirmdeletesite": "Are you sure you want to remove the account on {{sitename}}?",
|
"confirmdeletesite": "Are you sure you want to remove the account on {{sitename}}?",
|
||||||
|
@ -17,6 +17,8 @@
|
||||||
"createaccount": "Create my new account",
|
"createaccount": "Create my new account",
|
||||||
"createuserandpass": "Choose your username and password",
|
"createuserandpass": "Choose your username and password",
|
||||||
"credentialsdescription": "Please provide your username and password to log in.",
|
"credentialsdescription": "Please provide your username and password to log in.",
|
||||||
|
"credentialshelp": "If you have problems logging in, try again later or contact your school or learning provider.",
|
||||||
|
"credentialssupportsubject": "Need help logging in",
|
||||||
"emailconfirmsent": "<p>An email should have been sent to your address at <b>{{$a}}</b></p><p>It contains easy instructions to complete your registration.</p>",
|
"emailconfirmsent": "<p>An email should have been sent to your address at <b>{{$a}}</b></p><p>It contains easy instructions to complete your registration.</p>",
|
||||||
"emailconfirmsentnoemail": "<p>An email should have been sent to your address.</p><p>It contains easy instructions to complete your registration.</p>",
|
"emailconfirmsentnoemail": "<p>An email should have been sent to your address.</p><p>It contains easy instructions to complete your registration.</p>",
|
||||||
"emailconfirmsentsuccess": "Confirmation email sent successfully",
|
"emailconfirmsentsuccess": "Confirmation email sent successfully",
|
||||||
|
@ -94,7 +96,9 @@
|
||||||
"recaptchaexpired": "Verification expired. Answer the security question again.",
|
"recaptchaexpired": "Verification expired. Answer the security question again.",
|
||||||
"recaptchaincorrect": "The security question answer is incorrect.",
|
"recaptchaincorrect": "The security question answer is incorrect.",
|
||||||
"reconnect": "Reconnect",
|
"reconnect": "Reconnect",
|
||||||
|
"reconnecthelp": "If you have problems reconnecting, try again later or contact your school or learning provider.",
|
||||||
"reconnectssodescription": "Your authentication token is invalid or has expired. You have to reconnect to the site. You need to log in to the site in a browser window.",
|
"reconnectssodescription": "Your authentication token is invalid or has expired. You have to reconnect to the site. You need to log in to the site in a browser window.",
|
||||||
|
"reconnectsupportsubject": "Need help reconnecting",
|
||||||
"reconnecttosite": "Reconnect to the site",
|
"reconnecttosite": "Reconnect to the site",
|
||||||
"removeaccount": "Remove account",
|
"removeaccount": "Remove account",
|
||||||
"resendemail": "Resend email",
|
"resendemail": "Resend email",
|
||||||
|
|
|
@ -15,15 +15,12 @@
|
||||||
import { Component, OnDestroy } from '@angular/core';
|
import { Component, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
|
||||||
import { CoreLoginHelper } from '@features/login/services/login-helper';
|
import { CoreLoginHelper } from '@features/login/services/login-helper';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreUserSupport } from '@features/user/services/support';
|
import { CoreUserSupport } from '@features/user/services/support';
|
||||||
import { AlertButton } from '@ionic/angular';
|
|
||||||
import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that shows instructions to change the password.
|
* Page that shows instructions to change the password.
|
||||||
|
@ -46,29 +43,13 @@ export class CoreLoginChangePasswordPage implements OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a help modal.
|
* Show help modal.
|
||||||
*/
|
*/
|
||||||
showHelp(): void {
|
showHelp(): void {
|
||||||
const supportConfig = CoreUserAuthenticatedSupportConfig.forCurrentSite();
|
CoreUserSupport.showHelp(
|
||||||
const buttons: (AlertButton | string)[] = [];
|
Translate.instant('core.login.changepasswordhelp'),
|
||||||
|
Translate.instant('core.login.changepasswordsupportsubject'),
|
||||||
if (supportConfig.canContactSupport()) {
|
);
|
||||||
buttons.push({
|
|
||||||
text: Translate.instant('core.contactsupport'),
|
|
||||||
handler: () => CoreUserSupport.contact({
|
|
||||||
supportConfig,
|
|
||||||
subject: Translate.instant('core.login.changepasswordsupportsubject'),
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
buttons.push(Translate.instant('core.ok'));
|
|
||||||
|
|
||||||
CoreDomUtils.showAlertWithOptions({
|
|
||||||
header: Translate.instant('core.help'),
|
|
||||||
message: Translate.instant('core.login.changepasswordhelp'),
|
|
||||||
buttons,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<ion-button fill="clear" (click)="openSettings()" [attr.aria-label]="'core.settings.appsettings' | translate">
|
<ion-button fill="clear" (click)="openSettings()" [attr.aria-label]="'core.settings.appsettings' | translate">
|
||||||
<ion-icon slot="icon-only" name="fas-cog" aria-hidden="true"></ion-icon>
|
<ion-icon slot="icon-only" name="fas-cog" aria-hidden="true"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
<ion-button *ngIf="canContactSupport" fill="clear" (click)="contactSupport()" [attr.aria-label]="'core.help' | translate">
|
<ion-button fill="clear" (click)="showHelp()" [attr.aria-label]="'core.help' | translate">
|
||||||
<ion-icon slot="icon-only" name="far-question-circle" aria-hidden="true"></ion-icon>
|
<ion-icon slot="icon-only" name="far-question-circle" aria-hidden="true"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|
|
@ -59,7 +59,6 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
||||||
showScanQR = false;
|
showScanQR = false;
|
||||||
loginAttempts = 0;
|
loginAttempts = 0;
|
||||||
supportConfig?: CoreUserSupportConfig;
|
supportConfig?: CoreUserSupportConfig;
|
||||||
canContactSupport?: boolean;
|
|
||||||
|
|
||||||
protected siteConfig?: CoreSitePublicConfigResponse;
|
protected siteConfig?: CoreSitePublicConfigResponse;
|
||||||
protected eventThrown = false;
|
protected eventThrown = false;
|
||||||
|
@ -83,7 +82,6 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
||||||
this.siteConfig = CoreNavigator.getRouteParam<CoreSitePublicConfigResponse>('siteConfig');
|
this.siteConfig = CoreNavigator.getRouteParam<CoreSitePublicConfigResponse>('siteConfig');
|
||||||
this.urlToOpen = CoreNavigator.getRouteParam('urlToOpen');
|
this.urlToOpen = CoreNavigator.getRouteParam('urlToOpen');
|
||||||
this.supportConfig = this.siteConfig && new CoreUserGuestSupportConfig(this.siteConfig);
|
this.supportConfig = this.siteConfig && new CoreUserGuestSupportConfig(this.siteConfig);
|
||||||
this.canContactSupport = this.supportConfig?.canContactSupport();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
|
|
||||||
|
@ -132,14 +130,13 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contact site support.
|
* Show help modal.
|
||||||
*/
|
*/
|
||||||
async contactSupport(): Promise<void> {
|
showHelp(): void {
|
||||||
if (!this.supportConfig) {
|
CoreUserSupport.showHelp(
|
||||||
throw new Error('can\'t contact support');
|
Translate.instant('core.login.credentialshelp'),
|
||||||
}
|
Translate.instant('core.login.credentialssupportsubject'),
|
||||||
|
);
|
||||||
await CoreUserSupport.contact({ supportConfig: this.supportConfig });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</ion-title>
|
</ion-title>
|
||||||
|
|
||||||
<ion-buttons slot="end">
|
<ion-buttons slot="end">
|
||||||
<ion-button *ngIf="canContactSupport" fill="clear" (click)="contactSupport()" [attr.aria-label]="'core.help' | translate">
|
<ion-button fill="clear" (click)="showHelp()" [attr.aria-label]="'core.help' | translate">
|
||||||
<ion-icon slot="icon-only" name="far-question-circle" aria-hidden="true"></ion-icon>
|
<ion-icon slot="icon-only" name="far-question-circle" aria-hidden="true"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|
|
@ -29,6 +29,7 @@ import { CoreForms } from '@singletons/form';
|
||||||
import { CoreUserSupport } from '@features/user/services/support';
|
import { CoreUserSupport } from '@features/user/services/support';
|
||||||
import { CoreUserSupportConfig } from '@features/user/classes/support/support-config';
|
import { CoreUserSupportConfig } from '@features/user/classes/support/support-config';
|
||||||
import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config';
|
import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config';
|
||||||
|
import { Translate } from '@singletons';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page to enter the user password to reconnect to a site.
|
* Page to enter the user password to reconnect to a site.
|
||||||
|
@ -60,7 +61,6 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
showLoading = true;
|
showLoading = true;
|
||||||
reconnectAttempts = 0;
|
reconnectAttempts = 0;
|
||||||
supportConfig?: CoreUserSupportConfig;
|
supportConfig?: CoreUserSupportConfig;
|
||||||
canContactSupport?: boolean;
|
|
||||||
|
|
||||||
protected siteConfig?: CoreSitePublicConfigResponse;
|
protected siteConfig?: CoreSitePublicConfigResponse;
|
||||||
protected viewLeft = false;
|
protected viewLeft = false;
|
||||||
|
@ -108,7 +108,6 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
this.siteUrl = site.infos.siteurl;
|
this.siteUrl = site.infos.siteurl;
|
||||||
this.siteName = site.getSiteName();
|
this.siteName = site.getSiteName();
|
||||||
this.supportConfig = new CoreUserAuthenticatedSupportConfig(site);
|
this.supportConfig = new CoreUserAuthenticatedSupportConfig(site);
|
||||||
this.canContactSupport = this.supportConfig.canContactSupport();
|
|
||||||
|
|
||||||
// If login was OAuth we should only reach this page if the OAuth method ID has changed.
|
// If login was OAuth we should only reach this page if the OAuth method ID has changed.
|
||||||
this.isOAuth = site.isOAuth();
|
this.isOAuth = site.isOAuth();
|
||||||
|
@ -142,10 +141,13 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contact site support.
|
* Show help modal.
|
||||||
*/
|
*/
|
||||||
async contactSupport(): Promise<void> {
|
showHelp(): void {
|
||||||
await CoreUserSupport.contact({ supportConfig: this.supportConfig });
|
CoreUserSupport.showHelp(
|
||||||
|
Translate.instant('core.login.reconnecthelp'),
|
||||||
|
Translate.instant('core.login.reconnectsupportsubject'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"useraccount": "User account",
|
"useraccount": "User account",
|
||||||
"city": "City/town",
|
"city": "City/town",
|
||||||
"completeprofile": "Complete profile",
|
"completeprofile": "Complete profile",
|
||||||
"completeprofilehelp": "If you have problems completing your profile, please contact your school or learning provider.",
|
"completeprofilehelp": "If you have problems completing your profile, try again later or contact your school or learning provider.",
|
||||||
"completeprofilenotice": "Before you continue, please fill in the required fields in your user profile.",
|
"completeprofilenotice": "Before you continue, please fill in the required fields in your user profile.",
|
||||||
"completeprofilereconnectinstructions": "If you didn't complete your profile correctly, you'll be asked to do it again.",
|
"completeprofilereconnectinstructions": "If you didn't complete your profile correctly, you'll be asked to do it again.",
|
||||||
"completeprofilesupportsubject": "Need help completing my profile",
|
"completeprofilesupportsubject": "Need help completing my profile",
|
||||||
|
|
|
@ -15,15 +15,12 @@
|
||||||
import { Component, OnDestroy } from '@angular/core';
|
import { Component, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
|
||||||
import { CoreLoginHelper } from '@features/login/services/login-helper';
|
import { CoreLoginHelper } from '@features/login/services/login-helper';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { AlertButton } from '@ionic/angular';
|
|
||||||
import { CoreUserSupport } from '@features/user/services/support';
|
import { CoreUserSupport } from '@features/user/services/support';
|
||||||
import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that shows instructions to complete the profile.
|
* Page that shows instructions to complete the profile.
|
||||||
|
@ -45,29 +42,13 @@ export class CoreUserCompleteProfilePage implements OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a help modal.
|
* Show help modal.
|
||||||
*/
|
*/
|
||||||
showHelp(): void {
|
showHelp(): void {
|
||||||
const supportConfig = CoreUserAuthenticatedSupportConfig.forCurrentSite();
|
CoreUserSupport.showHelp(
|
||||||
const buttons: (AlertButton | string)[] = [];
|
Translate.instant('core.user.completeprofilehelp'),
|
||||||
|
Translate.instant('core.user.completeprofilesupportsubject'),
|
||||||
if (supportConfig.canContactSupport()) {
|
);
|
||||||
buttons.push({
|
|
||||||
text: Translate.instant('core.contactsupport'),
|
|
||||||
handler: () => CoreUserSupport.contact({
|
|
||||||
supportConfig,
|
|
||||||
subject: Translate.instant('core.login.completeprofilesupportsubject'),
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
buttons.push(Translate.instant('core.ok'));
|
|
||||||
|
|
||||||
CoreDomUtils.showAlertWithOptions({
|
|
||||||
header: Translate.instant('core.help'),
|
|
||||||
message: Translate.instant('core.user.completeprofilehelp'),
|
|
||||||
buttons,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,9 +19,11 @@ import { InAppBrowserObject } from '@ionic-native/in-app-browser';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton, Translate } from '@singletons';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { CoreSubscriptions } from '@singletons/subscriptions';
|
import { CoreSubscriptions } from '@singletons/subscriptions';
|
||||||
|
import { AlertButton } from '@ionic/angular';
|
||||||
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle site support.
|
* Handle site support.
|
||||||
|
@ -47,6 +49,35 @@ export class CoreUserSupportService {
|
||||||
await CoreEvents.waitUntil(CoreEvents.IAB_EXIT);
|
await CoreEvents.waitUntil(CoreEvents.IAB_EXIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show a help modal that suggests contacting support if available.
|
||||||
|
*
|
||||||
|
* @param message Help message.
|
||||||
|
* @param supportSubject Support subject.
|
||||||
|
*/
|
||||||
|
showHelp(message: string, supportSubject: string): void {
|
||||||
|
const supportConfig = CoreUserAuthenticatedSupportConfig.forCurrentSite();
|
||||||
|
const buttons: (AlertButton | string)[] = [];
|
||||||
|
|
||||||
|
if (supportConfig.canContactSupport()) {
|
||||||
|
buttons.push({
|
||||||
|
text: Translate.instant('core.contactsupport'),
|
||||||
|
handler: () => CoreUserSupport.contact({
|
||||||
|
supportConfig,
|
||||||
|
subject: supportSubject,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons.push(Translate.instant('core.close'));
|
||||||
|
|
||||||
|
CoreDomUtils.showAlertWithOptions({
|
||||||
|
header: Translate.instant('core.help'),
|
||||||
|
message,
|
||||||
|
buttons,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inject error details into contact support form.
|
* Inject error details into contact support form.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue