-
Notifications
You must be signed in to change notification settings - Fork 887
fix(site): Show folders in the template version editor #6145
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
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.
One quick thought I had (have not thoroughly reviewed everything) is that I think the typeof object
checks are a little obscure. Could we do similar to Node's fs.stat
response and have an isDirectory
on a File
interface? So maybe something like (probably not exactly this):
export interface File {
path: string
isDirectory: boolean
}
Edit: or we could have children
and if there are none we assume it is a directory although I think that is still slightly obtuse. Maybe we have an isDirectory()
which is implemented as typeof this.children !== "undefined"
. It could also make sense to have separate interfaces for files and directories, idk if that is too overengineered though
@code-asher I understand all the concerns but it would change all the implementation since it is based in a very simple tree structure. If you think it is something we definitely should do, I would say for us doing that after merge this PR to not block the fix. |
I do not feel strongly about it, I just stumbled over the object checks at first as it was not clear what was happening until I read the rest of the file tree code. Feel free to ignore! |
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.
Code looks good to me. I have not actually tested it because for the life of me I have not been able to figure out how to get the template editor. 😛 You probably already noticed the Storybook errors but just in case you have not seen them looks like some stories need to be updated.
Forgot to say I like the tree structure and I see now how the current interface makes it easy to use things like |
I tried to manually go to the view and edit template pages to test them out but I keep getting |
This should not be failing tho. Let me see if I can find any issue. |
A quick video review:
https://www.loom.com/share/7297f453b65a47388fd51e9820af53b3
PS: It does not fix the version update missing files.