Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOB-9995] reorganize source code #599

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
33dcd4b
Refactor file structure: move `IterableInbox` to `inbox` directory an…
lposen Nov 7, 2024
a1d215f
Update imports for IterableInboxCustomizations to reflect new file st…
lposen Nov 7, 2024
e5ff188
Refactor file structure: move inbox-related components to `inbox` dir…
lposen Nov 7, 2024
827462a
Refactor imports: consolidate IterableInApp classes into a single inA…
lposen Nov 7, 2024
27f1bf0
Refactor in-app structure: separate classes into individual files, in…
lposen Nov 7, 2024
507902a
Refactor inbox structure: move components to a new `components` direc…
lposen Nov 7, 2024
fd2ea12
Refactor Iterable module: rename AuthResponseCallback to IterableAuth…
lposen Nov 7, 2024
5af5f45
Refactor event names: rename EventName to IterableEventName in Iterab…
lposen Nov 7, 2024
7cf303c
Refactor enums: move IterableAuthResponseResult, IterableEventName, a…
lposen Nov 7, 2024
95c4988
Refactor Iterable module: move IterableActionContext to a new file, u…
lposen Nov 7, 2024
3a52215
Refactor Iterable module: update imports for IterableAuthResponse and…
lposen Nov 7, 2024
9ac9906
Refactor Iterable module: update imports for IterableActionContext, I…
lposen Nov 7, 2024
20b10a3
Refactor Iterable module: move IterablePushPlatform enum to a separat…
lposen Nov 7, 2024
f7066e7
Refactor imports in IterableLogger, IterableUtil, and IterableInAppMe…
lposen Nov 7, 2024
5a1eea0
Refactor Iterable module: update imports for consistency and rename t…
lposen Nov 7, 2024
1db7ca4
Refactor imports in Iterable module: update paths to use absolute imp…
lposen Nov 7, 2024
04dc426
Refactor imports and restructure files in Iterable module: consolidat…
lposen Nov 7, 2024
1393e4b
Undid local path changes as they do not work with the build
lposen Nov 7, 2024
6cfa8a2
Fix import path for package.json in Iterable class to ensure correct …
lposen Nov 7, 2024
4688446
Refactor types in inbox module: change type aliases to interfaces for…
lposen Nov 7, 2024
f96f5c9
Merge branch '2.0.0-alpha/MOB-10131-remove-duplicate-code' into 2.0.0…
lposen Nov 14, 2024
3d92e26
Changed file order as it was messing with mocks
lposen Nov 14, 2024
e6d729f
Merge branch '2.0.0-alpha/MOB-9995-reorganize-source-code' of github.…
lposen Nov 14, 2024
65aa68c
Merge branch '2.0.0-alpha/MOB-10131-remove-duplicate-code' into 2.0.0…
lposen Nov 15, 2024
4216fa7
Remove default exports from Iterable classes and enums
lposen Nov 15, 2024
8ea2a20
Merge branch '2.0.0-alpha/MOB-10131-remove-duplicate-code' into 2.0.0…
lposen Nov 25, 2024
a20baec
Merge branch '2.0.0-alpha/MOB-10131-remove-duplicate-code' into 2.0.0…
lposen Nov 26, 2024
c8ece69
Merge branch '2.0.0-alpha/MOB-10131-remove-duplicate-code' into 2.0.0…
lposen Nov 27, 2024
a7dccb5
Merge branch '2.0.0-alpha/master' into 2.0.0-alpha/MOB-9995-reorganiz…
lposen Dec 3, 2024
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
6 changes: 3 additions & 3 deletions src/Iterable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import {
import { IterableAction, IterableActionContext } from './IterableAction';
import IterableConfig, { AuthResponse } from './IterableConfig';
import {
IterableInAppManager,
IterableInAppMessage,
IterableInAppCloseSource,
IterableInAppDeleteSource,
IterableInAppLocation,
} from './IterableInAppClasses';
import IterableInAppManager from './IterableInAppManager';
import IterableInAppMessage from './IterableInAppMessage';
} from './inApp';
import { IterableLogger } from './IterableLogger';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice I like the reorganization

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I'm glad


const RNIterableAPI = NativeModules.RNIterableAPI;
Expand Down
3 changes: 1 addition & 2 deletions src/IterableConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {
IterableLogLevel,
} from './IterableAction';
import { IterableDataRegion } from './IterableDataRegion';
import { IterableInAppShowResponse } from './IterableInAppClasses';
import IterableInAppMessage from './IterableInAppMessage';
import { IterableInAppShowResponse, IterableInAppMessage } from './inApp';
import { IterablePushPlatform } from './IterablePushPlatform';

// TODO: Add description
Expand Down
2 changes: 1 addition & 1 deletion src/__mocks__/MockRNIterableAPI.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IterableAttributionInfo } from '../Iterable';
import IterableInAppMessage from '../IterableInAppMessage';
import { IterableInAppMessage } from '../inApp';

export class MockRNIterableAPI {
static email?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/IterableInApp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { MockRNIterableAPI } from '../__mocks__/MockRNIterableAPI';

import { Iterable, EventName } from '../Iterable';
import IterableConfig from '../IterableConfig';
import IterableInAppMessage from '../IterableInAppMessage';
import {
IterableInAppLocation,
IterableInAppTrigger,
Expand All @@ -13,7 +12,8 @@ import {
IterableInAppCloseSource,
IterableInAppShowResponse,
IterableInAppDeleteSource,
} from '../IterableInAppClasses';
IterableInAppMessage,
} from '../inApp';
import { IterableLogger } from '../IterableLogger';

describe('Iterable In App', () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NativeModules } from 'react-native';

import { Iterable } from './Iterable';
import { Iterable } from '../Iterable';
import {
IterableHtmlInAppContent,
IterableInAppDeleteSource,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type ViewToken } from 'react-native';

import IterableUtil from './IterableUtil';
import IterableUtil from '../IterableUtil';

import {
IterableInAppTrigger,
Expand Down
Empty file added src/inApp/inApp.enums.ts
Empty file.
3 changes: 3 additions & 0 deletions src/inApp/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './IterableInAppClasses';
export * from './IterableInAppManager';
export * from './IterableInAppMessage';
5 changes: 1 addition & 4 deletions src/inbox/IterableInbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import { SafeAreaView } from 'react-native-safe-area-context';
import type { InboxImpressionRowInfo } from '../InboxImpressionRowInfo';
import type { InboxRowViewModel } from '../InboxRowViewModel';
import { Iterable } from '../Iterable';
import {
IterableInAppDeleteSource,
IterableInAppLocation,
} from '../IterableInAppClasses';
import { IterableInAppDeleteSource, IterableInAppLocation } from '../inApp';
import { useAppStateListener, useDeviceOrientation } from '../hooks';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of the index file. The imports are very organized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

import type { IterableInboxCustomizations } from './IterableInboxCustomizations';
Expand Down
9 changes: 4 additions & 5 deletions src/inbox/IterableInboxDataModel.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { NativeModules } from 'react-native';

import {
IterableHtmlInAppContent,
IterableInAppDeleteSource,
IterableInAppLocation,
} from '../IterableInAppClasses';

import { Iterable } from '../Iterable';

IterableInAppMessage,
} from '../inApp';
import type { InboxImpressionRowInfo } from '../InboxImpressionRowInfo';
import type { InboxRowViewModel } from '../InboxRowViewModel';
import IterableInAppMessage from '../IterableInAppMessage';
import { Iterable } from '../Iterable';

const RNIterableAPI = NativeModules.RNIterableAPI;

Expand Down
2 changes: 1 addition & 1 deletion src/inbox/IterableInboxMessageDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
IterableHtmlInAppContent,
IterableInAppCloseSource,
IterableInAppLocation,
} from '../IterableInAppClasses';
} from '../inApp';

// TODO: Comment
export interface IterableInboxMessageDisplayProps {
Expand Down
2 changes: 1 addition & 1 deletion src/inbox/IterableInboxMessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type ViewabilityConfig, type ViewToken, FlatList } from 'react-native';

import type { InboxImpressionRowInfo } from '../InboxImpressionRowInfo';
import type { InboxRowViewModel } from '../InboxRowViewModel';
import IterableInAppMessage from '../IterableInAppMessage';
import { IterableInAppMessage } from '../inApp';

import type { IterableInboxCustomizations } from './IterableInboxCustomizations';
import IterableInboxDataModel from './IterableInboxDataModel';
Expand Down
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export {
export { IterableConfig } from './IterableConfig';
export { IterableDataRegion } from './IterableDataRegion';
export {
IterableInAppMessage,
IterableInAppManager,
IterableEdgeInsets,
IterableHtmlInAppContent,
IterableInAppCloseSource,
Expand All @@ -29,9 +31,7 @@ export {
IterableInAppTriggerType,
IterableInboxMetadata,
type IterableInAppContent,
} from './IterableInAppClasses';
export { IterableInAppManager } from './IterableInAppManager';
export { IterableInAppMessage } from './IterableInAppMessage';
} from './inApp';
export {
type IterableInboxCustomizations,
IterableInbox,
Expand Down