@inboxsdk/core 0.2.28-alpha.4 → 0.2.28-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/inboxsdk.js +1 -1
- package/package.json +5 -1
- package/src/inboxsdk-js/check-requirements.js +7 -3
- package/src/inboxsdk-js/header.js +1 -0
- package/src/inboxsdk-js/inboxsdk-NONREMOTE-INTEGRATED-PAGEWORLD.js +5 -6
- package/src/inboxsdk-js/inboxsdk-NONREMOTE.js +4 -3
- package/src/inboxsdk-js/inboxsdk-REMOTE.js +3 -1
- package/src/inboxsdk-js/inboxsdk-TEST.js +4 -3
- package/src/inboxsdk-js/inboxsdk.js +33 -39
- package/src/inboxsdk-js/loading/load-platform-implementation-DEV.js +15 -18
- package/src/injected-js/gmail/modify-suggestions.test.js +8 -9
- package/src/injected-js/gmail/setup-gmail-interceptor.js +340 -579
- package/src/injected-js/gmail/sync-compose-request-processor.test.js +39 -49
- package/src/injected-js/gmail/thread-identifier/click-and-get-popup-url.js +20 -33
- package/src/injected-js/gmail/thread-identifier/index.js +57 -93
- package/src/injected-js/gmail/thread-identifier/thread-row-parser.js +22 -31
- package/src/injected-js/gmail/thread-identifier/thread-row-parser.test.js +12 -28
- package/src/injected-js/inbox/setupAjaxInterceptor.js +64 -121
- package/src/injected-js/inbox/setupClickAndGetNewIframeSrc.js +53 -66
- package/src/injected-js/inbox/setupComposeViewDraftIDFinder.js +20 -36
- package/src/injected-js/inbox/setupInboxFakeWindowResizeListener.js +13 -13
- package/src/injected-js/main.js +11 -24
- package/src/injected-js/message-metadata-holder.js +52 -82
- package/src/injected-js/setup-data-exposer.js +89 -148
- package/src/injected-js/setup-error-silencer.js +21 -21
- package/src/injected-js/setup-event-reemitter.js +30 -22
- package/src/injected-js/setupInboxCustomViewLinkFixer.js +24 -29
- package/src/injected-js/setupPushStateListener.js +18 -11
- package/src/injected-js/xhr-helper.js +62 -65
- package/src/injected-js/xhr-proxy-factory.js +195 -445
- package/src/injected-js/xhr-proxy-factory.test.js +824 -991
- package/src/platform-implementation-js/constants/router.js +14 -9
- package/src/platform-implementation-js/constants/toolbars.js +8 -3
- package/src/platform-implementation-js/dom-driver/gmail/custom-style.js +13 -13
- package/src/platform-implementation-js/dom-driver/gmail/gmail-butter-bar-driver.js +115 -136
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-toolbar-button-for-app.js +13 -14
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/create-link.js +27 -48
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.js +31 -42
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-native-nav-item.js +30 -40
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-url-object.js +10 -18
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadForOldGmailThreadId.js +21 -28
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadFromSyncThreadId.js +33 -45
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.js +31 -49
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/goto-view.js +58 -65
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/keyboard-shortcut-help-modifier.js +40 -124
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-compose-window.js +17 -22
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-draft-by-message-id.test.js +10 -11
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/override-gmail-back-button.js +44 -80
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-query-rewriter.js +19 -26
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.js +71 -147
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.js +91 -148
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.js +150 -166
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.test.js +70 -120
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-app-id-warning.js +15 -15
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-route-view.js +44 -67
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.js +230 -379
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.test.js +121 -307
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-native-route-view.js +17 -24
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.js +41 -49
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/temporary-track-download-url-validity.js +30 -40
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/thread-row-identifier.js +28 -60
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-events.js +61 -133
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.js +30 -42
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.test.js +52 -46
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.js +354 -694
- package/src/platform-implementation-js/dom-driver/gmail/make-xhr-interceptor.js +77 -93
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.js +35 -82
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.test.js +44 -94
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-global-icon-area.js +12 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-thread-icon-area.js +17 -29
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-to-icon-area.js +26 -26
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.js +391 -797
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view/monitor-top-banner-size-and-react.js +7 -9
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view.js +60 -109
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-area-view.js +95 -135
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.js +103 -211
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.test.js +61 -61
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-backdrop.js +17 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.js +188 -541
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-button.js +67 -135
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-compose-notice.js +27 -49
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-inner-sidebar.js +7 -13
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-outer-sidebar.js +9 -22
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-recipient-row.js +36 -63
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-tooltip-to-button.js +38 -113
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-app-button-toolbars-are-closed.js +11 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-grouping-is-open.js +11 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/focus.js +8 -11
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/from-manager.js +27 -47
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-additional-action-toolbar.js +11 -24
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-changes-stream.js +59 -111
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-body-changes-stream.js +15 -14
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-formatting-area-offset-left.js +11 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-minimized-stream.js +18 -24
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-response-type-changes-stream.js +19 -23
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/insert-link-into-body.js +11 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/manage-button-grouping.js +141 -376
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/monitor-selection-range.js +17 -28
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/override-edit-subject.js +34 -70
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/position-formatting-toolbar.js +10 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/size-fixer.js +83 -137
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/update-insert-more-area-left.js +10 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.js +632 -1190
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view/get-updated-contact.js +29 -38
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view.js +327 -617
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-processor.js +26 -49
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.js +188 -380
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-row-list-view.js +104 -194
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-row-view.js +382 -811
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-sidebar-view/add-icon-area.js +34 -58
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-sidebar-view.js +330 -581
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-sidebar-view.test.js +123 -277
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view/width-manager.js +15 -35
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.js +216 -571
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-toolbar-view.js +152 -336
- package/src/platform-implementation-js/dom-driver/gmail/views/native-gmail-nav-item-view.js +87 -211
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/inbox-dropdown-button-view.js +10 -11
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-action-button-view.js +20 -29
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-label-view.js +41 -76
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-modal-view-driver.js +45 -99
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.js +76 -128
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-tooltip-view.js +128 -319
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.js +45 -78
- package/src/platform-implementation-js/dom-driver/inbox/__mocks__/getSidebarClassnames.js +8 -4
- package/src/platform-implementation-js/dom-driver/inbox/addNavItem.js +36 -54
- package/src/platform-implementation-js/dom-driver/inbox/addRecipientRow.js +35 -53
- package/src/platform-implementation-js/dom-driver/inbox/createLink.js +13 -15
- package/src/platform-implementation-js/dom-driver/inbox/createLink.test.js +15 -18
- package/src/platform-implementation-js/dom-driver/inbox/custom-style.js +14 -13
- package/src/platform-implementation-js/dom-driver/inbox/detection/appToolbarLocation/parser.js +14 -20
- package/src/platform-implementation-js/dom-driver/inbox/detection/attachmentCard/parser.js +14 -13
- package/src/platform-implementation-js/dom-driver/inbox/detection/attachmentOverlay/parser.js +35 -67
- package/src/platform-implementation-js/dom-driver/inbox/detection/chatSidebar/parser.js +16 -18
- package/src/platform-implementation-js/dom-driver/inbox/detection/compose/parser.js +68 -185
- package/src/platform-implementation-js/dom-driver/inbox/detection/message/parser.js +28 -56
- package/src/platform-implementation-js/dom-driver/inbox/detection/nativeDrawer/parser.js +12 -10
- package/src/platform-implementation-js/dom-driver/inbox/detection/searchBar/parser.js +16 -16
- package/src/platform-implementation-js/dom-driver/inbox/detection/thread/parser.js +24 -35
- package/src/platform-implementation-js/dom-driver/inbox/detection/thread-row/parser.js +37 -89
- package/src/platform-implementation-js/dom-driver/inbox/getComposeViewDriverLiveSet.js +56 -78
- package/src/platform-implementation-js/dom-driver/inbox/getInboxMessageIdForInboxThreadId.js +26 -32
- package/src/platform-implementation-js/dom-driver/inbox/getSidebarClassnames.js +52 -109
- package/src/platform-implementation-js/dom-driver/inbox/getSidebarClassnames.test.js +7 -8
- package/src/platform-implementation-js/dom-driver/inbox/gotoView.js +16 -20
- package/src/platform-implementation-js/dom-driver/inbox/gotoView.test.js +15 -16
- package/src/platform-implementation-js/dom-driver/inbox/inbox-butter-bar-driver.js +75 -83
- package/src/platform-implementation-js/dom-driver/inbox/inbox-driver.js +530 -822
- package/src/platform-implementation-js/dom-driver/inbox/inbox-page-communicator.js +48 -61
- package/src/platform-implementation-js/dom-driver/inbox/inboxResponseProcessor.js +9 -12
- package/src/platform-implementation-js/dom-driver/inbox/inboxResponseProcessor.test.js +12 -19
- package/src/platform-implementation-js/dom-driver/inbox/makePageParserTree.js +24 -33
- package/src/platform-implementation-js/dom-driver/inbox/pageParserOptions.js +201 -388
- package/src/platform-implementation-js/dom-driver/inbox/registerSearchSuggestionsProvider.js +249 -265
- package/src/platform-implementation-js/dom-driver/inbox/setupCustomAutocompleteSelectionHandling.js +84 -152
- package/src/platform-implementation-js/dom-driver/inbox/setupRouteViewDriverStream.js +55 -67
- package/src/platform-implementation-js/dom-driver/inbox/setupRouteViewDriverStream.test.js +43 -65
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxLabelView.js +31 -56
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxMoleViewDriver.js +191 -294
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxToolbarButtonView.js +32 -45
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxToolbarView.js +21 -39
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-app-sidebar-view.js +153 -240
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-app-toolbar-button-view.js +75 -150
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-app-toolbar-tooltip-view.js +20 -37
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-attachment-card-view.js +60 -114
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-attachment-overlay-view.js +47 -65
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-backdrop.js +41 -52
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-chat-sidebar-view.js +27 -36
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-compose-button-view.js +52 -80
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-compose-view.js +465 -649
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-custom-route-view.js +37 -58
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-custom-route-view.test.js +14 -26
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-drawer-view.js +118 -235
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-dropdown-view.js +10 -11
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-dummy-route-view.js +28 -46
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-message-view.js +131 -202
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-modal-view.js +40 -80
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-route-view.js +35 -61
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-thread-row-view.js +124 -221
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-thread-view.js +125 -213
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-thread-view.test.js +104 -126
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-tooltip-view.js +36 -51
- package/src/platform-implementation-js/dom-driver/inbox/views/inboxNavItemView.js +158 -297
- package/src/platform-implementation-js/dom-driver/inbox/waitForAnimationClickBlockerGone.js +21 -35
- package/src/platform-implementation-js/driver-common/compose/getDiscardStream.js +24 -43
- package/src/platform-implementation-js/driver-common/compose/getPresendingStream.js +39 -68
- package/src/platform-implementation-js/driver-common/getGmailMessageIdForSyncMessageId.js +14 -19
- package/src/platform-implementation-js/driver-common/getGmailThreadIdForRfcMessageId.js +27 -35
- package/src/platform-implementation-js/driver-common/getRfcMessageIdForSyncMessageId.js +16 -22
- package/src/platform-implementation-js/driver-common/getThreadIdFromMessageId.js +14 -14
- package/src/platform-implementation-js/driver-common/inboxAjax.js +12 -7
- package/src/platform-implementation-js/driver-common/requestGmailThread.js +19 -20
- package/src/platform-implementation-js/driver-common/sidebar/AppSidebar.js +197 -306
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.js +113 -161
- package/src/platform-implementation-js/driver-interfaces/compose-view-driver.js +1 -114
- package/src/platform-implementation-js/driver-interfaces/driver.js +1 -131
- package/src/platform-implementation-js/driver-interfaces/message-view-driver.js +4 -48
- package/src/platform-implementation-js/driver-interfaces/mole-view-driver.js +1 -29
- package/src/platform-implementation-js/driver-interfaces/route-view-driver.js +1 -32
- package/src/platform-implementation-js/driver-interfaces/thread-row-view-driver.js +1 -11
- package/src/platform-implementation-js/lib/array-to-lifetimes.js +43 -41
- package/src/platform-implementation-js/lib/array-to-lifetimes.test.js +139 -155
- package/src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.js +19 -38
- package/src/platform-implementation-js/lib/css-selector-escape.js +7 -3
- package/src/platform-implementation-js/lib/dom/element-view-mapper.js +8 -11
- package/src/platform-implementation-js/lib/dom/get-selection.js +23 -52
- package/src/platform-implementation-js/lib/dom/insert-html-at-cursor.js +69 -101
- package/src/platform-implementation-js/lib/dom/is-node-in-range.js +8 -10
- package/src/platform-implementation-js/lib/dom/on-mouse-down-and-up.js +15 -17
- package/src/platform-implementation-js/lib/dom/querySelectorOne.js +8 -11
- package/src/platform-implementation-js/lib/dom/set-css.js +7 -3
- package/src/platform-implementation-js/lib/dom/set-value-and-dispatch-event.js +9 -11
- package/src/platform-implementation-js/lib/dom/simulate-drag-and-drop.js +32 -33
- package/src/platform-implementation-js/lib/extract-contact-from-email-contact-string.test.js +23 -26
- package/src/platform-implementation-js/lib/handle-compose-link-chips.js +86 -149
- package/src/platform-implementation-js/lib/insert-link-chip-into-body.js +42 -57
- package/src/platform-implementation-js/lib/make-revocable-function.js +19 -21
- package/src/platform-implementation-js/lib/make-revocable-function.test.js +20 -22
- package/src/platform-implementation-js/lib/parseParamsFromRouteID.js +15 -17
- package/src/platform-implementation-js/lib/parseParamsFromRouteID.test.js +9 -18
- package/src/platform-implementation-js/lib/populateRouteID.js +8 -9
- package/src/platform-implementation-js/lib/populateRouteID.test.js +20 -19
- package/src/platform-implementation-js/lib/react/ElementContainer.js +23 -20
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.js +10 -9
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.test.js +13 -20
- package/src/platform-implementation-js/lib/routeIDmatchesHash.js +13 -18
- package/src/platform-implementation-js/lib/routeIDmatchesHash.test.js +11 -17
- package/src/platform-implementation-js/lib/shared-style.js +14 -13
- package/src/platform-implementation-js/lib/toItemWithLifetimeStream.js +18 -17
- package/src/platform-implementation-js/lib/toLiveSet.js +17 -15
- package/src/platform-implementation-js/main-INTEGRATED-PAGEWORLD.js +6 -5
- package/src/platform-implementation-js/main.js +9 -24
- package/src/platform-implementation-js/namespaces/compose.js +37 -60
- package/src/platform-implementation-js/namespaces/conversations.js +52 -124
- package/src/platform-implementation-js/namespaces/global.js +27 -39
- package/src/platform-implementation-js/namespaces/keyboard.js +29 -33
- package/src/platform-implementation-js/namespaces/lists.js +25 -31
- package/src/platform-implementation-js/namespaces/modal.js +34 -28
- package/src/platform-implementation-js/namespaces/nav-menu.js +30 -45
- package/src/platform-implementation-js/namespaces/router.js +70 -137
- package/src/platform-implementation-js/namespaces/search.js +19 -17
- package/src/platform-implementation-js/namespaces/toolbars.js +71 -117
- package/src/platform-implementation-js/namespaces/user.js +36 -37
- package/src/platform-implementation-js/namespaces/widgets.js +54 -61
- package/src/platform-implementation-js/platform-implementation.js +98 -229
- package/src/platform-implementation-js/views/app-toolbar-button-view.js +26 -47
- package/src/platform-implementation-js/views/collapsible-section-view.js +66 -63
- package/src/platform-implementation-js/views/content-panel-view.js +28 -30
- package/src/platform-implementation-js/views/conversations/attachment-card-view.js +21 -44
- package/src/platform-implementation-js/views/conversations/custom-message-view.js +44 -104
- package/src/platform-implementation-js/views/conversations/message-view.js +131 -202
- package/src/platform-implementation-js/views/conversations/thread-view.js +75 -127
- package/src/platform-implementation-js/views/native-nav-item-view.js +32 -65
- package/src/platform-implementation-js/views/nav-item-view.js +51 -115
- package/src/platform-implementation-js/views/route-view/custom-route-view.js +25 -20
- package/src/platform-implementation-js/views/route-view/dummy-route-view-driver.js +18 -18
- package/src/platform-implementation-js/views/route-view/list-route-view.js +30 -52
- package/src/platform-implementation-js/views/route-view/route-view.js +24 -35
- package/src/platform-implementation-js/views/section-view.js +60 -52
- package/src/platform-implementation-js/views/thread-row-view.js +49 -74
- package/src/platform-implementation-js/widgets/drawer-view.js +29 -36
- package/src/platform-implementation-js/widgets/modal-view.js +39 -68
- package/src/platform-implementation-js/widgets/mole-view.js +22 -22
- package/src/platform-implementation-js/widgets/top-message-bar-view.js +13 -10
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
|
|
5
|
-
import * as SCRP from './sync-compose-request-processor';
|
|
1
|
+
"use strict";
|
|
6
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
5
|
+
var SCRP = _interopRequireWildcard(require("./sync-compose-request-processor"));
|
|
6
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
7
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
7
8
|
it('handles first draft save', () => {
|
|
8
|
-
const request =
|
|
9
|
-
__dirname +
|
|
10
|
-
'/../../../__tests__/sync-compose-request-processor/first-draft-save-request-2018-01-25.json',
|
|
11
|
-
'utf8'
|
|
12
|
-
);
|
|
13
|
-
|
|
9
|
+
const request = _fs.default.readFileSync(__dirname + '/../../../__tests__/sync-compose-request-processor/first-draft-save-request-2018-01-25.json', 'utf8');
|
|
14
10
|
const composeRequest = SCRP.getDetailsOfComposeRequest(JSON.parse(request));
|
|
15
11
|
expect(composeRequest).toMatchObject({
|
|
16
12
|
body: '<div dir="ltr">new new draft</div>',
|
|
@@ -19,17 +15,11 @@ it('handles first draft save', () => {
|
|
|
19
15
|
subject: 'new draft',
|
|
20
16
|
to: null,
|
|
21
17
|
cc: null,
|
|
22
|
-
bcc: null
|
|
18
|
+
bcc: null
|
|
23
19
|
});
|
|
24
20
|
});
|
|
25
|
-
|
|
26
21
|
it('handles regular draft save', () => {
|
|
27
|
-
const request =
|
|
28
|
-
__dirname +
|
|
29
|
-
'/../../../__tests__/sync-compose-request-processor/draft-save-request-2018-01-25.json',
|
|
30
|
-
'utf8'
|
|
31
|
-
);
|
|
32
|
-
|
|
22
|
+
const request = _fs.default.readFileSync(__dirname + '/../../../__tests__/sync-compose-request-processor/draft-save-request-2018-01-25.json', 'utf8');
|
|
33
23
|
const composeRequest = SCRP.getDetailsOfComposeRequest(JSON.parse(request));
|
|
34
24
|
expect(composeRequest).toMatchObject({
|
|
35
25
|
body: '<div dir="ltr">new new draft 2</div>',
|
|
@@ -38,53 +28,53 @@ it('handles regular draft save', () => {
|
|
|
38
28
|
subject: 'new draft',
|
|
39
29
|
to: null,
|
|
40
30
|
cc: null,
|
|
41
|
-
bcc: null
|
|
31
|
+
bcc: null
|
|
42
32
|
});
|
|
43
33
|
});
|
|
44
|
-
|
|
45
34
|
it('handles regular draft save with recipients', () => {
|
|
46
|
-
const request =
|
|
47
|
-
__dirname +
|
|
48
|
-
'/../../../__tests__/sync-compose-request-processor/draft-save-request-2018-01-25-with-recipients.json',
|
|
49
|
-
'utf8'
|
|
50
|
-
);
|
|
51
|
-
|
|
35
|
+
const request = _fs.default.readFileSync(__dirname + '/../../../__tests__/sync-compose-request-processor/draft-save-request-2018-01-25-with-recipients.json', 'utf8');
|
|
52
36
|
const composeRequest = SCRP.getDetailsOfComposeRequest(JSON.parse(request));
|
|
53
37
|
expect(composeRequest).toMatchObject({
|
|
54
38
|
body: '<div dir="ltr">new new draft 2</div>',
|
|
55
39
|
type: 'DRAFT_SAVE',
|
|
56
40
|
draftID: 'r-5205311597211900881',
|
|
57
41
|
subject: 'new draft',
|
|
58
|
-
to: [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
42
|
+
to: [{
|
|
43
|
+
emailAddress: 'test+to@gmail.com',
|
|
44
|
+
name: null
|
|
45
|
+
}, {
|
|
46
|
+
emailAddress: 'test+to2@gmail.com',
|
|
47
|
+
name: 'test to2'
|
|
48
|
+
}],
|
|
49
|
+
cc: [{
|
|
50
|
+
emailAddress: 'test+cc@gmail.com',
|
|
51
|
+
name: null
|
|
52
|
+
}, {
|
|
53
|
+
emailAddress: 'test+cc2@gmail.com',
|
|
54
|
+
name: 'test cc2'
|
|
55
|
+
}],
|
|
56
|
+
bcc: [{
|
|
57
|
+
emailAddress: 'test+bcc@gmail.com',
|
|
58
|
+
name: null
|
|
59
|
+
}, {
|
|
60
|
+
emailAddress: 'test+bcc2@gmail.com',
|
|
61
|
+
name: 'test bcc2'
|
|
62
|
+
}]
|
|
70
63
|
});
|
|
71
64
|
});
|
|
72
|
-
|
|
73
65
|
it('handles sending', () => {
|
|
74
|
-
const request =
|
|
75
|
-
__dirname +
|
|
76
|
-
'/../../../__tests__/sync-compose-request-processor/send-request-2018-01-25.json',
|
|
77
|
-
'utf8'
|
|
78
|
-
);
|
|
79
|
-
|
|
66
|
+
const request = _fs.default.readFileSync(__dirname + '/../../../__tests__/sync-compose-request-processor/send-request-2018-01-25.json', 'utf8');
|
|
80
67
|
const composeRequest = SCRP.getDetailsOfComposeRequest(JSON.parse(request));
|
|
81
68
|
expect(composeRequest).toMatchObject({
|
|
82
69
|
body: '<div dir="ltr">new new draft 2</div>',
|
|
83
70
|
type: 'SEND',
|
|
84
71
|
draftID: 'r-5205311597211900881',
|
|
85
72
|
subject: 'new draft',
|
|
86
|
-
to: [{
|
|
73
|
+
to: [{
|
|
74
|
+
emailAddress: 'test+to@test.com',
|
|
75
|
+
name: null
|
|
76
|
+
}],
|
|
87
77
|
cc: null,
|
|
88
|
-
bcc: null
|
|
78
|
+
bcc: null
|
|
89
79
|
});
|
|
90
|
-
});
|
|
80
|
+
});
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = clickAndGetPopupUrl;
|
|
8
|
+
var _constant = _interopRequireDefault(require("lodash/constant"));
|
|
9
|
+
var _noop = _interopRequireDefault(require("lodash/noop"));
|
|
10
|
+
var logger = _interopRequireWildcard(require("../../injected-logger"));
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
const ignoreErrors = (0, _constant.default)(true);
|
|
14
|
+
function getIfOwn(object, prop) {
|
|
10
15
|
if (Object.prototype.hasOwnProperty.call(object, prop)) {
|
|
11
16
|
return object[prop];
|
|
12
17
|
}
|
|
@@ -15,7 +20,7 @@ function getIfOwn(object: Object, prop: string): any {
|
|
|
15
20
|
|
|
16
21
|
// Simulates a control+meta click on an element, intercepts the call to
|
|
17
22
|
// window.open, and returns the attempted popup's URL.
|
|
18
|
-
|
|
23
|
+
function clickAndGetPopupUrl(element) {
|
|
19
24
|
const event = document.createEvent('MouseEvents');
|
|
20
25
|
const options = {
|
|
21
26
|
bubbles: true,
|
|
@@ -26,41 +31,24 @@ export default function clickAndGetPopupUrl(element: HTMLElement): ?string {
|
|
|
26
31
|
ctrlKey: true,
|
|
27
32
|
altKey: false,
|
|
28
33
|
shiftKey: false,
|
|
29
|
-
metaKey: true
|
|
34
|
+
metaKey: true
|
|
30
35
|
};
|
|
31
|
-
|
|
32
|
-
'click',
|
|
33
|
-
options.bubbles,
|
|
34
|
-
options.cancelable,
|
|
35
|
-
document.defaultView,
|
|
36
|
-
options.button,
|
|
37
|
-
options.pointerX,
|
|
38
|
-
options.pointerY,
|
|
39
|
-
options.pointerX,
|
|
40
|
-
options.pointerY,
|
|
41
|
-
options.ctrlKey,
|
|
42
|
-
options.altKey,
|
|
43
|
-
options.shiftKey,
|
|
44
|
-
options.metaKey,
|
|
45
|
-
options.button,
|
|
46
|
-
null
|
|
47
|
-
);
|
|
48
|
-
|
|
36
|
+
event.initMouseEvent('click', options.bubbles, options.cancelable, document.defaultView, options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, null);
|
|
49
37
|
let url;
|
|
50
38
|
const oldWindowOpen = window.open,
|
|
51
39
|
oldWindowOnerror = window.onerror,
|
|
52
40
|
oldFocus = getIfOwn(window.HTMLElement.prototype, 'focus'),
|
|
53
41
|
oldBlur = getIfOwn(window.HTMLElement.prototype, 'blur');
|
|
54
42
|
try {
|
|
55
|
-
window.HTMLElement.prototype.focus =
|
|
56
|
-
window.HTMLElement.prototype.blur =
|
|
43
|
+
window.HTMLElement.prototype.focus = _noop.default;
|
|
44
|
+
window.HTMLElement.prototype.blur = _noop.default;
|
|
57
45
|
window.onerror = ignoreErrors;
|
|
58
46
|
const newOpen = function (_url, _title, _options) {
|
|
59
47
|
url = _url;
|
|
60
48
|
// Gmail checks the returned object for these two values specifically.
|
|
61
49
|
const newWin = {
|
|
62
50
|
closed: false,
|
|
63
|
-
focus:
|
|
51
|
+
focus: _noop.default
|
|
64
52
|
};
|
|
65
53
|
setTimeout(function () {
|
|
66
54
|
newWin.closed = true;
|
|
@@ -76,7 +64,6 @@ export default function clickAndGetPopupUrl(element: HTMLElement): ?string {
|
|
|
76
64
|
logger.error(new Error('Failed to override window.open'));
|
|
77
65
|
return null;
|
|
78
66
|
}
|
|
79
|
-
|
|
80
67
|
element.dispatchEvent(event);
|
|
81
68
|
} finally {
|
|
82
69
|
if (oldFocus) {
|
|
@@ -93,4 +80,4 @@ export default function clickAndGetPopupUrl(element: HTMLElement): ?string {
|
|
|
93
80
|
window.open = oldWindowOpen;
|
|
94
81
|
}
|
|
95
82
|
return url;
|
|
96
|
-
}
|
|
83
|
+
}
|
|
@@ -1,62 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.processThreadListResponse = processThreadListResponse;
|
|
8
|
+
exports.setup = setup;
|
|
9
|
+
var _find = _interopRequireDefault(require("lodash/find"));
|
|
10
|
+
var GmailResponseProcessor = _interopRequireWildcard(require("../../../platform-implementation-js/dom-driver/gmail/gmail-response-processor"));
|
|
11
|
+
var _querystring = require("querystring");
|
|
12
|
+
var logger = _interopRequireWildcard(require("../../injected-logger"));
|
|
13
|
+
var threadRowParser = _interopRequireWildcard(require("./thread-row-parser"));
|
|
14
|
+
var _clickAndGetPopupUrl = _interopRequireDefault(require("./click-and-get-popup-url"));
|
|
15
|
+
var _findParent = _interopRequireDefault(require("../../../common/find-parent"));
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
function setup() {
|
|
12
19
|
try {
|
|
13
20
|
processPreloadedThreads();
|
|
14
21
|
} catch (err) {
|
|
15
22
|
logger.error(err, 'Failed to process preloaded thread identifiers');
|
|
16
23
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const threadId = getGmailThreadIdForThreadRowByDatabase(event.target);
|
|
23
|
-
if (threadId) {
|
|
24
|
-
event.target.setAttribute('data-inboxsdk-threadid', threadId);
|
|
25
|
-
}
|
|
26
|
-
} catch (err) {
|
|
27
|
-
logger.error(err, 'Error in inboxSDKtellMeThisThreadIdByDatabase');
|
|
24
|
+
document.addEventListener('inboxSDKtellMeThisThreadIdByDatabase', function (event) {
|
|
25
|
+
try {
|
|
26
|
+
const threadId = getGmailThreadIdForThreadRowByDatabase(event.target);
|
|
27
|
+
if (threadId) {
|
|
28
|
+
event.target.setAttribute('data-inboxsdk-threadid', threadId);
|
|
28
29
|
}
|
|
30
|
+
} catch (err) {
|
|
31
|
+
logger.error(err, 'Error in inboxSDKtellMeThisThreadIdByDatabase');
|
|
29
32
|
}
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const threadId = getGmailThreadIdForThreadRowByClick(event.target);
|
|
37
|
-
if (threadId) {
|
|
38
|
-
event.target.setAttribute('data-inboxsdk-threadid', threadId);
|
|
39
|
-
}
|
|
40
|
-
} catch (err) {
|
|
41
|
-
logger.error(err, 'Error in inboxSDKtellMeThisThreadIdByClick');
|
|
33
|
+
});
|
|
34
|
+
document.addEventListener('inboxSDKtellMeThisThreadIdByClick', function (event) {
|
|
35
|
+
try {
|
|
36
|
+
const threadId = getGmailThreadIdForThreadRowByClick(event.target);
|
|
37
|
+
if (threadId) {
|
|
38
|
+
event.target.setAttribute('data-inboxsdk-threadid', threadId);
|
|
42
39
|
}
|
|
40
|
+
} catch (err) {
|
|
41
|
+
logger.error(err, 'Error in inboxSDKtellMeThisThreadIdByClick');
|
|
43
42
|
}
|
|
44
|
-
);
|
|
43
|
+
});
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
export function processThreadListResponse(threadListResponse: string) {
|
|
45
|
+
function processThreadListResponse(threadListResponse) {
|
|
48
46
|
processThreads(GmailResponseProcessor.extractThreads(threadListResponse));
|
|
49
47
|
}
|
|
50
|
-
|
|
51
|
-
function processThreads(threads: GmailResponseProcessor.Thread[]) {
|
|
48
|
+
function processThreads(threads) {
|
|
52
49
|
threads.forEach(storeThreadMetadata);
|
|
53
50
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
function storeThreadMetadata(threadMetadata: GmailResponseProcessor.Thread) {
|
|
51
|
+
const AMBIGUOUS = {
|
|
52
|
+
name: 'AMBIGUOUS'
|
|
53
|
+
};
|
|
54
|
+
const threadIdsByKey = new Map();
|
|
55
|
+
function storeThreadMetadata(threadMetadata) {
|
|
60
56
|
var key = threadMetadataKey(threadMetadata);
|
|
61
57
|
if (threadIdsByKey.has(key)) {
|
|
62
58
|
if (threadIdsByKey.get(key) !== threadMetadata.gmailThreadId) {
|
|
@@ -66,45 +62,23 @@ function storeThreadMetadata(threadMetadata: GmailResponseProcessor.Thread) {
|
|
|
66
62
|
threadIdsByKey.set(key, threadMetadata.gmailThreadId);
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
threadRowMetadata: threadRowParser.ThreadRowMetadata
|
|
72
|
-
): string {
|
|
73
|
-
return (
|
|
74
|
-
threadRowMetadata.subject.trim() +
|
|
75
|
-
':' +
|
|
76
|
-
threadRowMetadata.timeString.trim() +
|
|
77
|
-
':' +
|
|
78
|
-
threadRowMetadata.peopleHtml.trim()
|
|
79
|
-
);
|
|
65
|
+
function threadMetadataKey(threadRowMetadata) {
|
|
66
|
+
return threadRowMetadata.subject.trim() + ':' + threadRowMetadata.timeString.trim() + ':' + threadRowMetadata.peopleHtml.trim();
|
|
80
67
|
}
|
|
81
|
-
|
|
82
68
|
function processPreloadedThreads() {
|
|
83
|
-
const preloadScript =
|
|
84
|
-
document.querySelectorAll('script:not([src])'),
|
|
85
|
-
(script) =>
|
|
86
|
-
script.text && script.text.slice(0, 500).indexOf('var VIEW_DATA=[[') > -1
|
|
87
|
-
);
|
|
69
|
+
const preloadScript = (0, _find.default)(document.querySelectorAll('script:not([src])'), script => script.text && script.text.slice(0, 500).indexOf('var VIEW_DATA=[[') > -1);
|
|
88
70
|
if (!preloadScript) {
|
|
89
71
|
// preloadScript is not available in gmail v2, so let's stop logging an error
|
|
90
72
|
return;
|
|
91
73
|
} else {
|
|
92
74
|
const firstBracket = preloadScript.text.indexOf('[');
|
|
93
75
|
const lastBracket = preloadScript.text.lastIndexOf(']');
|
|
94
|
-
const viewDataString = preloadScript.text.slice(
|
|
95
|
-
|
|
96
|
-
lastBracket + 1
|
|
97
|
-
);
|
|
98
|
-
processThreads(
|
|
99
|
-
GmailResponseProcessor.extractThreadsFromDeserialized([
|
|
100
|
-
GmailResponseProcessor.deserializeArray(viewDataString),
|
|
101
|
-
])
|
|
102
|
-
);
|
|
76
|
+
const viewDataString = preloadScript.text.slice(firstBracket, lastBracket + 1);
|
|
77
|
+
processThreads(GmailResponseProcessor.extractThreadsFromDeserialized([GmailResponseProcessor.deserializeArray(viewDataString)]));
|
|
103
78
|
}
|
|
104
79
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
var tid = parse(url).th;
|
|
80
|
+
function getThreadIdFromUrl(url) {
|
|
81
|
+
var tid = (0, _querystring.parse)(url).th;
|
|
108
82
|
if (!tid) {
|
|
109
83
|
// drafts in sync world can have weird urls that kind of
|
|
110
84
|
// look like old style urls, and get handled properly here
|
|
@@ -112,7 +86,7 @@ function getThreadIdFromUrl(url: string): ?string {
|
|
|
112
86
|
if (urlHashMatch) {
|
|
113
87
|
// drafts have the hash in them without the th=
|
|
114
88
|
url = decodeURIComponent(decodeURIComponent(urlHashMatch[1]));
|
|
115
|
-
tid = parse(url).th;
|
|
89
|
+
tid = (0, _querystring.parse)(url).th;
|
|
116
90
|
}
|
|
117
91
|
}
|
|
118
92
|
|
|
@@ -120,38 +94,28 @@ function getThreadIdFromUrl(url: string): ?string {
|
|
|
120
94
|
// draft then a hash can come through in the beginning
|
|
121
95
|
return tid.replace('#', '');
|
|
122
96
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
threadRow: HTMLElement
|
|
126
|
-
): ?string {
|
|
127
|
-
const domRowMetadata =
|
|
128
|
-
threadRowParser.extractMetadataFromThreadRow(threadRow);
|
|
97
|
+
function getGmailThreadIdForThreadRowByDatabase(threadRow) {
|
|
98
|
+
const domRowMetadata = threadRowParser.extractMetadataFromThreadRow(threadRow);
|
|
129
99
|
const key = threadMetadataKey(domRowMetadata);
|
|
130
100
|
const value = threadIdsByKey.get(key);
|
|
131
101
|
if (typeof value === 'string') {
|
|
132
102
|
return value;
|
|
133
103
|
}
|
|
134
104
|
}
|
|
135
|
-
|
|
136
|
-
function getGmailThreadIdForThreadRowByClick(threadRow: HTMLElement): ?string {
|
|
105
|
+
function getGmailThreadIdForThreadRowByClick(threadRow) {
|
|
137
106
|
// Simulate a ctrl-click on the thread row to get the thread id, then
|
|
138
107
|
// simulate a ctrl-click on the previously selected thread row (or the
|
|
139
108
|
// first thread row) to put the cursor back where it was.
|
|
140
|
-
const domRowMetadata =
|
|
141
|
-
|
|
142
|
-
const parent = findParent(
|
|
143
|
-
threadRow,
|
|
144
|
-
(el) => el.nodeName === 'DIV' && el.getAttribute('role') === 'main'
|
|
145
|
-
);
|
|
109
|
+
const domRowMetadata = threadRowParser.extractMetadataFromThreadRow(threadRow);
|
|
110
|
+
const parent = (0, _findParent.default)(threadRow, el => el.nodeName === 'DIV' && el.getAttribute('role') === 'main');
|
|
146
111
|
if (!parent) {
|
|
147
112
|
throw new Error("Can't operate on disconnected thread row");
|
|
148
113
|
}
|
|
149
|
-
const currentRowSelection =
|
|
150
|
-
|
|
151
|
-
const url = clickAndGetPopupUrl(threadRow);
|
|
114
|
+
const currentRowSelection = parent.querySelector('td.PE') || parent.querySelector('tr');
|
|
115
|
+
const url = (0, _clickAndGetPopupUrl.default)(threadRow);
|
|
152
116
|
const threadId = url && getThreadIdFromUrl(url);
|
|
153
117
|
if (currentRowSelection) {
|
|
154
|
-
|
|
118
|
+
(0, _clickAndGetPopupUrl.default)(currentRowSelection);
|
|
155
119
|
}
|
|
156
120
|
return threadId;
|
|
157
|
-
}
|
|
121
|
+
}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
threadRow: HTMLElement
|
|
16
|
-
): ThreadRowMetadata {
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.extractMetadataFromThreadRow = extractMetadataFromThreadRow;
|
|
8
|
+
var _intersection = _interopRequireDefault(require("lodash/intersection"));
|
|
9
|
+
var _assert = _interopRequireDefault(require("assert"));
|
|
10
|
+
var logger = _interopRequireWildcard(require("../../injected-logger"));
|
|
11
|
+
var _gmailResponseProcessor = require("../../../platform-implementation-js/dom-driver/gmail/gmail-response-processor");
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
function extractMetadataFromThreadRow(threadRow) {
|
|
17
15
|
var timeSpan, subjectSpan, peopleDiv;
|
|
18
|
-
|
|
19
|
-
assert(threadRow.hasAttribute('id'), 'check element is main thread row');
|
|
20
|
-
|
|
16
|
+
(0, _assert.default)(threadRow.hasAttribute('id'), 'check element is main thread row');
|
|
21
17
|
var errors = [];
|
|
22
|
-
var threadRowIsVertical =
|
|
23
|
-
intersection(Array.from(threadRow.classList), ['zA', 'apv']).length === 2;
|
|
18
|
+
var threadRowIsVertical = (0, _intersection.default)(Array.from(threadRow.classList), ['zA', 'apv']).length === 2;
|
|
24
19
|
if (threadRowIsVertical) {
|
|
25
20
|
var threadRow2 = threadRow.nextElementSibling;
|
|
26
21
|
if (!threadRow2) {
|
|
@@ -30,17 +25,13 @@ export function extractMetadataFromThreadRow(
|
|
|
30
25
|
if (!threadRow3 || !threadRow3.classList.contains('apw')) {
|
|
31
26
|
threadRow3 = null;
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
timeSpan = threadRow.querySelector('td.apt > div.apm > span[title]');
|
|
35
29
|
subjectSpan = threadRow2.querySelector('td div.xS div.xT div.y6 > span');
|
|
36
30
|
peopleDiv = threadRow.querySelector('td.apy > div.yW, td.apx > div.yW');
|
|
37
31
|
}
|
|
38
32
|
} else {
|
|
39
33
|
timeSpan = threadRow.querySelector('td.xW > span[title]');
|
|
40
|
-
|
|
41
|
-
var subjectAreaDiv = threadRow.querySelector(
|
|
42
|
-
'td.a4W div[role=link] div.y6'
|
|
43
|
-
);
|
|
34
|
+
var subjectAreaDiv = threadRow.querySelector('td.a4W div[role=link] div.y6');
|
|
44
35
|
if (subjectAreaDiv && subjectAreaDiv.children.length >= 1) {
|
|
45
36
|
subjectSpan = subjectAreaDiv.children[0];
|
|
46
37
|
|
|
@@ -50,7 +41,6 @@ export function extractMetadataFromThreadRow(
|
|
|
50
41
|
|
|
51
42
|
peopleDiv = threadRow.querySelector('td.yX > div.yW');
|
|
52
43
|
}
|
|
53
|
-
|
|
54
44
|
if (!timeSpan) {
|
|
55
45
|
errors.push('failed to find timeSpan');
|
|
56
46
|
}
|
|
@@ -61,12 +51,13 @@ export function extractMetadataFromThreadRow(
|
|
|
61
51
|
errors.push('failed to find peopleDiv');
|
|
62
52
|
}
|
|
63
53
|
if (errors.length) {
|
|
64
|
-
logger.error(new Error('Errors in thread row parsing'), {
|
|
54
|
+
logger.error(new Error('Errors in thread row parsing'), {
|
|
55
|
+
errors
|
|
56
|
+
});
|
|
65
57
|
}
|
|
66
|
-
|
|
67
58
|
return {
|
|
68
59
|
timeString: timeSpan ? timeSpan.getAttribute('title') || '' : '',
|
|
69
60
|
subject: subjectSpan ? subjectSpan.textContent : '',
|
|
70
|
-
peopleHtml: peopleDiv ? cleanupPeopleLine(peopleDiv.innerHTML) : ''
|
|
61
|
+
peopleHtml: peopleDiv ? (0, _gmailResponseProcessor.cleanupPeopleLine)(peopleDiv.innerHTML) : ''
|
|
71
62
|
};
|
|
72
|
-
}
|
|
63
|
+
}
|
|
@@ -1,57 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { extractMetadataFromThreadRow } from './thread-row-parser';
|
|
1
|
+
"use strict";
|
|
4
2
|
|
|
3
|
+
var _threadRowParser = require("./thread-row-parser");
|
|
5
4
|
describe('extractMetadataFromThreadRow', () => {
|
|
6
5
|
it('can read row', () => {
|
|
7
6
|
const table = document.createElement('table');
|
|
8
|
-
table.innerHTML =
|
|
9
|
-
'<tbody>' +
|
|
10
|
-
'<tr class="zA yO" id=":46" tabindex="-1" aria-labelledby=":47"><td class="PF xY"></td><td id=":48" class="oZ-x3 xY aid" style=""><div id=":49" class="oZ-jc T-Jo J-J5-Ji " role="checkbox" aria-labelledby=":47" dir="ltr" aria-checked="false" tabindex="-1"><div class="T-Jo-auh"></div></div></td><td class="apU xY"><span id=":4a" class="aXw T-KT" title="Not starred" aria-label="Not starred"><img class="T-KT-JX" src="images/cleardot.gif" alt="Not starred"></span></td><td class="WA xY"><div class="pG" data-tooltip-contained="true" data-tooltip-align="b,l" data-tooltip-delay="1500" aria-label="Not important" role="img" id=":4b"><div class="T-ays-a45"><span class="aol">Click to teach Streak Mail this conversation is important.</span></div><div class="pH-A7"></div><div class="UW "></div></div></td><td class="yX xY "><div id=":47" class="afn">me (15), test merge again, 2:02 pm, 4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014.</div><div id=":4c" class="yW"><span class="yP" email="cowan@streak.com" name="me">me</span> (15)</div></td><td id=":4d" tabindex="-1" class="xY a4W"><div class="xS" role="link"><div class="xT"><div class="y6"><span id=":4f">test merge again</span><span class="y2"> - 4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014</span></div></div></div></td><td class="yf xY "> </td><td class="xW xY "><span title="Thu, Dec 4, 2014 at 2:02 PM" id=":4g" aria-label="Thu, Dec 4, 2014 at 2:02 PM">2:02 pm</span></td></tr>' +
|
|
11
|
-
'</tbody>';
|
|
7
|
+
table.innerHTML = '<tbody>' + '<tr class="zA yO" id=":46" tabindex="-1" aria-labelledby=":47"><td class="PF xY"></td><td id=":48" class="oZ-x3 xY aid" style=""><div id=":49" class="oZ-jc T-Jo J-J5-Ji " role="checkbox" aria-labelledby=":47" dir="ltr" aria-checked="false" tabindex="-1"><div class="T-Jo-auh"></div></div></td><td class="apU xY"><span id=":4a" class="aXw T-KT" title="Not starred" aria-label="Not starred"><img class="T-KT-JX" src="images/cleardot.gif" alt="Not starred"></span></td><td class="WA xY"><div class="pG" data-tooltip-contained="true" data-tooltip-align="b,l" data-tooltip-delay="1500" aria-label="Not important" role="img" id=":4b"><div class="T-ays-a45"><span class="aol">Click to teach Streak Mail this conversation is important.</span></div><div class="pH-A7"></div><div class="UW "></div></div></td><td class="yX xY "><div id=":47" class="afn">me (15), test merge again, 2:02 pm, 4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014.</div><div id=":4c" class="yW"><span class="yP" email="cowan@streak.com" name="me">me</span> (15)</div></td><td id=":4d" tabindex="-1" class="xY a4W"><div class="xS" role="link"><div class="xT"><div class="y6"><span id=":4f">test merge again</span><span class="y2"> - 4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014</span></div></div></div></td><td class="yf xY "> </td><td class="xW xY "><span title="Thu, Dec 4, 2014 at 2:02 PM" id=":4g" aria-label="Thu, Dec 4, 2014 at 2:02 PM">2:02 pm</span></td></tr>' + '</tbody>';
|
|
12
8
|
const threadRow = table.querySelector('tr');
|
|
13
9
|
if (!threadRow) throw new Error();
|
|
14
|
-
const parsed = extractMetadataFromThreadRow(threadRow);
|
|
10
|
+
const parsed = (0, _threadRowParser.extractMetadataFromThreadRow)(threadRow);
|
|
15
11
|
expect(parsed).toEqual({
|
|
16
12
|
timeString: 'Thu, Dec 4, 2014 at 2:02 PM',
|
|
17
13
|
subject: 'test merge again',
|
|
18
|
-
peopleHtml: '<span email="cowan@streak.com" name="me">me</span> (15)'
|
|
14
|
+
peopleHtml: '<span email="cowan@streak.com" name="me">me</span> (15)'
|
|
19
15
|
});
|
|
20
16
|
});
|
|
21
|
-
|
|
22
17
|
it('can read vertical preview pane row', () => {
|
|
23
18
|
const table = document.createElement('table');
|
|
24
|
-
table.innerHTML =
|
|
25
|
-
'<tbody>' +
|
|
26
|
-
'<tr class="zA yO apv" id=":151" tabindex="-1" aria-labelledby=":150"><td rowspan="3" class="PF xY"></td><td rowspan="3" id=":14z" class="apo-x3 xY aid" style=""><div id=":14y" class="apo-jc T-Jo J-J5-Ji " role="checkbox" aria-labelledby=":150" dir="ltr" aria-checked="false" tabindex="-1"><div class="T-Jo-auh"></div></div></td><td class="yX xY apy"><div id=":150" class="afn"><span class="yP" email="cowan@streak.com" name="me">me</span> (15), test merge again, 2:02 pm, 4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014.</div><div id=":14x" class="yW"><span class="yP" email="cowan@streak.com" name="me">me</span> (15)</div></td><td class="yf xY apt"><div class="apm"><span title="Thu, Dec 4, 2014 at 2:02 PM" id=":14w" aria-label="Thu, Dec 4, 2014 at 2:02 PM">2:02 pm</span></div> </td><td rowspan="3" class="apU apC"><span id=":14v" class="aXw T-KT" title="Not starred" aria-label="Not starred"><img class="T-KT-JX" src="images/cleardot.gif" alt="Not starred"></span></td></tr>' +
|
|
27
|
-
'<tr class="zA yO apv"><td colspan="2" tabindex="0" role="link" class="xY apD"><div class="apn apd"><div class="pG" data-tooltip-contained="true" data-tooltip-align="b,l" data-tooltip-delay="1500" aria-label="Not important" role="img" id=":14u"><div class="T-ays-a45"><span class="aol">Click to teach Streak Mail this conversation is important.</span></div><div class="pH-A7 aok"></div><div class="UW UW-yN-aa"></div></div></div><div class="xS" role="undefined"><div class="xT"><div class="y6"><span id=":14t">test merge again</span></div></div></div></td></tr>' +
|
|
28
|
-
'<tr class="zA yO apv apw"><td colspan="2" class="xY apA"><div class="apB"><div class="apu"><div class="as"> </div></div><div class="y2 apz">4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014</div></div></td></tr>' +
|
|
29
|
-
'</tbody>';
|
|
19
|
+
table.innerHTML = '<tbody>' + '<tr class="zA yO apv" id=":151" tabindex="-1" aria-labelledby=":150"><td rowspan="3" class="PF xY"></td><td rowspan="3" id=":14z" class="apo-x3 xY aid" style=""><div id=":14y" class="apo-jc T-Jo J-J5-Ji " role="checkbox" aria-labelledby=":150" dir="ltr" aria-checked="false" tabindex="-1"><div class="T-Jo-auh"></div></div></td><td class="yX xY apy"><div id=":150" class="afn"><span class="yP" email="cowan@streak.com" name="me">me</span> (15), test merge again, 2:02 pm, 4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014.</div><div id=":14x" class="yW"><span class="yP" email="cowan@streak.com" name="me">me</span> (15)</div></td><td class="yf xY apt"><div class="apm"><span title="Thu, Dec 4, 2014 at 2:02 PM" id=":14w" aria-label="Thu, Dec 4, 2014 at 2:02 PM">2:02 pm</span></div> </td><td rowspan="3" class="apU apC"><span id=":14v" class="aXw T-KT" title="Not starred" aria-label="Not starred"><img class="T-KT-JX" src="images/cleardot.gif" alt="Not starred"></span></td></tr>' + '<tr class="zA yO apv"><td colspan="2" tabindex="0" role="link" class="xY apD"><div class="apn apd"><div class="pG" data-tooltip-contained="true" data-tooltip-align="b,l" data-tooltip-delay="1500" aria-label="Not important" role="img" id=":14u"><div class="T-ays-a45"><span class="aol">Click to teach Streak Mail this conversation is important.</span></div><div class="pH-A7 aok"></div><div class="UW UW-yN-aa"></div></div></div><div class="xS" role="undefined"><div class="xT"><div class="y6"><span id=":14t">test merge again</span></div></div></div></td></tr>' + '<tr class="zA yO apv apw"><td colspan="2" class="xY apA"><div class="apB"><div class="apu"><div class="as"> </div></div><div class="y2 apz">4 On Thu, Dec 4, 2014 at 2:02 PM, Chris Cowan <cowan@streak.com> wrote: 3 On Thu, Dec 4, 2014</div></div></td></tr>' + '</tbody>';
|
|
30
20
|
const threadRow = table.querySelector('tr');
|
|
31
21
|
if (!threadRow) throw new Error();
|
|
32
|
-
const parsed = extractMetadataFromThreadRow(threadRow);
|
|
22
|
+
const parsed = (0, _threadRowParser.extractMetadataFromThreadRow)(threadRow);
|
|
33
23
|
expect(parsed).toEqual({
|
|
34
24
|
timeString: 'Thu, Dec 4, 2014 at 2:02 PM',
|
|
35
25
|
subject: 'test merge again',
|
|
36
|
-
peopleHtml: '<span email="cowan@streak.com" name="me">me</span> (15)'
|
|
26
|
+
peopleHtml: '<span email="cowan@streak.com" name="me">me</span> (15)'
|
|
37
27
|
});
|
|
38
28
|
});
|
|
39
|
-
|
|
40
29
|
it('can read snippet-less vertical preview pane row', () => {
|
|
41
30
|
const table = document.createElement('table');
|
|
42
|
-
table.innerHTML =
|
|
43
|
-
'<tbody>' +
|
|
44
|
-
'<tr class="zA yO apv" id=":3p" tabindex="-1" aria-labelledby=":3q"><td rowspan="2" class="PF xY"></td><td rowspan="2" id=":3r" class="apq-x3 xY aid" style=""><div id=":3s" class="apq-jc T-Jo J-J5-Ji " role="checkbox" aria-labelledby=":3q" dir="ltr" aria-checked="false" tabindex="-1"><div class="T-Jo-auh"></div></div></td><td class="xY apx"><div id=":3q" class="afn"><span class="yP" email="notifications@mailfoogae.appspotmail.com" name="Streak Bot">Streak Bot</span>, lordprogrammer finished a deploy (fed8a27), 11:02 am, .</div><div class="apu"><div class="as"> </div></div><div class="yW NyC7Y"><span class="yP" email="notifications@mailfoogae.appspotmail.com" name="Streak Bot">Streak Bot</span></div></td><td class="yf xY apt"><div class="apm"><span title="Mon, Jan 5, 2015 at 11:02 AM" id=":3t" aria-label="Mon, Jan 5, 2015 at 11:02 AM">11:02 am</span></div> </td><td rowspan="2" class="apU apC"><span id=":3u" class="aXw T-KT" title="Not starred" aria-label="Not starred"><img class="T-KT-JX" src="images/cleardot.gif" alt="Not starred"></span></td></tr>' +
|
|
45
|
-
'<tr class="zA yO apv"><td colspan="2" tabindex="0" role="link" class="xY apE"><div class="apn apd"><div class="pG" data-tooltip-contained="true" data-tooltip-align="b,l" data-tooltip-delay="1500" aria-label="Not important" role="img" id=":3v"><div class="T-ays-a45"><span class="aol">Click to teach Streak Mail this conversation is important.</span></div><div class="pH-A7"></div><div class="UW "></div></div></div><div class="xS" role="undefined"><div class="xT"><div class="y6"><span id=":3w">lordprogrammer finished a deploy (fed8a27)</span></div></div></div></td></tr>' +
|
|
46
|
-
'</tbody>';
|
|
31
|
+
table.innerHTML = '<tbody>' + '<tr class="zA yO apv" id=":3p" tabindex="-1" aria-labelledby=":3q"><td rowspan="2" class="PF xY"></td><td rowspan="2" id=":3r" class="apq-x3 xY aid" style=""><div id=":3s" class="apq-jc T-Jo J-J5-Ji " role="checkbox" aria-labelledby=":3q" dir="ltr" aria-checked="false" tabindex="-1"><div class="T-Jo-auh"></div></div></td><td class="xY apx"><div id=":3q" class="afn"><span class="yP" email="notifications@mailfoogae.appspotmail.com" name="Streak Bot">Streak Bot</span>, lordprogrammer finished a deploy (fed8a27), 11:02 am, .</div><div class="apu"><div class="as"> </div></div><div class="yW NyC7Y"><span class="yP" email="notifications@mailfoogae.appspotmail.com" name="Streak Bot">Streak Bot</span></div></td><td class="yf xY apt"><div class="apm"><span title="Mon, Jan 5, 2015 at 11:02 AM" id=":3t" aria-label="Mon, Jan 5, 2015 at 11:02 AM">11:02 am</span></div> </td><td rowspan="2" class="apU apC"><span id=":3u" class="aXw T-KT" title="Not starred" aria-label="Not starred"><img class="T-KT-JX" src="images/cleardot.gif" alt="Not starred"></span></td></tr>' + '<tr class="zA yO apv"><td colspan="2" tabindex="0" role="link" class="xY apE"><div class="apn apd"><div class="pG" data-tooltip-contained="true" data-tooltip-align="b,l" data-tooltip-delay="1500" aria-label="Not important" role="img" id=":3v"><div class="T-ays-a45"><span class="aol">Click to teach Streak Mail this conversation is important.</span></div><div class="pH-A7"></div><div class="UW "></div></div></div><div class="xS" role="undefined"><div class="xT"><div class="y6"><span id=":3w">lordprogrammer finished a deploy (fed8a27)</span></div></div></div></td></tr>' + '</tbody>';
|
|
47
32
|
const threadRow = table.querySelector('tr');
|
|
48
33
|
if (!threadRow) throw new Error();
|
|
49
|
-
const parsed = extractMetadataFromThreadRow(threadRow);
|
|
34
|
+
const parsed = (0, _threadRowParser.extractMetadataFromThreadRow)(threadRow);
|
|
50
35
|
expect(parsed).toEqual({
|
|
51
36
|
timeString: 'Mon, Jan 5, 2015 at 11:02 AM',
|
|
52
37
|
subject: 'lordprogrammer finished a deploy (fed8a27)',
|
|
53
|
-
peopleHtml:
|
|
54
|
-
'<span email="notifications@mailfoogae.appspotmail.com" name="Streak Bot">Streak Bot</span>',
|
|
38
|
+
peopleHtml: '<span email="notifications@mailfoogae.appspotmail.com" name="Streak Bot">Streak Bot</span>'
|
|
55
39
|
});
|
|
56
40
|
});
|
|
57
|
-
});
|
|
41
|
+
});
|