Skip to content

fix: hide remove container btn when only one container exists#8272

Open
dcpagotto wants to merge 1 commit intonasa:masterfrom
dcpagotto:mct7274
Open

fix: hide remove container btn when only one container exists#8272
dcpagotto wants to merge 1 commit intonasa:masterfrom
dcpagotto:mct7274

Conversation

@dcpagotto
Copy link
Copy Markdown

Summary

  • the remove container btn was showing up in the toolbar even
    when there was only one container left in flexible layout
  • clicking it would fail or delete the content inside wich is
    confusing for users
  • added a check in toolbarProvider.js to only show the btn when
    containers.length > 1
  • also added e2e test that verifies the btn hides/shows correctly

Test plan

  • e2e test added covering the exact scenario
  • Start openmct, create a flexible layout
  • In edit mode, remove containers until one remains
  • Verify "Remove Container" button is not in the toolbar
  • Add a container back, verify the button reappears

Closes #7274

@dcpagotto
Copy link
Copy Markdown
Author

Hey, just checking in on this one. Is there anything else I should change or add to get this reviewed? I tried to keep the changes minimal and added the e2e test to cover the scenario. Let me know if theres something missing or if you need me to rebase on main.

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.

[Flexible Layouts] The Remove Container (frame) button does work, but now it's available when there's only one frame

1 participant