-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: workspace level ui settings #328
Conversation
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 and I think maybe we should create integration test for new wrapper.
src/plugins/workspace/server/saved_objects/workspace_ui_settings_client_wrapper.ts
Show resolved
Hide resolved
src/plugins/workspace/server/saved_objects/workspace_ui_settings_client_wrapper.ts
Outdated
Show resolved
Hide resolved
return { | ||
...wrapperOptions.client, | ||
get: getUiSettingsWithWorkspace, | ||
update: updateUiSettingsWithWorkspace, | ||
}; |
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.
It seems some methods of client are inherited through prototype and spreading the methods here may make this
missing inside the methods. Better to declare those methods explicitly in each wrapper, though I think it should be an issue for client wrapper.
); | ||
|
||
core.savedObjects.addClientWrapper( | ||
-3, |
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.
A meaningful variable to the magical priority number would help, I merged another backport PR and maybe you can try that pattern.
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.
Should we declare the order sequence through a comment if there is?
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.
@raintygao right, I'll put a comment
do we ever have a comparison of workspace level setting as a normal setting object with workspace information vs a property of workspace itself? Thinking of user level setting, this solution may not have enough flexibility. |
That's a very good point!
Actually I did think of this as well, I'd imagine user level ui settings is an object with ACL attached. Similar to how we handle workspace ui level in this PR, there could be another wrapper to handle user ui settings. What do you think? Can you share more about your concerns? Don't know if I missed any corner cases. |
src/plugins/workspace/server/saved_objects/workspace_ui_settings_client_wrapper.ts
Show resolved
Hide resolved
I see, that's the point. thanks for explanation.
As we don't have a user object in kibana index, to save user level setting, we either reuse existing setting object type and associate it with user information. Base on this assumption, i am thinking workspace level setting could do same way. However, permission control is a issue.
one thing is that is there a case user need to export/import this kind of setting? For now, workspace itself is not exportable. |
LGTM |
When getting ui settings within a workspace, it will combine the workspace ui settings with the global ui settings and workspace ui settings have higher priority if the same setting was defined in both places When updating ui settings within a workspace, it will update the workspace ui settings, the global ui settings will remain unchanged. Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
615ee00
to
cf49d79
Compare
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
…gs_client_wrapper.ts Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
When getting ui settings within a workspace, it will combine the workspace ui settings with the global ui settings and workspace ui settings have higher priority if the same setting was defined in both places When updating ui settings within a workspace, it will update the workspace ui settings, the global ui settings will remain unchanged. Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
When getting ui settings within a workspace, it will combine the workspace ui settings with the global ui settings and workspace ui settings have higher priority if the same setting was defined in both places When updating ui settings within a workspace, it will update the workspace ui settings, the global ui settings will remain unchanged. Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
When getting ui settings within a workspace, it will combine the workspace ui settings with the global ui settings and workspace ui settings have higher priority if the same setting was defined in both places
When updating ui settings within a workspace, it will update the workspace ui settings, the global ui settings will remain unchanged.
Description
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration