-
Notifications
You must be signed in to change notification settings - Fork 968
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
[workspace]remove * when calling find in data source association modal and in workspace list page #9409
base: main
Are you sure you want to change the base?
[workspace]remove * when calling find in data source association modal and in workspace list page #9409
Conversation
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9409 +/- ##
=======================================
Coverage 61.71% 61.71%
=======================================
Files 3817 3817
Lines 91862 91862
Branches 14552 14552
=======================================
Hits 56697 56697
Misses 31509 31509
Partials 3656 3656
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Qxisylolo <[email protected]>
438cd15
to
0534e5a
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.
We still pass '' to getDataSourcesList
in line 367 of this file. Can we remove the '' argument?
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.
okok, I miss it, thanks for noticing
Signed-off-by: Qxisylolo <[email protected]>
const prependOptions = | ||
query.workspaces === undefined ? { withoutClientBasePath: true } : 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.
Actually not very comfortable with this line. I am thinking if we can pass prependOptions
directly instead of detecting whether there is workspaces
inside query.
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.
my initial thought is to directly pass prependOptions and already tested it, it worked well when calling inside a workspace, but I'm not sure then. already update~
@Qxisylolo Is it safe to remove the |
we don't use this function to filter * now. perhaps we could remove it in find |
const request: ReturnType<SavedObjectsApi['find']> = this.savedObjectsFetch(path, { | ||
method: 'GET', | ||
query, | ||
prependOptions: { withoutClientBasePath: true }, |
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.
Actually I am thinking:
savedObjectsClient.find({ ...otherParams, workspaces: null }, { prependOptions: { withoutClientBasePath: true } })
We should let client to decide how to make the call instead of removing the clientBasePath in the find method directly. It is a service used by many modules.
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.
@Qxisylolo DCO failed for the latest commit, could you help to fix it?
Description
This pr remove * when calling find in data source association modal and in workspace list page
Issues Resolved
Screenshot
Inside a workspace, and we want to find all the data sources which belong to the current workspaces, here we remove the client base path

Inside a workspace and open data source association modal, we want to find all the data sources, here we remove the client base path

in workspace list page, we also remove the client base path

Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration