-
Notifications
You must be signed in to change notification settings - Fork 492
Subgraph promoted dynamic widgets #8352
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
24cbf4f
add support for dynamic combos on subgraphs
pythongosssss e7e26ce
Add tests
pythongosssss 1807e0d
Group dynamic widgets together for drag operations
pythongosssss bd38a09
unused export
pythongosssss 946aea1
Fix node name
pythongosssss 67f366d
Add node
pythongosssss 6efa56d
review feedback
pythongosssss b053516
poll feedback
pythongosssss 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
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,94 @@ | ||
| import type { Locator, Page } from '@playwright/test' | ||
|
|
||
| export class PropertiesPanel { | ||
| readonly root: Locator | ||
| readonly panelTitle: Locator | ||
| readonly searchBox: Locator | ||
|
|
||
| constructor(readonly page: Page) { | ||
| this.root = page.getByTestId('properties-panel') | ||
| this.panelTitle = this.root.locator('h3') | ||
| this.searchBox = this.root.getByPlaceholder('Search...') | ||
| } | ||
|
|
||
| async ensureOpen() { | ||
| const isOpen = await this.root.isVisible() | ||
| if (!isOpen) { | ||
| await this.page.getByLabel('Toggle properties panel').click() | ||
| await this.root.waitFor({ state: 'visible' }) | ||
| } | ||
| } | ||
|
|
||
| async close() { | ||
| const isOpen = await this.root.isVisible() | ||
| if (isOpen) { | ||
| await this.page.getByLabel('Toggle properties panel').click() | ||
| await this.root.waitFor({ state: 'hidden' }) | ||
| } | ||
| } | ||
|
|
||
| async promoteWidget(widgetName: string) { | ||
| await this.ensureOpen() | ||
|
|
||
| // Check if widget is already visible in Advanced Inputs section | ||
| const widgetRow = this.root | ||
| .locator('[class*="widget-item"], [class*="input-item"]') | ||
| .filter({ hasText: widgetName }) | ||
| .first() | ||
| const isAdvancedExpanded = await widgetRow.isVisible() | ||
|
|
||
| if (!isAdvancedExpanded) { | ||
| // Click on Advanced Inputs to expand it | ||
| const advancedInputsButton = this.root | ||
| .getByRole('button') | ||
| .filter({ hasText: /advanced inputs/i }) | ||
| await advancedInputsButton.click() | ||
| await widgetRow.waitFor({ state: 'visible', timeout: 5000 }) | ||
| } | ||
|
|
||
| // Find and click the more options button | ||
| const moreButton = widgetRow.locator('button').filter({ | ||
| has: this.page.locator('[class*="lucide--more-vertical"]') | ||
| }) | ||
| await moreButton.click() | ||
|
|
||
| // Click "Show input" to promote the widget | ||
| await this.page.getByText('Show input').click() | ||
|
|
||
| // Close and reopen panel to refresh the UI state | ||
| await this.close() | ||
| await this.ensureOpen() | ||
| } | ||
|
|
||
| async demoteWidget(widgetName: string) { | ||
| await this.ensureOpen() | ||
|
|
||
| // Check if INPUTS section content is already visible | ||
| const widgetRow = this.root.locator('span').getByText(widgetName).first() | ||
| const isInputsExpanded = await widgetRow.isVisible() | ||
|
|
||
| if (!isInputsExpanded) { | ||
| // Click on INPUTS section to expand it (where promoted widgets appear) | ||
| const inputsButton = this.root | ||
| .getByRole('button') | ||
| .filter({ hasText: /^inputs$/i }) | ||
| await inputsButton.click() | ||
| } | ||
|
|
||
| await widgetRow.waitFor({ state: 'visible', timeout: 5000 }) | ||
|
|
||
| // Find the more options button in the widget-item-header | ||
| const moreButton = widgetRow | ||
| .locator('xpath=ancestor::*[contains(@class, "widget-item-header")]') | ||
| .locator('button') | ||
| .filter({ | ||
| has: this.page.locator('[class*="more-vertical"], [class*="lucide"]') | ||
| }) | ||
| .first() | ||
|
|
||
| await moreButton.click() | ||
|
|
||
| // Click "Hide input" to demote the widget | ||
| await this.page.getByText('Hide input').click() | ||
| } | ||
| } | ||
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
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.