gameplan icon indicating copy to clipboard operation
gameplan copied to clipboard

Can't delete page

Open blaggacao opened this issue 1 year ago • 6 comments

image

blaggacao avatar Jun 25 '24 09:06 blaggacao

hi @blaggacao The button works properly. It deletes the page. The problem is that the modal is expected to close after deleting successfully

huembw avatar Jul 17 '24 02:07 huembw

It's been a while, but I don't remember ever see a page disappear (except if I delete it from the backend).

blaggacao avatar Jul 17 '24 04:07 blaggacao

It appears this requires websocket via ws and does not work (well/at all) with long polling.

blaggacao avatar Jul 22 '24 18:07 blaggacao

@netchampfaris I noticed that I can locally reproduce after running bench build --apps gameplan. Without a build it works well, but after the production build it's broken.

blaggacao avatar Jul 22 '24 19:07 blaggacao

runtime-core.esm-bundler.js:262 TypeError: u is not a function
    at Proxy.onClick (PageGrid.vue:13:12)
    at onClick (Dialog.vue:206:34)
    at runtime-dom.esm-bundler.js:711:60
    at Ir (runtime-core.esm-bundler.js:195:19)
    at gn (runtime-core.esm-bundler.js:202:17)
    at gn (runtime-core.esm-bundler.js:212:17)
    at HTMLButtonElement.n (runtime-dom.esm-bundler.js:693:5)

blaggacao avatar Jul 22 '24 19:07 blaggacao

Fixed by:

diff --git a/frontend/src/pages/PageGrid.vue b/frontend/src/pages/PageGrid.vue
index 33ce698..fdc58df 100644
--- a/frontend/src/pages/PageGrid.vue
+++ b/frontend/src/pages/PageGrid.vue
@@ -22,9 +22,9 @@
                   actions: [
                     {
                       label: 'Delete',
-                      onClick: ({ close }) => {
+                      async onClick(close) {
+                        await $resources.pages.delete.submit(d.name)
                         close()
-                        return $resources.pages.delete.submit(d.name)
                       },
                       variant: 'solid',
                       theme: 'red',

(inspired by how its done in frappe/crm)

blaggacao avatar Jul 22 '24 20:07 blaggacao

Fixed in latest version

netchampfaris avatar Nov 21 '24 20:11 netchampfaris