Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

remove message-feed #1065

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions sandbox/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -101,9 +100,6 @@ const BasicExample = () => {
<li>
<Link to="/inAppMessages">In-app Messages</Link>
</li>
<li>
<Link to="/messageFeed">Message Feed</Link>
</li>
</ul>
<hr />

Expand Down Expand Up @@ -134,7 +130,6 @@ const BasicExample = () => {
<Route path="/identity" component={Identity} />
<Route path="/configOverrides" component={ConfigOverrides} />
<Route path="/inAppMessages" component={InAppMessages} />
<Route path="/messageFeed" component={MessageFeed} />
</div>
</Router>
<AlloyVersion />
Expand Down
15 changes: 0 additions & 15 deletions sandbox/src/components/MessageFeedDemo/MessageFeed.css

This file was deleted.

506 changes: 0 additions & 506 deletions sandbox/src/components/MessageFeedDemo/MessageFeed.js

This file was deleted.

8 changes: 3 additions & 5 deletions src/components/Personalization/createComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ governing permissions and limitations under the License.
import { noop, flatMap, isNonEmptyArray } 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,
Expand All @@ -30,8 +30,7 @@ export default ({
setTargetMigration,
mergeDecisionsMeta,
renderedPropositions,
onDecisionHandler,
subscribeMessageFeed
onDecisionHandler
}) => {
return {
lifecycle: {
Expand Down Expand Up @@ -122,8 +121,7 @@ export default ({
optionsValidator: options =>
validateApplyPropositionsOptions({ logger, options }),
run: applyPropositions
},
subscribeMessageFeed: subscribeMessageFeed.command
}
}
};
};
9 changes: 1 addition & 8 deletions src/components/Personalization/createOnDecisionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
136 changes: 0 additions & 136 deletions src/components/Personalization/createSubscribeMessageFeed.js

This file was deleted.

13 changes: 3 additions & 10 deletions src/components/Personalization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -122,15 +121,10 @@ const createPersonalization = ({ config, logger, eventManager }) => {
targetMigrationEnabled
});

const subscribeMessageFeed = createSubscribeMessageFeed({
collect
});

const onDecisionHandler = createOnDecisionHandler({
processPropositions,
createProposition,
collect,
subscribeMessageFeed
collect
});

return createComponent({
Expand All @@ -147,8 +141,7 @@ const createPersonalization = ({ config, logger, eventManager }) => {
setTargetMigration,
mergeDecisionsMeta,
renderedPropositions,
onDecisionHandler,
subscribeMessageFeed
onDecisionHandler
});
};

Expand Down
1 change: 0 additions & 1 deletion test/functional/helpers/createAlloyProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const commands = [
"appendIdentityToUrl",
"applyPropositions",
"subscribeRulesetItems",
"subscribeMessageFeed",
"evaluateRulesets"
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe("Personalization", () => {
let setTargetMigration;
let mergeDecisionsMeta;
let renderedPropositions;
let subscribeMessageFeed;
let cacheUpdate;

const build = () => {
Expand All @@ -41,8 +40,7 @@ describe("Personalization", () => {
showContainers,
setTargetMigration,
mergeDecisionsMeta,
renderedPropositions,
subscribeMessageFeed
renderedPropositions
});
};

Expand Down Expand Up @@ -72,7 +70,6 @@ describe("Personalization", () => {
renderedPropositions = jasmine.createSpyObj("renderedPropositions", [
"clear"
]);
subscribeMessageFeed = jasmine.createSpy("subscribeMessageFeed");

build();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ describe("Personalization::createOnDecisionHandler", () => {
let collect;
let processPropositions;
let createProposition;
let subscribeMessageFeed;
let onDecisionHandler;

beforeEach(() => {
Expand All @@ -200,16 +199,11 @@ describe("Personalization::createOnDecisionHandler", () => {
isPageWideSurface: () => false
});

subscribeMessageFeed = jasmine.createSpyObj("subscribeMessageFeed", [
"refresh"
]);

onDecisionHandler = createOnDecisionHandler({
processPropositions,
createProposition,
render,
collect,
subscribeMessageFeed
collect
});
});

Expand All @@ -220,7 +214,6 @@ describe("Personalization::createOnDecisionHandler", () => {
propositions: PROPOSITIONS
});

expect(subscribeMessageFeed.refresh).toHaveBeenCalledOnceWith(PROPOSITIONS);
expect(render).not.toHaveBeenCalled();
});

Expand All @@ -232,7 +225,6 @@ describe("Personalization::createOnDecisionHandler", () => {
});

expect(propositions).toEqual(PROPOSITIONS);
expect(subscribeMessageFeed.refresh).toHaveBeenCalledOnceWith(PROPOSITIONS);

expect(render).toHaveBeenCalledTimes(1);

Expand Down
Loading