Skip to content

Commit

Permalink
Merge branch 'bug-details'
Browse files Browse the repository at this point in the history
  • Loading branch information
danhd123 committed Feb 8, 2018
2 parents 4296d76 + 3e9ec69 commit 4768266
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 5 deletions.
1 change: 1 addition & 0 deletions Example/Buglife Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, BuglifeDelegate {
Buglife.shared().start(withEmail: "[email protected]")
Buglife.shared().invocationOptions = [.shake, .screenshot, .floatingButton]
Buglife.shared().delegate = self
Buglife.shared().inputFields = LIFETextInputField.bugDetailInputFields()

return true
}
Expand Down
3 changes: 3 additions & 0 deletions Source/Buglife+LocalizedStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ LIFEStringKey LIFEStringKey_Report = @"Feedback";
LIFEStringKey LIFEStringKey_UserEmailInputFieldTitle = @"Your email";
LIFEStringKey LIFEStringKey_UserEmailInputFieldPlaceholder = @"[email protected]";
LIFEStringKey LIFEStringKey_SummaryInputFieldTitle = @"Feedback";
LIFEStringKey LIFEStringKey_SummaryInputFieldDetailedTitle = @"What Happened?";
LIFEStringKey LIFEStringKey_SummaryInputFieldPlaceholder = @"Give us some feedback.";
LIFEStringKey LIFEStringKey_SummaryInputFieldDetailedPlaceholder = @"Provide a summary of your report.";
LIFEStringKey LIFEStringKey_SummaryInputFieldAccessibilityHint = @"Text entered here is submitted with your feedback.";
LIFEStringKey LIFEStringKey_SummaryInputFieldAccessibilityDetailedHint = @"Text entered here is submitted with the bug report.";
LIFEStringKey LIFEStringKey_StepsToReproduce = @"Steps to Reproduce";
LIFEStringKey LIFEStringKey_ExpectedResults = @"Expected Results";
LIFEStringKey LIFEStringKey_ExpectedResultsPlaceholder = @"Describe what you expected to happen.";
Expand Down
2 changes: 2 additions & 0 deletions Source/Buglife.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ extern NSString * __nonnull const LIFENotificationUserSubmittedReport;
* constructors, and include them in your array of custom input fields.
*
* Set this property to null if you'd like to simply use the default field(s).
* Set this property to `LIFEInputField.bugDetailInputFields()` if you want a Summary,
* Steps to Reproduce, Expected Resutls, and Actual Results fields.
*/
@property (nonatomic, nullable) NSArray<LIFEInputField *> *inputFields;

Expand Down
9 changes: 9 additions & 0 deletions Source/LIFEInputField.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@

- (null_unspecified instancetype)init NS_UNAVAILABLE;

/**
* Returns an array of fields for more detailed bug reports, to aid in reproducing the bug.
* These include Summary, Steps to Reproduce, Expected Results, and Actual Results
* Note that even without using detailed input fields, button taps (and other events)
* will be logged to the Buglife dashboard to aid in reproducing the bug.
*
*/
+ (nonnull NSArray<LIFEInputField *> *)bugDetailInputFields;

/**
* The bug report attribute name for this input field.
*
Expand Down
24 changes: 24 additions & 0 deletions Source/LIFEInputField.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,30 @@ - (BOOL)isSummaryField
return [self.attributeName isEqualToString:LIFEInputFieldSummaryAttributeName];
}

+ (NSArray<LIFEInputField *> *)bugDetailInputFields
{
LIFETextInputField *summaryInputField = [LIFETextInputField summaryInputField];
summaryInputField.title = LIFELocalizedString(LIFEStringKey_SummaryInputFieldDetailedTitle);
summaryInputField.placeholder = LIFELocalizedString(LIFEStringKey_SummaryInputFieldDetailedPlaceholder);
summaryInputField.accessibilityHint = LIFELocalizedString(LIFEStringKey_SummaryInputFieldAccessibilityDetailedHint);

LIFETextInputField *stepsToReproduce = [[LIFETextInputField alloc] initWithAttributeName:@"Steps to Reproduce"];
stepsToReproduce.multiline = YES;
stepsToReproduce.title = LIFELocalizedString(LIFEStringKey_StepsToReproduce);

LIFETextInputField *expectedResults = [[LIFETextInputField alloc] initWithAttributeName:@"Expected Results"];
expectedResults.multiline = YES;
expectedResults.title = LIFELocalizedString(LIFEStringKey_ExpectedResults);
expectedResults.placeholder = LIFELocalizedString(LIFEStringKey_ExpectedResultsPlaceholder);

LIFETextInputField *actualResults = [[LIFETextInputField alloc] initWithAttributeName:@"Actual Results"];
actualResults.multiline = YES;
actualResults.title = LIFELocalizedString(LIFEStringKey_ActualResults);
actualResults.placeholder = LIFELocalizedString(LIFEStringKey_ActualResultsPlaceholder);

return @[summaryInputField, stepsToReproduce, expectedResults, actualResults];
}

#pragma mark - Debug description

- (NSString *)debugDescription
Expand Down
1 change: 1 addition & 0 deletions Source/Services/LIFENetworkManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ + (NSURL *)_baseURL
NSDictionary *environment = [[NSProcessInfo processInfo] environment];
NSString *overrideURL = environment[@"com.buglife.base_url"];
if (overrideURL) {
NSLog(@"Running with overridden base url: %@", overrideURL);
return [NSURL URLWithString:overrideURL];
}

Expand Down
39 changes: 34 additions & 5 deletions Source/Views/LIFELocalizedStringProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ - (NSString *)_frenchStringForKey:(NSString *)key
LIFEStringKey_Report : @"Avis",
LIFEStringKey_UserEmailInputFieldTitle : @"Votre e-mail",
LIFEStringKey_SummaryInputFieldTitle : @"Avis",
LIFEStringKey_SummaryInputFieldAccessibilityHint : @"Le texte saisi ici est envoyé avec votre avis.",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Qu'est-il arrivé?",
LIFEStringKey_SummaryInputFieldAccessibilityHint : @"Le texte saisi ici est présenté avec le rapport de bogue.",
LIFEStringKey_SummaryInputFieldAccessibilityDetailedHint : @"Le texte saisi ici est envoyé avec votre avis.",
LIFEStringKey_StepsToReproduce : @"Procédure pour reproduire",
LIFEStringKey_ExpectedResults : @"Résultats attendus",
LIFEStringKey_ExpectedResultsPlaceholder : @"Décrivez ce que vous vous attendiez à arriver.",
Expand All @@ -187,29 +189,30 @@ - (NSString *)_frenchStringForKey:(NSString *)key
LIFEStringKey_DontAskUntilNextLaunch : @"Ne demandez pas jusqu'au prochain lancement",
LIFEStringKey_HelpUsMakeXYZBetter : @"Aidez-nous à %@ mieux!",
LIFEStringKey_HelpUsMakeThisAppBetter : @"Aidez-nous à améliorer cette application!",
LIFEStringKey_ThanksForFilingABug : @"Merci d'avoir envoyé votre avis !",
LIFEStringKey_ThanksForFilingABug : @"Merci d'avoir envoyé votre avis!",
LIFEStringKey_AttachPhoto : @"Joindre une photo",
LIFEStringKey_Arrow : @"Flèche",
LIFEStringKey_ArrowAccessibilityValue : @"Tête pointe de %.0f pixels de haut et %.0f pixels de la gauche",
LIFEStringKey_Blur : @"Flou",
LIFEStringKey_Loupe : @"Loupe",
LIFEStringKey_LoupeAccessibilityValue : @"Centré au pixel de coordonnées %.0f par %.0f, et est de %.0f pixels de large par %.0f pixels de haut",
LIFEStringKey_Component : @"Composant",
LIFEStringKey_DiscardReportAlertTitle : @"Supprimer cet avis ?",
LIFEStringKey_DiscardReportAlertTitle : @"Supprimer cet avis?",
LIFEStringKey_DiscardReportAlertMessage : @"Toutes les données de ce rapport seront supprimées... Mais vous pourrez toujours envoyer un autre avis plus tard.",
LIFEStringKey_DiscardReportAlertConfirm : @"Jeter",
LIFEStringKey_DiscardReportAlertCancel : @"Annuler",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Avis",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Veuillez fournir un résumé de votre rapport.",
LIFEStringKey_Attachments : @"Pièces jointes",
LIFEStringKey_GenericAlertTitle : @"Oups !",
LIFEStringKey_GenericAlertTitle : @"Oups!",
LIFEStringKey_InvalidEmailAlertMessage : @"%@ n'est pas une adresse e-mail valide.",
LIFEStringKey_ReportSubmissionErrorAlertTitle : @"Échec de l'envoi de votre avis",
LIFEStringKey_ReportSubmissionErrorAlertMessage : @"Ceci peut être dû à une mauvaise qualité de la connexion réseau. Veuillez réessayer.",

LIFEStringKey_ArrowToolLabel : @"Flèche",
LIFEStringKey_LoupeToolLabel : @"Zoomer",
LIFEStringKey_BlurToolLabel : @"Flou",
LIFEStringKey_ReportABugWithScreenRecording : @"Envoyer un avis avec cette capture vidéo ?",
LIFEStringKey_ReportABugWithScreenRecording : @"Envoyer un avis avec cette capture vidéo?",
};
});

Expand Down Expand Up @@ -238,7 +241,9 @@ - (NSString *)_dutchStringForKey:(NSString *)key
LIFEStringKey_Report : @"Feedback",
LIFEStringKey_UserEmailInputFieldTitle : @"Jouw email",
LIFEStringKey_SummaryInputFieldTitle : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Wat is er gebeurd?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Bij het bug rapport",
LIFEStringKey_StepsToReproduce : @"Stappen om te reproduceren",
LIFEStringKey_ExpectedResults : @"Verwachte resultaten",
LIFEStringKey_ExpectedResultsPlaceholder : @"Beschrijf wat je dacht dat er zou gebeuren",
Expand Down Expand Up @@ -375,7 +380,9 @@ - (NSString *)_germanStringForKey:(NSString *)key
LIFEStringKey_Report : @"Feedback",
LIFEStringKey_UserEmailInputFieldTitle : @"Ihre E-Mail-Adresse",
LIFEStringKey_SummaryInputFieldTitle : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Was ist passiert?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Den Text, den Sie hier eingeben, wird zusammen mit dem Fehlerbericht übermittelt.",
LIFEStringKey_StepsToReproduce : @"Schritte zum nachvollziehen",
LIFEStringKey_ExpectedResults : @"Erwartete Ergebnisse",
LIFEStringKey_ExpectedResultsPlaceholder : @"Beschreiben Sie was hätte passieren sollen.",
Expand Down Expand Up @@ -453,7 +460,9 @@ - (NSString *)_chineseSimplifiedStringForKey:(NSString *)key
LIFEStringKey_Report : @"反馈",
LIFEStringKey_UserEmailInputFieldTitle : @"您的电子邮件地址",
LIFEStringKey_SummaryInputFieldTitle : @"反馈",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"发生了什么情况?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"反馈",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"在此处输入的文字将随 Bug 报告一同提交。",
LIFEStringKey_SummaryInputFieldAccessibilityHint : @"在此处输入的文字将随您的反馈一起提交。",
LIFEStringKey_StepsToReproduce : @"重现步骤",
LIFEStringKey_ExpectedResults : @"期待的结果",
Expand Down Expand Up @@ -523,7 +532,9 @@ - (NSString *)_japaneseStringForKey:(NSString *)key
LIFEStringKey_Report : @"フィードバック",
LIFEStringKey_UserEmailInputFieldTitle : @"メールアドレス",
LIFEStringKey_SummaryInputFieldTitle : @"フィードバック",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"どうしましたか?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"フィードバック",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"こちらに入力したテキストはバグ報告と一緒に送信されます。",
LIFEStringKey_StepsToReproduce : @"再現ステップ",
LIFEStringKey_ExpectedResults : @"予想していた結果",
LIFEStringKey_ExpectedResultsPlaceholder : @"どうなると予測していたのか説明してください。",
Expand Down Expand Up @@ -591,7 +602,9 @@ - (NSString *)_koreanStringForKey:(NSString *)key
LIFEStringKey_Report : @"의견",
LIFEStringKey_UserEmailInputFieldTitle : @"이메일 주소",
LIFEStringKey_SummaryInputFieldTitle : @"의견",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"어떤 상황인가요?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"의견",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"여기에 입력한 내용은 버그 보고서와 함께 전송됩니다.",
LIFEStringKey_StepsToReproduce : @"버그 재현 방법",
LIFEStringKey_ExpectedResults : @"예상 결과",
LIFEStringKey_ExpectedResultsPlaceholder : @"예상한 결과가 무엇인지 설명해주세요.",
Expand Down Expand Up @@ -659,7 +672,9 @@ - (NSString *)_russianStringForKey:(NSString *)key
LIFEStringKey_Report : @"Отзыв",
LIFEStringKey_UserEmailInputFieldTitle : @"Ваш эл. адрес",
LIFEStringKey_SummaryInputFieldTitle : @"Отзыв",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Что случилось?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Отзыв",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Введите текст, который войдет в отчет об ошибках.",
LIFEStringKey_StepsToReproduce : @"Как воспроизвести",
LIFEStringKey_ExpectedResults : @"Ожидаемый результат",
LIFEStringKey_ExpectedResultsPlaceholder : @"Опишите, что должно было произойти.",
Expand Down Expand Up @@ -727,7 +742,9 @@ - (NSString *)_vietnameseStringForKey:(NSString *)key
LIFEStringKey_Report : @"Phản hồi",
LIFEStringKey_UserEmailInputFieldTitle : @"Email của bạn",
LIFEStringKey_SummaryInputFieldTitle : @"Phản hồi",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Chuyện gì đã xảy ra?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Phản hồi",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Nội dung được nhập vào đây sẽ được gửi cùng với báo cáo lỗi.",
LIFEStringKey_StepsToReproduce : @"Các bước để Tái hiện lỗi",
LIFEStringKey_ExpectedResults : @"Kết quả Mong đợi",
LIFEStringKey_ExpectedResultsPlaceholder : @"Mô tả những gì bạn mong đợi sẽ xảy ra.",
Expand Down Expand Up @@ -793,7 +810,9 @@ - (NSString *)_hebrewStringForKey:(NSString *)key
LIFEStringKey_Report : @"משוב",
LIFEStringKey_UserEmailInputFieldTitle : @"האימייל שלך",
LIFEStringKey_SummaryInputFieldTitle : @"משוב",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"מה קרה?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"משוב",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"טקסט שתכתבו כאן יכלל בדיווח",
LIFEStringKey_StepsToReproduce : @"צעדים לשחזור",
LIFEStringKey_ExpectedResults : @"תוצאות מצופות",
LIFEStringKey_ExpectedResultsPlaceholder : @"תארו מה ציפיתם שיקרה",
Expand Down Expand Up @@ -859,7 +878,9 @@ - (NSString *)_polishStringForKey:(NSString *)key
LIFEStringKey_Report : @"Opinia",
LIFEStringKey_UserEmailInputFieldTitle : @"Twój adres e-mail",
LIFEStringKey_SummaryInputFieldTitle : @"Opinia",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Co się stało?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Opinia",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Wpisana tutaj treść zostanie przekazana razem z raportem o błędzie.",
LIFEStringKey_StepsToReproduce : @"Kroki potrzebne do odtworzenia",
LIFEStringKey_ExpectedResults : @"Oczekiwane wyniki",
LIFEStringKey_ExpectedResultsPlaceholder : @"Opisz, co według Ciebie powinno się stać.",
Expand Down Expand Up @@ -925,7 +946,9 @@ - (NSString *)_swedishStringForKey:(NSString *)key
LIFEStringKey_Report : @"Feedback",
LIFEStringKey_UserEmailInputFieldTitle : @"Din e-postadress",
LIFEStringKey_SummaryInputFieldTitle : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Vad hände?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Den text som skrivs här skickas som en del av buggrapporten.",
LIFEStringKey_StepsToReproduce : @"Steg för att återskapa",
LIFEStringKey_ExpectedResults : @"Förväntat resultat",
LIFEStringKey_ExpectedResultsPlaceholder : @"Beskriv vad du trodde skulle hända.",
Expand Down Expand Up @@ -991,7 +1014,9 @@ - (NSString *)_italianStringForKey:(NSString *)key
LIFEStringKey_Report : @"Feedback",
LIFEStringKey_UserEmailInputFieldTitle : @"Il tuo indirizzo e-mail",
LIFEStringKey_SummaryInputFieldTitle : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"Cosa è successo?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Feedback",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"Il testo inserito qui viene inviato insieme alla segnalazione di bug.",
LIFEStringKey_StepsToReproduce : @"Passaggi da riprodurre",
LIFEStringKey_ExpectedResults : @"Risultati previsti",
LIFEStringKey_ExpectedResultsPlaceholder : @"Descrivi il risultato previsto.",
Expand Down Expand Up @@ -1057,7 +1082,9 @@ - (NSString *)_portugueseStringForKey:(NSString *)key
LIFEStringKey_Report : @"Comentários",
LIFEStringKey_UserEmailInputFieldTitle : @"O seu e-mail",
LIFEStringKey_SummaryInputFieldTitle : @"Comentários",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"O que aconteceu?",
LIFEStringKey_SummaryInputFieldPlaceholder : @"Comentários",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"O texto aqui introduzido é submetido com o relatório de erro.",
LIFEStringKey_StepsToReproduce : @"Passos de Reprodução",
LIFEStringKey_ExpectedResults : @"Resultados Esperados",
LIFEStringKey_ExpectedResultsPlaceholder : @"Descreva o que esperava que acontecesse.",
Expand Down Expand Up @@ -1133,7 +1160,9 @@ - (NSString *)_arabicStringForKey:(NSString *)key
LIFEStringKey_Report : @"التعليقات",
LIFEStringKey_UserEmailInputFieldTitle : @"بريدك الإلكتروني",
LIFEStringKey_SummaryInputFieldTitle : @"التعليقات",
LIFEStringKey_SummaryInputFieldDetailedTitle : @"ماذا حدث؟",
LIFEStringKey_SummaryInputFieldPlaceholder : @"التعليقات",
LIFEStringKey_SummaryInputFieldDetailedPlaceholder : @"النص الذي تم إدخاله هنا مُرسل مع تقرير الخطأ في البرمجة.",
LIFEStringKey_SummaryInputFieldAccessibilityHint : @"النص الذي يُدخَل هنا يُرسل مع تعليقاتك.",
LIFEStringKey_StepsToReproduce : @"خطوات إعادة توليد الخطأ",
LIFEStringKey_ExpectedResults : @"النتائج المتوقعة",
Expand Down

0 comments on commit 4768266

Please sign in to comment.