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

fix: Runtime drawers default active #2870

Merged
merged 10 commits into from
Oct 16, 2024

Conversation

georgylobko
Copy link
Contributor

Description

Runtime drawers with defaultActive: true were not opening when there were already open drawers on the page. This PR fixes that issue by updating the condition in the onDrawersRegistered event. Previously, runtime drawers with defaultActive: true would only set active drawers if none were open. Now, the condition has been adjusted to check if drawers with defaultActive are not currently open, allowing them to open regardless of other active drawers.

Related links, issue #, if available: n/a

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.20%. Comparing base (7ff976f) to head (db9fb31).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2870      +/-   ##
==========================================
- Coverage   96.20%   96.20%   -0.01%     
==========================================
  Files         762      761       -1     
  Lines       21488    21453      -35     
  Branches     7284     7280       -4     
==========================================
- Hits        20673    20639      -34     
+ Misses        762      761       -1     
  Partials       53       53              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@georgylobko georgylobko marked this pull request as ready for review October 15, 2024 10:34
@georgylobko georgylobko requested a review from a team as a code owner October 15, 2024 10:34
@georgylobko georgylobko requested review from jperals, just-boris and dpitcock and removed request for a team and jperals October 15, 2024 10:34
@@ -1042,5 +1042,36 @@ describe('toolbar mode only features', () => {

expect(wrapper.findActiveDrawer()!.getElement()).toHaveTextContent('runtime drawer content');
});

test('dynamically registered drawers with defaultActive: true should open even when there are already open drawer(s) on the page', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Do we have negative case scenarios?

  1. After max drawers already open, defaultActive does not open a new one
  2. After user opened a global drawer manually, late registered defaultActive don't open

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No for both. Do we have any specific requirements for this? If so, could you point me to where I can check them?

Copy link
Member

Choose a reason for hiding this comment

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

That's my understanding of our discussion for this bug yesterday. I do not think there is any written down text

…um limit is reached or if there are already global drawer(s) opened by user action
@georgylobko georgylobko added this pull request to the merge queue Oct 16, 2024
Merged via the queue into main with commit 4220993 Oct 16, 2024
38 checks passed
@georgylobko georgylobko deleted the fix/runtime-drawers-default-active branch October 16, 2024 13:26
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.

3 participants