-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[UI] Auto refresh/redirect experiment list/detail page when user selects a different namespace #3297
Conversation
/retest |
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.
Tested in my cluster, worked like a charm!
/lgtm
'', | ||
10, | ||
'created_at desc', | ||
'', |
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.
nit: not sure if this is just a common UI practice, feels a bit unreadable to me. Does it make sense to have a wrapper function with a more meaningful name?
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'm not sure what confused you. Do you mean this expect(xxxSpy).toHaveBeenLastCalledWith(...some arguments)
?
This is fairly common, but previous implementation has been listing arguments (even though they are just default values).
I think if we change signature of listExperiment api method to let it accept an object of arguments, then the verifications here will include argument names, it will be a lot more readable.
e.g. proposed change will look like
expect(listExperimentsSpy).toHaveBeenLastCalledWith({
page_token: xxx,
page_size: xxx,
sort_by: xxx,
filter: xxx,
resource_reference_key_type: xxx,
resource_reference_key_id: xxx,
})
Above is a little more than what we need to do in this PR, so I will leave that to future. What do you think?
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.
Sorry, somehow my comment was placed right above the line that I wanted to comment on.
I meant ...LIST_EXPERIMENT_DEFAULTS.slice(0, 4)
wasn't very clear to me what it's trying to get with the slice
part. I was thinking maybe have a helper function to hide it away, something like:
function getTestExperimentWithoutNamespace() {
return [...LIST_EXPERIMENT_DEFAULTS.slice(0, 4)]
}
or maybe even better as:
function getTestExperiment(namespace='test-ns') {
return [...LIST_EXPERIMENT_DEFAULTS.slice(0, 4), 'NAMESPACE', namespace]
}
Does it make sense? Just a nitpick. :)
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.
Thanks for the explanation!
I don't quite like introducing another function, to keep it simple, I will just add another constant. please take a look what I changed
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.
Yes, this looks good :)
219ff46
to
15ef212
Compare
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.
@chensun Thanks for the review!
I've updated accordingly.
PTAL
'', | ||
10, | ||
'created_at desc', | ||
'', |
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'm not sure what confused you. Do you mean this expect(xxxSpy).toHaveBeenLastCalledWith(...some arguments)
?
This is fairly common, but previous implementation has been listing arguments (even though they are just default values).
I think if we change signature of listExperiment api method to let it accept an object of arguments, then the verifications here will include argument names, it will be a lot more readable.
e.g. proposed change will look like
expect(listExperimentsSpy).toHaveBeenLastCalledWith({
page_token: xxx,
page_size: xxx,
sort_by: xxx,
filter: xxx,
resource_reference_key_type: xxx,
resource_reference_key_id: xxx,
})
Above is a little more than what we need to do in this PR, so I will leave that to future. What do you think?
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.
/lgtm
'', | ||
10, | ||
'created_at desc', | ||
'', |
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.
Sorry, somehow my comment was placed right above the line that I wanted to comment on.
I meant ...LIST_EXPERIMENT_DEFAULTS.slice(0, 4)
wasn't very clear to me what it's trying to get with the slice
part. I was thinking maybe have a helper function to hide it away, something like:
function getTestExperimentWithoutNamespace() {
return [...LIST_EXPERIMENT_DEFAULTS.slice(0, 4)]
}
or maybe even better as:
function getTestExperiment(namespace='test-ns') {
return [...LIST_EXPERIMENT_DEFAULTS.slice(0, 4), 'NAMESPACE', namespace]
}
Does it make sense? Just a nitpick. :)
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.
/lgtm
'', | ||
10, | ||
'created_at desc', | ||
'', |
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.
Yes, this looks good :)
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bobgy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
…cts a different namespace (kubeflow#3297) * [UI] Auto refresh/redirect experiment list/detail page when namespace changes * Add comments * Address CR comment
Fixes #3296
/area frontend
/cc @chensun
Built image for preview:
This change is