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

Hide creation buttons on search and recents tabs #42977

Merged
merged 2 commits into from
May 24, 2024

Conversation

iethree
Copy link
Contributor

@iethree iethree commented May 21, 2024

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.

noNewOnSearchOrRecent

Checklist

  • Tests have been added/updated to cover changes in this PR

@iethree iethree requested review from mazameli, luizarakaki and a team May 21, 2024 20:34
@iethree iethree self-assigned this May 21, 2024
@iethree iethree added the backport Automatically create PR on current release branch on merge label May 21, 2024
@metabase-bot metabase-bot bot added the .Team/AdminWebapp Admin and Webapp team label May 21, 2024
Copy link

replay-io bot commented May 21, 2024

Status Complete ↗︎
Commit b467072
Results
⚠️ 4 Flaky
2569 Passed

Comment on lines +101 to +103
const [showActionButtons, setShowActionButtons] = useState<boolean>(
!!actionButtons.length,
);
Copy link
Contributor Author

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 🤔

Copy link
Contributor

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

Copy link
Contributor Author

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(),
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 set a default for this prop so we could delete all these redundant props in each test

Comment on lines +101 to +103
const [showActionButtons, setShowActionButtons] = useState<boolean>(
!!actionButtons.length,
);
Copy link
Contributor

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

@iethree iethree merged commit c77f7f2 into master May 24, 2024
109 checks passed
@iethree iethree deleted the disable-create-on-recents branch May 24, 2024 19:03
github-actions bot pushed a commit that referenced this pull request May 24, 2024
* hide creation buttons on search and recents tabs

* update e2e tests
metabase-bot bot added a commit that referenced this pull request May 24, 2024
* hide creation buttons on search and recents tabs

* update e2e tests

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Automatically create PR on current release branch on merge .Team/AdminWebapp Admin and Webapp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disable creating new items from the recents screen
3 participants