From f0d1f2fbfb2127745468b2d6835747d1d0df0027 Mon Sep 17 00:00:00 2001 From: Jason Waters Date: Wed, 25 Oct 2023 14:22:55 -0600 Subject: [PATCH] remove message-feed --- sandbox/src/App.js | 5 - .../MessageFeedDemo/MessageFeed.css | 15 - .../components/MessageFeedDemo/MessageFeed.js | 506 ------------------ .../Personalization/createComponent.js | 10 +- .../createOnDecisionHandler.js | 9 +- .../createSubscribeMessageFeed.js | 136 ----- src/components/Personalization/index.js | 13 +- test/functional/helpers/createAlloyProxy.js | 1 - .../Personalization/createComponent.spec.js | 5 +- .../createOnDecisionHandler.spec.js | 10 +- .../createSubscribeMessageFeed.spec.js | 482 ----------------- .../Personalization/topLevel/buildAlloy.js | 13 +- 12 files changed, 13 insertions(+), 1192 deletions(-) delete mode 100644 sandbox/src/components/MessageFeedDemo/MessageFeed.css delete mode 100644 sandbox/src/components/MessageFeedDemo/MessageFeed.js delete mode 100644 src/components/Personalization/createSubscribeMessageFeed.js delete mode 100644 test/unit/specs/components/Personalization/createSubscribeMessageFeed.spec.js diff --git a/sandbox/src/App.js b/sandbox/src/App.js index 8bdf2516a..1282f112b 100755 --- a/sandbox/src/App.js +++ b/sandbox/src/App.js @@ -32,7 +32,6 @@ import Identity from "./Identity"; import AlloyVersion from "./components/AlloyVersion"; import ConfigOverrides from "./ConfigOverrides.jsx"; import InAppMessages from "./components/InAppMessagesDemo/InAppMessages"; -import MessageFeed from "./components/MessageFeedDemo/MessageFeed"; const BasicExample = () => { return ( @@ -101,9 +100,6 @@ const BasicExample = () => {
  • In-app Messages
  • -
  • - Message Feed -

  • @@ -134,7 +130,6 @@ const BasicExample = () => { - diff --git a/sandbox/src/components/MessageFeedDemo/MessageFeed.css b/sandbox/src/components/MessageFeedDemo/MessageFeed.css deleted file mode 100644 index 3fbd057da..000000000 --- a/sandbox/src/components/MessageFeedDemo/MessageFeed.css +++ /dev/null @@ -1,15 +0,0 @@ -/* Card.css */ -.pretty-card { - color: black; - border: 1px solid #ccc; - border-radius: 8px; - padding: 16px; - margin: 16px; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); - background-color: lightblue; - transition: transform 0.2s; -} - -.pretty-card:hover { - transform: scale(1.05); -} diff --git a/sandbox/src/components/MessageFeedDemo/MessageFeed.js b/sandbox/src/components/MessageFeedDemo/MessageFeed.js deleted file mode 100644 index 902409a6c..000000000 --- a/sandbox/src/components/MessageFeedDemo/MessageFeed.js +++ /dev/null @@ -1,506 +0,0 @@ -/* eslint-disable no-console */ -import React, { useEffect, useState } from "react"; -import ContentSecurityPolicy from "../ContentSecurityPolicy"; -import "./MessageFeed.css"; - -const mockResponse = { - requestId: "5a38a9ef-67d7-4f66-8977-c4dc0e0967b6", - handle: [ - { - payload: [ - { - id: "11893040138696185741718511332124641876", - namespace: { - code: "ECID" - } - } - ], - type: "identity:result" - }, - { - payload: [ - { - scopeDetails: { - decisionProvider: "AJO", - characteristics: { - eventToken: - "eyJtZXNzYWdlRXhlY3V0aW9uIjp7Im1lc3NhZ2VFeGVjdXRpb25JRCI6Ik5BIiwibWVzc2FnZUlEIjoiMDJjNzdlYTgtN2MwZS00ZDMzLTgwOTAtNGE1YmZkM2Q3NTAzIiwibWVzc2FnZVR5cGUiOiJtYXJrZXRpbmciLCJjYW1wYWlnbklEIjoiMzlhZThkNGItYjU1ZS00M2RjLWExNDMtNzdmNTAxOTViNDg3IiwiY2FtcGFpZ25WZXJzaW9uSUQiOiJiZDg1ZDllOC0yMDM3LTQyMmYtYjZkMi0zOTU3YzkwNTU5ZDMiLCJjYW1wYWlnbkFjdGlvbklEIjoiYjQ3ZmRlOGItNTdjMS00YmJlLWFlMjItNjRkNWI3ODJkMTgzIiwibWVzc2FnZVB1YmxpY2F0aW9uSUQiOiJhZTUyY2VkOC0yMDBjLTQ5N2UtODc4Ny1lZjljZmMxNzgyMTUifSwibWVzc2FnZVByb2ZpbGUiOnsiY2hhbm5lbCI6eyJfaWQiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbHMvd2ViIiwiX3R5cGUiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbC10eXBlcy93ZWIifSwibWVzc2FnZVByb2ZpbGVJRCI6ImY1Y2Q5OTk1LTZiNDQtNDIyMS05YWI3LTViNTMzOGQ1ZjE5MyJ9fQ==" - }, - strategies: [ - { - strategyID: "3VQe3oIqiYq2RAsYzmDTSf", - treatmentID: "yu7rkogezumca7i0i44v" - } - ], - activity: { - id: - "8e24e51d-5203-4d0b-99c9-2b3c95ff48f2#05885219-ea84-43bc-874e-1ef4a85b6fbb" - }, - correlationID: "02c77ea8-7c0e-4d33-8090-4a5bfd3d7503" - }, - id: "1a3d874f-39ee-4310-bfa9-6559a10041a4", - items: [ - { - id: "9d9c6e62-a8e5-419b-abe3-429950c27425", - schema: "https://ns.adobe.com/personalization/ruleset-item", - data: { - version: 1, - rules: [ - { - condition: { - definition: { - conditions: [ - { - definition: { - conditions: [ - { - definition: { - key: "events", - matcher: "ex" - }, - type: "matcher" - } - ], - logic: "and" - }, - type: "group" - } - ], - logic: "and" - }, - type: "group" - }, - consequences: [ - { - type: "schema", - detail: { - schema: - "https://ns.adobe.com/personalization/message/feed-item", - data: { - expiryDate: 1712190456, - publishedDate: 1677752640000, - meta: { - feedName: "Winter Promo", - surface: - "mobileapp://com.adobe.sampleApp/feed/promos" - }, - content: { - imageUrl: - "https://target.jasonwaters.dev/img/lumon.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: "a handshake is available upon request.", - title: "Welcome to Lumon!" - }, - contentType: "application/json" - }, - id: "a48ca420-faea-467e-989a-5d179d9f562d" - }, - id: "a48ca420-faea-467e-989a-5d179d9f562d" - }, - { - type: "schema", - detail: { - schema: - "https://ns.adobe.com/personalization/message/feed-item", - data: { - expiryDate: 1712190456, - publishedDate: 1677839040000, - meta: { - feedName: "Winter Promo", - surface: - "mobileapp://com.adobe.sampleApp/feed/promos" - }, - content: { - imageUrl: - "https://media.giphy.com/media/l0Ex3vQtX5VX2YtAQ/giphy.gif", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: "Great job, you completed your profile.", - title: "Achievement Unlocked!" - }, - contentType: "application/json" - }, - id: "b7173290-588f-40c6-a05c-43ed5ec08b28" - }, - id: "b7173290-588f-40c6-a05c-43ed5ec08b28" - } - ] - } - ] - } - } - ], - scope: "web://target.jasonwaters.dev/aep.html" - }, - { - scopeDetails: { - decisionProvider: "AJO", - characteristics: { - eventToken: - "eyJtZXNzYWdlRXhlY3V0aW9uIjp7Im1lc3NhZ2VFeGVjdXRpb25JRCI6Ik5BIiwibWVzc2FnZUlEIjoiMDJjNzdlYTgtN2MwZS00ZDMzLTgwOTAtNGE1YmZkM2Q3NTAzIiwibWVzc2FnZVR5cGUiOiJtYXJrZXRpbmciLCJjYW1wYWlnbklEIjoiMzlhZThkNGItYjU1ZS00M2RjLWExNDMtNzdmNTAxOTViNDg3IiwiY2FtcGFpZ25WZXJzaW9uSUQiOiJiZDg1ZDllOC0yMDM3LTQyMmYtYjZkMi0zOTU3YzkwNTU5ZDMiLCJjYW1wYWlnbkFjdGlvbklEIjoiYjQ3ZmRlOGItNTdjMS00YmJlLWFlMjItNjRkNWI3ODJkMTgzIiwibWVzc2FnZVB1YmxpY2F0aW9uSUQiOiJhZTUyY2VkOC0yMDBjLTQ5N2UtODc4Ny1lZjljZmMxNzgyMTUifSwibWVzc2FnZVByb2ZpbGUiOnsiY2hhbm5lbCI6eyJfaWQiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbHMvd2ViIiwiX3R5cGUiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbC10eXBlcy93ZWIifSwibWVzc2FnZVByb2ZpbGVJRCI6ImY1Y2Q5OTk1LTZiNDQtNDIyMS05YWI3LTViNTMzOGQ1ZjE5MyJ9fQ==" - }, - strategies: [ - { - strategyID: "3VQe3oIqiYq2RAsYzmDTSf", - treatmentID: "yu7rkogezumca7i0i44v" - } - ], - activity: { - id: - "cf087a6e-131d-4147-adc7-bc1ea947f09c#ff64e6e6-e43f-479d-b5c0-f5568c771b3b" - }, - correlationID: "02c77ea8-7c0e-4d33-8090-4a5bfd3d7503" - }, - id: "1ae11bc5-96dc-41c7-8f71-157c57a5290e", - items: [ - { - id: "e0575812-74e5-46b9-a4f2-9541dfaec2d0", - schema: "https://ns.adobe.com/personalization/ruleset-item", - data: { - version: 1, - rules: [ - { - condition: { - definition: { - conditions: [ - { - definition: { - conditions: [ - { - definition: { - key: "action", - matcher: "eq", - values: ["share-social-media"] - }, - type: "matcher" - }, - { - definition: { - events: [ - { - "iam.eventType": "display", - "iam.id": - "cf087a6e-131d-4147-adc7-bc1ea947f09c#ff64e6e6-e43f-479d-b5c0-f5568c771b3b" - } - ], - matcher: "ge", - value: 1 - }, - type: "historical" - } - ], - logic: "or" - }, - type: "group" - } - ], - logic: "and" - }, - type: "group" - }, - consequences: [ - { - type: "schema", - detail: { - schema: - "https://ns.adobe.com/personalization/message/feed-item", - data: { - expiryDate: 1712190456, - publishedDate: 1678098240000, - meta: { - feedName: "Winter Promo", - surface: - "mobileapp://com.adobe.sampleApp/feed/promos" - }, - content: { - imageUrl: - "https://target.jasonwaters.dev/img/twitter.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: - "Posting on social media helps us spread the word.", - title: "Thanks for sharing!" - }, - contentType: "application/json" - }, - id: "cfcb1af7-7bc2-45b2-a86a-0aa93fe69ce7" - }, - id: "cfcb1af7-7bc2-45b2-a86a-0aa93fe69ce7" - } - ] - } - ] - } - } - ], - scope: "web://target.jasonwaters.dev/aep.html" - }, - { - scopeDetails: { - decisionProvider: "AJO", - characteristics: { - eventToken: - "eyJtZXNzYWdlRXhlY3V0aW9uIjp7Im1lc3NhZ2VFeGVjdXRpb25JRCI6Ik5BIiwibWVzc2FnZUlEIjoiMDJjNzdlYTgtN2MwZS00ZDMzLTgwOTAtNGE1YmZkM2Q3NTAzIiwibWVzc2FnZVR5cGUiOiJtYXJrZXRpbmciLCJjYW1wYWlnbklEIjoiMzlhZThkNGItYjU1ZS00M2RjLWExNDMtNzdmNTAxOTViNDg3IiwiY2FtcGFpZ25WZXJzaW9uSUQiOiJiZDg1ZDllOC0yMDM3LTQyMmYtYjZkMi0zOTU3YzkwNTU5ZDMiLCJjYW1wYWlnbkFjdGlvbklEIjoiYjQ3ZmRlOGItNTdjMS00YmJlLWFlMjItNjRkNWI3ODJkMTgzIiwibWVzc2FnZVB1YmxpY2F0aW9uSUQiOiJhZTUyY2VkOC0yMDBjLTQ5N2UtODc4Ny1lZjljZmMxNzgyMTUifSwibWVzc2FnZVByb2ZpbGUiOnsiY2hhbm5lbCI6eyJfaWQiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbHMvd2ViIiwiX3R5cGUiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbC10eXBlcy93ZWIifSwibWVzc2FnZVByb2ZpbGVJRCI6ImY1Y2Q5OTk1LTZiNDQtNDIyMS05YWI3LTViNTMzOGQ1ZjE5MyJ9fQ==" - }, - strategies: [ - { - strategyID: "3VQe3oIqiYq2RAsYzmDTSf", - treatmentID: "yu7rkogezumca7i0i44v" - } - ], - activity: { - id: - "57712381-1690-4d19-9469-0a35ea5bd4e3#74f8e5cf-d770-41c3-b595-557b3ee00ba3" - }, - correlationID: "02c77ea8-7c0e-4d33-8090-4a5bfd3d7503" - }, - id: "d1f7d411-a549-47bc-a4d8-c8e638b0a46b", - items: [ - { - id: "f47638a0-b785-4f56-afa6-c24e714b8ff4", - schema: "https://ns.adobe.com/personalization/ruleset-item", - data: { - version: 1, - rules: [ - { - condition: { - definition: { - conditions: [ - { - definition: { - conditions: [ - { - definition: { - key: "action", - matcher: "eq", - values: ["deposit-funds"] - }, - type: "matcher" - }, - { - definition: { - events: [ - { - "iam.eventType": "trigger", - "iam.id": - "57712381-1690-4d19-9469-0a35ea5bd4e3#74f8e5cf-d770-41c3-b595-557b3ee00ba3" - } - ], - matcher: "ge", - value: 1 - }, - type: "historical" - } - ], - logic: "or" - }, - type: "group" - } - ], - logic: "and" - }, - type: "group" - }, - consequences: [ - { - type: "schema", - detail: { - schema: - "https://ns.adobe.com/personalization/message/feed-item", - data: { - expiryDate: 1712190456, - publishedDate: 1678184640000, - meta: { - feedName: "Winter Promo", - surface: - "mobileapp://com.adobe.sampleApp/feed/promos" - }, - content: { - imageUrl: - "https://media.giphy.com/media/ADgfsbHcS62Jy/giphy.gif", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: "Now you're ready to earn!", - title: "Funds deposited!" - }, - contentType: "application/json" - }, - id: "0263e171-fa32-4c7a-9611-36b28137a81d" - }, - id: "0263e171-fa32-4c7a-9611-36b28137a81d" - } - ] - } - ] - } - } - ], - scope: "web://target.jasonwaters.dev/aep.html" - } - ], - type: "personalization:decisions", - eventIndex: 0 - }, - { - payload: [ - { - scope: "Target", - hint: "35", - ttlSeconds: 1800 - }, - { - scope: "AAM", - hint: "9", - ttlSeconds: 1800 - }, - { - scope: "EdgeNetwork", - hint: "or2", - ttlSeconds: 1800 - } - ], - type: "locationHint:result" - }, - { - payload: [ - { - key: "kndctr_4DA0571C5FDC4BF70A495FC2_AdobeOrg_cluster", - value: "or2", - maxAge: 1800, - attrs: { - SameSite: "None" - } - } - ], - type: "state:store" - } - ] -}; - -const prettyDate = value => { - let output = ""; - - if (typeof value !== "undefined") { - const now = new Date().getTime(); - const seconds = Math.floor(now / 1000); - const oldTimestamp = Math.floor(value / 1000); - const difference = seconds - oldTimestamp; - - if (difference < 60) { - output = `${difference} second(s) ago`; - } else if (difference < 3600) { - output = `${Math.floor(difference / 60)} min ago`; - } else if (difference < 86400) { - output = `${Math.floor(difference / 3600)} hour(s) ago`; - } else if (difference < 2620800) { - output = `${Math.floor(difference / 86400)} day(s) ago`; - } else if (difference < 31449600) { - output = `${Math.floor(difference / 2620800)} month(s) ago`; - } else { - output = `${Math.floor(difference / 31449600)} year(s) ago`; - } - } - - return output; -}; - -export default function MessageFeed() { - const [clickHandler, setClickHandler] = useState(() => items => - console.log("items clicked!", items) - ); - - const [messageFeedItems, setMessageFeedItems] = useState([]); - - useEffect(() => { - const startupPromises = Promise.all([ - window.alloy("subscribeRulesetItems", { - surfaces: ["web://target.jasonwaters.dev/aep.html"], - callback: result => { - console.log("subscribeRulesetItems", result); - } - }), - window.alloy("subscribeMessageFeed", { - surface: "web://target.jasonwaters.dev/aep.html", - callback: ({ items = [], rendered, clicked }) => { - console.log("subscribeMessageFeed", items); - setClickHandler(() => clicked); - setMessageFeedItems(items); - rendered(items); - } - }), - window.alloy("applyResponse", { - renderDecisions: true, - responseBody: mockResponse - }) - ]); - - return () => { - startupPromises.then(([rulesetItems, messageFeed]) => { - messageFeed.unsubscribe(); - rulesetItems.unsubscribe(); - }); - }; - }, ["clickHandler"]); - - const shareSocialMedia = () => { - window.alloy("evaluateRulesets", { - renderDecisions: true, - decisionContext: { - action: "share-social-media" - } - }); - }; - - const depositFunds = () => { - window.alloy("evaluateRulesets", { - renderDecisions: true, - decisionContext: { - action: "deposit-funds" - } - }); - }; - - const resetPersistentData = () => { - localStorage.clear(); - window.location.reload(); - }; - - return ( -
    - -
    - - - -
    -
    -

    Message Feed

    -
    - {messageFeedItems.map((item, index) => ( -
    clickHandler([item])} - > -

    {item.title}

    -

    - {item.imageUrl && Item Image} -

    -

    {item.body}

    -

    Published: {prettyDate(item.publishedDate)}

    -

    Qualified: {prettyDate(item.qualifiedDate)}

    -

    Displayed: {prettyDate(item.displayedDate)}

    -
    - ))} -
    -
    -
    - ); -} diff --git a/src/components/Personalization/createComponent.js b/src/components/Personalization/createComponent.js index 165d9683b..16ac200ce 100644 --- a/src/components/Personalization/createComponent.js +++ b/src/components/Personalization/createComponent.js @@ -10,11 +10,11 @@ OF ANY KIND, either express or implied. See the License for the specific languag governing permissions and limitations under the License. */ -import { noop, flatMap } from "../../utils"; +import { flatMap, noop } from "../../utils"; import createPersonalizationDetails from "./createPersonalizationDetails"; import { AUTHORING_ENABLED } from "./constants/loggerMessage"; -import validateApplyPropositionsOptions from "./validateApplyPropositionsOptions"; import { PropositionEventType } from "../../constants/propositionEventType"; +import validateApplyPropositionsOptions from "./validateApplyPropositionsOptions"; export default ({ getPageLocation, @@ -30,8 +30,7 @@ export default ({ setTargetMigration, mergeDecisionsMeta, pendingDisplayNotifications, - onDecisionHandler, - subscribeMessageFeed + onDecisionHandler }) => { return { lifecycle: { @@ -121,8 +120,7 @@ export default ({ optionsValidator: options => validateApplyPropositionsOptions({ logger, options }), run: applyPropositions - }, - subscribeMessageFeed: subscribeMessageFeed.command + } } }; }; diff --git a/src/components/Personalization/createOnDecisionHandler.js b/src/components/Personalization/createOnDecisionHandler.js index 0cf55914f..7660a1a7e 100644 --- a/src/components/Personalization/createOnDecisionHandler.js +++ b/src/components/Personalization/createOnDecisionHandler.js @@ -10,15 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag governing permissions and limitations under the License. */ -export default ({ - processPropositions, - createProposition, - collect, - subscribeMessageFeed -}) => { +export default ({ processPropositions, createProposition, collect }) => { return ({ viewName, renderDecisions, propositions }) => { - subscribeMessageFeed.refresh(propositions); - if (!renderDecisions) { return Promise.resolve(); } diff --git a/src/components/Personalization/createSubscribeMessageFeed.js b/src/components/Personalization/createSubscribeMessageFeed.js deleted file mode 100644 index 289713175..000000000 --- a/src/components/Personalization/createSubscribeMessageFeed.js +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2023 Adobe. All rights reserved. -This file is licensed to you under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS -OF ANY KIND, either express or implied. See the License for the specific language -governing permissions and limitations under the License. -*/ -import { - callback as callbackType, - objectOf, - string -} from "../../utils/validation"; -import { MESSAGE_FEED_ITEM } from "../../constants/schema"; -import { DISPLAY, INTERACT } from "../../constants/eventType"; -import createSubscription from "../../utils/createSubscription"; - -const validateOptions = ({ options }) => { - const validator = objectOf({ - surface: string().required(), - callback: callbackType().required() - }).noUnknownFields(); - - return validator(options); -}; - -export default ({ collect }) => { - const renderedSet = new Set(); - - const createFeedItem = (payload, item) => { - const { id, scope, scopeDetails } = payload; - - const { data = {} } = item; - const { content = {}, publishedDate, qualifiedDate, displayedDate } = data; - - return { - ...content, - qualifiedDate, - displayedDate, - publishedDate, - getSurface: () => data.meta.surface, - getAnalyticsDetail: () => { - return { id, scope, scopeDetails }; - } - }; - }; - - const clicked = (items = []) => { - if (!(items instanceof Array)) { - return; - } - - const decisionsMeta = []; - const clickedSet = new Set(); - - items.forEach(item => { - const analyticsMeta = item.getAnalyticsDetail(); - if (!clickedSet.has(analyticsMeta.id)) { - decisionsMeta.push(analyticsMeta); - clickedSet.add(analyticsMeta.id); - } - }); - - if (decisionsMeta.length > 0) { - collect({ decisionsMeta, eventType: INTERACT, documentMayUnload: true }); - } - }; - - const rendered = (items = []) => { - const decisionsMeta = []; - - items.forEach(item => { - const analyticsMeta = item.getAnalyticsDetail(); - if (!renderedSet.has(analyticsMeta.id)) { - decisionsMeta.push(analyticsMeta); - renderedSet.add(analyticsMeta.id); - } - }); - - if (decisionsMeta.length > 0) { - collect({ decisionsMeta, eventType: DISPLAY }); - } - }; - - const subscription = createSubscription(); - subscription.setEmissionPreprocessor((params, propositions) => { - const { surfaceIdentifier } = params; - - const result = propositions - .filter(payload => payload.scope === surfaceIdentifier) - .reduce((allItems, payload) => { - const { items = [] } = payload; - - return [ - ...allItems, - ...items - .filter(item => item.schema === MESSAGE_FEED_ITEM) - .map(item => createFeedItem(payload, item)) - ]; - }, []) - .sort( - (a, b) => - b.qualifiedDate - a.qualifiedDate || b.publishedDate - a.publishedDate - ); - - return [{ items: result, clicked, rendered }]; - }); - - const run = ({ surface, callback }) => { - const unsubscribe = subscription.add(callback, { - surfaceIdentifier: surface - }); - return Promise.resolve({ unsubscribe }); - }; - - const optionsValidator = options => validateOptions({ options }); - - const refresh = propositions => { - if (!subscription.hasSubscriptions()) { - return; - } - - subscription.emit(propositions); - }; - - return { - refresh, - command: { - optionsValidator, - run - } - }; -}; diff --git a/src/components/Personalization/index.js b/src/components/Personalization/index.js index be4676fa9..b1444bb32 100644 --- a/src/components/Personalization/index.js +++ b/src/components/Personalization/index.js @@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag governing permissions and limitations under the License. */ -import { string, boolean, objectOf } from "../../utils/validation"; +import { boolean, objectOf, string } from "../../utils/validation"; import createComponent from "./createComponent"; import { initDomActionsModules } from "./dom-actions"; import createCollect from "./createCollect"; @@ -38,7 +38,6 @@ import createProcessDomAction from "./handlers/createProcessDomAction"; import createProcessHtmlContent from "./handlers/createProcessHtmlContent"; import createProcessRedirect from "./handlers/createProcessRedirect"; import createProcessPropositions from "./handlers/createProcessPropositions"; -import createSubscribeMessageFeed from "./createSubscribeMessageFeed"; import createOnDecisionHandler from "./createOnDecisionHandler"; import createProcessInAppMessage from "./handlers/createProcessInAppMessage"; import initInAppMessageActionsModules from "./in-app-message-actions/initInAppMessageActionsModules"; @@ -120,15 +119,10 @@ const createPersonalization = ({ config, logger, eventManager }) => { targetMigrationEnabled }); - const subscribeMessageFeed = createSubscribeMessageFeed({ - collect - }); - const onDecisionHandler = createOnDecisionHandler({ processPropositions, createProposition, - collect, - subscribeMessageFeed + collect }); return createComponent({ @@ -145,8 +139,7 @@ const createPersonalization = ({ config, logger, eventManager }) => { setTargetMigration, mergeDecisionsMeta, pendingDisplayNotifications, - onDecisionHandler, - subscribeMessageFeed + onDecisionHandler }); }; diff --git a/test/functional/helpers/createAlloyProxy.js b/test/functional/helpers/createAlloyProxy.js index 6de61e425..d1fbf154c 100644 --- a/test/functional/helpers/createAlloyProxy.js +++ b/test/functional/helpers/createAlloyProxy.js @@ -92,7 +92,6 @@ const commands = [ "appendIdentityToUrl", "applyPropositions", "subscribeRulesetItems", - "subscribeMessageFeed", "evaluateRulesets" ]; diff --git a/test/unit/specs/components/Personalization/createComponent.spec.js b/test/unit/specs/components/Personalization/createComponent.spec.js index b95570cfd..be81d2f1a 100644 --- a/test/unit/specs/components/Personalization/createComponent.spec.js +++ b/test/unit/specs/components/Personalization/createComponent.spec.js @@ -26,7 +26,6 @@ describe("Personalization", () => { let setTargetMigration; let mergeDecisionsMeta; let pendingDisplayNotifications; - let subscribeMessageFeed; let cacheUpdate; const build = () => { @@ -41,8 +40,7 @@ describe("Personalization", () => { showContainers, setTargetMigration, mergeDecisionsMeta, - pendingDisplayNotifications, - subscribeMessageFeed + pendingDisplayNotifications }); }; @@ -73,7 +71,6 @@ describe("Personalization", () => { "pendingDisplayNotifications", ["clear"] ); - subscribeMessageFeed = jasmine.createSpy("subscribeMessageFeed"); build(); }); diff --git a/test/unit/specs/components/Personalization/createOnDecisionHandler.spec.js b/test/unit/specs/components/Personalization/createOnDecisionHandler.spec.js index e9e5d5e7f..603dddf0e 100644 --- a/test/unit/specs/components/Personalization/createOnDecisionHandler.spec.js +++ b/test/unit/specs/components/Personalization/createOnDecisionHandler.spec.js @@ -183,7 +183,6 @@ describe("Personalization::createOnDecisionHandler", () => { let collect; let processPropositions; let createProposition; - let subscribeMessageFeed; let onDecisionHandler; beforeEach(() => { @@ -200,16 +199,11 @@ describe("Personalization::createOnDecisionHandler", () => { isPageWideSurface: () => false }); - subscribeMessageFeed = jasmine.createSpyObj("subscribeMessageFeed", [ - "refresh" - ]); - onDecisionHandler = createOnDecisionHandler({ processPropositions, createProposition, render, - collect, - subscribeMessageFeed + collect }); }); @@ -220,7 +214,6 @@ describe("Personalization::createOnDecisionHandler", () => { propositions: PROPOSITIONS }); - expect(subscribeMessageFeed.refresh).toHaveBeenCalledOnceWith(PROPOSITIONS); expect(render).not.toHaveBeenCalled(); }); @@ -232,7 +225,6 @@ describe("Personalization::createOnDecisionHandler", () => { }); expect(propositions).toEqual(PROPOSITIONS); - expect(subscribeMessageFeed.refresh).toHaveBeenCalledOnceWith(PROPOSITIONS); expect(render).toHaveBeenCalledTimes(1); diff --git a/test/unit/specs/components/Personalization/createSubscribeMessageFeed.spec.js b/test/unit/specs/components/Personalization/createSubscribeMessageFeed.spec.js deleted file mode 100644 index 5613df127..000000000 --- a/test/unit/specs/components/Personalization/createSubscribeMessageFeed.spec.js +++ /dev/null @@ -1,482 +0,0 @@ -/* -Copyright 2023 Adobe. All rights reserved. -This file is licensed to you under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS -OF ANY KIND, either express or implied. See the License for the specific language -governing permissions and limitations under the License. -*/ -import createSubscribeMessageFeed from "../../../../../src/components/Personalization/createSubscribeMessageFeed"; -import { MESSAGE_FEED_ITEM } from "../../../../../src/constants/schema"; - -describe("Personalization:subscribeMessageFeed", () => { - let collect; - let subscribeMessageFeed; - - const PROPOSITIONS = [ - { - id: "2e4c7b28-b3e7-4d5b-ae6a-9ab0b44af87e", - items: [ - { - schema: "https://ns.adobe.com/personalization/dom-action", - data: { - selector: "HTML > BODY > DIV.offer:eq(0) > IMG:nth-of-type(1)", - type: "setAttribute", - content: { - src: "img/demo-marketing-offer1-exp-A.png" - }, - prehidingSelector: - "HTML > BODY > DIV:nth-of-type(2) > IMG:nth-of-type(1)", - qualifiedDate: 1683042673387, - displayedDate: 1683042673395 - }, - id: "79129ecf-6430-4fbd-955a-b4f1dfdaa6fe" - }, - { - schema: "https://ns.adobe.com/personalization/dom-action", - data: { - selector: "HTML > BODY > DIV:nth-of-type(1) > H1:nth-of-type(1)", - type: "setHtml", - content: "Hello Treatment A!", - prehidingSelector: - "HTML > BODY > DIV:nth-of-type(1) > H1:nth-of-type(1)", - qualifiedDate: 1683042673387, - displayedDate: 1683042673395 - }, - id: "10da709c-aa1a-40e5-84dd-966e2e8a1d5f" - } - ], - scope: "web://mywebsite.com/feed" - }, - { - id: "1a3d874f-39ee-4310-bfa9-6559a10041a4", - items: [ - { - schema: MESSAGE_FEED_ITEM, - data: { - expiryDate: 1712190456, - publishedDate: 1677752640000, - meta: { - feedName: "Winter Promo", - surface: "web://mywebsite.com/feed" - }, - content: { - imageUrl: "img/lumon.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: "a handshake is available upon request.", - title: "Welcome to Lumon!" - }, - contentType: "application/json", - qualifiedDate: 1683042628064, - displayedDate: 1683042628070 - }, - id: "a48ca420-faea-467e-989a-5d179d9f562d" - }, - { - schema: MESSAGE_FEED_ITEM, - data: { - expiryDate: 1712190456, - publishedDate: 1677839040000, - - meta: { - feedName: "Winter Promo", - surface: "web://mywebsite.com/feed" - }, - content: { - imageUrl: "img/achievement.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: "Great job, you completed your profile.", - title: "Achievement Unlocked!" - }, - contentType: "application/json", - qualifiedDate: 1683042628064, - displayedDate: 1683042628070 - }, - id: "b7173290-588f-40c6-a05c-43ed5ec08b28" - } - ], - scope: "web://mywebsite.com/feed" - }, - { - id: "1ae11bc5-96dc-41c7-8f71-157c57a5290e", - items: [ - { - schema: MESSAGE_FEED_ITEM, - data: { - expiryDate: 1712190456, - publishedDate: 1678098240000, - meta: { - feedName: "Winter Promo", - surface: "web://mywebsite.com/feed" - }, - content: { - imageUrl: "img/twitter.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: "Posting on social media helps us spread the word.", - title: "Thanks for sharing!" - }, - contentType: "application/json", - qualifiedDate: 1683042658312, - displayedDate: 1683042658316 - }, - id: "cfcb1af7-7bc2-45b2-a86a-0aa93fe69ce7" - } - ], - scope: "web://mywebsite.com/feed", - scopeDetails: { - id: "1ae11bc5-96dc-41c7-8f71-157c57a5290e", - scope: "web://mywebsite.com/feed", - scopeDetails: { - decisionProvider: "AJO", - characteristics: { - eventToken: - "eyJtZXNzYWdlRXhlY3V0aW9uIjp7Im1lc3NhZ2VFeGVjdXRpb25JRCI6Ik5BIiwibWVzc2FnZUlEIjoiMDJjNzdlYTgtN2MwZS00ZDMzLTgwOTAtNGE1YmZkM2Q3NTAzIiwibWVzc2FnZVR5cGUiOiJtYXJrZXRpbmciLCJjYW1wYWlnbklEIjoiMzlhZThkNGItYjU1ZS00M2RjLWExNDMtNzdmNTAxOTViNDg3IiwiY2FtcGFpZ25WZXJzaW9uSUQiOiJiZDg1ZDllOC0yMDM3LTQyMmYtYjZkMi0zOTU3YzkwNTU5ZDMiLCJjYW1wYWlnbkFjdGlvbklEIjoiYjQ3ZmRlOGItNTdjMS00YmJlLWFlMjItNjRkNWI3ODJkMTgzIiwibWVzc2FnZVB1YmxpY2F0aW9uSUQiOiJhZTUyY2VkOC0yMDBjLTQ5N2UtODc4Ny1lZjljZmMxNzgyMTUifSwibWVzc2FnZVByb2ZpbGUiOnsiY2hhbm5lbCI6eyJfaWQiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbHMvd2ViIiwiX3R5cGUiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbC10eXBlcy93ZWIifSwibWVzc2FnZVByb2ZpbGVJRCI6ImY1Y2Q5OTk1LTZiNDQtNDIyMS05YWI3LTViNTMzOGQ1ZjE5MyJ9fQ==" - }, - strategies: [ - { - strategyID: "3VQe3oIqiYq2RAsYzmDTSf", - treatmentID: "yu7rkogezumca7i0i44v" - } - ], - activity: { - id: - "39ae8d4b-b55e-43dc-a143-77f50195b487#b47fde8b-57c1-4bbe-ae22-64d5b782d183" - }, - correlationID: "02c77ea8-7c0e-4d33-8090-4a5bfd3d7503" - } - } - }, - { - id: "d1f7d411-a549-47bc-a4d8-c8e638b0a46b", - items: [ - { - schema: MESSAGE_FEED_ITEM, - data: { - expiryDate: 1712190456, - publishedDate: 1678184640000, - meta: { - feedName: "Winter Promo", - surface: "web://mywebsite.com/feed" - }, - content: { - imageUrl: "img/gold-coin.jpg", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - body: "Now you're ready to earn!", - title: "Funds deposited!" - }, - contentType: "application/json", - qualifiedDate: 1683042653905, - displayedDate: 1683042653909 - }, - id: "0263e171-fa32-4c7a-9611-36b28137a81d" - } - ], - scope: "web://mywebsite.com/feed" - } - ]; - - beforeEach(() => { - collect = jasmine.createSpy().and.returnValue(Promise.resolve()); - subscribeMessageFeed = createSubscribeMessageFeed({ collect }); - }); - - it("has a command defined", () => { - const { command } = subscribeMessageFeed; - - expect(command).toEqual({ - optionsValidator: jasmine.any(Function), - run: jasmine.any(Function) - }); - }); - - it("calls the callback with list of items", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - // register a subscription. equivalent to alloy("subscribeMessageFeed", {surface, callback}) - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - expect(callback).toHaveBeenCalledOnceWith({ - items: [ - jasmine.objectContaining({ - imageUrl: "img/twitter.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - publishedDate: 1678098240000, - body: "Posting on social media helps us spread the word.", - title: "Thanks for sharing!", - qualifiedDate: 1683042658312, - displayedDate: 1683042658316 - }), - jasmine.objectContaining({ - imageUrl: "img/gold-coin.jpg", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - publishedDate: 1678184640000, - body: "Now you're ready to earn!", - title: "Funds deposited!", - qualifiedDate: 1683042653905, - displayedDate: 1683042653909 - }), - jasmine.objectContaining({ - imageUrl: "img/achievement.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - publishedDate: 1677839040000, - body: "Great job, you completed your profile.", - title: "Achievement Unlocked!", - qualifiedDate: 1683042628064, - displayedDate: 1683042628070 - }), - jasmine.objectContaining({ - imageUrl: "img/lumon.png", - actionTitle: "Shop the sale!", - actionUrl: "https://luma.com/sale", - publishedDate: 1677752640000, - body: "a handshake is available upon request.", - title: "Welcome to Lumon!", - qualifiedDate: 1683042628064, - displayedDate: 1683042628070 - }) - ], - clicked: jasmine.any(Function), - rendered: jasmine.any(Function) - }); - }); - it("has helper methods on items", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items } = callback.calls.first().args[0]; - - expect(items[0].getSurface).toEqual(jasmine.any(Function)); - expect(items[0].getAnalyticsDetail).toEqual(jasmine.any(Function)); - - expect(items[0].getSurface()).toEqual("web://mywebsite.com/feed"); - expect(items[0].getAnalyticsDetail()).toEqual({ - id: "1ae11bc5-96dc-41c7-8f71-157c57a5290e", - scope: "web://mywebsite.com/feed", - scopeDetails: { - id: "1ae11bc5-96dc-41c7-8f71-157c57a5290e", - scope: "web://mywebsite.com/feed", - scopeDetails: { - decisionProvider: "AJO", - characteristics: { - eventToken: - "eyJtZXNzYWdlRXhlY3V0aW9uIjp7Im1lc3NhZ2VFeGVjdXRpb25JRCI6Ik5BIiwibWVzc2FnZUlEIjoiMDJjNzdlYTgtN2MwZS00ZDMzLTgwOTAtNGE1YmZkM2Q3NTAzIiwibWVzc2FnZVR5cGUiOiJtYXJrZXRpbmciLCJjYW1wYWlnbklEIjoiMzlhZThkNGItYjU1ZS00M2RjLWExNDMtNzdmNTAxOTViNDg3IiwiY2FtcGFpZ25WZXJzaW9uSUQiOiJiZDg1ZDllOC0yMDM3LTQyMmYtYjZkMi0zOTU3YzkwNTU5ZDMiLCJjYW1wYWlnbkFjdGlvbklEIjoiYjQ3ZmRlOGItNTdjMS00YmJlLWFlMjItNjRkNWI3ODJkMTgzIiwibWVzc2FnZVB1YmxpY2F0aW9uSUQiOiJhZTUyY2VkOC0yMDBjLTQ5N2UtODc4Ny1lZjljZmMxNzgyMTUifSwibWVzc2FnZVByb2ZpbGUiOnsiY2hhbm5lbCI6eyJfaWQiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbHMvd2ViIiwiX3R5cGUiOiJodHRwczovL25zLmFkb2JlLmNvbS94ZG0vY2hhbm5lbC10eXBlcy93ZWIifSwibWVzc2FnZVByb2ZpbGVJRCI6ImY1Y2Q5OTk1LTZiNDQtNDIyMS05YWI3LTViNTMzOGQ1ZjE5MyJ9fQ==" - }, - strategies: [ - { - strategyID: "3VQe3oIqiYq2RAsYzmDTSf", - treatmentID: "yu7rkogezumca7i0i44v" - } - ], - activity: { - id: - "39ae8d4b-b55e-43dc-a143-77f50195b487#b47fde8b-57c1-4bbe-ae22-64d5b782d183" - }, - correlationID: "02c77ea8-7c0e-4d33-8090-4a5bfd3d7503" - } - } - }); - }); - - it("collects interact events", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, clicked } = callback.calls.first().args[0]; - - clicked([items[0]]); - - expect(collect).toHaveBeenCalledWith({ - decisionsMeta: [items[0].getAnalyticsDetail()], - eventType: "decisioning.propositionInteract", - documentMayUnload: true - }); - }); - - it("collects only one interact event per proposition", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, clicked } = callback.calls.first().args[0]; - - clicked([items[0], items[0], items[0]]); - - expect(collect).toHaveBeenCalledWith({ - decisionsMeta: [items[0].getAnalyticsDetail()], - eventType: "decisioning.propositionInteract", - documentMayUnload: true - }); - }); - - it("collects separately interact events for each distinct proposition", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, clicked } = callback.calls.first().args[0]; - - clicked([items[0]]); - - expect(collect).toHaveBeenCalledWith({ - decisionsMeta: [items[0].getAnalyticsDetail()], - eventType: "decisioning.propositionInteract", - documentMayUnload: true - }); - - clicked([items[0]]); - - expect(collect).toHaveBeenCalledWith({ - decisionsMeta: [items[0].getAnalyticsDetail()], - eventType: "decisioning.propositionInteract", - documentMayUnload: true - }); - - expect(collect).toHaveBeenCalledTimes(2); - }); - - it("collects multiple interact events for distinct propositions", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, clicked } = callback.calls.first().args[0]; - - clicked([items[0], items[1]]); - - expect(collect).toHaveBeenCalledOnceWith({ - decisionsMeta: [ - items[0].getAnalyticsDetail(), - items[1].getAnalyticsDetail() - ], - eventType: "decisioning.propositionInteract", - documentMayUnload: true - }); - }); - - it("collects display events", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, rendered } = callback.calls.first().args[0]; - - rendered([items[0]]); - - expect(collect).toHaveBeenCalledWith({ - decisionsMeta: [items[0].getAnalyticsDetail()], - eventType: "decisioning.propositionDisplay" - }); - }); - - it("collects only one display event per proposition", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, rendered } = callback.calls.first().args[0]; - - rendered([items[0]]); - rendered([items[0], items[0]]); - - expect(collect).toHaveBeenCalledOnceWith({ - decisionsMeta: [items[0].getAnalyticsDetail()], - eventType: "decisioning.propositionDisplay" - }); - }); - - it("collects multiple display events for distinct propositions", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, rendered } = callback.calls.first().args[0]; - - rendered([items[0], items[1]]); - - expect(collect).toHaveBeenCalledOnceWith({ - decisionsMeta: [ - items[0].getAnalyticsDetail(), - items[1].getAnalyticsDetail() - ], - eventType: "decisioning.propositionDisplay" - }); - }); - - it("collects display events only once per session", () => { - const { command, refresh } = subscribeMessageFeed; - - const callback = jasmine.createSpy(); - - command.run({ surface: "web://mywebsite.com/feed", callback }); - - refresh(PROPOSITIONS); - - const { items, rendered } = callback.calls.first().args[0]; - - rendered([items[0], items[1]]); - rendered([items[0], items[1]]); - rendered([items[2]]); - - expect(collect).toHaveBeenCalledTimes(2); - - expect(collect).toHaveBeenCalledWith({ - decisionsMeta: [ - items[0].getAnalyticsDetail(), - items[1].getAnalyticsDetail() - ], - eventType: "decisioning.propositionDisplay" - }); - - expect(collect).toHaveBeenCalledWith({ - decisionsMeta: [items[2].getAnalyticsDetail()], - eventType: "decisioning.propositionDisplay" - }); - }); -}); diff --git a/test/unit/specs/components/Personalization/topLevel/buildAlloy.js b/test/unit/specs/components/Personalization/topLevel/buildAlloy.js index 2c4b3fc2f..dee97c0e8 100644 --- a/test/unit/specs/components/Personalization/topLevel/buildAlloy.js +++ b/test/unit/specs/components/Personalization/topLevel/buildAlloy.js @@ -26,7 +26,7 @@ import createViewChangeHandler from "../../../../../../src/components/Personaliz import createClickStorage from "../../../../../../src/components/Personalization/createClickStorage"; import createApplyPropositions from "../../../../../../src/components/Personalization/createApplyPropositions"; import createSetTargetMigration from "../../../../../../src/components/Personalization/createSetTargetMigration"; -import { createCallbackAggregator, assign } from "../../../../../../src/utils"; +import { assign, createCallbackAggregator } from "../../../../../../src/utils"; import injectCreateProposition from "../../../../../../src/components/Personalization/handlers/injectCreateProposition"; import createProcessPropositions from "../../../../../../src/components/Personalization/handlers/createProcessPropositions"; import createAsyncArray from "../../../../../../src/components/Personalization/utils/createAsyncArray"; @@ -36,7 +36,6 @@ import createProcessHtmlContent from "../../../../../../src/components/Personali import createProcessRedirect from "../../../../../../src/components/Personalization/handlers/createProcessRedirect"; import processDefaultContent from "../../../../../../src/components/Personalization/handlers/processDefaultContent"; import { isPageWideSurface } from "../../../../../../src/components/Personalization/utils/surfaceUtils"; -import createSubscribeMessageFeed from "../../../../../../src/components/Personalization/createSubscribeMessageFeed"; import createOnDecisionHandler from "../../../../../../src/components/Personalization/createOnDecisionHandler"; const createAction = renderFunc => ({ selector, content }) => { @@ -146,15 +145,10 @@ const buildComponent = ({ targetMigrationEnabled }); - const subscribeMessageFeed = createSubscribeMessageFeed({ - collect - }); - const onDecisionHandler = createOnDecisionHandler({ processPropositions, createProposition, - collect, - subscribeMessageFeed + collect }); return createComponent({ @@ -171,8 +165,7 @@ const buildComponent = ({ setTargetMigration, mergeDecisionsMeta, pendingDisplayNotifications, - onDecisionHandler, - subscribeMessageFeed + onDecisionHandler }); };