Skip to content

Commit

Permalink
Add FAQ page (#850)
Browse files Browse the repository at this point in the history
* Merge master

* Add new page

* Finir FAQ login

* Add FAQ to more page

* Add faq viewmodel tests

* flutter test --update-goldens

* Add more page test

* Clean up

* [BOT] Applying version.

* [BOT] Applying format.

* Fix test

* Remove unused

* Remove unused variables

* Change colors in darkteam

* [BOT] Applying format.

* generate goldens

* [BOT] Applying format.

* [BOT] Update golden files

* Import

* -_-

* 😑

* [BOT] Applying version.

---------

Co-authored-by: camillebrulotte <[email protected]>
Co-authored-by: clubapplets-server <[email protected]>
  • Loading branch information
3 people authored Sep 22, 2023
1 parent 3ec46ac commit db09c2a
Show file tree
Hide file tree
Showing 23 changed files with 732 additions and 83 deletions.
5 changes: 4 additions & 1 deletion l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
"discovery_navbar_more_title": "More",
"discovery_navbar_more_details": "The More page gives you access to additional options of the application.",
"discovery_page_more_contributors": "Here you will find the list of all the students who contributed and developed this application.",
"discovery_page_faq": "Here you will find the answers to the most frequently asked questions.",
"discovery_page_more_report_bug": "The app is not perfect and we are always open to suggestions! If you see a problem or want us to be part of an idea, you can use this feature.",
"discovery_page_more_settings": "Here you can change the general settings of the application.",

Expand Down Expand Up @@ -309,7 +310,9 @@

"in_app_review_title": "Rate us!",
"forgot_password": "Forgot your password?",
"need_help_contact_us": "Need help? Contact us!",
"need_help": "Need help?",
"actions": "Actions",
"questions_and_answers": "Questions and answers",
"universal_code_example": "Ex: AB12345",
"my_tickets": "My tickets",
"no_ticket": "No ticket",
Expand Down
7 changes: 5 additions & 2 deletions l10n/intl_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"discovery_navbar_more_details": "La page Plus vous permet d'avoir accès aux options supplémentaires de l'application.",
"discovery_page_more_report_bug": "L'application n'est pas parfaite et nous sommes toujours ouverts à des suggestions! Si vous voyez un problème ou si vous souhaitez nous faire part d'une idée, vous pouvez utiliser cette fonctionnalité",
"discovery_page_more_contributors": "Ici vous trouverez la liste de tous les étudiants qui ont travaillé sur le projet d'un point de vue du code.",
"discovery_page_faq": "Si vous avez des questions, vous pouvez consulter notre FAQ.",
"discovery_page_more_settings": "Et finalement ici vous pouvez changer les paramètres généraux de l'application!",

"discovery_page_thankyou_message": "Merci encore d'avoir installé ÉTSMobile! Nous espérons que cette application vous sera utile! Plein de nouvelles fonctionnalités vont arriver dans les mois à venir donc penser à mettre à jour l'application!!",
Expand Down Expand Up @@ -307,9 +308,11 @@
},
"progress_bar_suffix": "jours",

"in_app_review_title": "Évaluez-nous!",
"in_app_review_title": "Évaluez-nous!",
"need_help": "Besoin d'aide?",
"questions_and_answers": "Questions et réponses",
"actions": "Actions",
"forgot_password": "Mot de passe oublié?",
"need_help_contact_us": "Besoin d'aide? Contactez-nous!",
"universal_code_example": "Ex: AB12345",
"my_tickets": "Mes billets",
"no_ticket": "Aucun billet",
Expand Down
1 change: 1 addition & 0 deletions lib/core/constants/discovery_ids.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DiscoveryIds {

static const String detailsMoreBugReport = "page_more_bug_report";
static const String detailsMoreContributors = "page_more_contributors";
static const String detailsMoreFaq = "page_more_faq";
static const String detailsMoreSettings = "page_more_settings";
static const String detailsMoreThankYou = "page_more_thank_you";
}
129 changes: 129 additions & 0 deletions lib/core/constants/faq.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// FLUTTER / DART / THIRD-PARTIES
import 'package:flutter/material.dart';

// MODELS
import 'package:notredame/core/models/faq_actions.dart';
import 'package:notredame/core/models/faq_questions.dart';

// CONSTANTS
import 'package:notredame/core/constants/app_info.dart';

class Faq {
List<QuestionItem> questions = [
QuestionItem(
title: {
"fr": "Quel mot de passe dois-je utiliser pour me connecter ?",
"en": "What password should I use to log in?"
},
description: {
"fr":
"Le mot de passe à utiliser correspond à celui utilisé pour la connexion à MonÉTS et les autres systèmes informatiques de l’ÉTS.",
"en":
"The password is the one you use for logging into MonÉTS and other ÉTS computer systems."
},
),
QuestionItem(
title: {
"fr": "Je n’ai pas accès au cours et au programme.",
"en": "I don't have access to the courses and program."
},
description: {
"fr":
"Les nouveaux étudiants pourraient ne pas voir l’horaire et les cours inscrits avant le début de la première session de cours. Cependant, ces informations apparaissent dès le début de la première session de cours.",
"en":
"New students may not see the schedule and courses before the start of the first course session. However, this information becomes available at the beginning of the first course session."
},
),
QuestionItem(
title: {
"fr":
"Je suis diplômé de l’ÉTS et je souhaite faire réactiver mon compte.",
"en": "I am an ÉTS graduate, and I want to reactivate my account."
},
description: {
"fr": "Vous pouvez demander de réactiver votre compte",
"en": "You can request to reactivate your account."
},
),
QuestionItem(
title: {
"fr": "Je ne vois plus mes notes de contrôle",
"en": "I can't see my grades anymore."
},
description: {
"fr":
"Il est possible qu’il s’agit de la période d'évaluation des cours. Vous devez compléter les évaluations sur SignETS. Les notes seront disponibles après avoir répondu aux évaluations.",
"en":
"It is possible that this is the course evaluation period. You need to complete the evaluations on SignETS. Grades will be available after responding to the evaluations."
},
),
];

List<ActionItem> actions = [
ActionItem(
title: {
"fr": "Où trouver mon code universel ?",
"en": "Where can I find my universal code?"
},
description: {
"fr":
"Le code universel se trouve dans la décision d’admission sur le portail de monÉTS.",
"en":
"The universal code can be found in the admission decision on the MonÉTS portal."
},
type: ActionType.webview,
link: "https://portail.etsmtl.ca/home/Admission",
iconName: Icons.person,
iconColor: const Color(0xFFD5A8F8),
circleColor: const Color(0xFF6939B7),
),
ActionItem(
title: {
"fr":
"Je suis diplômé de l’ÉTS et je souhaite faire réactiver mon compte.",
"en": "I am an ÉTS graduate, and I want to reactivate my account."
},
description: {
"fr": "Vous pouvez demander de réactiver votre compte.",
"en": "You can request to reactivate your account."
},
type: ActionType.webview,
link: "https://formulaires.etsmtl.ca/ReactivationCompte",
iconName: Icons.school,
iconColor: const Color(0xFF78E2BC),
circleColor: const Color(0xFF39B78A),
),
ActionItem(
title: {
"fr":
"Questions concernant vos conditions d'admission, des inscriptions et des conditions relatives à la poursuite de vos études",
"en":
"Questions about your admission conditions, registrations, and conditions for continuing your studies"
},
description: {
"fr": "Veuillez contacter le Bureau de la registraire.",
"en": "Please contact the Office of the Registrar."
},
type: ActionType.email,
link: "[email protected]",
iconName: Icons.email,
iconColor: const Color(0xFFFCA4A4),
circleColor: const Color(0xFFDA4444),
),
ActionItem(
title: {
"fr": "Questions concernant l’application ÉTSMobile",
"en": "Questions about the ÉTSMobile app"
},
description: {
"fr": "Veuillez contacter App|ETS.",
"en": "Please contact App|ETS."
},
type: ActionType.email,
link: AppInfo.email,
iconName: Icons.install_mobile,
iconColor: const Color(0xFF71D8F7),
circleColor: const Color(0xFF397DB7),
),
];
}
1 change: 1 addition & 0 deletions lib/core/constants/router_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class RouterPaths {
static const String startup = "/startup";
static const String login = "/login";
static const String faq = "/faq";
static const String dashboard = "/dashboard";
static const String schedule = "/schedule";
static const String student = "/student";
Expand Down
27 changes: 27 additions & 0 deletions lib/core/models/faq_actions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// FLUTTER / DART / THIRD-PARTIES
import 'package:flutter/material.dart';

class ActionItem {
final Map<String, String> title;
final Map<String, String> description;
final ActionType type;
final String link;
final IconData iconName;
final Color iconColor;
final Color circleColor;

ActionItem({
@required this.title,
@required this.description,
@required this.type,
@required this.link,
@required this.iconName,
@required this.iconColor,
@required this.circleColor,
});
}

enum ActionType {
webview,
email,
}
12 changes: 12 additions & 0 deletions lib/core/models/faq_questions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// FLUTTER / DART / THIRD-PARTIES
import 'package:flutter/material.dart';

class QuestionItem {
final Map<String, String> title;
final Map<String, String> description;

QuestionItem({
@required this.title,
@required this.description,
});
}
48 changes: 48 additions & 0 deletions lib/core/viewmodels/faq_viewmodel.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// FLUTTER / DART / THIRD-PARTIES
import 'package:flutter/material.dart';
import 'package:notredame/locator.dart';
import 'package:stacked/stacked.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

// MANAGERS
import 'package:notredame/core/managers/settings_manager.dart';

// SERVICES
import 'package:notredame/core/services/launch_url_service.dart';
import 'package:notredame/core/services/analytics_service.dart';

// CONSTANTS
import 'package:notredame/core/constants/app_info.dart';

class FaqViewModel extends BaseViewModel {
final SettingsManager _settingsManager = locator<SettingsManager>();

final LaunchUrlService _launchUrlService = locator<LaunchUrlService>();

Locale get locale => _settingsManager.locale;

String mailtoStr(String email, String subject) {
return 'mailto:$email?subject=$subject';
}

Future<void> launchWebsite(String link, Brightness brightness) async {
await _launchUrlService.launchInBrowser(link, brightness);
}

Future<void> openMail(String addressEmail, BuildContext context) async {
var email = "";
if (addressEmail == AppInfo.email) {
email = mailtoStr(addressEmail, AppIntl.of(context).email_subject);
} else {
email = mailtoStr(addressEmail, "");
}

final urlLaunchable = await _launchUrlService.canLaunch(email);

if (urlLaunchable) {
await _launchUrlService.launch(email);
} else {
locator<AnalyticsService>().logError("login_view", "Cannot send email.");
}
}
}
4 changes: 0 additions & 4 deletions lib/core/viewmodels/login_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,4 @@ class LoginViewModel extends BaseViewModel {

return _appIntl.login_error_invalid_credentials;
}

String mailtoStr(String email, String subject) {
return 'mailto:$email?subject=$subject';
}
}
6 changes: 6 additions & 0 deletions lib/ui/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:notredame/ui/views/feedback_view.dart';

// VIEWS
import 'package:notredame/ui/views/login_view.dart';
import 'package:notredame/ui/views/faq_view.dart';
import 'package:notredame/ui/views/not_found_view.dart';
import 'package:notredame/ui/views/more_view.dart';
import 'package:notredame/ui/views/outage_view.dart';
Expand Down Expand Up @@ -48,6 +49,11 @@ Route<dynamic> generateRoute(RouteSettings routeSettings) {
return MaterialPageRoute(
settings: RouteSettings(name: routeSettings.name),
builder: (_) => LoginView());
case RouterPaths.faq:
return MaterialPageRoute(
settings: RouteSettings(name: routeSettings.name),
builder: (_) =>
FaqView(backgroundColor: routeSettings.arguments as Color));
case RouterPaths.dashboard:
final code = (routeSettings.arguments as UpdateCode) ?? UpdateCode.none;
return PageRouteBuilder(
Expand Down
23 changes: 23 additions & 0 deletions lib/ui/utils/discovery_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,29 @@ List<GroupDiscovery> discoveryComponents(BuildContext context) {
),
),
),
Discovery(
path: null,
featureId: DiscoveryIds.detailsMoreFaq,
title: AppIntl.of(context).need_help,
details: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.2),
child: Column(
children: [
Expanded(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
_buildSkipDiscoveryButton(context),
Text(AppIntl.of(context).discovery_page_faq,
textAlign: TextAlign.justify),
],
),
),
],
),
),
),
Discovery(
path: null,
featureId: DiscoveryIds.detailsMoreSettings,
Expand Down
Loading

0 comments on commit db09c2a

Please sign in to comment.