Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v11.13.0...dev)

### Added

- Add new strings (`StringKey.discardAlertStay` and `StringKey.discardAlertDiscard`) for overriding the discard alert buttons for consistency between iOS and Android ([#1001](https://github.com/Instabug/Instabug-React-Native/pull/1001)).

### Deprecated

- Deprecate the old `StringKey.discardAlertCancel` and `StringKey.discardAlertAction` string keys for overriding the discard alert buttons as they had incosistent behavior between iOS and Android ([#1001](https://github.com/Instabug/Instabug-React-Native/pull/1001)).

## [11.13.0](https://github.com/Instabug/Instabug-React-Native/compare/v11.12.0...v11.13.0) (July 10, 2023)

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ static Map<String, Object> getAll() {
put("discardAlertMessage", Key.REPORT_DISCARD_DIALOG_BODY);
put("discardAlertCancel", Key.REPORT_DISCARD_DIALOG_NEGATIVE_ACTION);
put("discardAlertAction", Key.REPORT_DISCARD_DIALOG_POSITIVE_ACTION);
put("discardAlertStay", Key.REPORT_DISCARD_DIALOG_NEGATIVE_ACTION);
put("discardAlertDiscard", Key.REPORT_DISCARD_DIALOG_POSITIVE_ACTION);

put("addAttachmentButtonTitleStringName", Key.REPORT_ADD_ATTACHMENT_HEADER);

put("reportReproStepsDisclaimerBody", Key.REPORT_REPRO_STEPS_DISCLAIMER_BODY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

Expand Down Expand Up @@ -453,11 +454,15 @@ public void tearDown() {
// given
mockStatic(Log.class);
Map<String, InstabugCustomTextPlaceHolder.Key> args = ArgsRegistry.placeholders;
String[] keysArray = args.keySet().toArray(new String[0]);
Set<String> keys = args.keySet();

// Ignore deprecated keys
keys.remove("discardAlertCancel");
keys.remove("discardAlertAction");

// when
InstabugCustomTextPlaceHolder expectedPlaceHolders = new InstabugCustomTextPlaceHolder();
for (String key : keysArray) {
for (String key : keys) {
InstabugCustomTextPlaceHolder.Key placeHolder = args.get(key);
expectedPlaceHolders.set(placeHolder, key);
rnModule.setString(key, key);
Expand All @@ -473,7 +478,7 @@ public void tearDown() {
getDeclaredField("placeHolders");
privateStringField.setAccessible(true);
InstabugCustomTextPlaceHolder placeHolders = (InstabugCustomTextPlaceHolder) privateStringField.get(rnModule);
for (String key : keysArray) {
for (String key : keys) {
InstabugCustomTextPlaceHolder.Key placeHolder = args.get(key);
Assert.assertEquals(placeHolders.get(placeHolder), key);
}
Expand Down
2 changes: 2 additions & 0 deletions ios/RNInstabug/ArgsRegistry.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ + (ArgsDictionary *) locales {
@"discardAlertMessage": kIBGDiscardAlertMessage,
@"discardAlertCancel": kIBGDiscardAlertCancel,
@"discardAlertAction": kIBGDiscardAlertAction,
@"discardAlertDiscard": kIBGDiscardAlertCancel,
@"discardAlertStay": kIBGDiscardAlertAction,
@"addAttachmentButtonTitleStringName": kIBGAddAttachmentButtonTitleStringName,

@"reportReproStepsDisclaimerBody": kIBGReproStepsDisclaimerBody,
Expand Down
2 changes: 2 additions & 0 deletions src/native/NativeConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ interface NativeStringKey {
conversationTextFieldHint: any;
discardAlertAction: any;
discardAlertCancel: any;
discardAlertStay: any;
discardAlertDiscard: any;
discardAlertMessage: any;
discardAlertTitle: any;
edgeSwipeStartHint: any;
Expand Down
4 changes: 4 additions & 0 deletions src/utils/ArgsRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,12 @@ export enum strings {
requestFeatureDescription = constants.requestFeatureDescription,
discardAlertTitle = constants.discardAlertTitle,
discardAlertMessage = constants.discardAlertMessage,
/** @deprecated Use {@link discardAlertStay} and {@link discardAlertDiscard} instead */
discardAlertCancel = constants.discardAlertCancel,
/** @deprecated Use {@link discardAlertStay} and {@link discardAlertDiscard} instead */
discardAlertAction = constants.discardAlertAction,
discardAlertDiscard = constants.discardAlertDiscard,
discardAlertStay = constants.discardAlertStay,
addAttachmentButtonTitleStringName = constants.addAttachmentButtonTitleStringName,
reportReproStepsDisclaimerBody = constants.reportReproStepsDisclaimerBody,
reportReproStepsDisclaimerLink = constants.reportReproStepsDisclaimerLink,
Expand Down
4 changes: 4 additions & 0 deletions src/utils/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,12 @@ export enum StringKey {
commentFieldHintForQuestion = constants.commentFieldHintForQuestion,
conversationsHeaderTitle = constants.conversationsHeaderTitle,
conversationTextFieldHint = constants.conversationTextFieldHint,
/** @deprecated Use {@link discardAlertStay} and {@link discardAlertDiscard} instead */
discardAlertAction = constants.discardAlertAction,
/** @deprecated Use {@link discardAlertStay} and {@link discardAlertDiscard} instead */
discardAlertCancel = constants.discardAlertCancel,
discardAlertDiscard = constants.discardAlertDiscard,
discardAlertStay = constants.discardAlertStay,
discardAlertMessage = constants.discardAlertMessage,
discardAlertTitle = constants.discardAlertTitle,
edgeSwipeStartHint = constants.edgeSwipeStartHint,
Expand Down