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] Implement storage browser actions #3877

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

nidhibhatg
Copy link
Collaborator

@nidhibhatg nidhibhatg commented Nov 4, 2024

What changes were proposed in this pull request?

  • Improvements on content summary
  • Update create new files based on new public api
  • Update create new folders based on new public api
  • Update rename to use useSaveData hook
  • Implement UI for set replication
  • Added tests for set replication action
  • Improve storage browser actions using useMemo
  • Implement UI for copy action in storage browser
  • Implement UI for move action in storage browser
  • Minor UI improvements

How was this patch tested?

  • Unit tests
  • Manually

Please review Hue Contributing Guide before opening a pull request.

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, I have only looked at the FileChooserModal so far, but I think we need some refactoring to get better code reusability and modularity.

{
params: {
pagesize: '1000',
filter: searchTerm
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would apply the URI encoding here instead of when setting the state

type: string;
}

const FileChooserModal = ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Like discussed on slack. The name is misleading if the only purpose is to let the user choose a destination path.

return (
<Modal
cancelText={cancelText}
className="hue-filechooser-modal cuix antd"
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you need the cuix antd classes here?

);

const getColumns = (file: FileChooserTableData) => {
const columns: ColumnProps<FileChooserTableData>[] = [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we not duplicating a lot this behaviour from the StorageBrowserTable.tsx?

In my opinion the StorageBrowserTable.tsx should be more modular, e.g. the actual table in it should be reusable component. I would see if it was possible to create a reusable and configurable "FilesystemTable" that could be used by different components (like this one) instead of duplicating this code. We will also need an actual "file picker" (for the importer and other places) which also needs a "FilesystemTable" to display the files and folders.

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.

2 participants