From e2f74b97e6f7fb3944cfcff0a5620da27d5ac1eb Mon Sep 17 00:00:00 2001 From: keplyx Date: Tue, 17 Sep 2019 11:51:26 +0200 Subject: [PATCH] Added mail contact for bug reports --- screens/About/AboutScreen.js | 89 ++++++++++++++++++++++++++++++------ translations/en.json | 13 +++--- translations/fr.json | 4 +- 3 files changed, 86 insertions(+), 20 deletions(-) diff --git a/screens/About/AboutScreen.js b/screens/About/AboutScreen.js index b1c1220..a033b5f 100644 --- a/screens/About/AboutScreen.js +++ b/screens/About/AboutScreen.js @@ -2,23 +2,37 @@ import * as React from 'react'; import {FlatList, Linking, Platform, View} from 'react-native'; -import {Body, Card, CardItem, Container, Content, H1, Left, Right, Text, Thumbnail} from 'native-base'; +import {Body, Card, CardItem, Container, Content, H1, Left, Right, Text, Thumbnail, Button} from 'native-base'; import CustomHeader from "../../components/CustomHeader"; import i18n from "i18n-js"; import appJson from '../../app'; import packageJson from '../../package'; import CustomMaterialIcon from "../../components/CustomMaterialIcon"; import AsyncStorageManager from "../../utils/AsyncStorageManager"; +import Modalize from "react-native-modalize"; +import ThemeManager from "../../utils/ThemeManager"; const links = { appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148', playstore: 'https://play.google.com/store/apps/details?id=fr.amicaleinsat.application', - expo: 'https://expo.io/@amicaleinsat/application-amicale', git: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/README.md', - bugs: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/issues', + bugsMail: 'mailto:vergnet@etud.insa-toulouse.fr?' + + 'subject=' + + '[BUG] Application Amicale INSA Toulouse' + + '&body=' + + 'Coucou Arnaud ça bug c\'est nul,\n\n' + + 'Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n' + + 'Nature du problème :\n\n\n' + + 'Étapes pour reproduire ce pb :\n\n\n\n' + + 'Stp corrige le pb, bien cordialement.', + bugsGit: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/issues', changelog: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/Changelog.md', license: 'https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/LICENSE', - mail: "mailto:vergnet@etud.insa-toulouse.fr?subject=Application Amicale INSA Toulouse&body=", + mail: "mailto:vergnet@etud.insa-toulouse.fr?" + + "subject=" + + "Application Amicale INSA Toulouse" + + "&body=" + + "Coucou !\n\n", linkedin: 'https://www.linkedin.com/in/arnaud-vergnet-434ba5179/', facebook: 'https://www.facebook.com/arnaud.vergnet', react: 'https://facebook.github.io/react-native/', @@ -46,11 +60,17 @@ function openWebLink(link) { export default class AboutScreen extends React.Component { debugTapCounter = 0; + modalRef: { current: null | Modalize }; state = { isDebugUnlocked: AsyncStorageManager.getInstance().preferences.debugUnlocked.current === '1' }; + constructor(props: any) { + super(props); + this.modalRef = React.createRef(); + } + /** * Data to be displayed in the app card */ @@ -62,9 +82,9 @@ export default class AboutScreen extends React.Component { showChevron: true }, { - onPressCallback: () => openWebLink(links.expo), - icon: 'worker', - text: i18n.t('aboutScreen.expoBeta'), + onPressCallback: () => this.openBugReportModal(), + icon: 'bug', + text: i18n.t('aboutScreen.bugs'), showChevron: true }, { @@ -73,12 +93,6 @@ export default class AboutScreen extends React.Component { text: 'Git', showChevron: true }, - { - onPressCallback: () => openWebLink(links.bugs), - icon: 'bug', - text: i18n.t('aboutScreen.bugs'), - showChevron: true - }, { onPressCallback: () => openWebLink(links.changelog), icon: 'refresh', @@ -199,10 +213,59 @@ export default class AboutScreen extends React.Component { AsyncStorageManager.getInstance().savePref(key, '1'); } + getBugReportModal() { + return ( + + +

{i18n.t('aboutScreen.bugs')}

+ + {i18n.t('aboutScreen.bugsDescription')} + + + +
+
+ ); + } + + openBugReportModal() { + if (this.modalRef.current) { + this.modalRef.current.open(); + } + } + render() { const nav = this.props.navigation; return ( + {this.getBugReportModal()} diff --git a/translations/en.json b/translations/en.json index 7b93da3..bc782a0 100644 --- a/translations/en.json +++ b/translations/en.json @@ -69,8 +69,10 @@ "aboutScreen": { "appstore": "See on the Appstore", "playstore": "See on the Playstore", - "expoBeta": "Participate in the Beta!", "bugs": "Report Bugs", + "bugsDescription": "Reporting bugs helps us make the app better. Please be as precise as possible when describing your problem!", + "bugsMail": "Send a Mail", + "bugsGit": "Open an issue on Git", "changelog": "Changelog", "license": "License", "debug": "Debug", @@ -92,8 +94,8 @@ "inStock": "in stock", "description": "The Proximo is your small grocery store maintained by students directly on the campus. Open every day from 18h30 to 19h30, we welcome you when you are short on pastas or sodas ! Different products for different problems, everything at cost price. You can pay by Lydia or cash.", "openingHours": "Openning Hours", - "paymentMethods" : "Payment Methods", - "paymentMethodsDescription" : "Cash or Lydia" + "paymentMethods": "Payment Methods", + "paymentMethodsDescription": "Cash or Lydia" }, "proxiwashScreen": { "dryer": "Dryer", @@ -107,19 +109,18 @@ "loading": "Loading...", "description": "This is the washing service operated by Promologis for INSA's residences (We don't mind if you do not live on the campus and you do your laundry here). The room is right next to the R2, with 3 dryers and 9 washers, is open 7d/7 24h/24 ! Here you can check their availability ! You can bring your own detergent, use the one given on site or buy it at the Proximo (cheaper than the one given by the machines ). You can pay b credit card or cash.", "informationTab": "Information", - "paymentTab" : "Payment", + "paymentTab": "Payment", "tariffs": "Tariffs", "washersTariff": "3€ the washer + 0.80€ with detergent.", "dryersTariff": "0.35€ for 5min of dryer usage.", "paymentMethods": "Payment Methods", - "paymentMethodsDescription" : "Cash up until 10€.\nCredit Card also accepted.", + "paymentMethodsDescription": "Cash up until 10€.\nCredit Card also accepted.", "washerProcedure": "Put your laundry in the tumble without tamping it and by respecting charge limits.\n\nClose the machine's door.\n\nChoose a program using one of the four favorite program buttons.\n\nPay to the command central, then press the START button on the machine.\n\nWhen the program is finished, the screen indicates 'Programme terminé', press the yellow button to open the lid and retrieve your laundry.", "washerTips": "Program 'blanc/couleur': 6kg of dry laundry (cotton linen, linen, underwear, sheets, jeans, towels).\n\nProgram 'non repassable': 3,5 kg of dry laundry (synthetic fibre linen, cotton and polyester mixed).\n\nProgram 'fin 30°C': 2,5 kg of dry laundry (delicate linen in synthetic fibres).\n\nProgram 'laine 30°C': 2,5 kg of dry laundry (wool textiles).", "dryerProcedure": "Put your laundry in the tumble without tamping it and by respecting charge limits.\n\nClose the machine's door.\n\nChoose a program using one of the four favorite program buttons.\n\nPay to the command central, then press the START button on the machine.", "dryerTips": "The advised dryer length is 35 minutes for 14 kg of laundry. You can choose a shorter length if the dryer is not fully charged.", "procedure": "Procedure", "tips": "Tips", - "modal": { "enableNotifications": "Notify me", "disableNotifications": "Stop notifications", diff --git a/translations/fr.json b/translations/fr.json index c52970b..101a380 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -69,8 +69,10 @@ "aboutScreen": { "appstore": "Voir sur l'Appstore", "playstore": "Voir sur le Playstore", - "expoBeta": "Participer à la Beta !", "bugs": "Rapporter des Bugs", + "bugsDescription": "Rapporter les bugs nous aide à améliorer l'appli. Merci de décrire votre problème le plus précisément possible !", + "bugsMail": "Envoyer un Mail", + "bugsGit": "Ouvrir un ticket sur Git", "changelog": "Historique des modifications", "license": "Licence", "debug": "Debug",