Skip to content

Commit c660677

Browse files
author
Ali Abdelfattah
authored
Merge pull request #601 from Instabug/fix/discard-attachment-string-keys
[MOB-5448] Add discard attachment string keys
2 parents 5df2744 + 3f9387f commit c660677

File tree

6 files changed

+48
-5
lines changed

6 files changed

+48
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## v10.8.0 (2021-08-02)
1+
## v10.8.0 (2021-08-04)
22

33
* Bumps Instabug native SDKs to v10.8
4+
* Adds string keys for the discard attachment prompt dialog.
45

56
## v10.4.0 (2021-05-10)
67

android/src/main/java/com/instabug/reactlibrary/ArgsRegistry.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ static void registerCustomTextPlaceHolderKeysArgs(Map<String, Object> args) {
200200
args.put("betaWelcomeMessageFinishStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT);
201201
args.put("liveWelcomeMessageTitle", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_TITLE);
202202
args.put("liveWelcomeMessageContent", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_CONTENT);
203+
args.put("discardAlertTitle", InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_TITLE);
204+
args.put("discardAlertMessage", InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_BODY);
205+
args.put("discardAlertCancel", InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_NEGATIVE_ACTION);
206+
args.put("discardAlertAction", InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_POSITIVE_ACTION);
207+
args.put("addAttachmentButtonTitleStringName", InstabugCustomTextPlaceHolder.Key.REPORT_ADD_ATTACHMENT_HEADER);
203208
}
204209

205210
static void registerInstabugReportTypesArgs(Map<String, Object> args) {

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
228228
private final String REPORT_QUESTION_DESCRIPTION = "reportQuestionDescription";
229229
private final String REQUEST_FEATURE_DESCRIPTION = "requestFeatureDescription";
230230

231+
private final String REPORT_DISCARD_DIALOG_TITLE = "discardAlertTitle";
232+
private final String REPORT_DISCARD_DIALOG_BODY = "discardAlertMessage";
233+
private final String REPORT_DISCARD_DIALOG_NEGATIVE_ACTION = "discardAlertCancel";
234+
private final String REPORT_DISCARD_DIALOG_POSITIVE_ACTION = "discardAlertAction";
235+
private final String REPORT_ADD_ATTACHMENT_HEADER = "addAttachmentButtonTitleStringName";
236+
231237
private Application androidApplication;
232238
private Instabug mInstabug;
233239
private InstabugInvocationEvent invocationEvent;
@@ -2309,6 +2315,16 @@ private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
23092315
return InstabugCustomTextPlaceHolder.Key.REPORT_QUESTION_DESCRIPTION;
23102316
case REQUEST_FEATURE_DESCRIPTION:
23112317
return InstabugCustomTextPlaceHolder.Key.REQUEST_FEATURE_DESCRIPTION;
2318+
case REPORT_DISCARD_DIALOG_TITLE:
2319+
return InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_TITLE;
2320+
case REPORT_DISCARD_DIALOG_BODY:
2321+
return InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_BODY;
2322+
case REPORT_DISCARD_DIALOG_NEGATIVE_ACTION:
2323+
return InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_NEGATIVE_ACTION;
2324+
case REPORT_DISCARD_DIALOG_POSITIVE_ACTION:
2325+
return InstabugCustomTextPlaceHolder.Key.REPORT_DISCARD_DIALOG_POSITIVE_ACTION;
2326+
case REPORT_ADD_ATTACHMENT_HEADER:
2327+
return InstabugCustomTextPlaceHolder.Key.REPORT_ADD_ATTACHMENT_HEADER;
23122328
default:
23132329
return null;
23142330
}
@@ -2484,6 +2500,12 @@ public Map<String, Object> getConstants() {
24842500
constants.put(REPORT_QUESTION_DESCRIPTION, REPORT_QUESTION_DESCRIPTION);
24852501
constants.put(REQUEST_FEATURE_DESCRIPTION, REQUEST_FEATURE_DESCRIPTION);
24862502

2503+
constants.put(REPORT_DISCARD_DIALOG_TITLE, REPORT_DISCARD_DIALOG_TITLE);
2504+
constants.put(REPORT_DISCARD_DIALOG_BODY, REPORT_DISCARD_DIALOG_BODY);
2505+
constants.put(REPORT_DISCARD_DIALOG_NEGATIVE_ACTION, REPORT_DISCARD_DIALOG_NEGATIVE_ACTION);
2506+
constants.put(REPORT_DISCARD_DIALOG_POSITIVE_ACTION, REPORT_DISCARD_DIALOG_POSITIVE_ACTION);
2507+
constants.put(REPORT_ADD_ATTACHMENT_HEADER, REPORT_ADD_ATTACHMENT_HEADER);
2508+
24872509
return constants;
24882510
}
24892511
}

index.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,12 @@ export enum strings {
432432
reportBugDescription,
433433
reportFeedbackDescription,
434434
reportQuestionDescription,
435-
requestFeatureDescription
435+
requestFeatureDescription,
436+
discardAlertTitle,
437+
discardAlertMessage,
438+
discardAlertCancel,
439+
discardAlertAction,
440+
addAttachmentButtonTitleStringName
436441
}
437442

438443
interface Report {

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,12 @@ const InstabugModule = {
10741074
reportBugDescription: Instabug.reportBugDescription,
10751075
reportFeedbackDescription: Instabug.reportFeedbackDescription,
10761076
reportQuestionDescription: Instabug.reportQuestionDescription,
1077-
requestFeatureDescription: Instabug.requestFeatureDescription
1077+
requestFeatureDescription: Instabug.requestFeatureDescription,
1078+
discardAlertTitle: Instabug.discardAlertTitle,
1079+
discardAlertMessage: Instabug.discardAlertMessage,
1080+
discardAlertCancel: Instabug.discardAlertCancel,
1081+
discardAlertAction: Instabug.discardAlertAction,
1082+
addAttachmentButtonTitleStringName: Instabug.addAttachmentButtonTitleStringName
10781083
},
10791084

10801085
};

ios/RNInstabug/InstabugReactBridge.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,14 @@ - (NSDictionary *)constantsToExport
581581
@"reportBugDescription": kIBGReportBugDescriptionStringName,
582582
@"reportFeedbackDescription": kIBGReportFeedbackDescriptionStringName,
583583
@"reportQuestionDescription": kIBGReportQuestionDescriptionStringName,
584-
@"requestFeatureDescription": kIBGRequestFeatureDescriptionStringName
584+
@"requestFeatureDescription": kIBGRequestFeatureDescriptionStringName,
585585

586-
};
586+
@"discardAlertTitle": kIBGDiscardAlertTitle,
587+
@"discardAlertMessage": kIBGDiscardAlertMessage,
588+
@"discardAlertCancel": kIBGDiscardAlertCancel,
589+
@"discardAlertAction": kIBGDiscardAlertAction,
590+
@"addAttachmentButtonTitleStringName": kIBGAddAttachmentButtonTitleStringName
591+
};
587592
};
588593

589594
- (void) setBaseUrlForDeprecationLogs {

0 commit comments

Comments
 (0)