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

feat: Adds support for mkdir and rename in destination browser. #58

Merged
merged 3 commits into from
May 21, 2024

Conversation

becca-palmer
Copy link
Contributor

[sc-33140]

Copy link
Collaborator

@jbottigliero jbottigliero left a comment

Choose a reason for hiding this comment

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

It's looking like we might need to consider creating a directory listing context that would allow easier dispatch of fetchItems, I think with that in place addDirectory and renameFile can be pushed down to the components that actual contain the forms rather than have to pass the handlers down.

</Td>
)}
{showAddDirectory && (
<Tr>
<Td>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding a colSpan here based on the number of visible columns (something that could be added to the context) would take advantage of the horizontal space here.

Suggested change
<Td>
<Td colSpan={3}>

Though there are some states where that will push the submit and cancel buttons out of the visible viewport (overflow scroll), I think that might be ok for now and something we can consider cleaning up with improved small device styles overall.

@@ -0,0 +1,46 @@
import React, { ReactNode, useState } from "react";
import { HStack, IconButton, Input } from "@chakra-ui/react";
import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use the outline heroicons (https://heroicons.com/) instead of the Chakra icons:

import { CheckIcon, XMarkIcon } from "@heroicons/react/24/outline";

The Chakra Icons are pretty limited so I've been moving to heroicons.

return (
<HStack>
{icon}
<Input
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will need a label, even if it is visually hidden.

<HStack>
{icon}
<Input
id="name-input"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need an id here. If we do, there will need to be some UUID attached to it based on the current ability to render more than one rename form at a time.

}}
value={name}
/>
<IconButton
Copy link
Collaborator

Choose a reason for hiding this comment

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

size="sm" on these <IconButton>s

Comment on lines 303 to 277
includeSize={fileBrowser.view.columns.includes("size")}
includeLastModified={fileBrowser.view.columns.includes(
"last_modified",
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use the File Browser context in the <FileEntry> component instead of passing properties of the context as props.

key={i}
item={item}
isSource={isSource}
httpsServer={endpoint?.https_server}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would be a little more flexible if you just pass the endpoint rather than properties on the endpoint.

}
};
const isDirectory = item.type === "dir";
const getLineItem = () => {
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 push this to either an additional pure component in this file (not exported), keep the logic in the return, or look into useCallback (though based on it's use of some of the props I'm not sure it would improve much) rather than create this function every render.

@jbottigliero jbottigliero changed the title Add support for mkdir and rename in destination browser. feat: Adds support for mkdir and rename in destination browser. May 21, 2024
@jbottigliero jbottigliero merged commit a1e93a4 into globus:main May 21, 2024
1 check passed
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.

None yet

2 participants