Closed Bug 1841086 Opened 1 year ago Closed 1 year ago

Page parent component to connect API data to UI components

Categories

(Firefox :: Shopping, task, P2)

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: jhirsch, Assigned: amy)

References

Details

(Whiteboard: [fidefe-shopping])

Attachments

(1 file)

Some details still TBD, but as a summary, we need a top-level component in the sidebar page that fetches data and passes the data to individual UI components.


Background info: right now, we haven't set up Actor messaging yet, instead we're communicating the product URL down to the sidebar shopping.html page by setting its URL, which triggers the shopping page to reload.

For example, if the user navigates to https://www.amazon.com/FEZIBO-Height-Adjustable-Electric-Standing/dp/B099ZTMGYQ, then the parent process code sets the shopping html page's URL to chrome://...stuff.../shopping.html?url=https://www.amazon.com/FEZIBO-Height-Adjustable-Electric-Standing/dp/B099ZTMGYQ. This is available to the code inside the shopping page as its window.location.


Here's what the topmost component needs to do for this bug:

  • initialize when the page loads
  • get the product URL from the query string in the shopping page's window.location
  • pass the product URL to the API, using the ShoppingProduct toolkit component, and pull back data
  • when data comes back, render the individual UI components, propagating data down to each by setting properties/attributes
  • one basic integration test to verify the whole thing works when the browser's src is set

Some things that can be handled in a followup, and don't need to be done in this bug:

  • most of the tests can be handled in a followup, provided it's the very next task
  • figuring out how to listen for click events from the components
  • fetching data from the ads API (we don't have the ads component yet)
  • handling error responses from the API (just worry about the happy path here)
Blocks: 1840180
Whiteboard: [fidefe-shopping]

As there's no assignee, setting to P2 per observation of other Shopping bugs.

Severity: -- → N/A
Priority: -- → P2
Assignee: nobody → achurchwell
Attachment #9342772 - Attachment description: WIP: Bug 1841086 - Page parent component to connect data to UI components. → Bug 1841086 - Page parent component to connect data to UI components. r=jhirsch
Pushed by achurchwell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d5791243ac7a Page parent component to connect data to UI components. r=jhirsch

Thanks, :amy's on it.

Flags: needinfo?(jhirsch)
Attachment #9342772 - Attachment description: Bug 1841086 - Page parent component to connect data to UI components. r=jhirsch → Bug 1841086 - Page parent component to connect data to UI components. r=#shopping-reviewers
Attachment #9342772 - Attachment description: Bug 1841086 - Page parent component to connect data to UI components. r=#shopping-reviewers → Bug 1841086 - Page parent component to connect data to UI components. r=jhirsch
Pushed by achurchwell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b7ba9766093 Page parent component to connect data to UI components. r=shopping-reviewers,jhirsch
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: