Обсуждение: [pgadmin-hackers] [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu formodules that are loaded using deps

Поиск
Список
Период
Сортировка
Hi

Issue:

If modules are loaded without any node dependency(i.e: on page load), the function 'create_menu' is called implicitly to generate menu items.

But when the modules are loaded when its dependent node expands, the function 'create_menus' has to explicitly call after 'add_menus' from respective module's template files.

This patch is dependent on patch 'load_modules_js_when_required.patch'

Please find attached patch and review.
Вложения
Hi

On Mon, May 29, 2017 at 8:52 AM, Surinder Kumar
<surinder.kumar@enterprisedb.com> wrote:
> Hi
>
> Issue:
>
> If modules are loaded without any node dependency(i.e: on page load), the
> function 'create_menu' is called implicitly to generate menu items.
>
> But when the modules are loaded when its dependent node expands, the
> function 'create_menus' has to explicitly call after 'add_menus' from
> respective module's template files.
>
> This patch is dependent on patch 'load_modules_js_when_required.patch'
>
> Please find attached patch and review.

Unfortunately I just realised why this change isn't so good - it
causes the menus to be built when JS is loaded. That's not good, as we
really want the Tools menu to list all items, all of the time - it's
important that menu stays consistent so that users don't get confused
when they find an option they expected to be there, isn't.

Is there any way you can think of to have the menu items added at
startup, but the rest of the code loaded as needed?

Of course, whatever we do with Grunt/webpack will make this moot
anyway, so don't spend much time on it..

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

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