-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Hide creation buttons on search and recents tabs #42977
Conversation
|
const [showActionButtons, setShowActionButtons] = useState<boolean>( | ||
!!actionButtons.length, | ||
); |
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.
another colorable argument for entitypicker context 🤔
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.
Yeah, I don't love it, but without lifting the tabs state out of tabs view, I'm not sure how else you make it work
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.
there's only two new tests in this file (testing the action button visibility), but the diff is all messy because i grouped the search tests together in their own block
@@ -294,7 +321,6 @@ describe("EntityPickerModal", () => { | |||
recentItems, | |||
defaultToRecentTab: false, | |||
initialValue: { model: "card" }, | |||
onConfirm: jest.fn(), |
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.
i set a default for this prop so we could delete all these redundant props in each test
const [showActionButtons, setShowActionButtons] = useState<boolean>( | ||
!!actionButtons.length, | ||
); |
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.
Yeah, I don't love it, but without lifting the tabs state out of tabs view, I'm not sure how else you make it work
* hide creation buttons on search and recents tabs * update e2e tests
Closes #42976
Description
The "Create a dashboard" and "Create a collection" buttons were pretty confusing on the recents and search screens (they would create items in the root collection), this hides those buttons on the recents and search tabs.
Checklist