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

Introduce Pinia store to manage app state #5274

Merged
merged 14 commits into from
Mar 14, 2023

Conversation

pranavxc
Copy link
Member

@pranavxc pranavxc commented Mar 9, 2023

Change Summary

  • Use pinia for app state management

  • Move useProject composable to Pinia store

    Syntax to use useProject store

    // get project store reference
    const projectStore = useProject()
    
    // get actions from store as usual
    const { loadTables } = projectStore
    
    // get  any state values or getters to reactive variable
    const { project } = storeToRefs(projectStore)
    // alternately it can be directly used from store like `projectStore.project`
  • Move useTabs store to Pinia store

Change type

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Test/ Verification

Provide summary of changes.

Additional information / screenshots (optional)

Anything for maintainers to be made aware of

Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
… syntax

Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
@pranavxc pranavxc requested a review from wingkwong March 10, 2023 05:40
Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
@pranavxc pranavxc marked this pull request as ready for review March 10, 2023 06:34
@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2023

Uffizzi Preview deployment-18612 was deleted.

packages/nc-gui/components/dashboard/settings/Misc.vue Outdated Show resolved Hide resolved
packages/nc-gui/components/dlg/AirtableImport.vue Outdated Show resolved Hide resolved
packages/nc-gui/components/dlg/TableRename.vue Outdated Show resolved Hide resolved
packages/nc-gui/composables/useMultiSelect/index.ts Outdated Show resolved Hide resolved
packages/nc-gui/store/tab.ts Show resolved Hide resolved
packages/nc-gui/components/cell/SingleSelect.vue Outdated Show resolved Hide resolved
@pranavxc pranavxc changed the title Introduce Pinia sgore to manage app state Introduce Pinia store to manage app state Mar 12, 2023
Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
@pranavxc pranavxc requested a review from wingkwong March 12, 2023 05:28
Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
Signed-off-by: Pranav C <pranavxc@gmail.com>
Copy link
Member

@wingkwong wingkwong left a comment

Choose a reason for hiding this comment

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

would the existing eventBus logic also migrate to pinia in this pr? e.g. Menu.vue.

@pranavxc
Copy link
Member Author

would the existing eventBus logic also migrate to pinia in this pr? e.g. Menu.vue.

It's not migrated yet. At the moment just migrated the tab and project state to Pinia. Those refactoring we can do later.

@wingkwong wingkwong merged commit f6497ae into develop Mar 14, 2023
@wingkwong wingkwong deleted the refactor/pinia-for-state-managemen branch March 14, 2023 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants