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 function editor save #1507

Merged
merged 5 commits into from
Jan 4, 2023
Merged

Fix function editor save #1507

merged 5 commits into from
Jan 4, 2023

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Jan 3, 2023

Closes #1452

Turns out the shortcut was working after all. The problem was that the update didn't reflect in the UI afterwards

@oliviertassinari oliviertassinari requested a deployment to fix-save - toolpad-db PR #1507 January 3, 2023 17:10 — with Render Abandoned
@Janpot Janpot added the core Infrastructure work going on behind the scenes label Jan 3, 2023
@Janpot Janpot marked this pull request as ready for review January 3, 2023 17:28
@Janpot Janpot requested a review from bharatkashyap January 4, 2023 09:49
@@ -106,6 +106,9 @@ export default function QueryNodeEditorDialog<Q>({
const node = useLatest(nodeProp);

const [input, setInput] = React.useState<appDom.QueryNode<Q>>(node);
React.useEffect(() => {
Copy link
Member

@apedroferreira apedroferreira Jan 4, 2023

Choose a reason for hiding this comment

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

This is repeated, there's the same effect in line 237 (I might've added in the last PR I merged).

Copy link
Member Author

@Janpot Janpot Jan 4, 2023

Choose a reason for hiding this comment

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

Ok, I'm removing the other one to keep it closer to where the state is created. It's a good convention to keep these lines together when the behavior is desired of reinitializing when initial value changes.


await expect(editorModel.appCanvas.getByText('edited hello')).toBeVisible();

await editorModel.componentEditor.getByRole('button', { name: 'edited' }).click();
Copy link
Member

@apedroferreira apedroferreira Jan 4, 2023

Choose a reason for hiding this comment

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

When we add more tests for the query editor it might make sense for some of these to have methods/properties we can reuse.

Copy link
Member

@apedroferreira apedroferreira left a comment

Choose a reason for hiding this comment

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

Looks good, just need to remove the duplicate effect I think.

@oliviertassinari oliviertassinari temporarily deployed to fix-save - toolpad PR #1507 January 4, 2023 11:17 — with Render Destroyed
@Janpot Janpot merged commit 459a0ff into master Jan 4, 2023
@Janpot Janpot deleted the fix-save branch January 4, 2023 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cmd+S doesn't work in the function query editor
3 participants