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

[Panel] "Change Status" Dialog Loads Siblings When Unnecessary (Automatic Numbering) #2052

Closed
neildaniels opened this issue Sep 3, 2019 · 3 comments

Comments

@neildaniels
Copy link
Contributor

@neildaniels neildaniels commented Sep 3, 2019

Describe the bug
When opening a "Change Status" dialog in the Panel, it sometimes takes seconds to load. Looking at the API responses happening, I suspect its because it's loading every sibling, even though for the specific template in question, siblings seems completely unnecessary.

To Reproduce
Steps to reproduce the behavior:

  1. Have a template that uses automatic numbering in the Blueprint, such as:
num: '{{ page.created.toDate("YmdHi", "now") }}'
  1. Within a pages section, click on a status change button to bring up the dialog.

The Panel loads an AJAX call such as:

https://thestreamable.com/api/pages/news+test-post?select=id,status,num,errors,siblings,blueprint

This response has hundreds of siblings (for our site). Normally the siblings would be used to indicate where the post in question should be ordered into. However, because numbering is set to automatic, the siblings are never displayed on this page are seemingly unneeded.

I think the burden of loading almost ~1500 pages is too strenuous in this situation. Can there be an optimization to exclude siblings when they're not needed? Or, at least somehow speed it up (by maybe avoid reading the text fields for actual title content).

Kirby Version
3.2.4

@neildaniels neildaniels changed the title [Panel] "Change Status" Dialog Loads Siblings When Unnecessary [Panel] "Change Status" Dialog Loads Siblings When Unnecessary (Automatic Numbering) Sep 3, 2019
distantnative added a commit that referenced this issue Sep 14, 2019
@distantnative distantnative added this to the 3.2.5 milestone Sep 14, 2019
@distantnative distantnative self-assigned this Sep 14, 2019
distantnative added a commit that referenced this issue Sep 14, 2019
distantnative added a commit that referenced this issue Sep 14, 2019
@distantnative distantnative removed their assignment Sep 14, 2019
@distantnative distantnative removed this from the 3.2.5 milestone Sep 14, 2019
@distantnative

This comment has been minimized.

Copy link
Contributor

@distantnative distantnative commented Sep 15, 2019

Developer's note:
I tried to split the API call into two: an initial one without siblings and when page.blueprint.num === "default" sending a second request to get the siblings. However, I ran into problems with reactivity where either I would get an error cause this.siblings wasn't set yet or the UI would not update and display an empty dropdown.

bastianallgeier added a commit that referenced this issue Oct 14, 2019
@bastianallgeier

This comment has been minimized.

Copy link
Contributor

@bastianallgeier bastianallgeier commented Oct 14, 2019

I solved it. The problem with the select input is connected to the other open issue we have, but when you set the options before opening the dialog, it works.

@distantnative

This comment has been minimized.

Copy link
Contributor

@distantnative distantnative commented Oct 14, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.