Skip to content
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-storagebrowser] adds change owner and group action #3973

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

ramprasadagarwal
Copy link
Collaborator

What changes were proposed in this pull request?

  • for the file and folder in new storage browser, this action will allow super user to change the owners

How was this patch tested?

  • Added unit tests

Please review Hue Contributing Guide before opening a pull request.

Copy link
Contributor

@JohanAhlen JohanAhlen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nice!

@use 'variables' as vars;

.antd.cuix {
.change-owner-group {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we prefix classes with hue-

const groupOptions = getDropdownOptions(groups);

useEffect(() => {
const isOtherUserSelected = !users.includes(files[0].user);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With files[0].user you assume there is always at least on file in the array, is that guaranteed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the action will not be enabled until at-least one file is selected.


const { save, loading } = useSaveData(BULK_CHANGE_OWNER_API_URL, {
postOptions: {
qsEncodeData: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this true by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, It is undefined by default and const encodeData = options?.qsEncodeData == undefined || options?.qsEncodeData; condition turns encodeData value to true

@ramprasadagarwal ramprasadagarwal enabled auto-merge (squash) January 28, 2025 19:13
Copy link
Collaborator

@bjornalm bjornalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@ramprasadagarwal ramprasadagarwal merged commit e5d26ed into master Jan 28, 2025
6 checks passed
@ramprasadagarwal ramprasadagarwal deleted the feat/storage-browser-20 branch January 28, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants