-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update event payloads #14
Conversation
Add more details to the payloads of many of the previous events that had undefined payloads
uuid to requestId
Made ATC and ConsultDesigner use separate payloads because ConsultDesigner requires fewer fields.
We will need 2 net new events for atc and continue to cart flow Vendor comms
|
|
||
interface AddToCartPayload { | ||
schema: string; | ||
interface CommonPayload { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NothingButThyme I took a pass at creating general/common interfaces that are extended for specific events. This commit is a proposal for us to discuss, not intended to unilaterally override the commit you pushed up (didn't think a whole separate PR for it was warranted). Thoughts appreciated!
The main point to get across here is the requirement for token
and customerId
be included in the majority of event payloads (excluding non-customer-centric events like tracking) so we can validate the token and make sure it's intended for the right customer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good. I don't have any objections.
I am curious what future-proofing is being accomplished by CommonMedata vs CabinetsMetadata, because 'source' and 'area' seem like they would apply to other things besides cabinets.
src/classes/VendorCommunicator.ts
Outdated
addToCart(payload: EventPayload): void { | ||
this.post({type: VendorEvent.AddToCart, payload}); | ||
appInitialized(message: string): void { | ||
this.post({type: VendorEvent.AddToCart, payload: message}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed this should be type: VendorEvent.AppInitialized
src/classes/VendorCommunicator.ts
Outdated
projectId: string; | ||
} | ||
|
||
interface DirtyStateChangedPayload { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add projectId
src/classes/VendorCommunicator.ts
Outdated
isDirty: boolean; | ||
} | ||
|
||
interface iFrameRedirectPayload { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to generalize this into a navigation event?
- One event for when the iframe re-initialized
- One for internal navigation to update the url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a small preference to keep them separate, because we want to see a clear difference between an "application exit" event and a navigation tracking event. It's just a convenience on our side for developers to be able to see when an event is expected to trigger a redirect.
src/classes/VendorCommunicator.ts
Outdated
} | ||
|
||
interface EventPayload { | ||
interface AddToCartPayload { | ||
schema: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add message
to the EventPayload interface since you are sending it.
# Conflicts: # src/classes/VendorCommunicator.ts
Description
The purpose of this PR is to clearly specify the fields that will be expected in messages coming from the Vendor, and to provide a starting point for discussion about changes to those fields.
Also includes some updates that have been discussed previously:
Type of Change
Checklist