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

FileTree and WebDav updates to support module editor scenario #259

Merged
merged 16 commits into from
Jun 2, 2020

Conversation

cnathe
Copy link
Contributor

@cnathe cnathe commented May 29, 2020

Rationale

The moduleEditor module will soon be making use of the FileTree component and WebDav model/actions to load the module resources in a tree view for browsing and editing resource files from the LabKey UI. The FileTree usage has a few different requirements which warrant some changes/updates to the component (see changes below).

Related Pull Requests

Changes

FileTree component

  • add prop to remove checkbox selection option from node display
  • support font awesome icon display for file based on WebDav iconFontCls data
  • call the onFileSelect callback function on node select for non-checkbox case
  • make the arrow toggle smaller

WebDav model updates for module editor browser scenario

  • add contentType and options properties to model
  • add param to getWebDavFiles for the non-@files case

cnathe added 4 commits May 28, 2020 16:46
- prop to remove checkbox selection option from node display
- support font awesome icon display for file based on WebDav iconFontCls data
- call the onFileSelect callback function on node select for non-checkbox case
- make the arrow toggle smaller
- add contentType and options properties to model
- add param to getWebDavFiles for the non-@files case
Copy link
Contributor

@labkey-martyp labkey-martyp left a comment

Choose a reason for hiding this comment

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

Looks great Cory. I like the opening files. Just a couple comments in review. I'm also not familiar with useFileIconCls, not sure if a story could be added for that and maybe allowMultiSelect = false. But maybe that will come in a later story.

packages/components/src/components/files/FileTree.tsx Outdated Show resolved Hide resolved
@@ -246,11 +263,11 @@ export class FileTree extends PureComponent<FileTreeProps, FileTreeState> {
};

// Callback to parent with actual path of selected file
onFileSelect = (id: string, checked: boolean, isDirectory: boolean): void => {
onFileSelect = (id: string, checked: boolean, isDirectory: boolean, node: any): void => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't notice this when I did the initial implementation, but looks like someone has already done a little work defining the types here in this issue. If you are up for providing some types. (Although looks like it's missing node.selected).

storybook-eol/react-treebeard#186 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not going to take that on as part of this PR, but I'll add a TODO comment to the component.

@cnathe
Copy link
Contributor Author

cnathe commented Jun 2, 2020

Looks great Cory. I like the opening files. Just a couple comments in review. I'm also not familiar with useFileIconCls, not sure if a story could be added for that and maybe allowMultiSelect = false. But maybe that will come in a later story.

I did add a knob to the existing storybook story for FileTree so that you can toggle between the allowMultiSelect true / false. I can look into adding a story / knob for useFileIconCls as well.

@cnathe cnathe merged commit 7a8d783 into master Jun 2, 2020
@cnathe cnathe deleted the fb_moduleEditorBrowserWIP branch June 2, 2020 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants