-
Notifications
You must be signed in to change notification settings - Fork 246
chore(components): upgrade LeafyGreen modal components COMPASS-9642 #7594
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
Open
kraenhansen
wants to merge
42
commits into
main
Choose a base branch
from
kh/leafygreen-modal-updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
ec92d89
Upgrade LG modal packages
kraenhansen c0ef6fa
Fix Modal to adopt LG Modal v20
kraenhansen 2a4a76d
Fix connection-form to work around LG Modal v20
kraenhansen f6de037
Update generative-ai to adopt marketing-modal v7
kraenhansen f3feb66
Fix compass-import-export to work around LG modal v20
kraenhansen d2f9411
Update compass-welcome to adopt marketing-modal v7
kraenhansen 2d4fcf9
Update compass-explain-plan to LG Modal v20
kraenhansen bcdfb26
Fix compass-crud to adopt LG modal v20
kraenhansen dedb29e
Update compass-schema to LG Modal v20
kraenhansen 23c9b9f
Add workaround for jsdom missing HTMLDialogElement support
kraenhansen e8e8770
Update generative-ai to adopt LG modal v20
kraenhansen 22b6d10
Fix fullScreen prop on derived Modal
kraenhansen 1bdc87e
Remove use of deprecated backdropClassName
kraenhansen 1d45b5a
Remove workaround for MarketingModal button disabling
kraenhansen 6e8624a
Fix remaining components tests
kraenhansen ba8e128
Revert workaround for LG-5593
kraenhansen b3e1d3f
Update existing tests to handle dialog elements remaining in the DOM
kraenhansen d1b75f0
Update databases-collections to allow immediate removal of the heading
kraenhansen 9428ef0
Update e2e tests to use waitForDisplayed over waitForExist as this is…
kraenhansen 47888eb
Update e2e tests removing [role=dialog] from confirm dialog selectors
kraenhansen a63d598
Update e2e tests to wait for bulk delete modal to disappear
kraenhansen 1f2f4a4
Update e2e tests to wait for connection form to be non-clickable in a…
kraenhansen c2bed1f
Update e2e tests to fix modal regressions
kraenhansen 059a651
Disable pointer events on a closed modal
kraenhansen fc8b6eb
Disable auto-focus on confirmation modal children by default
kraenhansen df5ba1c
Add new modal specific commands
kraenhansen 8a5d987
Update E2E tests to use new modal commands instead of waitForDisplayed
kraenhansen f5d901a
Default initialFocus to "null" to avoid breaking existing modals
kraenhansen fbb4ff0
Wait for confirm button to show instead of simply expecting it
kraenhansen 6946951
Update FocusMode tests to handle LG Modal v20
kraenhansen ce4de95
Update SettingsModal tests to handle LG Modal v20
kraenhansen a696d7e
Clarify disabling the @typescript-eslint/no-namespace and add a TODO …
kraenhansen fec839f
Partial revert of ddd6d70dd59fbe8f948ea6e5ef80b6d478bc1eff
kraenhansen 4b26c6b
Fix auto-focus in bulk update and delete modals
kraenhansen ac00cfd
Correcting sizing styles
kraenhansen 3c626c2
Correcting sizing styles more
kraenhansen d27b33d
Use named imports
kraenhansen f8f6cd6
Upgrade confirm-modal package
kraenhansen 9d5c979
Fix useConfirmation's confirmButtonProps types
kraenhansen 072f47c
Update use of ConfirmationModal
kraenhansen c95b12f
Set initial focus on cancel (fallback to confirm) button
kraenhansen 536b433
Fix package lock
kraenhansen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { Assertion, util } from 'chai'; | ||
|
|
||
| // TODO(COMPASS-10119): Move declaration into a separate .d.ts and implementation into a *-register.js file as we do with other global patching code intended for tests. | ||
|
|
||
| declare global { | ||
| // eslint-disable-next-line @typescript-eslint/no-namespace -- We're following a pattern established in the `@types/chai-as-promised` package to add a Chai assertion property. | ||
| export namespace Chai { | ||
| interface Assertion { | ||
| /** Asserts that a dialog is open */ | ||
| get open(): Assertion; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Anemy FYI for the eslint plugin you are working on in devtools-shared, new terminator assertion |
||
| /** Asserts that a dialog is closed */ | ||
| get closed(): Assertion; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| util.addProperty( | ||
| Assertion.prototype, | ||
| 'open', | ||
| function (this: typeof Assertion) { | ||
| const obj = util.flag(this, 'object'); | ||
| new Assertion(obj).to.be.instanceof(HTMLDialogElement); | ||
| new Assertion(obj as HTMLDialogElement).has.property( | ||
| 'open', | ||
| true, | ||
| 'Expected dialog to be open' | ||
| ); | ||
| } | ||
| ); | ||
|
|
||
| util.addProperty( | ||
| Assertion.prototype, | ||
| 'closed', | ||
| function (this: typeof Assertion) { | ||
| const obj = util.flag(this, 'object'); | ||
| new Assertion(obj).to.be.instanceof(HTMLDialogElement); | ||
| new Assertion(obj as HTMLDialogElement).has.property( | ||
| 'open', | ||
| false, | ||
| 'Expected dialog to be closed' | ||
| ); | ||
| } | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.