-
Notifications
You must be signed in to change notification settings - Fork 15
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
NETOBSERV-783 multiple page loads with quick filters #273
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -49,7 +49,7 @@ class NetflowTrafficParent extends React.Component<Props, State> { | |||
return this.props.children; | |||
} | |||
// else render default NetworkTraffic | |||
return <NetflowTraffic />; | |||
return <NetflowTraffic forcedFilters={null} />; |
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.
why do we need a distinction null vs undefined?
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.
Coming from netflow-tab
, the prop will be undefined before being set.
As we force null in netflow-traffic-parent
, we make the distinction between the loading state from tabs and the null state from page to skip a tick before confing loaded
// skip tick while forcedFilters & config are not loaded | ||
// this check ensure tick will not be called during init | ||
// as it's difficult to manage react state changes | ||
if (!initState.current.includes('forcedFiltersLoaded') || !initState.current.includes('configLoaded')) { |
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 think it would be better to have a union type for initState
such as array of 'forcedFiltersLoaded' | 'configLoaded' | ...
(e.g. to avoid typos)
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.
/ok-to-test |
New image: ["quay.io/netobserv/network-observability-console-plugin:6927299"]. It will expire after two weeks. |
@jpinsonneau - I see the "default" quick filters are not coming selected with this image, is that intentional? |
I can confirm stability of tests have improved vastly with this change, where it loads page only once, currently without default quick filters - I am not sure if we should have kept page load with default quick filters instead? |
Good catch @memodi ! That was not intentionnal. |
/ok-to-test |
New image: ["quay.io/netobserv/network-observability-console-plugin:c3325a5"]. It will expire after two weeks. |
This image works for default filters at first start on my side 🥳 |
/qe-approved |
/approve |
no changes, just fixed merge conflict |
This fix avoid tick being called multiple times at start.
Code changes:
config
/forcedFilters
useEffectforcedFilters
are disabled to differenciate with undefinedinitState
as string array to let developpers better understand what has been done, in which order and allow future states