Skip to content

Commit

Permalink
[MOB-8539]: Embedded GA (#381)
Browse files Browse the repository at this point in the history
* notificiation view implemented (#212)

* notificiation view implemented

* code changes as per recent review

* usage of banner view

* usage of notification view

* Webpack config changed for Notification View

---------

Co-authored-by: Vishal Joshi <[email protected]>

* Embedded msg (#232)

* Embedded Manager Module - WIP

* Embedded Manager Module - added uuid library

* Code modified for embedded msg

* Documentation added

* Events example added

* Embedded msg configurations changed

* Import issue of embeddedManager fixed

* Circuler dependency solved

* Linting error fixing

* events code break down into separate folders

* Import issues fixed

---------

Co-authored-by: Vishal Joshi <[email protected]>

* Embedded test (#234)

* Embedded Manager Module - WIP

* Embedded Manager Module - added uuid library

* Code modified for embedded msg

* Documentation added

* Events example added

* Test Cases added for embedded message manager

* Added Embedded Placement Test cases

* EmbeddedMsg Test Cases added

* embeddedManager import issue fixed

* Linting error resolved

* Test issues resolved

* basic changes to run the code

* change query params of get embedded messaging api

* remove code for embedded messaging sync parameters

* revert the changes that were made earlier to run the code.

---------

Co-authored-by: Vishal Joshi <[email protected]>
Co-authored-by: Hani <[email protected]>

* Embedded msgs example (#233)

* card view implemented

* code changes as per recent review

* Embedded Manager Module - WIP

* Embedded Manager Module - added uuid library

* usage of card view

* Code modified for embedded msg

* Documentation added

* Events example added

* Embedded msg example with card view

* Embedded msg example updated

* build config changed and few updates done on card component

* react-example improved

* Node webpack config changed

* Webpack config changed

* Yarn file issue fixed

* Resolve revice comments

---------

Co-authored-by: iamavishkar <[email protected]>
Co-authored-by: Vishal Joshi <[email protected]>
Co-authored-by: Hani <[email protected]>

* Embedded Messaging Dismiss Event Track (#241)

* set embedded message dismiss event

* remove unnecessary file

* display API response to the embedded page

* Resolve review comments

---------

Co-authored-by: Hani <[email protected]>

* Dev 248 (Update payload to include updated placements) (#242)

* Embedded Manager Module - WIP

* Embedded Manager Module - added uuid library

* Code modified for embedded msg

* Documentation added

* Events example added

* Test Cases added for embedded message manager

* Added Embedded Placement Test cases

* EmbeddedMsg Test Cases added

* embeddedManager import issue fixed

* Linting error resolved

* Test issues resolved

* basic changes to run the code

* change query params of get embedded messaging api

* change placementIds param format in API query param

* change query param in sample app

* make placement id param optional

* modify test case accordingly

---------

Co-authored-by: Vishal Joshi <[email protected]>
Co-authored-by: Hani <[email protected]>

* banner view implemented (#213)

* banner view implemented

* code changes as per recent review

* usage of banner view

* Banner View Webpack config changed

* .babelrc config changed

* [MOB-7175]: add new filter method that leaves in JSON only messages (#238)

* add new filter method that leaves in JSON only messages

* Mentioning filterOnlyReadAndNeverTriggerMessages

---------

Co-authored-by: mitch prewitt <[email protected]>
Co-authored-by: Brad Umbaugh <[email protected]>

* ver bump (#240)

Co-authored-by: mitch prewitt <[email protected]>

---------

Co-authored-by: Vishal Joshi <[email protected]>
Co-authored-by: devcsomnicg <[email protected]>
Co-authored-by: Mitch Prewitt <[email protected]>
Co-authored-by: mitch prewitt <[email protected]>
Co-authored-by: Brad Umbaugh <[email protected]>
Co-authored-by: Hani <[email protected]>

* card view implemented (#214)

* card view implemented

* code changes as per recent review

* usage of card view

* build config changed and few updates done on card component

* react-example improved

* Node webpack config changed

* Webpack config changed

---------

Co-authored-by: Vishal Joshi <[email protected]>
Co-authored-by: Hani <[email protected]>
Co-authored-by: Mitch Prewitt <[email protected]>

* Add embedded views to the SDK & integrate into sample app (#243)

* card view implemented

* code changes as per recent review

* Embedded Manager Module - WIP

* Embedded Manager Module - added uuid library

* usage of card view

* Code modified for embedded msg

* Documentation added

* Events example added

* Embedded msg example with card view

* Embedded msg example updated

* build config changed and few updates done on card component

* react-example improved

* Create manual.yml

* Node webpack config changed

* Webpack config changed

* Yarn file issue fixed

* [MOB-7175]: add new filter method that leaves in JSON only messages (#238)

* add new filter method that leaves in JSON only messages

* Mentioning filterOnlyReadAndNeverTriggerMessages

---------

Co-authored-by: mitch prewitt <[email protected]>
Co-authored-by: Brad Umbaugh <[email protected]>

* ver bump (#240)

Co-authored-by: mitch prewitt <[email protected]>

* embedded msg view integration

* integrate demo in sample app

* Resolve node build issue

* commit remaining code

* commit remaining files

---------

Co-authored-by: iamavishkar <[email protected]>
Co-authored-by: Vishal Joshi <[email protected]>
Co-authored-by: Mitch Prewitt <[email protected]>
Co-authored-by: mitch prewitt <[email protected]>
Co-authored-by: Brad Umbaugh <[email protected]>
Co-authored-by: Hani <[email protected]>

* Add remaining events to web embedded messaging

* update the test cases

* Add remaining events to web embedded messaging

* Add remaining events to web embedded messaging

* Revert "Add remaining events to web embedded messaging"

This reverts commit 3704505.

* Update events.test.ts

* Add remaining events to web embedded messaging (#245)

* Add remaining events to web embedded messaging

* Resolve review comments

---------

Co-authored-by: Hani Vora <[email protected]>

* resolve build error issue using dev config

* Create test (#250) (#252)

* Create test (#250)

* Create test

* Update yarn.lock (#251)

* Update events.schema.ts (#257)

* Update types.ts (#262)

* Update events.schema.ts (#259)

* Update EmbeddedForm.tsx (#253)

* Delete test (#254)

* Update EmbeddedMsgs.tsx (#255)

* Update embeddedManager.ts (#256)

* Update types.ts (#258)

* Update events.test.ts (#260)

* Update events.ts (#261)

* Update EmbeddedForm.tsx (#290)

* Create Functions.ts (#291)

* Update embeddedManager.ts (#292)

* Update events.ts (#293)

* Create functions (#294)

* Rename functions to functions.ts (#298)

* Update embeddedManager.test.ts (#299)

* Embedded received event (#278)

* change in embedded api params

* Update EmbeddedMsgs.tsx (#263)

* Update index.tsx (#264)

* Update index.tsx (#265)

* Update index.tsx (#266)

* Update embeddedManager.ts (#267)

* Update index.ts (#268)

* Update events.schema.ts (#270)

* Update types.ts (#271)

* Update yarn.lock (#272)

* Create IterableActionRunner.ts (#274)

* Update embeddedManager.ts (#276)

* Update types.ts (#277)

* Resolve build fail issue (#289)

* Resolve merge conflicts

* Embedded msg image (#286)

* Create test (#250)

* Create test

* Update yarn.lock (#251)

* Update events.schema.ts (#257)

* Update types.ts (#262)

* Update events.schema.ts (#259)

* Update EmbeddedForm.tsx (#253)

* Delete test (#254)

* Update EmbeddedMsgs.tsx (#255)

* Update embeddedManager.ts (#256)

* Update types.ts (#258)

* Update events.test.ts (#260)

* Update events.ts (#261)

* Update index.tsx (#284)

* Update index.tsx (#285)

* Resolve merge conflicts

* Embedded text wrap (#283)

* Create test (#250)

* Create test

* Update yarn.lock (#251)

* Update events.schema.ts (#257)

* Update types.ts (#262)

* Update events.schema.ts (#259)

* Update EmbeddedForm.tsx (#253)

* Delete test (#254)

* Update EmbeddedMsgs.tsx (#255)

* Update embeddedManager.ts (#256)

* Update types.ts (#258)

* Update events.test.ts (#260)

* Update events.ts (#261)

* Update index.tsx (#279)

* Update index.tsx (#280)

* Update index.ts (#281)

* Update index.tsx (#282)

* Update index.tsx (#295)

* Update index.tsx (#296)

* Update index.tsx (#297)

* Embedded message button click (#273)

* change in embedded api params

* Update EmbeddedMsgs.tsx (#263)

* Update index.tsx (#264)

* Update index.tsx (#265)

* Update index.tsx (#266)

* Update embeddedManager.ts (#267)

* Update index.ts (#268)

* Update events.schema.ts (#270)

* Update types.ts (#271)

* Update yarn.lock (#272)

* Create IterableActionRunner.ts (#274)

* Remove unused code (#275)

* Update embeddedManager.ts (#287)

* resolve error for OOTB not responding properly (#309)

* Resolve: Content not aligned for notification view (#310)

* set text align for default style (#311)

* make cursor to pointer (#312)

* Make UI responsive (#314)

* Make UI responsive

* Resolve review comments

* Mob 7843 (#307)

* set message if message is not available

* resolve review comments

* MOB-7859 (Long buttons become stacked) (#315)

* modify button UI

* resolve merge conflicts

* Lower `[email protected]` version (#316)

* make OOTB views  unavailable for Beta (#319)

* remove markdown files for embedded (#326)

Co-authored-by: mitch prewitt <[email protected]>

* remove ActionHandler (#321)

* update the doc (#323)

* Handling incoming embedded messages (#320)

* Handling incoming embedded messages

* add missing requirement

* Update embeddedManager.test.ts

* resolve merge conflicts

* Support custom as well default click handler (#317)

* Support custom as well default click handler

* remove circular dependency

* Resolve PR comments

* fix conflicts (#327)

Co-authored-by: mitch prewitt <[email protected]>

* Mob 8058 (Web SDK: Click Handling) (#328)

* Implement for embedded click

* modify test cases

* Resolve review comments

* change import path to resolve build error

* resolve build failure

* resolve review comments

* Resolve circular dependency

---------

Co-authored-by: Mitch Prewitt <[email protected]>

* update styles (#329)

Co-authored-by: mitch prewitt <[email protected]>

* update (#330)

Co-authored-by: mitch prewitt <[email protected]>

* session track (#331)

Co-authored-by: mitch prewitt <[email protected]>

* add uuid as session ID (#332)

* Resolve errors (#333)

* fix (#340)

Co-authored-by: mitch prewitt <[email protected]>

* Remove console statements (#341)

* fix

* fix

---------

Co-authored-by: mitch prewitt <[email protected]>

* bump version 1.1.0-beta (#342)

* Fix beta publish issue (#344)

* fix publish issue

* revert lock changes

* fix

* now?

---------

Co-authored-by: mitch prewitt <[email protected]>

* OOTB Rework: Need to be pure JS/HTML/CSS (#354)

* OOTB Rework: Need to be pure JS/HTML/CSS

* OOTB Rework: Need to be pure JS/HTML/CSS

* added id of all component

* added custom changes

* fixed click issue

* fixed comments

* handled click by elements name

* updated example

* fixed cursor pointer

* Update EmbeddedMsgs.tsx (sample code) to use EmbeddedMessageUpdateHandler

* fixed client's comments

* Fixed comments

* updated click events as common

* HTTP call in retrieveEmbeddedMessages (#355)

* HTTP call in retrieveEmbeddedMessages

* updated test file

* sdk and platform updated

* updated test file

---------

Co-authored-by: hardikmashru <[email protected]>

---------

Co-authored-by: hardikmashru <[email protected]>

* Web SDK is incorrectly parsing custom action objects (#358)

* OOTB Rework: Need to be pure JS/HTML/CSS

* OOTB Rework: Need to be pure JS/HTML/CSS

* added id of all component

* added custom changes

* fixed click issue

* fixed comments

* handled click by elements name

* updated example

* fixed cursor pointer

* Update EmbeddedMsgs.tsx (sample code) to use EmbeddedMessageUpdateHandler

* HTTP call in retrieveEmbeddedMessages

* updated test file

* fixed client's comments

* Fixed comments

* updated click events as common

* sdk and platform updated

* updated test file

* Web SDK is incorrectly parsing custom action objects

* updated listener name and handle callback

* Updated custom action object type

* HTTP call in retrieveEmbeddedMessages (#355)

* HTTP call in retrieveEmbeddedMessages

* updated test file

* sdk and platform updated

* updated test file

---------

Co-authored-by: hardikmashru <[email protected]>

* Too many Embedded-related interfaces? (#359)

* Updated interfaces

* removed duplicate interface from in-app

* Updated IEmbeddedMessage in events

* Updated EnbeddedMessagingDismiss, EnbeddedMessagingSession

* Removed unused interfaces

* Removed unused interfaces

* Updated test.ts

---------

Co-authored-by: hardikmashru <[email protected]>

* updated code in useeffect

* pass package name and expose trackembeddedclick as standalone function (#363)

---------

Co-authored-by: hardikmashru <[email protected]>

* Update Embedded requests to not need to pass userId or email (#364)

* OOTB Rework: Need to be pure JS/HTML/CSS

* OOTB Rework: Need to be pure JS/HTML/CSS

* added id of all component

* added custom changes

* fixed click issue

* fixed comments

* handled click by elements name

* updated example

* fixed cursor pointer

* Update EmbeddedMsgs.tsx (sample code) to use EmbeddedMessageUpdateHandler

* HTTP call in retrieveEmbeddedMessages

* updated test file

* fixed client's comments

* Fixed comments

* updated click events as common

* sdk and platform updated

* updated test file

* Web SDK is incorrectly parsing custom action objects

* updated listener name and handle callback

* Updated custom action object type

* HTTP call in retrieveEmbeddedMessages (#355)

* HTTP call in retrieveEmbeddedMessages

* updated test file

* sdk and platform updated

* updated test file

---------

Co-authored-by: hardikmashru <[email protected]>

* Too many Embedded-related interfaces? (#359)

* Updated interfaces

* removed duplicate interface from in-app

* Updated IEmbeddedMessage in events

* Updated EnbeddedMessagingDismiss, EnbeddedMessagingSession

* Removed unused interfaces

* Removed unused interfaces

* Updated test.ts

---------

Co-authored-by: hardikmashru <[email protected]>

* updated code in useeffect

* pass package name and expose trackembeddedclick as standalone function

* Update Embedded requests to not need to pass userId or email

* removed unused code from test

* Updated endpoints in setUserId and setEmail

* added impression endpoint

---------

Co-authored-by: hardikmashru <[email protected]>

* Rework Embedded Session Manager (#362)

* OOTB Rework: Need to be pure JS/HTML/CSS

* OOTB Rework: Need to be pure JS/HTML/CSS

* added id of all component

* added custom changes

* fixed click issue

* fixed comments

* handled click by elements name

* updated example

* fixed cursor pointer

* Update EmbeddedMsgs.tsx (sample code) to use EmbeddedMessageUpdateHandler

* HTTP call in retrieveEmbeddedMessages

* updated test file

* sdk and platform updated

* updated test file

* Web SDK is incorrectly parsing custom action objects

* updated listener name and handle callback

* Updated custom action object type

* Too many Embedded-related interfaces? (#359)

* Updated interfaces

* removed duplicate interface from in-app

* Updated IEmbeddedMessage in events

* Updated EnbeddedMessagingDismiss, EnbeddedMessagingSession

* Removed unused interfaces

* Removed unused interfaces

* Updated test.ts

---------

Co-authored-by: hardikmashru <[email protected]>

* Rework Embedded Session Manager

* Updated messageId

* Update types.ts

* Update EmbeddedMsgs.tsx

* Fixed end session event in SDK

---------

Co-authored-by: hardikmashru <[email protected]>

* [MOB-8148]:  clean up embedded types (#365)

* OOTB Rework: Need to be pure JS/HTML/CSS

* OOTB Rework: Need to be pure JS/HTML/CSS

* added id of all component

* added custom changes

* fixed click issue

* fixed comments

* handled click by elements name

* updated example

* fixed cursor pointer

* Update EmbeddedMsgs.tsx (sample code) to use EmbeddedMessageUpdateHandler

* HTTP call in retrieveEmbeddedMessages

* updated test file

* sdk and platform updated

* updated test file

* Web SDK is incorrectly parsing custom action objects

* updated listener name and handle callback

* Updated custom action object type

* Too many Embedded-related interfaces? (#359)

* Updated interfaces

* removed duplicate interface from in-app

* Updated IEmbeddedMessage in events

* Updated EnbeddedMessagingDismiss, EnbeddedMessagingSession

* Removed unused interfaces

* Removed unused interfaces

* Updated test.ts

---------

Co-authored-by: hardikmashru <[email protected]>

* Rework Embedded Session Manager

* Updated messageId

* Update types.ts

* Update EmbeddedMsgs.tsx

* remove react dep

* Fixed end session event in SDK

* checking

* need to see

* remove dupe schema

* cleanup

* clean up packages and more

* typo

* fix tests and change requests

* further change requests

* oop

* fix circular deps

* additional cleanup and rework

* fix embeddedManager test

* fix base branch issues

* rename to iterable

* update OOTB names

* export

---------

Co-authored-by: hardikmashru <[email protected]>
Co-authored-by: hardikmashru <[email protected]>
Co-authored-by: Hardik Mashru <[email protected]>
Co-authored-by: mitch prewitt <[email protected]>

* [MOB-8405]: Add new eslint rules (#367)

* OOTB Rework: Need to be pure JS/HTML/CSS

* OOTB Rework: Need to be pure JS/HTML/CSS

* added id of all component

* added custom changes

* fixed click issue

* fixed comments

* handled click by elements name

* updated example

* fixed cursor pointer

* Update EmbeddedMsgs.tsx (sample code) to use EmbeddedMessageUpdateHandler

* HTTP call in retrieveEmbeddedMessages

* updated test file

* sdk and platform updated

* updated test file

* Web SDK is incorrectly parsing custom action objects

* updated listener name and handle callback

* Updated custom action object type

* Too many Embedded-related interfaces? (#359)

* Updated interfaces

* removed duplicate interface from in-app

* Updated IEmbeddedMessage in events

* Updated EnbeddedMessagingDismiss, EnbeddedMessagingSession

* Removed unused interfaces

* Removed unused interfaces

* Updated test.ts

---------

Co-authored-by: hardikmashru <[email protected]>

* Rework Embedded Session Manager

* Updated messageId

* Update types.ts

* Update EmbeddedMsgs.tsx

* remove react dep

* Fixed end session event in SDK

* checking

* need to see

* remove dupe schema

* cleanup

* clean up packages and more

* typo

* fix tests and change requests

* further change requests

* oop

* fix circular deps

* additional cleanup and rework

* fix embeddedManager test

* fix base branch issues

* update lint rules

* more tweaks

---------

Co-authored-by: hardikmashru <[email protected]>
Co-authored-by: hardikmashru <[email protected]>
Co-authored-by: Hardik Mashru <[email protected]>
Co-authored-by: mitch prewitt <[email protected]>

* MOB-8139 & MOB-8028 (#369)

* pushed changes

* Error handling for trackEmbeddedClick

Error handling for trackEmbeddedClick

* sample app changes

* revert unnecessary react-example changes

* revert react-example unnecessary changes

* implemented changes as per review suggestions

* Update request.ts

* create utility method for getting url from action (#371)

create utility method for getting url from action

* [MOB-8416]: easier UUID testing in sample app (#374)

* easier UUID testing in sample app

* some cleanup and change request additions

---------

Co-authored-by: mitch prewitt <[email protected]>

* fix focus bug and console error (#377)

Co-authored-by: mitch prewitt <[email protected]>

* [MOB-8425]: strengthen network interceptors (#376)

* easier UUID testing in sample app

* hopping

* update interceptors and routes

* oops

* accidental delete from merge

* forgot route

* wrong route

* oops

* Update src/constants.ts

Co-authored-by: Paul Jung <[email protected]>

* update const name

---------

Co-authored-by: mitch prewitt <[email protected]>
Co-authored-by: Paul Jung <[email protected]>

* [MOB-8475]: Remove Sample TImeout (#379)

* easier UUID testing in sample app

* hopping

* update interceptors and routes

* oops

* accidental delete from merge

* forgot route

* wrong route

* oops

* Update src/constants.ts

Co-authored-by: Paul Jung <[email protected]>

* update const name

* remove timeout

---------

Co-authored-by: mitch prewitt <[email protected]>
Co-authored-by: Paul Jung <[email protected]>

* MOB 8472 (#390)

* pushed changes

* Update LoginForm.tsx

* fix cardView, notificationView, bannerView

* fix aspect-ratio, padding

* fix margin-top for banner image

* revert LoginForm changes

* final fix card, banner, notification view

* UI fixes, responsive fixes and impression tracker screen fixes

* put back env.example

* rename env.example

* removed inline style

* rollback for unnecessary PR diff

* Update index.tsx

* update .evn.example

* fix card, banner, notification view

* updates

* escape htmltext

---------

Co-authored-by: Hardik Mashru <[email protected]>

* Fixing placementIds issue on IterableEmbeddedManager (#392)

* [MOB-8503]: refactor OOTB views (#391)

* mostly up to date

* updates

* teeny

* button cleanup

* oop

* add style update examples

* jsdoc comments

---------

Co-authored-by: mitch prewitt <[email protected]>

* MOB-8604 (#394)

* update trackNewlyRetrieved

* clean up

---------

Co-authored-by: mitch prewitt <[email protected]>

* MOB-8600 (#393)

* expose handleEmbeddedClick

* fix embeddedClick alias

* Update utils.ts

* Update utils.ts

* rename

---------

Co-authored-by: mitch prewitt <[email protected]>

* [MOB-8639]: add elements to OOTB type (#395)

* add elements to OOTB type

* update var name

---------

Co-authored-by: mitch prewitt <[email protected]>

* [MOB-8646]: targetUrl not being sent on click (#400)

* update to target url

* update func name

---------

Co-authored-by: mitch prewitt <[email protected]>

* jwt-gen param issue (#402)

Co-authored-by: mitch prewitt <[email protected]>

---------

Co-authored-by: Avishkar Singh <[email protected]>
Co-authored-by: Vishal Joshi <[email protected]>
Co-authored-by: devcsomnicg <[email protected]>
Co-authored-by: Hani <[email protected]>
Co-authored-by: iamavishkar <[email protected]>
Co-authored-by: mitch prewitt <[email protected]>
Co-authored-by: Brad Umbaugh <[email protected]>
Co-authored-by: Hani Vora <[email protected]>
Co-authored-by: Hani Vora <[email protected]>
Co-authored-by: Justin Yu <[email protected]>
Co-authored-by: hardikmashru <[email protected]>
Co-authored-by: hardikmashru <[email protected]>
Co-authored-by: Hardik Mashru <[email protected]>
Co-authored-by: Paul Jung <[email protected]>
Co-authored-by: Hardik Mashru <[email protected]>
  • Loading branch information
16 people authored Jun 12, 2024
1 parent d5b6dc1 commit f3f8022
Show file tree
Hide file tree
Showing 73 changed files with 10,185 additions and 6,775 deletions.
6 changes: 5 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"presets": [
"@babel/typescript"
"@babel/preset-env",
"@babel/preset-typescript"
],
"ignore": [
"**/*.test.ts",
Expand All @@ -12,6 +13,9 @@
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"@babel/plugin-proposal-optional-chaining",
["@babel/transform-runtime", {
"regenerator": true
}],
"@babel/plugin-transform-modules-umd",
"@babel/plugin-transform-nullish-coalescing-operator",
[
Expand Down
18 changes: 16 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,26 @@
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"ignorePatterns": ["webpack.*.js"],
"ignorePatterns": [
"webpack.*.js"
],
"rules": {
"no-console": 1,
"no-duplicate-imports": 2,
"no-extra-boolean-cast": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/comma-spacing": 2,
"@typescript-eslint/explicit-function-return-type": "off",
"eqeqeq": 2
"@typescript-eslint/array-type": [
2,
{
"default": "array"
}
],
"eqeqeq": 2,
"quotes": [
2,
"single"
]
}
}
10 changes: 5 additions & 5 deletions example/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
}
}
)
.then((response) => {
.then((response: any) => {
return response.data?.token;
});
}
Expand Down Expand Up @@ -71,11 +71,11 @@ import {
const handleGetMessagesClick = (event: MouseEvent) => {
event.preventDefault();
if (startBtn.getAttribute('aria-disabled') !== 'true') {
startBtn.innerText = `Loading...`;
startBtn.innerText = 'Loading...';
startBtn.setAttribute('aria-disabled', 'true');
startBtn.className = 'disabled';
request()
.then((response) => {
.then((response: any) => {
triggerDisplayMessages(response.data.inAppMessages);
startBtn.innerText = `${response.data.inAppMessages.length} total messages retrieved!`;
})
Expand All @@ -94,7 +94,7 @@ import {
/* login */
loginBtn.setAttribute('aria-disabled', 'true');
loginBtn.className = 'disabled';
loginBtn.innerText = `Loading...`;
loginBtn.innerText = 'Loading...';
setEmail(email).then(() => {
/* enable change email button */
changeEmailBtn.classList.remove('disabled');
Expand Down Expand Up @@ -123,7 +123,7 @@ import {

changeEmailBtn.setAttribute('aria-disabled', 'true');
changeEmailBtn.className = 'disabled';
changeEmailBtn.innerText = `Loading...`;
changeEmailBtn.innerText = 'Loading...';

startBtn.setAttribute('aria-disabled', 'true');
startBtn.className = 'disabled';
Expand Down
3,225 changes: 1,515 additions & 1,710 deletions example/yarn.lock

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@
],
"dependencies": {
"@pabra/sortby": "^1.0.1",
"@types/ws": "8.5.4",
"axios": "^1.6.2",
"buffer": "^6.0.3",
"copy-webpack-plugin": "^11.0.0",
"idb-keyval": "^6.2.0",
"throttle-debounce": "^3.0.1",
"uuid": "^9.0.0",
"yup": "^0.32.9"
},
"scripts": {
Expand All @@ -46,7 +49,7 @@
"build": "ttsc && babel src --out-dir ./dist --extensions '.ts,.tsx' && webpack",
"build:node": "yarn build --config webpack.node.config.js",
"test": "jest --config jest.config.js --collectCoverage",
"format": "prettier --write \"src/**/*.{ts,tsx}\" \"src/**/*.{js}\" \"example/src/**/*.{ts,tsx}\" \"example/src/**/*.{js}\" --no-error-on-unmatched-pattern",
"format": "prettier --write \"src/**/*.{ts,tsx}\" \"src/**/*.{js}\" \"example/src/**/*.{ts,tsx}\" \"example/src/**/*.{js}\" \"react-example/src/**/*.{ts,tsx}\" \"react-example/src/**/*.{js}\" --no-error-on-unmatched-pattern",
"lint": "eslint src --ignore-pattern '*.test.*' --ignore-pattern '*.spec.*' --ext '.ts,.tsx'",
"typecheck": "ttsc --noEmit true --emitDeclarationOnly false",
"check-deps": "madge --extensions js,ts --circular dist",
Expand All @@ -61,27 +64,34 @@
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
"@babel/plugin-transform-modules-umd": "^7.14.5",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
"@babel/plugin-transform-runtime": "^7.22.15",
"@babel/preset-env": "^7.5.5",
"@babel/preset-typescript": "^7.6.0",
"@types/jest": "^27.0.2",
"@types/node": "^12.7.1",
"@types/throttle-debounce": "^2.1.0",
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@webpack-cli/serve": "^1.6.0",
"babel-plugin-module-resolver": "^5.0.0",
"axios-mock-adapter": "^1.22.0",
"babel-loader": "^9.1.3",
"babel-plugin-module-resolver": "^5.0.0",
"concurrently": "^6.3.0",
"css-loader": "^6.8.1",
"dotenv": "^10.0.0",
"eslint": "^7.14.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"fake-indexeddb": "^4.0.0",
"file-loader": "^6.2.0",
"husky": "^3.1.0",
"jest": "^27.3.1",
"lint-staged": "^11.2.6",
"madge": "^5.0.1",
"mini-css-extract-plugin": "^2.7.6",
"prettier": "^2.2.1",
"style-loader": "^3.3.3",
"ts-jest": "^27.0.7",
"ttypescript": "^1.5.15",
"typescript": "^4.9.5",
Expand All @@ -103,4 +113,4 @@
"eslint"
]
}
}
}
18 changes: 13 additions & 5 deletions react-example/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# To make requests from this example app make sure you first create an .env file
# and add the API key and JWT Secret to it like so (and uncomment the keys):
# API_KEY=1234
# JWT_SECRET=1234
# Optional environment variables for local development. Start by creating a
# called .env and add these values to it and change them appropriately.
# Remember to uncomment the variables!

# Only set BASE_URL if developing locally, as it will take precedence over the production api urls.
# BASE_URL="https://api.iterable.com/api"

# You can set the URL for the JWT generator here if needed
# JWT_GENERATOR=http://localhost:5000/generate
# JWT_GENERATOR=http://localhost:3000/generate

# Set this to false to prevent messages from being consumed to fetch the same message(s) when testing changes locally.
# ENABLE_INAPP_CONSUME=false

# Toggle this to true if you would need to hit our EU APIs.
# IS_EU_ITERABLE_SERVICE=false

# Convenience variable to automatically set the login email during testing.
# [email protected]
Expand Down
7 changes: 5 additions & 2 deletions react-example/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
],
"rules": {
"@typescript-eslint/no-empty-interface": "off",
"react/react-in-jsx-scope": "off"
}
"react/react-in-jsx-scope": "off",
},
"ignorePatterns": [
"node_modules/"
]
}
2 changes: 1 addition & 1 deletion react-example/cypress/integration/inapp/inapp.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as mockMessages from '../../fixtures/inapp/200.json';

const url = `/api/inApp/web/getMessages*`;
const url = '/api/inApp/web/getMessages*';

describe('Requesting In-App Messages', () => {
it('should paint the correct 200 response', () => {
Expand Down
33 changes: 17 additions & 16 deletions react-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,30 @@
"cypress": "cypress open"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.9.5",
"@babel/core": "^7.5.0",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
"@babel/preset-react": "^7.16.7",
"@babel/preset-react": "^7.22.15",
"@types/jest": "^27.0.2",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/styled-components": "^5.1.34",
"@babel/preset-typescript": "^7.9.0",
"@playwright/test": "^1.44.0",
"@types/jest": "^27.0.2",
"@types/node": "^20.12.12",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@types/styled-components": "^5.1.21",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"@webpack-cli/serve": "^1.6.0",
"babel-loader": "^8.1.0",
"babel-plugin-styled-components": "^2.0.2",
"babel-loader": "^9.1.3",
"concurrently": "^6.3.0",
"css-loader": "^6.5.1",
"cypress": "^9.3.1",
"dotenv": "^10.0.0",
"eslint": "^7.14.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.28.0",
"eslint-webpack-plugin": "^3.1.0",
"eslint-webpack-plugin": "3.1.0",
"html-webpack-plugin": "^5.5.0",
"jest": "^27.3.1",
"mini-css-extract-plugin": "^2.5.2",
Expand All @@ -62,12 +60,15 @@
"typescript": "^4.6.4",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.7.3"
"webpack-dev-server": "^4.7.3",
"@types/uuid": "^9.0.2"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@iterable/web-sdk": "../",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.2.1",
"styled-components": "^5.3.3"
"styled-components": "^5.3.3",
"uuid": "^9.0.0"
}
}
Loading

0 comments on commit f3f8022

Please sign in to comment.