-
Notifications
You must be signed in to change notification settings - Fork 2
feat(DataManager): New datamanager feature #287
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
Draft
SpliiT
wants to merge
23
commits into
next
Choose a base branch
from
feat/datamanager
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
c63a3f1
feat(DataManager): New datamanager feature
SpliiT 829b9ac
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
SpliiT cfd3957
Apply prepare changes
SpliiT c741370
check comments & other
SpliiT c65facf
Apply prepare changes
SpliiT b875d27
rm other versions
SpliiT b6386fa
Merge branch 'feat/datamanager' of https://github.com/Geode-solutions…
SpliiT 215a07f
Apply prepare changes
SpliiT 9953445
apply comments changes needed
SpliiT 9bf9f4c
Merge branch 'feat/datamanager' of https://github.com/Geode-solutions…
SpliiT 44c9e49
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
SpliiT 244a802
Apply prepare changes
SpliiT 615da73
rm imported queue
SpliiT 70c83ab
Merge branch 'feat/datamanager' of https://github.com/Geode-solutions…
SpliiT 4adda49
reput dependencies
SpliiT 952442d
Apply prepare changes
SpliiT d9b3f4a
implement liveQuery
SpliiT 29e48c8
Apply prepare changes
SpliiT f481de7
fix dexie dependence
SpliiT 5bfa700
Apply prepare changes
SpliiT b123235
correct comments
SpliiT 60aafe4
Merge branch 'feat/datamanager' of https://github.com/Geode-solutions…
SpliiT 2d2dca1
apply changes about path
SpliiT 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
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 |
|---|---|---|
| @@ -1,76 +1,76 @@ | ||
| export const useAppStore = defineStore("app", () => { | ||
| const stores = [] | ||
|
|
||
| function registerStore(store) { | ||
| const isAlreadyRegistered = stores.some( | ||
| (registeredStore) => registeredStore.$id === store.$id, | ||
| ) | ||
| if (isAlreadyRegistered) { | ||
| console.log( | ||
| `[AppStore] Store "${store.$id}" already registered, skipping`, | ||
| ) | ||
| return | ||
| } | ||
| console.log("[AppStore] Registering store", store.$id) | ||
| stores.push(store) | ||
| } | ||
|
|
||
| function exportStores() { | ||
| function exportStores(params = {}) { | ||
| const snapshot = {} | ||
| let exportCount = 0 | ||
|
|
||
| for (const store of stores) { | ||
| if (!store.exportStores) continue | ||
| const storeId = store.$id | ||
| try { | ||
| snapshot[storeId] = store.exportStores() | ||
| snapshot[storeId] = store.exportStores(params) | ||
| exportCount++ | ||
| } catch (error) { | ||
| console.error(`[AppStore] Error exporting store "${storeId}":`, error) | ||
| } | ||
| } | ||
| console.log( | ||
| `[AppStore] Exported ${exportCount} stores; snapshot keys:`, | ||
| Object.keys(snapshot), | ||
| ) | ||
| return snapshot | ||
| } | ||
|
|
||
| async function importStores(snapshot) { | ||
| if (!snapshot) { | ||
| console.warn("[AppStore] import called with invalid snapshot") | ||
| return | ||
| } | ||
| console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {})) | ||
|
|
||
| let importedCount = 0 | ||
| const notFoundStores = [] | ||
| for (const store of stores) { | ||
| if (!store.importStores) continue | ||
| const storeId = store.$id | ||
| if (!snapshot[storeId]) { | ||
| notFoundStores.push(storeId) | ||
| continue | ||
| } | ||
| try { | ||
| await store.importStores(snapshot[storeId]) | ||
| importedCount++ | ||
| } catch (error) { | ||
| console.error(`[AppStore] Error importing store "${storeId}":`, error) | ||
| } | ||
| } | ||
| if (notFoundStores.length > 0) { | ||
| console.warn( | ||
| `[AppStore] Stores not found in snapshot: ${notFoundStores.join(", ")}`, | ||
| ) | ||
| } | ||
| console.log(`[AppStore] Imported ${importedCount} stores`) | ||
| } | ||
|
|
||
| return { | ||
| stores, | ||
| registerStore, | ||
| exportStores, | ||
| importStores, | ||
| } | ||
| }) | ||
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
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.
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.