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

SCAL-222310 : Host Event Client #75

Merged
merged 26 commits into from
Jan 8, 2025
Merged

SCAL-222310 : Host Event Client #75

merged 26 commits into from
Jan 8, 2025

Conversation

sastaachar
Copy link
Contributor

No description provided.

@sastaachar sastaachar force-pushed the SCAL-222310 branch 17 times, most recently from 620fd42 to 75303a0 Compare December 19, 2024 00:20
Copy link

pkg-pr-new bot commented Jan 4, 2025

Open in Stackblitz

npm i https://pkg.pr.new/thoughtspot/visual-embed-sdk/@thoughtspot/visual-embed-sdk@75

commit: 922bcd3

src/embed/hostEventClient/host-event-client.ts Outdated Show resolved Hide resolved
Comment on lines 64 to 137
if (hostEvent === HostEvent.Pin && payload?.newVizName) {
return this.handleUiPassthroughForHostEvent(
iFrame, UiPassthroughEvent.addVizToPinboard, payload,
);
}
if (hostEvent === HostEvent.SaveAnswer && payload?.name) {
const data = await this.handleUiPassthroughForHostEvent(
iFrame, UiPassthroughEvent.saveAnswer, payload,
);
return {
...data,
answerId: data?.saveResponse?.data?.Answer__save?.answer?.id,
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's make this part more generic, so that it wouldn't be too hard when extending to new hostEvents

return { ...response.value };
}

public async hostEventFallback(
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this up beside the executeUiPassthroughApi, to keep similar methods together and name them more similar with different intentions. eg executePassthroughEvent and executeHostEvent

src/embed/hostEventClient/contracts.ts Show resolved Hide resolved
src/embed/hostEventClient/contracts.ts Outdated Show resolved Hide resolved
@sastaachar sastaachar changed the title SCAL-222310 : Embed inti SCAL-222310 : Host Event Client Jan 8, 2025
@sastaachar sastaachar merged commit 38bf474 into main Jan 8, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants