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

feature | add support of custom no result message #14

Merged
merged 4 commits into from
Jul 13, 2023

Conversation

elad-n
Copy link
Contributor

@elad-n elad-n commented Jul 12, 2023

for empty or nonrelevant files today we render the same message of "no files".
now, we support custom message for empty children result but we can differentiate when there's no files and no relevant dir or bucket and existing files but nothing relevant to display

case 1: 0 files display "no files"
case 2: some files but not dir or bucket so we would display a custom message about it.

add no results custom message
@elad-n elad-n requested a review from simonlsk July 12, 2023 22:53
@@ -23,6 +30,7 @@ export const FileTree = ({ list, loading, getFilesCb, onSelect }: FileTreeInterf
}
};

console.log('emptyMessage', emptyMessage);
Copy link
Contributor

Choose a reason for hiding this comment

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

Slipped or intended?

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 didnt pushed my last commit ):

@@ -59,6 +59,7 @@ FileTreeWithFiles.args = {
href: '/'
}
],
emptyMessage: 'empty message ',
Copy link
Contributor

Choose a reason for hiding this comment

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

You can write a real message like "no files here" no?

@@ -29,7 +30,8 @@ export function FileTreeItem({
getFilesCb,
setSelected,
type,
href
href,
emptyMessage,
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird formatting no?

if (emptyMessage) {
return <Box ml={2} p={1}>{emptyMessage}</Box>;
}
// fallback
return <Box p={1}>This file is empty</Box>;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be "This directory is empty"

@elad-n elad-n merged commit e2d782c into main Jul 13, 2023
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.

2 participants