feat: switch the data source to the new backend#336
Conversation
a8bcb6d to
2bd2662
Compare
|
|
||
| export const widgetIdSeparator = '#'; | ||
|
|
||
| export type LayoutTypes = 'landingPage' | 'landing-landingPage'; |
There was a problem hiding this comment.
Now that we will have multiple dashboards, I am wondering if this should be simply a string. And we validate the strings based on what we got back from the API. It should have an endpoint that returns all possible types.
If that endpoint does not exist, it should be a follow-up work instead of blocking this.
| }; | ||
|
|
||
| export const getWidgetIdentifier = (widgetType: string, uniqueId: string = crypto.randomUUID()) => { | ||
| return `${widgetType}${widgetIdSeparator}${uniqueId}`; |
There was a problem hiding this comment.
Just wondering it this unique ID is ever used to do any updates in the backend? Or just for local React purposes. If its used in backend it can't be randomized like this.
f056880 to
89a57de
Compare
|
/retest |
1 similar comment
|
/retest |
|
/retest |
Hyperkid123
left a comment
There was a problem hiding this comment.
When switching to user who has never fetched the data from the new backend, I see a blank dashboard. The data was loaded, and I can see it in the component props, but nothing is rendered.
ba5a7c0 to
68a7676
Compare
68a7676 to
021aa2a
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
Description
Adds feature flag-based API routing for the chrome-service → widget-layout backend migration.
useApi()hook reads platform.widget-layout.new-backend flag and returns the correct API modulegetApi()from a shared store (can't use hooks)Default.tsx,DashboardHub.tsx) sync the flag via<Provider store={store}>Flag:
platform.widget-layout.new-backend— routes API calls to /api/widget-layout/v1/ when enabled, chrome-service endpoints when disabled.RHCLOUD40885