Skip to content

Commit

Permalink
Fix deleting blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed May 2, 2024
1 parent 2af373d commit 2d01791
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions panel/src/components/Forms/Blocks/Blocks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ export default {
if (index !== -1) {
this.deselect(block);
this.$delete(this.blocks, index);
this.blocks.splice(index, 1);
this.save();
}
},
Expand Down Expand Up @@ -629,7 +629,7 @@ export default {
for (const id of this.selected) {
const index = this.findIndex(id);
if (index !== -1) {
this.$delete(this.blocks, index);
this.blocks.splice(index, 1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion panel/src/components/Forms/Layouts/Layouts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export default {
const index = this.rows.findIndex((element) => element.id === layout.id);
if (index !== -1) {
this.$delete(this.rows, index);
this.rows.splice(index, 1);
}
this.save();
Expand Down
15 changes: 6 additions & 9 deletions panel/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,11 @@ import kirby from "./scripts/vite-kirby.mjs";
function createAliases(proxy) {
return {
"@": path.resolve(__dirname, "src"),
// use absolute proxied url to avoid Vue being loaded twice
vue: proxy.target + ":3000/node_modules/vue/dist/vue.esm-browser.js"
};
}

function createProxy() {
return {
target: process.env.VUE_APP_DEV_SERVER ?? "https://sandbox.test",
changeOrigin: true,
secure: false
};
}

/**
* Returns the server configuration
*/
Expand Down Expand Up @@ -105,7 +98,11 @@ function createTest() {
* Returns the Vite configuration
*/
export default defineConfig(({ mode }) => {
const proxy = createProxy();
const proxy = {
target: process.env.VUE_APP_DEV_SERVER ?? "https://sandbox.test",
changeOrigin: true,
secure: false
};

return {
plugins: createPlugins(mode),
Expand Down
2 changes: 1 addition & 1 deletion src/Panel/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function importMaps(): array
$map['vue'] = $this->url . '/node_modules/vue/dist/vue.esm-browser.js';
}

return $map;
return array_filter($map);
}

/**
Expand Down

0 comments on commit 2d01791

Please sign in to comment.