diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateViewModal.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateViewModal.svelte
index 6a7f5b96a1..ac5e522923 100644
--- a/packages/builder/src/components/backend/DataTable/modals/CreateViewModal.svelte
+++ b/packages/builder/src/components/backend/DataTable/modals/CreateViewModal.svelte
@@ -1,22 +1,19 @@
{#if $database?._id}
@@ -37,28 +45,22 @@
{/if}
- {#each [...Object.entries(table.views || {})].sort() as [viewName, view], idx (idx)}
- {@const viewSelected =
- $isActive("./view") && $views.selected?.name === viewName}
- {@const viewV2Selected =
- $isActive("./view/v2") && $viewsV2.selected?.name === viewName}
+ {#each [...Object.entries(table.views || {})].sort() as [name, view], idx (idx)}
{
if (view.version === 2) {
$goto(`./view/v2/${view.id}`)
} else {
- $goto(`./view/${encodeURIComponent(viewName)}`)
+ $goto(`./view/v1/${encodeURIComponent(name)}`)
}
}}
- selectedBy={$userSelectedResourceMap[viewName]}
+ selectedBy={$userSelectedResourceMap[name]}
>
-
+
{/each}
{/each}
diff --git a/packages/builder/src/pages/builder/app/[application]/data/view/[viewName]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/v1/[viewName]/_layout.svelte
similarity index 95%
rename from packages/builder/src/pages/builder/app/[application]/data/view/[viewName]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/view/v1/[viewName]/_layout.svelte
index f3793317e8..7f4fc9c597 100644
--- a/packages/builder/src/pages/builder/app/[application]/data/view/[viewName]/_layout.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/data/view/v1/[viewName]/_layout.svelte
@@ -13,7 +13,7 @@
stateKey: "selectedViewName",
validate: name => $views.list?.some(view => view.name === name),
update: views.select,
- fallbackUrl: "../",
+ fallbackUrl: "../../",
store: views,
routify,
decode: decodeURIComponent,
diff --git a/packages/builder/src/pages/builder/app/[application]/data/view/[viewName]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/v1/[viewName]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/builder/app/[application]/data/view/[viewName]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/view/v1/[viewName]/index.svelte
diff --git a/packages/builder/src/pages/builder/app/[application]/data/view/v1/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/v1/index.svelte
new file mode 100644
index 0000000000..c11ca87023
--- /dev/null
+++ b/packages/builder/src/pages/builder/app/[application]/data/view/v1/index.svelte
@@ -0,0 +1,5 @@
+
diff --git a/packages/builder/src/pages/builder/app/[application]/data/view/v2/[id]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/v2/[viewId]/_layout.svelte
similarity index 96%
rename from packages/builder/src/pages/builder/app/[application]/data/view/v2/[id]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/view/v2/[viewId]/_layout.svelte
index 62844a54df..8ddd6adbd0 100644
--- a/packages/builder/src/pages/builder/app/[application]/data/view/v2/[id]/_layout.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/data/view/v2/[viewId]/_layout.svelte
@@ -9,7 +9,7 @@
$: store.actions.websocket.selectResource(id)
const stopSyncing = syncURLToState({
- urlParam: "id",
+ urlParam: "viewId",
stateKey: "selectedViewId",
validate: id => $viewsV2.list?.some(view => view.id === id),
update: viewsV2.select,
diff --git a/packages/builder/src/pages/builder/app/[application]/data/view/v2/[id]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/v2/[viewId]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/builder/app/[application]/data/view/v2/[id]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/view/v2/[viewId]/index.svelte
diff --git a/packages/builder/src/pages/builder/app/[application]/data/view/v2/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/v2/index.svelte
new file mode 100644
index 0000000000..c11ca87023
--- /dev/null
+++ b/packages/builder/src/pages/builder/app/[application]/data/view/v2/index.svelte
@@ -0,0 +1,5 @@
+
diff --git a/packages/frontend-core/src/components/grid/stores/rows.js b/packages/frontend-core/src/components/grid/stores/rows.js
index 1346d7c8b2..5d3cd20109 100644
--- a/packages/frontend-core/src/components/grid/stores/rows.js
+++ b/packages/frontend-core/src/components/grid/stores/rows.js
@@ -111,7 +111,7 @@ export const deriveStores = context => {
// Create new fetch model
const newFetch = fetchData({
API,
- datasource,
+ datasource: $datasource,
options: {
filter: $filter,
sortColumn: $sort.column,