MOBILE-4059 core: Contact support from help

main
Noel De Martin 2022-10-05 14:07:26 +02:00
parent d859af122e
commit d0f28162da
5 changed files with 51 additions and 10 deletions

View File

@ -1913,6 +1913,7 @@
"core.login.changepasswordbutton": "local_moodlemobileapp",
"core.login.changepasswordhelp": "local_moodlemobileapp",
"core.login.changepasswordreconnectinstructions": "local_moodlemobileapp",
"core.login.changepasswordsupportsubject": "local_moodlemobileapp",
"core.login.confirmdeletesite": "local_moodlemobileapp",
"core.login.connect": "local_moodlemobileapp",
"core.login.connecttomoodle": "local_moodlemobileapp",
@ -2347,8 +2348,10 @@
"core.user.address": "moodle",
"core.user.city": "moodle",
"core.user.completeprofile": "local_moodlemobileapp",
"core.user.completeprofilehelp": "local_moodlemobileapp",
"core.user.completeprofilenotice": "local_moodlemobileapp",
"core.user.completeprofilereconnectinstructions": "local_moodlemobileapp",
"core.user.completeprofilesupportsubject": "local_moodlemobileapp",
"core.user.completeyourprofile": "local_moodlemobileapp",
"core.user.contact": "local_moodlemobileapp",
"core.user.country": "moodle",

View File

@ -6,8 +6,9 @@
"cancel": "Cancel",
"changepassword": "Change password",
"changepasswordbutton": "Change password",
"changepasswordhelp": "If you have problems changing your password, please contact your site administrator. \"Site Administrators\" are the people who manages the Moodle at your school/university/company or learning organisation. If you don't know how to contact them, please contact your teachers/trainers.",
"changepasswordhelp": "If you have problems changing your password, please contact your institution.",
"changepasswordreconnectinstructions": "If you didn't change your password correctly, you'll be asked to do it again.",
"changepasswordsupportsubject": "Need help changing my password",
"confirmdeletesite": "Are you sure you want to remove the account on {{sitename}}?",
"connect": "Connect!",
"connecttomoodle": "Connect to Moodle",

View File

@ -21,6 +21,8 @@ import { Translate } from '@singletons';
import { CoreNavigator } from '@services/navigator';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreUtils } from '@services/utils/utils';
import { CoreUserSupport } from '@features/user/services/support';
import { AlertButton } from '@ionic/angular';
/**
* Page that shows instructions to change the password.
@ -46,10 +48,26 @@ export class CoreLoginChangePasswordPage implements OnDestroy {
* Show a help modal.
*/
showHelp(): void {
CoreDomUtils.showAlert(
Translate.instant('core.help'),
Translate.instant('core.login.changepasswordhelp'),
);
const site = CoreSites.getRequiredCurrentSite();
const buttons: (AlertButton | string)[] = [];
if (site.canContactSupport()) {
buttons.push({
text: Translate.instant('core.contactsupport'),
handler: () => CoreUserSupport.contact({
supportPageUrl: site.getSupportPageUrl(),
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,
});
}
/**

View File

@ -3,8 +3,10 @@
"useraccount": "User account",
"city": "City/town",
"completeprofile": "Complete profile",
"completeprofilehelp": "If you have problems completing your profile, please contact your institution.",
"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.",
"completeprofilesupportsubject": "Need help completing my profile",
"completeyourprofile": "Complete your profile",
"contact": "Contact",
"country": "Country",

View File

@ -21,6 +21,8 @@ import { Translate } from '@singletons';
import { CoreNavigator } from '@services/navigator';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreUtils } from '@services/utils/utils';
import { AlertButton } from '@ionic/angular';
import { CoreUserSupport } from '@features/user/services/support';
/**
* Page that shows instructions to complete the profile.
@ -45,11 +47,26 @@ export class CoreUserCompleteProfilePage implements OnDestroy {
* Show a help modal.
*/
showHelp(): void {
// @todo MOBILE-4059: Change this message.
CoreDomUtils.showAlert(
Translate.instant('core.help'),
Translate.instant('core.login.changepasswordhelp'),
);
const site = CoreSites.getRequiredCurrentSite();
const buttons: (AlertButton | string)[] = [];
if (site.canContactSupport()) {
buttons.push({
text: Translate.instant('core.contactsupport'),
handler: () => CoreUserSupport.contact({
supportPageUrl: site.getSupportPageUrl(),
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,
});
}
/**