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: Cannot add tool when dragging by image #673

Merged
merged 6 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/default/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def increment(state):
print("The counter has been incremented.")
_update_message(state)

# Initialise the state
# Initialize the state

# "_my_private_element" won't be serialised or sent to the frontend,
# "_my_private_element" won't be serialized or sent to the frontend,
# because it starts with an underscore

initial_state = wf.init_state({
"my_app": {
"title": "MY APP"
"title": "My app"
},
"_my_private_element": 1337,
"message": None,
Expand Down
6 changes: 2 additions & 4 deletions src/ui/src/builder/BuilderApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
:key="selectedId ?? 'noneSelected'"
></BuilderSettings>
</div>
<BuilderPanelSwitcher
class="builderPanelSwitcher"
></BuilderPanelSwitcher>
<BuilderPanelSwitcher class="panelSwitcher"></BuilderPanelSwitcher>
</div>

<!-- INSTANCE TRACKERS -->
Expand Down Expand Up @@ -375,7 +373,7 @@ onMounted(() => {
--notificationsDisplacement: calc(var(--builderSettingsWidth) + 24px);
}

.builderPanelSwitcher {
.panelSwitcher {
grid-column: 2 / 3;
grid-row: 3;
}
Expand Down
1 change: 1 addition & 0 deletions src/ui/src/builder/sidebar/BuilderSidebarToolkit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<img
:alt="`(Icon for ${tool.name})`"
:src="`./../../../../components/${tool.type}.svg`"
draggable="false"
@error="
!isImageFallback[tool.type]
? handleImageError(
Expand Down
15 changes: 9 additions & 6 deletions tests/e2e/tests/workflows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ test.describe("Workflows", () => {
}) => {
await page.getByPlaceholder(object).fill(color);
await page.locator(`[data-automation-action="toggle-panel"][data-automation-key="log"]`).click();
const rowLocator = page
.locator(".BuilderPanelSwitcher div.row")
.filter({ hasText: "Return value" });
const rowsLocator = page
.locator(".BuilderPanelSwitcher div.row");
await expect(rowsLocator).toHaveCount(3);
const rowLocator = rowsLocator.filter({ hasText: "Return value" });
await rowLocator.getByRole("button", { name: "Details" }).click();
await expect(page.locator(".BuilderModal")).toBeVisible();
const resultsLocator = page.locator(
`.BuilderModal [data-automation-key="result"]`,
);
Expand Down Expand Up @@ -93,10 +95,11 @@ test.describe("Workflows", () => {
await page.locator(`[data-automation-action="run-workflow"]`).click();

await page.locator(`[data-automation-action="toggle-panel"][data-automation-key="log"]`).click();
const rowLocator = page
.locator(".BuilderPanelSwitcher div.row")
.filter({ hasText: "Return value" }).first();;
const rowsLocator = page.locator(".BuilderPanelSwitcher div.row");
await expect(rowsLocator).toHaveCount(5);
const rowLocator = rowsLocator.filter({ hasText: "Return value" }).first();;
await rowLocator.getByRole("button", { name: "Details" }).click();
await expect(page.locator(".BuilderModal")).toBeVisible();
const returnValueLocator = page.locator(
`.BuilderModal [data-automation-key="return-value"]`,
);
Expand Down
Loading