Re: [pgAdmin4][Patch]: RM 1253 - Store and reload current location in treeview

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: [pgAdmin4][Patch]: RM 1253 - Store and reload current location in treeview
Дата
Msg-id CA+OCxoy1j0-A-LrCJ4mJyAcNtvrm5F+Ud8p7NRvOi8WCAtRd=w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [pgAdmin4][Patch]: RM 1253 - Store and reload current location in treeview  (Khushboo Vashi <khushboo.vashi@enterprisedb.com>)
Ответы Re: [pgAdmin4][Patch]: RM 1253 - Store and reload current location in treeview  (Khushboo Vashi <khushboo.vashi@enterprisedb.com>)
Список pgadmin-hackers
Hi

On Tue, Aug 28, 2018 at 1:40 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Mon, Aug 27, 2018 at 1:19 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Khushboo 

Patch looks good to me, following are my review comments:
  • Logic doesn't work when we disconnect and re-connect to the database server. We have duplicated RM #1335.
I have saved the current state of the tree. so If I have disconnected the server, so that closed state will be considered for that server.
If another server(s) is still connected and opened at some node, and then you reload the browser, on connecting/expanding the server it will populate the server nodes.

@Dave,

Do I need to change this behaviour?

Per our Skype call, let's store and restore both the current tree state and the previous state of disconnected servers (as pgAdmin 3 did). So:

- On browser open, the treeview is restored to the previous state, with databases reconnected as required.

- On re-connect of a database, the sub-treeview for that database is restored to the state it was in prior to disconnection.

Thanks!
  • Instead of -1 we should use 0 to stop the tree saving functionality. Send request at 0 second doesn't make any sense.
  • What if pgAdmin4 opens in two different browsers or two different tabs with different tree hierarchy in that case it will override the state of each other. (This could be an enhancement request).

On Mon, Aug 27, 2018 at 11:09 AM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Khushboo,

Cheers, the patch looks good to me. I have few suggestions:
1) Expand the tree -> Go to server properties and rename the server -> the tree closes. It should expand to last state. Same applies to other nodes which can be renamed.
2) It would be nice if we can also save the last selected object. The tree expands but the last selected object is not selected.
3) In /web/pgadmin/static/js/tree/pgadmin_tree_save_state.js
 import pgAdmin from '../../../static/js/pgadmin'; -- please use alias here rather than relative path.
4) I would suggest to add 1 example/format JSON of tree state in comments in the file so that it will be easier to relate the code with.
 

On Fri, Aug 24, 2018 at 10:08 AM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi,

Please find the attached patch for RM #1253 - Store and reload current location in treeview

Feature Details:
- The current tree state will be stored in the sqlite database.
- The time interval to store the tree state is configurable via preferences and the default is 30 secs.
   -1 can be used to stop the tree saving functionality,
- On window unload the current tree state will be saved.
- On Reload, while opening the server, the stored path will be populated.
- On closing the node the saved will be updated accordingly.
- Jasmine test cases are included.


Thanks,
Khushboo


--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246




--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Akshay Joshi
Дата:
Сообщение: pgAdmin 4 commit: Fixed auto complete issue for EPAS database server.
Следующее
От: Dave Page
Дата:
Сообщение: pgAdmin 4 commit: Add a geometry viewer that can render PostGIS dataon