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

refactor(editor): Migrate ui.store to use composition API (no-changelog) #9892

Merged
merged 23 commits into from
Jul 3, 2024

Conversation

RicardoE105
Copy link
Contributor

@RicardoE105 RicardoE105 commented Jun 28, 2024

Summary

  1. Convert ui.store to composition API.
  2. Remove unused getters isNodeView and areExpressionsDisabled.
  3. Remove isPageLoading and mainPanelPosition from the state as they are not used anymore.
  4. Clean up all the uses of isAnyModalOpen as we do not have that method in the store.
  5. Fix type errors that came up with the change.
  6. Fix type warnings except for the cycle dependency ones (will address in a later PR when we migrate all stores to use composition API)

@alexgrozav thinking a bit further:

  1. Should we also organize the stores by logical concert?
  2. Is this not too big of a store? We can split it into multiple ones. For instance, could we extract modals, banners, and nodes selected into its own stores?

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@RicardoE105 RicardoE105 changed the title migrate ui.store to composition API refactor(editor): Migrate ui.store to use composition API (no-changelog) Jun 28, 2024
@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jun 28, 2024
Copy link

cypress bot commented Jun 28, 2024

3 flaky tests on run #5770 ↗︎

0 399 0 0 Flakiness 3

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 RicardoE105 🗃️ e2e/*
Project: n8n Commit: 73f3824a3a
Status: Passed Duration: 05:05 💡
Started: Jul 3, 2024 7:06 PM Ended: Jul 3, 2024 7:11 PM
Flakiness  5-ndv.cy.ts • 2 flaky tests

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Screenshots Video
NDV > Stop listening for trigger event from NDV Screenshots Video
Flakiness  10-undo-redo.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Undo/Redo > should undo/redo adding connected nodes Test Replay Screenshots Video

Review all test suite changes for PR #9892 ↗︎

- delete isNodeView computed method as it's not used anymore.
- Remove of instances of isAnyModal open as we do not have that method in the store
Copy link
Contributor

@alexgrozav alexgrozav left a comment

Choose a reason for hiding this comment

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

Looking good. Same comments about value caching like the previous PR.

I completely agree about the splitting of this store! We could tackle that in a separate PR.

packages/editor-ui/src/stores/ui.store.ts Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/stores/ui.store.ts Outdated Show resolved Hide resolved
alexgrozav
alexgrozav previously approved these changes Jul 3, 2024
Copy link
Contributor

@alexgrozav alexgrozav left a comment

Choose a reason for hiding this comment

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

Thank you for addressing all the feedback! 💪

Copy link
Contributor

github-actions bot commented Jul 3, 2024

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link
Contributor

github-actions bot commented Jul 3, 2024

✅ All Cypress E2E specs passed

@RicardoE105 RicardoE105 merged commit f64ca62 into master Jul 3, 2024
48 checks passed
@RicardoE105 RicardoE105 deleted the migrate-ui.store-to-composition branch July 3, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants